Browse Source

- Documentation for mat lib
- Refactoring math lib

Panagiotis Christopoulos Charitos 15 years ago
parent
commit
7c8490ef82

+ 1 - 1
build/debug/gen.cfg.py

@@ -1,4 +1,4 @@
-sourcePaths = ["../../src/Math/", "../../src/Util/Tokenizer/", "../../src/Misc/", "../../src/", "../../src/Renderer/", "../../src/Scene/", "../../src/Ui/", "../../src/Resources/", "../../src/Util/", "../../src/Scene/Controllers/", "../../src/Physics/", "../../src/Renderer/BufferObjects/", "../../src/Resources/Helpers/", "../../src/Resources/Core/", "../../src/Core/", "../../src/Scripting/", "../../src/Scripting/Math", "../../src/Scripting/Util", "../../src/Scripting/Core", "../../src/Scripting/Scene", "../../src/Scripting/Renderer"]
+sourcePaths = ["../../src/Scripting/", "../../src/Math/", "../../src/Util/Tokenizer/", "../../src/Misc/", "../../src/", "../../src/Renderer/", "../../src/Scene/", "../../src/Ui/", "../../src/Resources/", "../../src/Util/", "../../src/Scene/Controllers/", "../../src/Physics/", "../../src/Renderer/BufferObjects/", "../../src/Resources/Helpers/", "../../src/Resources/Core/", "../../src/Core/", "../../src/Scripting/Math", "../../src/Scripting/Util", "../../src/Scripting/Core", "../../src/Scripting/Scene", "../../src/Scripting/Renderer"]
 
 
 includePaths = []
 includePaths = []
 includePaths.append("./")
 includePaths.append("./")

+ 1 - 1
build/release/gen.cfg.py

@@ -1,4 +1,4 @@
-sourcePaths = ["../../src/Math/", "../../src/Util/Tokenizer/", "../../src/Misc/", "../../src/", "../../src/Renderer/", "../../src/Scene/", "../../src/Ui/", "../../src/Resources/", "../../src/Util/", "../../src/Scene/Controllers/", "../../src/Physics/", "../../src/Renderer/BufferObjects/", "../../src/Resources/Helpers/", "../../src/Resources/Core/", "../../src/Core/", "../../src/Scripting/", "../../src/Scripting/Math", "../../src/Scripting/Util", "../../src/Scripting/Core", "../../src/Scripting/Scene", "../../src/Scripting/Renderer"]
+sourcePaths = ["../../src/Scripting/", "../../src/Math/", "../../src/Util/Tokenizer/", "../../src/Misc/", "../../src/", "../../src/Renderer/", "../../src/Scene/", "../../src/Ui/", "../../src/Resources/", "../../src/Util/", "../../src/Scene/Controllers/", "../../src/Physics/", "../../src/Renderer/BufferObjects/", "../../src/Resources/Helpers/", "../../src/Resources/Core/", "../../src/Core/", "../../src/Scripting/Math", "../../src/Scripting/Util", "../../src/Scripting/Core", "../../src/Scripting/Scene", "../../src/Scripting/Renderer"]
 
 
 includePaths = []
 includePaths = []
 includePaths.append("./")
 includePaths.append("./")

+ 14 - 8
src/Main.cpp

@@ -71,7 +71,7 @@ void initPhysics()
 
 
 	Transform groundTransform;
 	Transform groundTransform;
 	groundTransform.setIdentity();
 	groundTransform.setIdentity();
-	groundTransform.setOrigin(Vec3(0,-50, 0));
+	groundTransform.origin = Vec3(0,-50, 0);
 
 
 	RigidBody::Initializer init;
 	RigidBody::Initializer init;
 	init.mass = 0.0;
 	init.mass = 0.0;
@@ -124,7 +124,7 @@ void init()
 
 
 	RendererInitializer initializer;
 	RendererInitializer initializer;
 	initializer.ms.ez.enabled = false;
 	initializer.ms.ez.enabled = false;
-	initializer.dbg.enabled = true;
+	initializer.dbg.enabled = false;
 	initializer.is.sm.bilinearEnabled = true;
 	initializer.is.sm.bilinearEnabled = true;
 	initializer.is.sm.enabled = true;
 	initializer.is.sm.enabled = true;
 	initializer.is.sm.pcfEnabled = true;
 	initializer.is.sm.pcfEnabled = true;
@@ -201,13 +201,19 @@ void init()
 
 
 	// sponza map
 	// sponza map
 	MeshNode* node = new MeshNode();
 	MeshNode* node = new MeshNode();
-	node->init("maps/sponza/sponza.mesh");
+	node->init("maps/sponza/floor.mesh");
+	node = new MeshNode();
+	node->init("maps/sponza/walls.mesh");
+	node = new MeshNode();
+	node->init("maps/sponza/light-marbles.mesh");
+	node = new MeshNode();
+	node->init("maps/sponza/dark-marbles.mesh");
 	//node->setLocalTransform(Transform(Vec3(0.0, -0.0, 0.0), Mat3::getIdentity(), 0.01));
 	//node->setLocalTransform(Transform(Vec3(0.0, -0.0, 0.0), Mat3::getIdentity(), 0.01));
 
 
 	// particle emitter
 	// particle emitter
 	partEmitter = new ParticleEmitter;
 	partEmitter = new ParticleEmitter;
 	partEmitter->init("asdf");
 	partEmitter->init("asdf");
-	partEmitter->getLocalTransform().setOrigin(Vec3(3.0, 0.0, 0.0));
+	partEmitter->getLocalTransform().origin = Vec3(3.0, 0.0, 0.0);
 
 
 	// character
 	// character
 	PhyCharacter::Initializer init;
 	PhyCharacter::Initializer init;
@@ -285,10 +291,10 @@ void mainLoop()
 		}
 		}
 		if(I::keys[SDL_SCANCODE_Q]) mover->rotateLocalZ(ang);
 		if(I::keys[SDL_SCANCODE_Q]) mover->rotateLocalZ(ang);
 		if(I::keys[SDL_SCANCODE_E]) mover->rotateLocalZ(-ang);
 		if(I::keys[SDL_SCANCODE_E]) mover->rotateLocalZ(-ang);
-		if(I::keys[SDL_SCANCODE_PAGEUP]) mover->getLocalTransform().getScale() += scale ;
-		if(I::keys[SDL_SCANCODE_PAGEDOWN]) mover->getLocalTransform().getScale() -= scale ;
+		if(I::keys[SDL_SCANCODE_PAGEUP]) mover->getLocalTransform().scale += scale ;
+		if(I::keys[SDL_SCANCODE_PAGEDOWN]) mover->getLocalTransform().scale -= scale ;
 
 
-		if(I::keys[SDL_SCANCODE_K]) app->getActiveCam()->lookAtPoint(point_lights[0]->getWorldTransform().getOrigin());
+		if(I::keys[SDL_SCANCODE_K]) app->getActiveCam()->lookAtPoint(point_lights[0]->getWorldTransform().origin);
 
 
 		if(I::keys[SDL_SCANCODE_I])
 		if(I::keys[SDL_SCANCODE_I])
 			character->moveForward(0.1);
 			character->moveForward(0.1);
@@ -310,7 +316,7 @@ void mainLoop()
 			app->getScriptingEngine().execScript(Util::readFile("test.py").c_str());
 			app->getScriptingEngine().execScript(Util::readFile("test.py").c_str());
 		}
 		}
 
 
-		mover->getLocalTransform().getRotation().reorthogonalize();
+		mover->getLocalTransform().rotation.reorthogonalize();
 
 
 		app->execStdinScpripts();
 		app->execStdinScpripts();
 		app->getScene().getPhysics().update(crntTime);
 		app->getScene().getPhysics().update(crntTime);

+ 3 - 4
src/Math/Axisang.h

@@ -1,5 +1,5 @@
-#ifndef _AXISANG_H_
-#define _AXISANG_H_
+#ifndef AXISANG_H
+#define AXISANG_H
 
 
 #include "Common.h"
 #include "Common.h"
 #include "MathForwardDecls.h"
 #include "MathForwardDecls.h"
