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