Updated namespace
This commit is contained in:
parent
91c7b2086d
commit
f8009a7663
4
Angle.h
4
Angle.h
@ -6,6 +6,7 @@
|
|||||||
#define ANGLE_H
|
#define ANGLE_H
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
template <typename T> class AngleOf {
|
template <typename T> class AngleOf {
|
||||||
public:
|
public:
|
||||||
@ -40,7 +41,8 @@ private:
|
|||||||
|
|
||||||
using Angle = AngleOf<float>;
|
using Angle = AngleOf<float>;
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -4,6 +4,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
typedef AngleUsing<signed short> Angle16;
|
typedef AngleUsing<signed short> Angle16;
|
||||||
|
|
||||||
@ -22,5 +23,6 @@ template <> float Angle16::ToFloat() const {
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
@ -4,6 +4,8 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
typedef AngleUsing<signed long> Angle32;
|
typedef AngleUsing<signed long> Angle32;
|
||||||
|
|
||||||
template <> Angle32::AngleUsing(float angle) {
|
template <> Angle32::AngleUsing(float angle) {
|
||||||
@ -21,5 +23,6 @@ template <> float Angle32::ToFloat() const {
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
4
Angle8.h
4
Angle8.h
@ -4,6 +4,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
typedef AngleUsing<signed char> Angle8;
|
typedef AngleUsing<signed char> Angle8;
|
||||||
|
|
||||||
@ -23,5 +24,6 @@ template <> float Angle8::ToFloat() const {
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
@ -9,6 +9,7 @@
|
|||||||
#include "Axis.h"
|
#include "Axis.h"
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgbra {
|
||||||
|
|
||||||
class AngleAxis {
|
class AngleAxis {
|
||||||
public:
|
public:
|
||||||
@ -18,7 +19,9 @@ public:
|
|||||||
AngleAxis();
|
AngleAxis();
|
||||||
AngleAxis(Angle angle, Axis axis);
|
AngleAxis(Angle angle, Axis axis);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace LinearAlgbra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgbra;
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -5,6 +5,7 @@
|
|||||||
#include "Range.h"
|
#include "Range.h"
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
// A fixed angle between (-180..180]
|
// A fixed angle between (-180..180]
|
||||||
|
|
||||||
@ -40,7 +41,9 @@ public:
|
|||||||
// protected:
|
// protected:
|
||||||
T value;
|
T value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
5
Axis.h
5
Axis.h
@ -8,6 +8,7 @@
|
|||||||
#include "Angle.h"
|
#include "Angle.h"
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
struct Vector3;
|
struct Vector3;
|
||||||
|
|
||||||
@ -29,7 +30,9 @@ public:
|
|||||||
|
|
||||||
Vector3 ToVector3();
|
Vector3 ToVector3();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgbra;
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -6,6 +6,7 @@
|
|||||||
#define FLOAT_H
|
#define FLOAT_H
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
class Float {
|
class Float {
|
||||||
public:
|
public:
|
||||||
@ -14,7 +15,9 @@ public:
|
|||||||
|
|
||||||
static float Clamp(float f, float min, float max);
|
static float Clamp(float f, float min, float max);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
5
Matrix.h
5
Matrix.h
@ -4,6 +4,7 @@
|
|||||||
#include "Vector3.h"
|
#include "Vector3.h"
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
/// @brief Single precision float matrix
|
/// @brief Single precision float matrix
|
||||||
template <typename T> class MatrixOf {
|
template <typename T> class MatrixOf {
|
||||||
@ -112,7 +113,9 @@ private:
|
|||||||
unsigned int cols;
|
unsigned int cols;
|
||||||
T *data;
|
T *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
||||||
|
|
||||||
#endif
|
#endif
|
12
Polar.h
12
Polar.h
@ -8,6 +8,7 @@
|
|||||||
#include "Angle.h"
|
#include "Angle.h"
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
struct Vector2;
|
struct Vector2;
|
||||||
struct Spherical;
|
struct Spherical;
|
||||||
@ -24,7 +25,8 @@ public:
|
|||||||
/// @remark The angle shall be between -180 .. 180
|
/// @remark The angle shall be between -180 .. 180
|
||||||
Angle angle;
|
Angle angle;
|
||||||
|
|
||||||
/// @brief A new vector with polar coordinates with zero degrees and distance
|
/// @brief A new vector with polar coordinates with zero degrees and
|
||||||
|
/// distance
|
||||||
Polar();
|
Polar();
|
||||||
/// @brief A new vector with polar coordinates
|
/// @brief A new vector with polar coordinates
|
||||||
/// @param distance The distance in meters
|
/// @param distance The distance in meters
|
||||||
@ -55,8 +57,8 @@ public:
|
|||||||
/// @brief Equality test to another vector
|
/// @brief Equality test to another vector
|
||||||
/// @param v The vector to check against
|
/// @param v The vector to check against
|
||||||
/// @return true: if it is identical to the given vector
|
/// @return true: if it is identical to the given vector
|
||||||
/// @note This uses float comparison to check equality which may have strange
|
/// @note This uses float comparison to check equality which may have
|
||||||
/// effects. Equality on floats should be avoided.
|
/// strange effects. Equality on floats should be avoided.
|
||||||
bool operator==(const Polar &v) const;
|
bool operator==(const Polar &v) const;
|
||||||
|
|
||||||
/// @brief The vector length
|
/// @brief The vector length
|
||||||
@ -120,9 +122,9 @@ public:
|
|||||||
/// @return The rotated vector
|
/// @return The rotated vector
|
||||||
static Polar Rotate(const Polar &v, Angle a);
|
static Polar Rotate(const Polar &v, Angle a);
|
||||||
};
|
};
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
||||||
|
|
||||||
#include "Spherical.h"
|
#include "Spherical.h"
|
||||||
#include "Vector2.h"
|
#include "Vector2.h"
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "Vector3.h"
|
#include "Vector3.h"
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -281,7 +282,9 @@ private:
|
|||||||
|
|
||||||
Vector3 xyz() const;
|
Vector3 xyz() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
5
Range.h
5
Range.h
@ -2,6 +2,7 @@
|
|||||||
#define RANGE_H
|
#define RANGE_H
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
/// @brief Signed range. May be renamed to SignedRange later
|
/// @brief Signed range. May be renamed to SignedRange later
|
||||||
@ -41,7 +42,9 @@ public:
|
|||||||
|
|
||||||
T value;
|
T value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -9,6 +9,7 @@
|
|||||||
#include "Polar.h"
|
#include "Polar.h"
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
struct Vector3;
|
struct Vector3;
|
||||||
|
|
||||||
@ -120,8 +121,9 @@ public:
|
|||||||
static Spherical RotateVertical(const Spherical &v, Angle angle);
|
static Spherical RotateVertical(const Spherical &v, Angle angle);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
||||||
|
|
||||||
#include "Vector3.h"
|
#include "Vector3.h"
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ typedef struct Vec2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
struct Vector3;
|
struct Vector3;
|
||||||
struct Polar;
|
struct Polar;
|
||||||
@ -178,7 +179,7 @@ public:
|
|||||||
/// @param v The vector to rotate
|
/// @param v The vector to rotate
|
||||||
/// @param a The angle in degrees to rotate
|
/// @param a The angle in degrees to rotate
|
||||||
/// @return The rotated vector
|
/// @return The rotated vector
|
||||||
static Vector2 Rotate(const Vector2 &v, Passer::Angle a);
|
static Vector2 Rotate(const Vector2 &v, Passer::LinearAlgebra::Angle a);
|
||||||
|
|
||||||
/// @brief Lerp (linear interpolation) between two vectors
|
/// @brief Lerp (linear interpolation) between two vectors
|
||||||
/// @param v1 The starting vector
|
/// @param v1 The starting vector
|
||||||
@ -191,8 +192,9 @@ public:
|
|||||||
static Vector2 Lerp(const Vector2 &v1, const Vector2 &v2, float f);
|
static Vector2 Lerp(const Vector2 &v1, const Vector2 &v2, float f);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
||||||
|
|
||||||
#include "Polar.h"
|
#include "Polar.h"
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "Vector2.h"
|
#include "Vector2.h"
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
|
namespace LinearAlgebra {
|
||||||
|
|
||||||
struct Spherical;
|
struct Spherical;
|
||||||
|
|
||||||
@ -213,8 +214,9 @@ public:
|
|||||||
static Vector3 Lerp(const Vector3 &v1, const Vector3 &v2, float f);
|
static Vector3 Lerp(const Vector3 &v1, const Vector3 &v2, float f);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace LinearAlgebra
|
||||||
} // namespace Passer
|
} // namespace Passer
|
||||||
using namespace Passer;
|
using namespace Passer::LinearAlgebra;
|
||||||
|
|
||||||
#include "Spherical.h"
|
#include "Spherical.h"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user