@@ -12,10 +12,9 @@ namespace M {
 class Axisang
 class Axisang
 {
 {
 	public:
 	public:
-		// data members
 		float ang;
 		float ang;
 		Vec3 axis;
 		Vec3 axis;
-		// constructors & distructors
+
 		explicit Axisang();
 		explicit Axisang();
 		         Axisang(const Axisang& b);
 		         Axisang(const Axisang& b);
 		explicit Axisang(float rad, const Vec3& axis_);
 		explicit Axisang(float rad, const Vec3& axis_);

+ 24 - 14
src/Math/Euler.h

@@ -1,5 +1,5 @@
-#ifndef _EULER_H_
-#define _EULER_H_
+#ifndef EULER_H
+#define EULER_H
 
 
 #include "Common.h"
 #include "Common.h"
 #include "MathForwardDecls.h"
 #include "MathForwardDecls.h"
@@ -12,28 +12,38 @@ namespace M {
 class Euler
 class Euler
 {
 {
 	public:
 	public:
-		// data members
+		/// @name Data
+		/// @{
 		float x, y, z;
 		float x, y, z;
-		// accessors
-		float& operator [](uint i);
-		float  operator [](uint i) const;
-		float& bank();
-		float  bank() const;
-		float& heading();
-		float  heading() const;
-		float& attitude();
-		float  attitude() const;
-		// constructors & distructors
+		/// @}
+
+		/// @name Constructors & distructors
+		/// @{
 		explicit Euler();
 		explicit Euler();
 		explicit Euler(float x, float y, float z);
 		explicit Euler(float x, float y, float z);
 		         Euler(const Euler& b);
 		         Euler(const Euler& b);
 		explicit Euler(const Quat& q);
 		explicit Euler(const Quat& q);
 		explicit Euler(const Mat3& m3);
 		explicit Euler(const Mat3& m3);
+		/// @}
+
+		/// @name Accessors
+		/// @{
+		float& operator [](uint i);
+		float operator [](uint i) const;
+		float& getBank();
+		float getBank() const;
+		float& getHeading();
+		float getHeading() const;
+		float& getAttitude();
+		float getAttitude() const;
+		/// @}
 };
 };
 
 
 
 
-// other operators
+/// @name Other operators
+/// @{
 extern ostream& operator<<(ostream& s, const Euler& e);
 extern ostream& operator<<(ostream& s, const Euler& e);
+/// @}
 
 
 
 
 } // end namespace
 } // end namespace

+ 15 - 15
src/Math/Euler.inl.h

@@ -15,32 +15,32 @@ inline float Euler::operator [](uint i) const
 	return (&x)[i];
 	return (&x)[i];
 }
 }
 
 
-inline float& Euler::bank()
+inline float& Euler::getBank()
 {
 {
 	return x;
 	return x;
 }
 }
 
 
-inline float Euler::bank() const
+inline float Euler::getBank() const
 {
 {
 	return x;
 	return x;
 }
 }
 
 
-inline float& Euler::heading()
+inline float& Euler::getHeading()
 {
 {
 	return y;
 	return y;
 }
 }
 
 
-inline float Euler::heading() const
+inline float Euler::getHeading() const
 {
 {
 	return y;
 	return y;
 }
 }
 
 
-inline float& Euler::attitude()
+inline float& Euler::getAttitude()
 {
 {
 	return z;
 	return z;
 }
 }
 
 
-inline float Euler::attitude() const
+inline float Euler::getAttitude() const
 {
 {
 	return z;
 	return z;
 }
 }
@@ -66,25 +66,25 @@ inline Euler::Euler(const Quat& q)
 	float test = q.x*q.y + q.z*q.w;
 	float test = q.x*q.y + q.z*q.w;
 	if(test > 0.499)
 	if(test > 0.499)
 	{
 	{
-		heading() = 2.0 * atan2(q.x, q.w);
-		attitude() = PI/2.0;
-		bank() = 0.0;
+		getHeading() = 2.0 * atan2(q.x, q.w);
+		getAttitude() = PI/2.0;
+		getBank() = 0.0;
 		return;
 		return;
 	}
 	}
 	if(test < -0.499)
 	if(test < -0.499)
 	{
 	{
-		heading() = -2.0 * atan2(q.x, q.w);
-		attitude() = -PI/2.0;
-		bank() = 0.0;
+		getHeading() = -2.0 * atan2(q.x, q.w);
+		getAttitude() = -PI/2.0;
+		getBank() = 0.0;
 		return;
 		return;
 	}
 	}
 
 
 	float sqx = q.x*q.x;
 	float sqx = q.x*q.x;
 	float sqy = q.y*q.y;
 	float sqy = q.y*q.y;
 	float sqz = q.z*q.z;
 	float sqz = q.z*q.z;
-	heading() = atan2(2.0*q.y*q.w-2.0*q.x*q.z, 1.0-2.0*sqy-2.0*sqz);
-	attitude() = asin(2.0f*test);
-	bank() = atan2(2.0*q.x*q.w-2.0*q.y*q.z, 1.0-2.0*sqx-2.0*sqz);
+	getHeading() = atan2(2.0*q.y*q.w-2.0*q.x*q.z, 1.0-2.0*sqy-2.0*sqz);
+	getAttitude() = asin(2.0f*test);
+	getBank() = atan2(2.0*q.x*q.w-2.0*q.y*q.z, 1.0-2.0*sqx-2.0*sqz);
 }
 }
 
 
 // constructor [mat3]
 // constructor [mat3]

+ 47 - 27
src/Math/Mat3.h

@@ -1,5 +1,5 @@
-#ifndef _MAT3_H_
-#define _MAT3_H_
+#ifndef MAT3_H
+#define MAT3_H
 
 
 #include "Common.h"
 #include "Common.h"
 #include "MathForwardDecls.h"
 #include "MathForwardDecls.h"
@@ -8,42 +8,46 @@
 namespace M {
 namespace M {
 
 
 
 
-/// Mainly used for rotations. It includes many helpful member functions
+/// Mainly used for rotations. It includes many helpful member functions. Its row major
 class Mat3
 class Mat3
 {
 {
-	private:
-		// data members
-		union
-		{
-			float arr1[9];
-			float arr2[3][3];
-		};
-
 	public:
 	public:
-		// accessors
+		/// @name Accessors
+		/// @{
 		float& operator ()(const uint i, const uint j);
 		float& operator ()(const uint i, const uint j);
 		const float& operator ()(const uint i, const uint j) const;
 		const float& operator ()(const uint i, const uint j) const;
 		float& operator [](const uint i);
 		float& operator [](const uint i);
 		const float& operator [](const uint i) const;
 		const float& operator [](const uint i) const;
-		// constructors & distructors
+		/// @}
+
+		/// @name Constructors & distructors
+		/// @{
 		explicit Mat3() {};
 		explicit Mat3() {};
 		explicit Mat3(float f);
 		explicit Mat3(float f);
 		explicit Mat3(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22);
 		explicit Mat3(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22);
 		explicit Mat3(float arr []);
 		explicit Mat3(float arr []);
 		         Mat3(const Mat3& b);
 		         Mat3(const Mat3& b);
-		explicit Mat3(const Quat& q); ///< @ref Quat to @ref Mat3. 12 muls, 12 adds
+		explicit Mat3(const Quat& q); ///< Quat to Mat3. 12 muls, 12 adds
 		explicit Mat3(const Euler& eu);
 		explicit Mat3(const Euler& eu);
 		explicit Mat3(const Axisang& axisang);
 		explicit Mat3(const Axisang& axisang);
-		// ops with mat3
-		Mat3  operator + (const Mat3& b) const;
+		/// @}
+
+		/// @name Operators with Mat3
+		/// @{
+		Mat3  operator +(const Mat3& b) const;
 		Mat3& operator +=(const Mat3& b);
 		Mat3& operator +=(const Mat3& b);
-		Mat3  operator - (const Mat3& b) const;
+		Mat3  operator -(const Mat3& b) const;
 		Mat3& operator -=(const Mat3& b);
 		Mat3& operator -=(const Mat3& b);
-		Mat3  operator * (const Mat3& b) const; ///< 27 muls, 18 adds
+		Mat3  operator *(const Mat3& b) const; ///< 27 muls, 18 adds
 		Mat3& operator *=(const Mat3& b);
 		Mat3& operator *=(const Mat3& b);
-		Mat3  operator / (const Mat3& b) const;
+		Mat3  operator /(const Mat3& b) const;
 		Mat3& operator /=(const Mat3& b);
 		Mat3& operator /=(const Mat3& b);
-		// ops with float
+		bool operator ==(const Mat3& b) const;
+		bool operator !=(const Mat3& b) const;
+		/// @}
+
+		/// @name Operators with float
+		/// @{
 		Mat3  operator + (float f) const;
 		Mat3  operator + (float f) const;
 		Mat3& operator +=(float f);
 		Mat3& operator +=(float f);
 		Mat3  operator - (float f) const;
 		Mat3  operator - (float f) const;
@@ -52,12 +56,15 @@ class Mat3
 		Mat3& operator *=(float f);
 		Mat3& operator *=(float f);
 		Mat3  operator / (float f) const;
 		Mat3  operator / (float f) const;
 		Mat3& operator /=(float f);
 		Mat3& operator /=(float f);
-		// ops with others
+		/// @}
+
+		/// @name Operators with others
+		/// @{
 		Vec3  operator * (const Vec3& b) const;  ///< 9 muls, 6 adds
 		Vec3  operator * (const Vec3& b) const;  ///< 9 muls, 6 adds
-		// comparision
-		bool operator ==(const Mat3& b) const;
-		bool operator !=(const Mat3& b) const;
-		// other
+		/// @}
+
+		/// @name Other
+		/// @{
 		void  setRows(const Vec3& a, const Vec3& b, const Vec3& c);
 		void  setRows(const Vec3& a, const Vec3& b, const Vec3& c);
 		void  setRow(const uint i, const Vec3& v);
 		void  setRow(const uint i, const Vec3& v);
 		void  getRows(Vec3& a, Vec3& b, Vec3& c) const;
 		void  getRows(Vec3& a, Vec3& b, Vec3& c) const;
@@ -87,16 +94,29 @@ class Mat3
 		Mat3  getInverse() const;
 		Mat3  getInverse() const;
 		void  setIdentity();
 		void  setIdentity();
 		static const Mat3& getZero();
 		static const Mat3& getZero();
-		static const Mat3& getIdentity();		
+		static const Mat3& getIdentity();
+		/// @}
+
+	private:
+		/// @name Data members
+		/// @{
+		union
+		{
+			float arr1[9];
+			float arr2[3][3];
+		};
+		/// @}
 };
 };
 
 
 
 
-// other operators
+/// @name Other Mat3 operators
+/// @{
 extern Mat3 operator +(float f, const Mat3& m3);
 extern Mat3 operator +(float f, const Mat3& m3);
 extern Mat3 operator -(float f, const Mat3& m3);
 extern Mat3 operator -(float f, const Mat3& m3);
 extern Mat3 operator *(float f, const Mat3& m3);
 extern Mat3 operator *(float f, const Mat3& m3);
 extern Mat3 operator /(float f, const Mat3& m3);
 extern Mat3 operator /(float f, const Mat3& m3);
 extern ostream& operator<<(ostream& s, const Mat3& m);
 extern ostream& operator<<(ostream& s, const Mat3& m);
+/// @}
 
 
 
 
 } // end namespace
 } // end namespace

