46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0.If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at https ://mozilla.org/MPL/2.0/.
|
|
|
|
#ifndef DIRECTION_H
|
|
#define DIRECTION_H
|
|
|
|
#include "Angle.h"
|
|
|
|
namespace Passer {
|
|
namespace LinearAlgebra {
|
|
|
|
struct Vector3;
|
|
|
|
template <typename T>
|
|
class DirectionOf {
|
|
public:
|
|
AngleOf<T> horizontal;
|
|
AngleOf<T> vertical;
|
|
|
|
DirectionOf<T>();
|
|
DirectionOf<T>(AngleOf<T> horizontal, AngleOf<T> vertical);
|
|
DirectionOf<T>(Vector3 v);
|
|
|
|
const static DirectionOf forward;
|
|
const static DirectionOf back;
|
|
const static DirectionOf up;
|
|
const static DirectionOf down;
|
|
const static DirectionOf left;
|
|
const static DirectionOf right;
|
|
|
|
DirectionOf<T> operator+(const DirectionOf<T>& v) const;
|
|
DirectionOf<T> operator+=(const DirectionOf<T>& v);
|
|
|
|
Vector3 ToVector3();
|
|
};
|
|
|
|
using DirectionSingle = DirectionOf<float>;
|
|
using Direction16 = DirectionOf<signed short>;
|
|
using Direction = DirectionOf<float>;
|
|
|
|
} // namespace LinearAlgebra
|
|
} // namespace Passer
|
|
using namespace Passer::LinearAlgebra;
|
|
|
|
#endif |