+ 3 - 3
src/Math/Mat3.inl.h

@@ -93,9 +93,9 @@ inline Mat3::Mat3(const Quat& q)
 inline Mat3::Mat3(const Euler& e)
 inline Mat3::Mat3(const Euler& e)
 {
 {
 	float ch, sh, ca, sa, cb, sb;
 	float ch, sh, ca, sa, cb, sb;
-  sinCos(e.heading(), sh, ch);
-  sinCos(e.attitude(), sa, ca);
-  sinCos(e.bank(), sb, cb);
+  sinCos(e.getHeading(), sh, ch);
+  sinCos(e.getAttitude(), sa, ca);
+  sinCos(e.getBank(), sb, cb);
 
 
   ME(0, 0) = ch * ca;
   ME(0, 0) = ch * ca;
   ME(0, 1) = sh*sb - ch*sa*cb;
   ME(0, 1) = sh*sb - ch*sa*cb;

+ 46 - 24
src/Math/Mat4.h

@@ -8,23 +8,20 @@
 namespace M {
 namespace M {
 
 
 
 
-/// Used mainly for transformations but not necessarily
+/// Used mainly for transformations but not necessarily. Its row major
 class Mat4
 class Mat4
 {
 {
-	private:
-		union
-		{
-			float arr1[16];
-			float arr2[4][4];
-		};
-
 	public:
 	public:
-		// access to the data
+		/// @name Accessors
+		/// @{
 		float& operator ()(const uint i, const uint j);
 		float& operator ()(const uint i, const uint j);
 		const float& operator ()(const uint i, const uint j) const;
 		const float& operator ()(const uint i, const uint j) const;
 		float& operator [](const uint i);
 		float& operator [](const uint i);
 		const float& operator [](const uint i) const;
 		const float& operator [](const uint i) const;
-		// constructors & distructors
+		/// @}
+
+		/// @name Constructors & distructors
+		/// @{
 		explicit Mat4() {}
 		explicit Mat4() {}
 		explicit Mat4(float f);
 		explicit Mat4(float f);
 		explicit Mat4(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13,
 		explicit Mat4(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13,
@@ -37,16 +34,24 @@ class Mat4
 		explicit Mat4(const Vec3& transl, const Mat3& rot);
 		explicit Mat4(const Vec3& transl, const Mat3& rot);
 		explicit Mat4(const Vec3& transl, const Mat3& rot, float scale);
 		explicit Mat4(const Vec3& transl, const Mat3& rot, float scale);
 		explicit Mat4(const Transform& t);
 		explicit Mat4(const Transform& t);
-		// ops with same type
-		Mat4  operator + (const Mat4& b) const;
+		/// @}
+
+		/// @name Operators with same type
+		/// @{
+		Mat4 operator +(const Mat4& b) const;
 		Mat4& operator +=(const Mat4& b);
 		Mat4& operator +=(const Mat4& b);
-		Mat4  operator - (const Mat4& b) const;
+		Mat4 operator -(const Mat4& b) const;
 		Mat4& operator -=(const Mat4& b);
 		Mat4& operator -=(const Mat4& b);
-		Mat4  operator * (const Mat4& b) const; ///< 64 muls, 48 adds
+		Mat4 operator *(const Mat4& b) const; ///< 64 muls, 48 adds
 		Mat4& operator *=(const Mat4& b);
 		Mat4& operator *=(const Mat4& b);
-		Mat4  operator / (const Mat4& b) const;
+		Mat4 operator /(const Mat4& b) const;
 		Mat4& operator /=(const Mat4& b);
 		Mat4& operator /=(const Mat4& b);
-		// ops with float
+		bool operator ==(const Mat4& b) const;
+		bool operator !=(const Mat4& b) const;
+		/// @}
+
+		/// @name Operators with float
+		/// @{
 		Mat4  operator + (float f) const;
 		Mat4  operator + (float f) const;
 		Mat4& operator +=(float f);
 		Mat4& operator +=(float f);
 		Mat4  operator - (float f) const;
 		Mat4  operator - (float f) const;
@@ -55,12 +60,15 @@ class Mat4
 		Mat4& operator *=(float f);
 		Mat4& operator *=(float f);
 		Mat4  operator / (float f) const;
 		Mat4  operator / (float f) const;
 		Mat4& operator /=(float f);
 		Mat4& operator /=(float f);
-		// ops with other types
-		Vec4  operator * (const Vec4& v4) const; ///< 16 muls, 12 adds
-		// comparision
-		bool operator ==(const Mat4& b) const;
-		bool operator !=(const Mat4& b) const;
-		// other
+		/// @}
+
+		/// @name Operators with other types
+		/// @{
+		Vec4  operator *(const Vec4& v4) const; ///< 16 muls, 12 adds
+		/// @}
+
+		/// @name Other
+		/// @{
 		void  setRows(const Vec4& a, const Vec4& b, const Vec4& c, const Vec4& d);
 		void  setRows(const Vec4& a, const Vec4& b, const Vec4& c, const Vec4& d);
 		void  setRow(uint i, const Vec4& v);
 		void  setRow(uint i, const Vec4& v);
 		void  setColumns(const Vec4& a, const Vec4& b, const Vec4& c, const Vec4& d);
 		void  setColumns(const Vec4& a, const Vec4& b, const Vec4& c, const Vec4& d);
@@ -78,18 +86,32 @@ class Mat4
 		Mat4  getInverseTransformation() const;
 		Mat4  getInverseTransformation() const;
 		Mat4  lerp(const Mat4& b, float t) const;
 		Mat4  lerp(const Mat4& b, float t) const;
 		void  setIdentity();
 		void  setIdentity();
-		static Mat4 combineTransformations(const Mat4& m0, const Mat4& m1); ///< 12 muls, 27 adds. Something like m4 = m0 * m1 but without touching the 4rth row and allot faster
+		/// 12 muls, 27 adds. Something like m4 = m0 * m1 but without touching the 4rth row and allot faster
+		static Mat4 combineTransformations(const Mat4& m0, const Mat4& m1);
 		static const Mat4& getIdentity();
 		static const Mat4& getIdentity();
 		static const Mat4& getZero();
 		static const Mat4& getZero();
+		/// @}
+
+	private:
+		/// @name Data
+		/// @{
+		union
+		{
+			float arr1[16];
+			float arr2[4][4];
+		};
+		/// @}
 };
 };
 
 
 
 
-// other operators
+/// @name Other operators
+/// @{
 extern Mat4 operator +(float f, const Mat4& m4);
 extern Mat4 operator +(float f, const Mat4& m4);
 extern Mat4 operator -(float f, const Mat4& m4);
 extern Mat4 operator -(float f, const Mat4& m4);
 extern Mat4 operator *(float f, const Mat4& m4);
 extern Mat4 operator *(float f, const Mat4& m4);
 extern Mat4 operator /(float f, const Mat4& m4);
 extern Mat4 operator /(float f, const Mat4& m4);
 extern ostream& operator<<(ostream& s, const Mat4& m);
 extern ostream& operator<<(ostream& s, const Mat4& m);
+/// @}
 
 
 
 
 } // end namespace
 } // end namespace

+ 1 - 1
src/Math/Mat4.inl.h

@@ -155,7 +155,7 @@ inline Mat4::Mat4(float f)
 // constructor [Transform]
 // constructor [Transform]
 inline Mat4::Mat4(const Transform& t)
 inline Mat4::Mat4(const Transform& t)
 {
 {
-	ME = Mat4(t.getOrigin(), t.getRotation(), t.getScale());
+	ME = Mat4(t.origin, t.rotation, t.scale);
 }
 }
 
 
 // 4x4 + 4x4
 // 4x4 + 4x4

+ 4 - 8
src/Math/MathFuncs.h

@@ -1,5 +1,5 @@
-#ifndef _MATHFUNCS_H_
-#define _MATHFUNCS_H_
+#ifndef MATH_FUNCS_H
+#define MATH_FUNCS_H
 
 
 #include "Common.h"
 #include "Common.h"
 #include "MathForwardDecls.h"
 #include "MathForwardDecls.h"
@@ -22,16 +22,12 @@ extern float sin(float rad);
 extern float cos(float rad);
 extern float cos(float rad);
 extern bool  isZero(float f); ///< The proper way to test if a float is zero
 extern bool  isZero(float f); ///< The proper way to test if a float is zero
 
 
-/**
- * mat4(t0,r0,s0)*mat4(t1,r1,s1) == mat4(tf,rf,sf)
- */
+/// mat4(t0,r0,s0)*mat4(t1,r1,s1) == mat4(tf,rf,sf)
 extern void combineTransformations(const Vec3& t0, const Mat3& r0, float s0, // in 0
 extern void combineTransformations(const Vec3& t0, const Mat3& r0, float s0, // in 0
                                     const Vec3& t1, const Mat3& r1, float s1, // in 1
                                     const Vec3& t1, const Mat3& r1, float s1, // in 1
                                     Vec3& tf, Mat3& rf, float& sf); // out
                                     Vec3& tf, Mat3& rf, float& sf); // out
 
 
-/**
- * mat4(t0,r0, 1.0)*mat4(t1,r1, 1.0) == mat4(tf,rf,sf)
- */
+/// mat4(t0,r0, 1.0)*mat4(t1,r1, 1.0) == mat4(tf,rf,sf)
 extern void combineTransformations(const Vec3& t0, const Mat3& r0, // in 0
 extern void combineTransformations(const Vec3& t0, const Mat3& r0, // in 0
                                     const Vec3& t1, const Mat3& r1, // in 1
                                     const Vec3& t1, const Mat3& r1, // in 1
                                     Vec3& tf, Mat3& rf); // out
                                     Vec3& tf, Mat3& rf); // out

+ 21 - 9
src/Math/Quat.h

@@ -1,5 +1,5 @@
-#ifndef _QUAT_H_
-#define _QUAT_H_
+#ifndef QUAT_H
+#define QUAT_H
 
 
 #include "Common.h"
 #include "Common.h"
 #include "MathForwardDecls.h"
 #include "MathForwardDecls.h"
@@ -12,9 +12,13 @@ namespace M {
 class Quat
 class Quat
 {
 {
 	public:
 	public:
-		// data members
+		/// @name Data
+		/// @{
 		float x, y, z, w;
 		float x, y, z, w;
-		// constructors & destructors
+		/// @}
+
+		/// @name Constructors & destructors
+		/// @{
 		explicit Quat();
 		explicit Quat();
 		explicit Quat(float f);
 		explicit Quat(float f);
 		explicit Quat(float x, float y, float z, float w);
 		explicit Quat(float x, float y, float z, float w);
@@ -25,13 +29,18 @@ class Quat
 		explicit Quat(const Mat3& m3);
 		explicit Quat(const Mat3& m3);
 		explicit Quat(const Euler& eu);
 		explicit Quat(const Euler& eu);
 		explicit Quat(const Axisang& axisang);
 		explicit Quat(const Axisang& axisang);
-		// ops with same
-		Quat  operator * (const Quat& b) const; ///< 16 muls, 12 adds
+		/// @}
+
+		/// Operatorswith same
+		/// @{
+		Quat operator *(const Quat& b) const; ///< 16 muls, 12 adds
 		Quat& operator *=(const Quat& b);
 		Quat& operator *=(const Quat& b);
-		// comparision
 		bool operator ==(const Quat& b) const;
 		bool operator ==(const Quat& b) const;
 		bool operator !=(const Quat& b) const;
 		bool operator !=(const Quat& b) const;
-		// other
+		/// @}
+
+		/// @name Other
+		/// @{
 		void  setFrom2Vec3(const Vec3& v0, const Vec3& v1); ///< calculates a quat from v0 to v1
 		void  setFrom2Vec3(const Vec3& v0, const Vec3& v1); ///< calculates a quat from v0 to v1
 		float getLength() const;
 		float getLength() const;
 		Quat  getInverted() const;
 		Quat  getInverted() const;
@@ -46,11 +55,14 @@ class Quat
 		void  rotate(const Quat& b); ///< @see getRotated
 		void  rotate(const Quat& b); ///< @see getRotated
 		void  setIdentity();
 		void  setIdentity();
 		static const Quat& getIdentity();
 		static const Quat& getIdentity();
+		/// @}
 };
 };
 
 
 
 
-// other operators
+/// @name Other operators
+/// @{
 extern ostream& operator<<(ostream& s, const Quat& q);
 extern ostream& operator<<(ostream& s, const Quat& q);
+/// @}
 
 
 
 
 } // end namespace
 } // end namespace

+ 3 - 3
src/Math/Quat.inl.h

@@ -87,13 +87,13 @@ inline Quat::Quat(const Mat3& m3)
 inline Quat::Quat(const Euler& eu)
 inline Quat::Quat(const Euler& eu)
 {
 {
 	float cx, sx;
 	float cx, sx;
-	sinCos(eu.heading()*0.5, sx, cx);
+	sinCos(eu.getHeading()*0.5, sx, cx);
 
 
 	float cy, sy;
 	float cy, sy;
-	sinCos(eu.attitude()*0.5, sy, cy);
+	sinCos(eu.getAttitude()*0.5, sy, cy);
 
 
 	float cz, sz;
 	float cz, sz;
-	sinCos(eu.bank()*0.5, sz, cz);
+	sinCos(eu.getBank()*0.5, sz, cz);
 
 
 	float cxcy = cx*cy;
 	float cxcy = cx*cy;
 	float sxsy = sx*sy;
 	float sxsy = sx*sy;

+ 16 - 8
src/Math/Transform.h

@@ -1,5 +1,5 @@
-#ifndef _TRANSFORM_H_
-#define _TRANSFORM_H_
+#ifndef TRANSFORM_H
+#define TRANSFORM_H
 
 
 #include "Common.h"
 #include "Common.h"
 #include "MathForwardDecls.h"
 #include "MathForwardDecls.h"
@@ -11,20 +11,28 @@ namespace M {
 /// For transformations
 /// For transformations
 class Transform
 class Transform
 {
 {
-	PROPERTY_RW(Mat3, rotation, setRotation, getRotation) ///< @ref PROPERTY_RW : The rotation
-	PROPERTY_RW(Vec3, origin, setOrigin, getOrigin) ///< @ref PROPERTY_RW : The translation
-	PROPERTY_RW(float, scale, setScale, getScale) ///< @ref PROPERTY_RW : The uniform scaling
-
 	public:
 	public:
-		// constructors
+		/// @name Data
+		/// @{
+		Vec3 origin; ///< The rotation
+		Mat3 rotation; ///< The translation
+		float scale; ///< The uniform scaling
+		/// @}
+
+		/// @name Constructors
+		/// @{
 		explicit Transform();
 		explicit Transform();
 		         Transform(const Transform& b);
 		         Transform(const Transform& b);
 		explicit Transform(const Mat4& m4);
 		explicit Transform(const Mat4& m4);
 		explicit Transform(const Vec3& origin, const Mat3& rotation_, float scale_);
 		explicit Transform(const Vec3& origin, const Mat3& rotation_, float scale_);
-		// funcs
+		/// @}
+
+		/// @name Other
+		/// @{
 		void setIdentity();
 		void setIdentity();
 		static const Transform& getIdentity();
 		static const Transform& getIdentity();
 		static Transform combineTransformations(const Transform& a, const Transform& b); ///< @see M::combineTransformations
 		static Transform combineTransformations(const Transform& a, const Transform& b); ///< @see M::combineTransformations
+		/// @}
 };
 };
 
 
 
 

+ 6 - 2
src/Math/Transform.inl.h

@@ -13,7 +13,9 @@ inline Transform::Transform()
 
 
 // constructor [Transform]
 // constructor [Transform]
 inline Transform::Transform(const Transform& b):
 inline Transform::Transform(const Transform& b):
-	rotation(b.rotation), origin(b.origin)
+	origin(b.origin),
+	rotation(b.rotation),
+	scale(b.scale)
 {}
 {}
 
 
 // constructor [Mat4]
 // constructor [Mat4]
@@ -26,7 +28,9 @@ inline Transform::Transform(const Mat4& m4)
 
 
 // constructor [Vec3, Quat, float]
 // constructor [Vec3, Quat, float]
 inline Transform::Transform(const Vec3& origin, const Mat3& rotation_, float scale_):
 inline Transform::Transform(const Vec3& origin, const Mat3& rotation_, float scale_):
-	rotation(rotation_), origin(origin), scale(scale_)
+	origin(origin),
+	rotation(rotation_),
+	scale(scale_)
 {}
 {}
 
 
 // setIdentity
 // setIdentity

+ 28 - 9
src/Math/Vec2.h

@@ -1,5 +1,5 @@
-#ifndef _VEC2_H_
-#define _VEC2_H_
+#ifndef VEC2_H
+#define VEC2_H
 
 
 #include "Common.h"
 #include "Common.h"
 #include "MathForwardDecls.h"
 #include "MathForwardDecls.h"
@@ -12,20 +12,30 @@ namespace M {
 class Vec2
 class Vec2
 {
 {
 	public:
 	public:
-		// data members
+		/// @name Data members
+		/// @{
 		float x;
 		float x;
 		float y;
 		float y;
-		// accessors
+		/// @}
+
+		/// @name Accessors
+		/// @{
 		float& operator [](uint i);
 		float& operator [](uint i);
 		float  operator [](uint i) const;
 		float  operator [](uint i) const;
-		// constructors & distructors
+		/// @}
+
+		/// @name Constructors & distructors
+		/// @{
 		explicit Vec2();
 		explicit Vec2();
 		explicit Vec2(float f);
 		explicit Vec2(float f);
 		explicit Vec2(float x, float y);
 		explicit Vec2(float x, float y);
 		         Vec2(const Vec2& b);
 		         Vec2(const Vec2& b);
 		explicit Vec2(const Vec3& v3);
 		explicit Vec2(const Vec3& v3);
 		explicit Vec2(const Vec4& v4);
 		explicit Vec2(const Vec4& v4);
-		// ops with same type
+		/// @}
+
+		/// @name Operators with same type
+		/// @{
 		Vec2 operator +(const Vec2& b) const;
 		Vec2 operator +(const Vec2& b) const;
 		Vec2& operator +=(const Vec2& b);
 		Vec2& operator +=(const Vec2& b);
 		Vec2 operator -(const Vec2& b) const;
 		Vec2 operator -(const Vec2& b) const;
@@ -37,7 +47,10 @@ class Vec2
 		Vec2 operator -() const;
 		Vec2 operator -() const;
 		bool operator ==(const Vec2& b) const;
 		bool operator ==(const Vec2& b) const;
 		bool operator !=(const Vec2& b) const;
 		bool operator !=(const Vec2& b) const;
-		// ops with float
+		/// @}
+
+		/// @name Operators with float
+		/// @{
 		Vec2 operator +(float f) const;
 		Vec2 operator +(float f) const;
 		Vec2& operator +=(float f);
 		Vec2& operator +=(float f);
 		Vec2 operator -(float f) const;
 		Vec2 operator -(float f) const;
@@ -46,20 +59,26 @@ class Vec2
 		Vec2& operator *=(float f);
 		Vec2& operator *=(float f);
 		Vec2 operator /(float f) const;
 		Vec2 operator /(float f) const;
 		Vec2& operator /=(float f);
 		Vec2& operator /=(float f);
-		// other
+		/// @}
+
+		/// @name Other
+		/// @{
 		float getLength() const;
 		float getLength() const;
 		Vec2 getNormalized() const;
 		Vec2 getNormalized() const;
 		void normalize();
 		void normalize();
 		float dot(const Vec2& b) const;
 		float dot(const Vec2& b) const;
+		/// @}
 };
 };
 
 
 
 
-// other operators
+/// @name Other operators
+/// @{
 extern Vec2 operator +(float f, const Vec2& v2);
 extern Vec2 operator +(float f, const Vec2& v2);
 extern Vec2 operator -(float f, const Vec2& v2);
 extern Vec2 operator -(float f, const Vec2& v2);
 extern Vec2 operator *(float f, const Vec2& v2);
 extern Vec2 operator *(float f, const Vec2& v2);
 extern Vec2 operator /(float f, const Vec2& v2);
 extern Vec2 operator /(float f, const Vec2& v2);
 extern ostream& operator<<(ostream& s, const Vec2& v);
 extern ostream& operator<<(ostream& s, const Vec2& v);
+/// @}
 
 
 
 
 } // end namespace
 } // end namespace

+ 64 - 44
src/Math/Vec3.h

@@ -1,5 +1,5 @@
-#ifndef _VEC3_H_
-#define _VEC3_H_
+#ifndef VEC3_H
+#define VEC3_H
 
 
 #include "Common.h"
 #include "Common.h"
 #include "MathForwardDecls.h"
 #include "MathForwardDecls.h"
@@ -12,12 +12,19 @@ namespace M {
 class Vec3
 class Vec3
 {
 {
 	public:
 	public:
-		// data members
+		/// @name Data members
+		/// @{
 		float x, y, z;
 		float x, y, z;
-		// accessors
+		/// @}
+
+		/// @name Accessors
+		/// @{
 		float& operator [](uint i);
 		float& operator [](uint i);
 		float  operator [](uint i) const;
 		float  operator [](uint i) const;
-		// constructors & distructors
+		/// @}
+
+		/// @name Constructors & distructors
+		/// @{
 		explicit Vec3();
 		explicit Vec3();
 		explicit Vec3(float f);
 		explicit Vec3(float f);
 		explicit Vec3(float x, float y, float z);
 		explicit Vec3(float x, float y, float z);
@@ -25,70 +32,83 @@ class Vec3
 		         Vec3(const Vec3& b);
 		         Vec3(const Vec3& b);
 		explicit Vec3(const Vec4& v4);
 		explicit Vec3(const Vec4& v4);
 		explicit Vec3(const Quat& q);
 		explicit Vec3(const Quat& q);
-		// ops with same type
-		Vec3  operator + (const Vec3& b) const;
+		/// @}
+
+		/// @name Operators with same type
+		/// @{
+		Vec3 operator +(const Vec3& b) const;
 		Vec3& operator +=(const Vec3& b);
 		Vec3& operator +=(const Vec3& b);
-		Vec3  operator - (const Vec3& b) const;
+		Vec3 operator -(const Vec3& b) const;
 		Vec3& operator -=(const Vec3& b);
 		Vec3& operator -=(const Vec3& b);
-		Vec3  operator * (const Vec3& b) const;
+		Vec3 operator *(const Vec3& b) const;
 		Vec3& operator *=(const Vec3& b);
 		Vec3& operator *=(const Vec3& b);
-		Vec3  operator / (const Vec3& b) const;
+		Vec3 operator /(const Vec3& b) const;
 		Vec3& operator /=(const Vec3& b);
 		Vec3& operator /=(const Vec3& b);
-		Vec3  operator - () const; // return the negative
-		// ops with float
-		Vec3  operator + (float f) const;
+		Vec3 operator -() const;
+		bool operator ==(const Vec3& b) const;
+		bool operator !=(const Vec3& b) const;
+		/// @}
+
+		/// @name Operators with float
+		/// @{
+		Vec3 operator +(float f) const;
 		Vec3& operator +=(float f);
 		Vec3& operator +=(float f);
-		Vec3  operator - (float f) const;
+		Vec3 operator -(float f) const;
 		Vec3& operator -=(float f);
 		Vec3& operator -=(float f);
-		Vec3  operator * (float f) const;
+		Vec3 operator *(float f) const;
 		Vec3& operator *=(float f);
 		Vec3& operator *=(float f);
-		Vec3  operator / (float f) const;
+		Vec3 operator /(float f) const;
 		Vec3& operator /=(float f);
 		Vec3& operator /=(float f);
-		// ops with other types
-		Vec3  operator * (const Mat3& m3) const;
-		// comparision
-		bool operator ==(const Vec3& b) const;
-		bool operator !=(const Vec3& b) const;
-		// other
+		/// @}
+
+		/// @name Operators with other types
+		/// @{
+		Vec3 operator * (const Mat3& m3) const;
+		/// @}
+
+		/// @name Other
+		/// @{
 		float dot(const Vec3& b) const;
 		float dot(const Vec3& b) const;
-		Vec3  cross(const Vec3& b) const;
+		Vec3 cross(const Vec3& b) const;
 		float getLength() const;
 		float getLength() const;
 		float getLengthSquared() const;
 		float getLengthSquared() const;
 		float getDistanceSquared(const Vec3& b) const;
 		float getDistanceSquared(const Vec3& b) const;
 		void  normalize();
 		void  normalize();
-		Vec3  getNormalized() const;
-		Vec3  getProjection(const Vec3& toThis) const;
-		Vec3  getRotated(const Quat& q) const; ///< Returns q * this * q.Conjucated() aka returns a rotated this. 18 muls, 12 adds
+		Vec3 getNormalized() const;
+		Vec3 getProjection(const Vec3& toThis) const;
+		/// Returns q * this * q.Conjucated() aka returns a rotated this. 18 muls, 12 adds
+		Vec3 getRotated(const Quat& q) const;
 		void  rotate(const Quat& q);
 		void  rotate(const Quat& q);
-		Vec3  lerp(const Vec3& v1, float t) const; ///< return lerp(this, v1, t)
+		Vec3 lerp(const Vec3& v1, float t) const; ///< Return lerp(this, v1, t)
+		/// @}
 
 
-		/**
-		 * @name Transformations
-		 * The faster way is by far the mat4 * vec3 or the getTransformed(Vec3, Mat3)
-		 */
+		/// @name Transformations
+		/// The faster way is by far the mat4 * vec3 or the getTransformed(Vec3, Mat3)
 		/**@{*/
 		/**@{*/
-		Vec3  getTransformed(const Vec3& translate, const Mat3& rotate, float scale) const;
-		void  transform(const Vec3& translate, const Mat3& rotate, float scale);
-		Vec3  getTransformed(const Vec3& translate, const Mat3& rotate) const;
-		void  transform(const Vec3& translate, const Mat3& rotate);
-		Vec3  getTransformed(const Vec3& translate, const Quat& rotate, float scale) const;
-		void  transform(const Vec3& translate, const Quat& rotate, float scale);
-		Vec3  getTransformed(const Vec3& translate, const Quat& rotate) const;
-		void  transform(const Vec3& translate, const Quat& rotate);
-		Vec3  getTransformed(const Mat4& transform) const;  ///< 9 muls, 9 adds
-		void  transform(const Mat4& transform);
-		Vec3  getTransformed(const Transform& transform) const;
-		void  transform(const Transform& transform);
+		Vec3 getTransformed(const Vec3& translate, const Mat3& rotate, float scale) const;
+		void transform(const Vec3& translate, const Mat3& rotate, float scale);
+		Vec3 getTransformed(const Vec3& translate, const Mat3& rotate) const;
+		void transform(const Vec3& translate, const Mat3& rotate);
+		Vec3 getTransformed(const Vec3& translate, const Quat& rotate, float scale) const;
+		void transform(const Vec3& translate, const Quat& rotate, float scale);
+		Vec3 getTransformed(const Vec3& translate, const Quat& rotate) const;
+		void transform(const Vec3& translate, const Quat& rotate);
+		Vec3 getTransformed(const Mat4& transform) const;  ///< 9 muls, 9 adds
+		void transform(const Mat4& transform);
+		Vec3 getTransformed(const Transform& transform) const;
+		void transform(const Transform& transform);
 		/**@}*/
 		/**@}*/
 };
 };
 
 
 
 
-// other operators
+/// @name Other operators
+/// @{
 extern Vec3 operator +(float f, const Vec3& v);
 extern Vec3 operator +(float f, const Vec3& v);
 extern Vec3 operator -(float f, const Vec3& v);
 extern Vec3 operator -(float f, const Vec3& v);
 extern Vec3 operator *(float f, const Vec3& v);
 extern Vec3 operator *(float f, const Vec3& v);
 extern Vec3 operator /(float f, const Vec3& v);
 extern Vec3 operator /(float f, const Vec3& v);
 extern ostream& operator<<(ostream& s, const Vec3& v);
 extern ostream& operator<<(ostream& s, const Vec3& v);
+/// @}
 
 
 
 
 } // end namespace
 } // end namespace

+ 1 - 1
src/Math/Vec3.inl.h

@@ -339,7 +339,7 @@ inline void Vec3::transform(const Mat4& transform)
 // getTransformed [Transform]
 // getTransformed [Transform]
 inline Vec3 Vec3::getTransformed(const Transform& transform) const
 inline Vec3 Vec3::getTransformed(const Transform& transform) const
 {
 {
-	return (transform.getRotation() * (ME * transform.getScale())) + transform.getOrigin();
+	return (transform.rotation * (ME * transform.scale)) + transform.origin;
 }
 }
 
 
 // getTransformed [Transform]
 // getTransformed [Transform]

+ 45 - 24
src/Math/Vec4.h

@@ -1,5 +1,5 @@
-#ifndef _VEC4_H_
-#define _VEC4_H_
+#ifndef VEC4_H
+#define VEC4_H
 
 
 #include "Common.h"
 #include "Common.h"
 #include "MathForwardDecls.h"
 #include "MathForwardDecls.h"
@@ -12,12 +12,19 @@ namespace M {
 class Vec4
 class Vec4
 {
 {
 	public:
 	public:
-		// data members
+		/// @name Data members
+		/// @{
 		float x, y, z, w;
 		float x, y, z, w;
-		// accessors
+		/// @}
+
+		/// @name Accessors
+		/// @{
 		float& operator [](uint i);
 		float& operator [](uint i);
 		float  operator [](uint i) const;
 		float  operator [](uint i) const;
-		// constructors & distructors
+		/// @}
+
+		/// @name Constructors & distructors
+		/// @{
 		explicit Vec4();
 		explicit Vec4();
 		explicit Vec4(float f);
 		explicit Vec4(float f);
 		explicit Vec4(float x, float y, float z, float w);
 		explicit Vec4(float x, float y, float z, float w);
@@ -25,44 +32,58 @@ class Vec4
 		explicit Vec4(const Vec3& v3, float w);
 		explicit Vec4(const Vec3& v3, float w);
 		         Vec4(const Vec4& b);
 		         Vec4(const Vec4& b);
 		explicit Vec4(const Quat& q);
 		explicit Vec4(const Quat& q);
-		// ops with same
-		Vec4  operator + (const Vec4& b) const;
+		/// @}
+
+		/// @name Operators with same
+		/// @{
+		Vec4 operator +(const Vec4& b) const;
 		Vec4& operator +=(const Vec4& b);
 		Vec4& operator +=(const Vec4& b);
-		Vec4  operator - (const Vec4& b) const;
+		Vec4 operator -(const Vec4& b) const;
 		Vec4& operator -=(const Vec4& b);
 		Vec4& operator -=(const Vec4& b);
-		Vec4  operator * (const Vec4& b) const;
+		Vec4 operator *(const Vec4& b) const;
 		Vec4& operator *=(const Vec4& b);
 		Vec4& operator *=(const Vec4& b);
-		Vec4  operator / (const Vec4& b) const;
+		Vec4 operator /(const Vec4& b) const;
 		Vec4& operator /=(const Vec4& b);
 		Vec4& operator /=(const Vec4& b);
-		Vec4  operator - () const;
-		// ops with float
-		Vec4  operator + (float f) const;
+		Vec4 operator -() const;
+		bool operator ==(const Vec4& b) const;
+		bool operator !=(const Vec4& b) const;
+		/// @}
+
+		/// @name Operators with float
+		/// @{
+		Vec4 operator +(float f) const;
 		Vec4& operator +=(float f);
 		Vec4& operator +=(float f);
-		Vec4  operator - (float f) const;
+		Vec4 operator -(float f) const;
 		Vec4& operator -=(float f);
 		Vec4& operator -=(float f);
-		Vec4  operator * (float f) const;
+		Vec4 operator *(float f) const;
 		Vec4& operator *=(float f);
 		Vec4& operator *=(float f);
-		Vec4  operator / (float f) const;
+		Vec4 operator /(float f) const;
 		Vec4& operator /=(float f);
 		Vec4& operator /=(float f);
-		// ops with other
+		/// @}
+
+		/// @name Operators with other
+		/// @{
 		Vec4  operator * (const Mat4& m4) const;
 		Vec4  operator * (const Mat4& m4) const;
-		// comparision
-		bool operator ==(const Vec4& b) const;
-		bool operator !=(const Vec4& b) const;
-		// other
+		/// @}
+
+		/// @name Other
+		/// @{
 		float getLength() const;
 		float getLength() const;
-		Vec4  getNormalized() const;
-		void  normalize();
+		Vec4 getNormalized() const;
+		void normalize();
 		float dot(const Vec4& b) const;
 		float dot(const Vec4& b) const;
+		/// @}
 };
 };
 
 
 
 
-// other operators
+/// @name Other operators
+/// @{
 extern Vec4 operator +(float f, const Vec4& v4);
 extern Vec4 operator +(float f, const Vec4& v4);
 extern Vec4 operator -(float f, const Vec4& v4);
 extern Vec4 operator -(float f, const Vec4& v4);
 extern Vec4 operator *(float f, const Vec4& v4);
 extern Vec4 operator *(float f, const Vec4& v4);
 extern Vec4 operator /(float f, const Vec4& v4);
 extern Vec4 operator /(float f, const Vec4& v4);
 extern ostream& operator<<(ostream& s, const Vec4& v);
 extern ostream& operator<<(ostream& s, const Vec4& v);
+/// @}
 
 
 
 
 } // end namespace
 } // end namespace

+ 5 - 5
src/Physics/BtAndAnkiConvertors.h

@@ -36,9 +36,9 @@ inline Quat toAnki(const btQuaternion& q)
 inline Transform toAnki(const btTransform& t)
 inline Transform toAnki(const btTransform& t)
 {
 {
 	Transform out;
 	Transform out;
-	out.setRotation(toAnki(t.getBasis()));
-	out.setOrigin(toAnki(t.getOrigin()));
-	out.setScale(1.0);
+	out.rotation = toAnki(t.getBasis());
+	out.origin = toAnki(t.getOrigin());
+	out.scale = 1.0;
 	return out;
 	return out;
 }
 }
 
 
@@ -82,8 +82,8 @@ inline btQuaternion toBt(const Quat& q)
 inline btTransform toBt(const Transform& trf)
 inline btTransform toBt(const Transform& trf)
 {
 {
 	btTransform r;
 	btTransform r;
-	r.setOrigin(toBt(trf.getOrigin()));
-	r.setRotation(toBt(Quat(trf.getRotation())));
+	r.setOrigin(toBt(trf.origin));
+	r.setRotation(toBt(Quat(trf.rotation)));
 	return r;
 	return r;
 }
 }
 
 

+ 6 - 10
src/Physics/MotionState.h

@@ -7,23 +7,19 @@
 #include "Object.h"
 #include "Object.h"
 
 
 
 
-/**
- * A custom motion state
- */
+/// A custom motion state
 class MotionState: public btMotionState, public Object
 class MotionState: public btMotionState, public Object
 {
 {
 	public:
 	public:
 		MotionState(const Transform& initialTransform, SceneNode* node_, Object* parent);
 		MotionState(const Transform& initialTransform, SceneNode* node_, Object* parent);
 		~MotionState() {}
 		~MotionState() {}
 
 
-		/**
-		 * @name Bullet implementation of virtuals
-		 */
-		/**@{*/
+		/// @name Bullet implementation of virtuals
+		/// @{
 		void getWorldTransform(btTransform& worldTrans) const;
 		void getWorldTransform(btTransform& worldTrans) const;
 		const btTransform& getWorldTransform() const;
 		const btTransform& getWorldTransform() const;
 		void setWorldTransform(const btTransform& worldTrans);
 		void setWorldTransform(const btTransform& worldTrans);
-		/**@}*/
+		/// @}
 
 
 	private:
 	private:
 		btTransform worldTransform;
 		btTransform worldTransform;
@@ -61,9 +57,9 @@ inline void MotionState::setWorldTransform(const btTransform& worldTrans)
 	if(node)
 	if(node)
 	{
 	{
 		Transform& nodeTrf = node->getLocalTransform();
 		Transform& nodeTrf = node->getLocalTransform();
-		float originalScale = nodeTrf.getScale();
+		float originalScale = nodeTrf.scale;
 		nodeTrf = toAnki(worldTrans);
 		nodeTrf = toAnki(worldTrans);
-		nodeTrf.setScale(originalScale);
+		nodeTrf.scale = originalScale;
 	}
 	}
 }
 }
 
 

+ 3 - 3
src/Renderer/Is.cpp

@@ -158,7 +158,7 @@ void Is::pointLightPass(const PointLight& light)
 	const Camera& cam = r.getCamera();
 	const Camera& cam = r.getCamera();
 
 
 	// frustum test
 	// frustum test
-	bsphere_t sphere(light.getWorldTransform().getOrigin(), light.getRadius());
+	bsphere_t sphere(light.getWorldTransform().origin, light.getRadius());
 	if(!cam.insideFrustum(sphere)) return;
 	if(!cam.insideFrustum(sphere)) return;
 
 
 	// stencil optimization
 	// stencil optimization
@@ -173,7 +173,7 @@ void Is::pointLightPass(const PointLight& light)
 	shader.findUniVar("msSpecularFai")->setTexture(r.ms.specularFai, 2);
 	shader.findUniVar("msSpecularFai")->setTexture(r.ms.specularFai, 2);
 	shader.findUniVar("msDepthFai")->setTexture(r.ms.depthFai, 3);
 	shader.findUniVar("msDepthFai")->setTexture(r.ms.depthFai, 3);
 	shader.findUniVar("planes")->setVec2(&planes);
 	shader.findUniVar("planes")->setVec2(&planes);
-	Vec3 lightPosEyeSpace = light.getWorldTransform().getOrigin().getTransformed(cam.getViewMatrix());
+	Vec3 lightPosEyeSpace = light.getWorldTransform().origin.getTransformed(cam.getViewMatrix());
 	shader.findUniVar("lightPos")->setVec3(&lightPosEyeSpace);
 	shader.findUniVar("lightPos")->setVec3(&lightPosEyeSpace);
 	shader.findUniVar("lightRadius")->setFloat(light.getRadius());
 	shader.findUniVar("lightRadius")->setFloat(light.getRadius());
 	shader.findUniVar("lightDiffuseCol")->setVec3(&light.lightProps->getDiffuseColor());
 	shader.findUniVar("lightDiffuseCol")->setVec3(&light.lightProps->getDiffuseColor());
@@ -254,7 +254,7 @@ void Is::spotLightPass(const SpotLight& light)
 	shdr->findUniVar("planes")->setVec2(&planes);
 	shdr->findUniVar("planes")->setVec2(&planes);
 
 
 	// the light params
 	// the light params
-	Vec3 lightPosEyeSpace = light.getWorldTransform().getOrigin().getTransformed(cam.getViewMatrix());
+	Vec3 lightPosEyeSpace = light.getWorldTransform().origin.getTransformed(cam.getViewMatrix());
 	shdr->findUniVar("lightPos")->setVec3(&lightPosEyeSpace);
 	shdr->findUniVar("lightPos")->setVec3(&lightPosEyeSpace);
 	shdr->findUniVar("lightRadius")->setFloat(light.getDistance());
 	shdr->findUniVar("lightRadius")->setFloat(light.getDistance());
 	shdr->findUniVar("lightDiffuseCol")->setVec3(&light.lightProps->getDiffuseColor());
 	shdr->findUniVar("lightDiffuseCol")->setVec3(&light.lightProps->getDiffuseColor());

+ 10 - 0
src/Renderer/Renderer.cpp

@@ -103,18 +103,28 @@ void Renderer::setupMaterial(const Material& mtl, const SceneNode& sceneNode, co
 		glBlendFunc(mtl.blendingSfactor, mtl.blendingDfactor);
 		glBlendFunc(mtl.blendingSfactor, mtl.blendingDfactor);
 	}
 	}
 	else
 	else
+	{
 		glDisable(GL_BLEND);
 		glDisable(GL_BLEND);
+	}
 
 
 
 
 	if(mtl.depthTesting)
 	if(mtl.depthTesting)
+	{
 		glEnable(GL_DEPTH_TEST);
 		glEnable(GL_DEPTH_TEST);
+	}
 	else
 	else
+	{
 		glDisable(GL_DEPTH_TEST);
 		glDisable(GL_DEPTH_TEST);
+	}
 
 
 	if(mtl.wireframe)
 	if(mtl.wireframe)
+	{
 		glPolygonMode(GL_FRONT, GL_LINE);
 		glPolygonMode(GL_FRONT, GL_LINE);
+	}
 	else
 	else
+	{
 		glPolygonMode(GL_FRONT, GL_FILL);
 		glPolygonMode(GL_FRONT, GL_FILL);
+	}
 
 
 
 
 	//
 	//

+ 1 - 1
src/Renderer/Smo.cpp

@@ -42,7 +42,7 @@ void Smo::run(const PointLight& light)
 	// set shared prog
 	// set shared prog
 	const float scale = 1.2; // we scale the sphere a little
 	const float scale = 1.2; // we scale the sphere a little
 	sProg->bind();
 	sProg->bind();
-	Mat4 modelMat = Mat4(light.getWorldTransform().getOrigin(), Mat3::getIdentity(), light.getRadius() * scale);
+	Mat4 modelMat = Mat4(light.getWorldTransform().origin, Mat3::getIdentity(), light.getRadius() * scale);
 	Mat4 trf = r.getCamera().getProjectionMatrix() * Mat4::combineTransformations(r.getCamera().getViewMatrix(), modelMat);
 	Mat4 trf = r.getCamera().getProjectionMatrix() * Mat4::combineTransformations(r.getCamera().getViewMatrix(), modelMat);
 	sProg->findUniVar("modelViewProjectionMat")->setMat4(&trf);
 	sProg->findUniVar("modelViewProjectionMat")->setMat4(&trf);
 
 

+ 1 - 1
src/Resources/Mesh.cpp

@@ -282,7 +282,7 @@ void Mesh::createVertTangents()
 		float det = (uvedge01.y * uvedge02.x) - (uvedge01.x * uvedge02.y);
 		float det = (uvedge01.y * uvedge02.x) - (uvedge01.x * uvedge02.y);
 		if(isZero(det))
 		if(isZero(det))
 		{
 		{
-			WARNING(getRsrcName() << ": det == " << fixed << det);
+			//WARNING(getRsrcName() << ": det == " << fixed << det);
 			det = 0.0001;
 			det = 0.0001;
 		}
 		}
 		else
 		else

+ 8 - 8
src/Scene/Camera.cpp

@@ -53,10 +53,10 @@ void Camera::render()
 void Camera::lookAtPoint(const Vec3& point)
 void Camera::lookAtPoint(const Vec3& point)
 {
 {
 	const Vec3& j = Vec3(0.0, 1.0, 0.0);
 	const Vec3& j = Vec3(0.0, 1.0, 0.0);
-	Vec3 vdir = (point - getLocalTransform().getOrigin()).getNormalized();
+	Vec3 vdir = (point - getLocalTransform().origin).getNormalized();
 	Vec3 vup = j - vdir * j.dot(vdir);
 	Vec3 vup = j - vdir * j.dot(vdir);
 	Vec3 vside = vdir.cross(vup);
 	Vec3 vside = vdir.cross(vup);
-	getLocalTransform().getRotation().setColumns(vside, vup, -vdir);
+	getLocalTransform().rotation.setColumns(vside, vup, -vdir);
 }
 }
 
 
 
 
@@ -93,9 +93,9 @@ void Camera::updateWSpaceFrustumPlanes()
 {
 {
 	for(uint i=0; i<6; i++)
 	for(uint i=0; i<6; i++)
 	{
 	{
-		wspaceFrustumPlanes[i] = lspaceFrustumPlanes[i].Transformed(getWorldTransform().getOrigin(),
-		                                                            getWorldTransform().getRotation(),
-		                                                            getWorldTransform().getScale());
+		wspaceFrustumPlanes[i] = lspaceFrustumPlanes[i].Transformed(getWorldTransform().origin,
+		                                                            getWorldTransform().rotation,
+		                                                            getWorldTransform().scale);
 	}
 	}
 }
 }
 
 
@@ -132,7 +132,7 @@ bool Camera::insideFrustum(const Camera& cam) const
 	points[1] = Vec3(-x, y, z); // top left
 	points[1] = Vec3(-x, y, z); // top left
 	points[2] = Vec3(-x, -y, z); // bottom left
 	points[2] = Vec3(-x, -y, z); // bottom left
 	points[3] = Vec3(x, -y, z); // bottom right
 	points[3] = Vec3(x, -y, z); // bottom right
-	points[4] = Vec3(cam.getWorldTransform().getOrigin()); // eye (already in world space)
+	points[4] = Vec3(cam.getWorldTransform().origin); // eye (already in world space)
 
 
 	// transform them to the given camera's world space (exept the eye)
 	// transform them to the given camera's world space (exept the eye)
 	for(uint i=0; i<4; i++)
 	for(uint i=0; i<4; i++)
@@ -198,8 +198,8 @@ void Camera::updateViewMatrix()
 	*/
 	*/
 
 
 	// The view matrix is: Mview = camera.world_transform.Inverted(). Bus instead of inverting we do the following:
 	// The view matrix is: Mview = camera.world_transform.Inverted(). Bus instead of inverting we do the following:
-	Mat3 camInvertedRot = getWorldTransform().getRotation().getTransposed();
-	Vec3 camInvertedTsl = -(camInvertedRot * getWorldTransform().getOrigin());
+	Mat3 camInvertedRot = getWorldTransform().rotation.getTransposed();
+	Vec3 camInvertedTsl = -(camInvertedRot * getWorldTransform().origin);
 	viewMat = Mat4(camInvertedTsl, camInvertedRot);
 	viewMat = Mat4(camInvertedTsl, camInvertedRot);
 }
 }
 
 

+ 3 - 1
src/Scene/Controllers/SkelAnimCtrl.cpp

@@ -162,6 +162,8 @@ void SkelAnimCtrl::update(float)
 
 
 	interpolate(*skelAnim, frame);
 	interpolate(*skelAnim, frame);
 	updateBoneTransforms();
 	updateBoneTransforms();
-	if(app->getMainRenderer().dbg.isShowSkeletonsEnabled())
+	if(app->getMainRenderer().dbg.isEnabled() && app->getMainRenderer().dbg.isShowSkeletonsEnabled())
+	{
 		deform();
 		deform();
+	}
 }
 }

+ 5 - 3
src/Scene/ParticleEmitter.cpp

@@ -75,7 +75,7 @@ void ParticleEmitter::update()
 	float crntTime = app->getTicks() / 1000.0;
 	float crntTime = app->getTicks() / 1000.0;
 
 
 	// Opt: We dont have to make extra calculations if the ParticleEmitter's rotation is the identity
 	// Opt: We dont have to make extra calculations if the ParticleEmitter's rotation is the identity
-	bool identRot = worldTransform.getRotation() == Mat3::getIdentity();
+	bool identRot = worldTransform.rotation == Mat3::getIdentity();
 
 
 	// deactivate the dead particles
 	// deactivate the dead particles
 	for(uint i=0; i<particles.size(); i++)
 	for(uint i=0; i<particles.size(); i++)
@@ -139,7 +139,9 @@ void ParticleEmitter::update()
 				forceDir.normalize();
 				forceDir.normalize();
 
 
 				if(!identRot)
 				if(!identRot)
-					forceDir = worldTransform.getRotation() * forceDir; // the forceDir depends on the particle emitter rotation
+				{
+					forceDir = worldTransform.rotation * forceDir; // the forceDir depends on the particle emitter rotation
+				}
 
 
 				Vec3 force;
 				Vec3 force;
 
 
@@ -184,7 +186,7 @@ void ParticleEmitter::update()
 			}
 			}
 
 
 			if(identRot)
 			if(identRot)
-				pos += worldTransform.getOrigin();
+				pos += worldTransform.origin;
 			else
 			else
 				pos.transform(worldTransform);
 				pos.transform(worldTransform);
 
 

+ 6 - 6
src/Scene/SceneNode.cpp

@@ -87,20 +87,20 @@ void SceneNode::updateWorldTransform()
 //======================================================================================================================
 //======================================================================================================================
 void SceneNode::moveLocalX(float distance)
 void SceneNode::moveLocalX(float distance)
 {
 {
-	Vec3 x_axis = localTransform.getRotation().getColumn(0);
-	getLocalTransform().getOrigin() += x_axis * distance;
+	Vec3 x_axis = localTransform.rotation.getColumn(0);
+	getLocalTransform().origin += x_axis * distance;
 }
 }
 
 
 void SceneNode::moveLocalY(float distance)
 void SceneNode::moveLocalY(float distance)
 {
 {
-	Vec3 y_axis = localTransform.getRotation().getColumn(1);
-	getLocalTransform().getOrigin() += y_axis * distance;
+	Vec3 y_axis = localTransform.rotation.getColumn(1);
+	getLocalTransform().origin += y_axis * distance;
 }
 }
 
 
 void SceneNode::moveLocalZ(float distance)
 void SceneNode::moveLocalZ(float distance)
 {
 {
-	Vec3 z_axis = localTransform.getRotation().getColumn(2);
-	getLocalTransform().getOrigin() += z_axis * distance;
+	Vec3 z_axis = localTransform.rotation.getColumn(2);
+	getLocalTransform().origin += z_axis * distance;
 }
 }
 
 
 
 

+ 3 - 3
src/Scene/SceneNode.h

@@ -96,19 +96,19 @@ inline SceneNode::SceneNode(SceneNodeType type_, SceneNode* parent):
 
 
 inline void SceneNode::rotateLocalX(float angDegrees)
 inline void SceneNode::rotateLocalX(float angDegrees)
 {
 {
-	localTransform.getRotation().rotateXAxis(angDegrees);
+	localTransform.rotation.rotateXAxis(angDegrees);
 }
 }
 
 
 
 
 inline void SceneNode::rotateLocalY(float angDegrees)
 inline void SceneNode::rotateLocalY(float angDegrees)
 {
 {
-	localTransform.getRotation().rotateYAxis(angDegrees);
+	localTransform.rotation.rotateYAxis(angDegrees);
 }
 }
 
 
 
 
 inline void SceneNode::rotateLocalZ(float angDegrees)
 inline void SceneNode::rotateLocalZ(float angDegrees)
 {
 {
-	localTransform.getRotation().rotateZAxis(angDegrees);
+	localTransform.rotation.rotateZAxis(angDegrees);
 }
 }
 
 
 
 

+ 1 - 1
src/Scripting/Renderer/Dbg.bpi.h

@@ -1,4 +1,4 @@
 
 
 class_<Dbg, noncopyable>("Dbg", no_init)
 class_<Dbg, noncopyable>("Dbg", no_init)
-	.add_property("enable", &Dbg::isEnabled, &Dbg::setEnabled)
+	.add_property("enabled", &Dbg::isEnabled, &Dbg::setEnabled)
 ;
 ;

+ 3 - 3
src/Scripting/ScriptingEngine.h

@@ -31,9 +31,9 @@ class ScriptingEngine: public Object
 		void exposeVar(const char* varName, Type* var);
 		void exposeVar(const char* varName, Type* var);
 
 
 	private:
 	private:
-		boost::python::object mainModule;
-		boost::python::object ankiModule;
-		boost::python::object mainNamespace;
+		python::object mainModule;
+		python::object ankiModule;
+		python::object mainNamespace;
 
 
 		/**
 		/**
 		 * Init python and modules
 		 * Init python and modules