Browse Source

- Doxygen file updates
- Changes in the math library

Panagiotis Christopoulos Charitos 15 years ago
parent
commit
800425bca1

File diff suppressed because it is too large
+ 482 - 349
build/debug/Makefile


+ 29 - 11
docs/doxyfile

@@ -180,7 +180,7 @@ SEPARATE_MEMBER_PAGES  = NO
 # The TAB_SIZE tag can be used to set the number of spaces in a tab. 
 # Doxygen uses this value to replace tabs by spaces in code fragments.
 
-TAB_SIZE               = 8
+TAB_SIZE               = 2
 
 # This tag can be used to specify a number of aliases that acts 
 # as commands in the documentation. An alias has the form "name=value". 
@@ -916,7 +916,7 @@ TOC_EXPAND             = NO
 # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 
 # HTML documentation.
 
-GENERATE_QHP           = NO
+GENERATE_QHP           = YES
 
 # If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
 # be used to specify the file name of the resulting .qch file. 
@@ -928,7 +928,7 @@ QCH_FILE               =
 # Qt Help Project output. For more information please see 
 # http://doc.trolltech.com/qthelpproject.html#namespace
 
-QHP_NAMESPACE          = 
+QHP_NAMESPACE          = org.AnKi
 
 # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
 # Qt Help Project output. For more information please see 
@@ -1015,7 +1015,7 @@ GENERATE_LATEX         = NO
 # If a relative path is entered the value of OUTPUT_DIRECTORY will be 
 # put in front of it. If left blank `latex' will be used as the default path.
 
-LATEX_OUTPUT           = latex
+LATEX_OUTPUT           = doxygen-latex
 
 # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
 # invoked. If left blank `latex' will be used as the default command name.
@@ -1038,7 +1038,7 @@ COMPACT_LATEX          = NO
 # by the printer. Possible values are: a4, a4wide, letter, legal and 
 # executive. If left blank a4wide will be used.
 
-PAPER_TYPE             = a4wide
+PAPER_TYPE             = letter
 
 # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
 # packages that should be included in the LaTeX output.
@@ -1070,7 +1070,7 @@ USE_PDFLATEX           = YES
 # running if errors occur, instead of asking the user for help. 
 # This option is also used when generating formulas in HTML.
 
-LATEX_BATCHMODE        = NO
+LATEX_BATCHMODE        = YES
 
 # If LATEX_HIDE_INDICES is set to YES then doxygen will not 
 # include the index chapters (such as File Index, Compound Index, etc.) 
@@ -1260,7 +1260,27 @@ SEARCH_INCLUDES        = YES
 # contain include files that are not input files but should be processed by 
 # the preprocessor.
 
-INCLUDE_PATH           = ../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
+INCLUDE_PATH           = ../src/Scripting/ \ 
+                         ../src/Math/ \ 
+                         ../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 \ 
+                         ../src/Input
 
 # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
 # patterns (like *.h and *.hpp) to filter out the header-files in the 
@@ -1278,10 +1298,8 @@ INCLUDE_FILE_PATTERNS  = *.h \
 # undefined via #undef or recursively expanded use the := operator 
 # instead of the = operator.
 
-PREDEFINED             = "PROPERTY_RW(_v0_,_v1_,_v2_,_v3_):=private: _v0_ _v1_;" \
-                         "PROPERTY_R(_v0_,_v1_,_v2_):= private: _v0_ _v1_; \
-                                                       public: const _v0_& _v2_() const; /**< Property getter */ \
-                                                       private: _v0_ _v1_;"
+PREDEFINED             = "PROPERTY_RW(_v0_,_v1_,_v2_,_v3_) := private: _v0_ _v1_; public: const _v0_& _v3_() const; /**< Property getter */ public: _v0_& _v3_(); /**< Property getter #2*/ void _v2_(_v0_&); /**< Property setter*/ private: _v0_ _v1_;" \
+                         "PROPERTY_R(_v0_,_v1_,_v2_):= private: _v0_ _v1_; public: const _v0_& _v2_() const; /**< Property getter */ private: _v0_ _v1_;"
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
 # this tag can be used to specify a list of macro names that should be expanded. 

+ 5 - 29
src/Core/Common.h

@@ -3,13 +3,18 @@
 
 #include <iostream>
 #include "StdTypes.h"
+#include "Properties.h"
 
 // dummy define just to use the namespace
 namespace boost
 {}
 
+namespace M
+{}
+
 using namespace boost;
 using namespace std;
+using namespace M;
 
 
 //======================================================================================================================
@@ -88,35 +93,6 @@ extern bool msgGlError(const char* file, int line, const char* func);
 #define FOREACH(x) for(int i=0; i<x; i++)
 
 
-/**
- * Read write property
- *
- * - It creates a unique type so it can work with pointers
- * - The get funcs are coming into two flavors, one const and one non-const. The property is read-write after all so the
- *   non-const is acceptable
- * - Dont use it with semicolon at the end (eg PROPERTY_RW(....);) because of a doxygen bug
- */
-#define PROPERTY_RW(Type__, varName__, setFunc__, getFunc__) \
-	private: \
-		Type__ varName__; \
-	public: \
-		void setFunc__(const Type__& x__) {varName__ = x__;} \
-		const Type__& getFunc__() const {return varName__;} \
-		Type__& getFunc__() {return varName__;}
-
-/**
- * Read only property
- *
- * - It creates a unique type so it can work with pointers
- * - Dont use it with semicolon at the end (eg PROPERTY_RW(....);) because of a doxygen bug
- */
-#define PROPERTY_R(Type__, varName__, getFunc__) \
-	private: \
-		Type__ varName__; \
-	public: \
-		const Type__& getFunc__() const { return varName__; }
-
-
 /// Just print
 #define PRINT(x) cout << x << endl
 

+ 1 - 2
src/Math/Axisang.h

@@ -1,8 +1,7 @@
 #ifndef AXISANG_H
 #define AXISANG_H
 
-#include "Common.h"
-#include "MathForwardDecls.h"
+#include "MathCommon.h"
 
 
 namespace M {

+ 4 - 2
src/Math/Axisang.inl.h

@@ -1,4 +1,5 @@
-#include "MathDfltHeader.h"
+#include "MathCommon.inl.h"
+
 
 namespace M {
 
@@ -38,7 +39,8 @@ inline Axisang::Axisang(const Mat3& m3)
 	if((fabs(m3(0, 1)-m3(1, 0))< EPSILON)  && (fabs(m3(0, 2)-m3(2, 0))< EPSILON)  && (fabs(m3(1, 2)-m3(2, 1))< EPSILON))
 	{
 
-		if((fabs(m3(0, 1)+m3(1, 0)) < 0.1) && (fabs(m3(0, 2)+m3(2, 0)) < 0.1) && (fabs(m3(1, 2)+m3(2, 1)) < 0.1) && (fabs(m3(0, 0)+m3(1, 1)+m3(2, 2))-3) < 0.1)
+		if((fabs(m3(0, 1)+m3(1, 0)) < 0.1) && (fabs(m3(0, 2)+m3(2, 0)) < 0.1) && (fabs(m3(1, 2)+m3(2, 1)) < 0.1) &&
+		   (fabs(m3(0, 0)+m3(1, 1)+m3(2, 2))-3) < 0.1)
 		{
 			axis = Vec3(1.0, 0.0, 0.0);
 			ang = 0.0;

+ 2 - 3
src/Math/Euler.h

@@ -1,8 +1,7 @@
 #ifndef EULER_H
 #define EULER_H
 
-#include "Common.h"
-#include "MathForwardDecls.h"
+#include "MathCommon.h"
 
 
 namespace M {
@@ -42,7 +41,7 @@ class Euler
 
 /// @name Other operators
 /// @{
-extern ostream& operator<<(ostream& s, const Euler& e);
+extern std::ostream& operator<<(std::ostream& s, const Euler& e);
 /// @}
 
 

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

@@ -1,4 +1,4 @@
-#include "MathDfltHeader.h"
+#include "MathCommon.inl.h"
 
 
 namespace M {
@@ -120,7 +120,7 @@ inline Euler::Euler(const Mat3& m3)
 }
 
 // print
-inline ostream& operator<<(ostream& s, const Euler& e)
+inline std::ostream& operator<<(std::ostream& s, const Euler& e)
 {
 	s << e.x << ' ' << e.y << ' ' << e.z;
 	return s;

+ 2 - 3
src/Math/Mat3.h

@@ -1,8 +1,7 @@
 #ifndef MAT3_H
 #define MAT3_H
 
-#include "Common.h"
-#include "MathForwardDecls.h"
+#include "MathCommon.h"
 
 
 namespace M {
@@ -115,7 +114,7 @@ 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 std::ostream& operator<<(std::ostream& s, const Mat3& m);
 /// @}
 
 

+ 5 - 6
src/Math/Mat3.inl.h

@@ -1,5 +1,4 @@
-#include <iostream>
-#include "MathDfltHeader.h"
+#include "MathCommon.inl.h"
 
 
 #define ME (*this)
@@ -59,7 +58,7 @@ inline Mat3::Mat3(const Mat3& b)
 // constructor [quat]
 inline Mat3::Mat3(const Quat& q)
 {
-	DEBUG_ERR(fabs(1.0 - q.getLength()) > 0.002); // If length is > 1 + 0.002 or < 1 - 0.002 then not normalized quat
+	RASSERT_THROW_EXCEPTION(fabs(1.0 - q.getLength()) > 0.002); // If length is > 1 + 0.002 or < 1 - 0.002 then not normalized quat
 
 	float xs, ys, zs, wx, wy, wz, xx, xy, xz, yy, yz, zz;
 
@@ -111,7 +110,7 @@ inline Mat3::Mat3(const Euler& e)
 // constructor [axisang]
 inline Mat3::Mat3(const Axisang& axisang)
 {
-	DEBUG_ERR(!isZero(1.0 - axisang.axis.getLength())); // Not normalized axis
+	RASSERT_THROW_EXCEPTION(!isZero(1.0 - axisang.axis.getLength())); // Not normalized axis
 
 	float c, s;
 	sinCos(axisang.ang, s, c);
@@ -686,7 +685,7 @@ inline Mat3 Mat3::getInverse() const
 	float cofactor6 = ME(0, 1)*ME(1, 2) - ME(0, 2)*ME(1, 1);
 	float det = ME(0, 0)*cofactor0 + ME(1, 0)*cofactor3 + ME(2, 0)*cofactor6;
 
-	DEBUG_ERR(isZero(det)); // Cannot invert det == 0
+	RASSERT_THROW_EXCEPTION(isZero(det)); // Cannot invert det == 0
 
 	// create adjoint matrix and multiply by 1/det to get inverse
 	float invDet = 1.0f/det;
@@ -733,7 +732,7 @@ inline const Mat3& Mat3::getIdentity()
 }
 
 // print
-inline ostream& operator<<(ostream& s, const Mat3& m)
+inline std::ostream& operator<<(std::ostream& s, const Mat3& m)
 {
 	for(int i=0; i<3; i++)
 	{

+ 2 - 3
src/Math/Mat4.h

@@ -1,8 +1,7 @@
 #ifndef MAT4_H
 #define MAT4_H
 
-#include "Common.h"
-#include "MathForwardDecls.h"
+#include "MathCommon.h"
 
 
 namespace M {
@@ -110,7 +109,7 @@ 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 std::ostream& operator<<(std::ostream& s, const Mat4& m);
 /// @}
 
 

+ 6 - 7
src/Math/Mat4.inl.h

@@ -1,5 +1,4 @@
-#include <iostream>
-#include "MathDfltHeader.h"
+#include "MathCommon.inl.h"
 
 
 #define ME (*this)
@@ -369,7 +368,7 @@ inline void Mat4::setRows(const Vec4& a, const Vec4& b, const Vec4& c, const Vec
 // setRow
 inline void Mat4::setRow(uint i, const Vec4& v)
 {
-	DEBUG_ERR(i > 3);
+	RASSERT_THROW_EXCEPTION(i > 3);
 	ME(i, 0) = v.x;
 	ME(i, 1) = v.y;
 	ME(i, 2) = v.z;
@@ -400,7 +399,7 @@ inline void Mat4::setColumns(const Vec4& a, const Vec4& b, const Vec4& c, const
 // setColumn
 inline void Mat4::setColumn(uint i, const Vec4& v)
 {
-	DEBUG_ERR(i > 3);
+	RASSERT_THROW_EXCEPTION(i > 3);
 	ME(0,i) = v.x;
 	ME(1,i) = v.y;
 	ME(2,i) = v.z;
@@ -618,7 +617,7 @@ inline Mat4 Mat4::getInverse() const
 
 	det = ME(0, 0)*m4(0, 0)+ME(1, 0)*m4(0, 1)+ME(2, 0)*m4(0, 2)+ME(3, 0)*m4(0, 3);
 
-	DEBUG_ERR(isZero(det)); // Cannot invert, det == 0
+	RASSERT_THROW_EXCEPTION(isZero(det)); // Cannot invert, det == 0
 	det = 1.0/det;
 	m4 *= det;
 	return m4;
@@ -656,7 +655,7 @@ inline Mat4 Mat4::combineTransformations(const Mat4& m0, const Mat4& m1)
 	 * return Mat4(tra, rot);
 	 * and the optimized:
 	 */
-	DEBUG_ERR(!isZero(m0(3, 0)+m0(3, 1)+m0(3, 2)+m0(3, 3)-1.0) ||
+	RASSERT_THROW_EXCEPTION(!isZero(m0(3, 0)+m0(3, 1)+m0(3, 2)+m0(3, 3)-1.0) ||
 	          !isZero(m1(3, 0)+m1(3, 1)+m1(3, 2)+m1(3, 3)-1.0)); // one of the 2 mat4 doesnt represent transformation
 
 	Mat4 m4;
@@ -682,7 +681,7 @@ inline Mat4 Mat4::combineTransformations(const Mat4& m0, const Mat4& m1)
 }
 
 // print
-inline ostream& operator<<(ostream& s, const Mat4& m)
+inline std::ostream& operator<<(std::ostream& s, const Mat4& m)
 {
 	for(int i=0; i<4; i++)
 	{

+ 0 - 3
src/Math/Math.h

@@ -14,7 +14,4 @@
 #include "Transform.h"
 
 
-using namespace M;
-
-
 #endif

+ 29 - 0
src/Math/MathCommon.h

@@ -0,0 +1,29 @@
+/**
+ * @file
+ * For Internal use in math lib
+ */
+
+#ifndef MATH_COMMON_H
+#define MATH_COMMON_H
+
+#include <iostream>
+#include "StdTypes.h"
+
+
+// Forward delcs
+namespace M {
+
+class Vec2;
+class Vec3;
+class Vec4;
+class Quat;
+class Euler;
+class Axisang;
+class Mat3;
+class Mat4;
+class Transform;
+
+}
+
+
+#endif

+ 2 - 0
src/Math/MathDfltHeader.h → src/Math/MathCommon.inl.h

@@ -13,3 +13,5 @@
 #include "Mat4.h"
 #include "MathFuncs.h"
 #include "Transform.h"
+
+#include "Exception.h"

+ 0 - 21
src/Math/MathForwardDecls.h

@@ -1,21 +0,0 @@
-/**
- * @file
- * For Internal use in math lib
- */
-
-#ifndef _MATHFORWARDDECLS_H_
-#define _MATHFORWARDDECLS_H_
-
-namespace M {
-	class Vec2;
-	class Vec3;
-	class Vec4;
-	class Quat;
-	class Euler;
-	class Axisang;
-	class Mat3;
-	class Mat4;
-	class Transform;
-}
-
-#endif

+ 1 - 2
src/Math/MathFuncs.h

@@ -1,8 +1,7 @@
 #ifndef MATH_FUNCS_H
 #define MATH_FUNCS_H
 
-#include "Common.h"
-#include "MathForwardDecls.h"
+#include "MathCommon.h"
 
 
 namespace M {

+ 4 - 4
src/Math/MathFuncs.inl.h

@@ -1,4 +1,4 @@
-#include "MathDfltHeader.h"
+#include "MathCommon.inl.h"
 
 
 namespace M {
@@ -11,7 +11,7 @@ inline void mathSanityChecks()
 	if(sizeof(Vec2)!=fs*2 || sizeof(Vec3)!=fs*3 || sizeof(Vec4)!=fs*4 || sizeof(Quat)!=fs*4 ||
 	   sizeof(Euler)!=fs*3 || sizeof(Mat3)!=fs*9 || sizeof(Mat4)!=fs*16)
 	{
-		FATAL("Your compiler does class alignment");
+		THROW_EXCEPTION("Your compiler does class alignment");
 	}
 }
 
@@ -100,8 +100,8 @@ inline void sinCos(float a, float& sina, float& cosa)
 	if(negative)
 		sina = -sina;
 
-	/*DEBUG_ERR(!isZero(M::sin(a) - sina));
-	DEBUG_ERR(!isZero(M::cos(a) - cosa));*/
+	/*RASSERT_THROW_EXCEPTION(!isZero(M::sin(a) - sina));
+	RASSERT_THROW_EXCEPTION(!isZero(M::cos(a) - cosa));*/
 }
 
 

+ 2 - 3
src/Math/Quat.h

@@ -1,8 +1,7 @@
 #ifndef QUAT_H
 #define QUAT_H
 
-#include "Common.h"
-#include "MathForwardDecls.h"
+#include "MathCommon.h"
 
 
 namespace M {
@@ -61,7 +60,7 @@ class Quat
 
 /// @name Other operators
 /// @{
-extern ostream& operator<<(ostream& s, const Quat& q);
+extern std::ostream& operator<<(std::ostream& s, const Quat& q);
 /// @}
 
 

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

@@ -1,5 +1,4 @@
-#include <iostream>
-#include "MathDfltHeader.h"
+#include "MathCommon.inl.h"
 
 
 #define ME (*this)
@@ -194,7 +193,7 @@ inline Quat Quat::getInverted() const
 {
 	float norm = w*w + x*x + y*y + z*z;
 
-	DEBUG_ERR(isZero(norm)); // Norm is zero
+	RASSERT_THROW_EXCEPTION(isZero(norm)); // Norm is zero
 
 	float normi = 1.0 / norm;
 	return Quat(-normi*x, -normi*y, -normi*z, normi*w);
@@ -290,7 +289,7 @@ inline const Quat::Quat& getIdentity()
 }
 
 // print
-inline ostream& operator<<(ostream& s, const Quat& q)
+inline std::ostream& operator<<(std::ostream& s, const Quat& q)
 {
 	s << q.w << ' ' << q.x << ' ' << q.y << ' ' << q.z;
 	return s;

+ 1 - 2
src/Math/Transform.h

@@ -1,8 +1,7 @@
 #ifndef TRANSFORM_H
 #define TRANSFORM_H
 
-#include "Common.h"
-#include "MathForwardDecls.h"
+#include "MathCommon.h"
 
 
 namespace M {

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

@@ -1,4 +1,4 @@
-#include "MathDfltHeader.h"
+#include "MathCommon.inl.h"
 
 
 #define ME (*this)

+ 2 - 3
src/Math/Vec2.h

@@ -1,8 +1,7 @@
 #ifndef VEC2_H
 #define VEC2_H
 
-#include "Common.h"
-#include "MathForwardDecls.h"
+#include "MathCommon.h"
 
 
 namespace M {
@@ -77,7 +76,7 @@ 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 std::ostream& operator<<(std::ostream& s, const Vec2& v);
 /// @}
 
 

+ 4 - 3
src/Math/Vec2.inl.h

@@ -1,11 +1,12 @@
-#include <iostream>
-#include "MathDfltHeader.h"
+#include "MathCommon.inl.h"
 
 
 #define ME (*this)
 
+
 namespace M {
 
+
 // accessors
 inline float& Vec2::operator [](uint i)
 {
@@ -218,7 +219,7 @@ inline float Vec2::dot(const Vec2& b) const
 }
 
 // print
-inline ostream& operator<<(ostream& s, const Vec2& v)
+inline std::ostream& operator<<(std::ostream& s, const Vec2& v)
 {
 	s << v.x << ' ' << v.y;
 	return s;

+ 2 - 3
src/Math/Vec3.h

@@ -1,8 +1,7 @@
 #ifndef VEC3_H
 #define VEC3_H
 
-#include "Common.h"
-#include "MathForwardDecls.h"
+#include "MathCommon.h"
 
 
 namespace M {
@@ -107,7 +106,7 @@ 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 std::ostream& operator<<(std::ostream& s, const Vec3& v);
 /// @}
 
 

+ 3 - 4
src/Math/Vec3.inl.h

@@ -1,5 +1,4 @@
-#include <iostream>
-#include "MathDfltHeader.h"
+#include "MathCommon.inl.h"
 
 
 #define ME (*this)
@@ -259,7 +258,7 @@ inline Vec3 Vec3::getProjection(const Vec3& toThis) const
 // Rotated
 inline Vec3 Vec3::getRotated(const Quat& q) const
 {
-	DEBUG_ERR(!isZero(1.0-q.getLength())); // Not normalized quat
+	RASSERT_THROW_EXCEPTION(!isZero(1.0-q.getLength())); // Not normalized quat
 
 	/*float vmult = 2.0f*(q.x*x + q.y*y + q.z*z);
 	float crossmult = 2.0*q.w;
@@ -349,7 +348,7 @@ inline void Vec3::transform(const Transform& transform)
 }
 
 // print
-inline ostream& operator<<(ostream& s, const Vec3& v)
+inline std::ostream& operator<<(std::ostream& s, const Vec3& v)
 {
 	s << v.x << ' ' << v.y << ' ' << v.z;
 	return s;

+ 2 - 3
src/Math/Vec4.h

@@ -1,8 +1,7 @@
 #ifndef VEC4_H
 #define VEC4_H
 
-#include "Common.h"
-#include "MathForwardDecls.h"
+#include "MathCommon.h"
 
 
 namespace M {
@@ -82,7 +81,7 @@ 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 std::ostream& operator<<(std::ostream& s, const Vec4& v);
 /// @}
 
 

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

@@ -1,5 +1,4 @@
-#include <iostream>
-#include "MathDfltHeader.h"
+#include "MathCommon.inl.h"
 
 
 #define ME (*this)
@@ -248,10 +247,11 @@ inline void Vec4::normalize()
 }
 
 // print
-inline ostream& operator<<(ostream& s, const Vec4& v)
+inline std::ostream& operator<<(std::ostream& s, const Vec4& v)
 {
 	s << v.x << ' ' << v.y << ' ' << v.z << ' ' << v.w;
 	return s;
 }
 
+
 } // end namespace

+ 1 - 1
src/Misc/TestHeader.cpp

@@ -1 +1 @@
-#include "RigidBody.h"
+#include "Math.h"

+ 3 - 2
src/Resources/Mesh.h

@@ -14,8 +14,8 @@ class Material;
 
 /// Mesh Resource. If the material name is empty then the mesh wont be rendered and no VBOs will be created
 ///
-/// File format:
-///
+/// Binary file format:
+/// @code
 /// <magic:ANKIMESH>
 /// <string:meshName>
 /// <string:material>
@@ -25,6 +25,7 @@ class Material;
 /// <uint:facesNum>
 /// <uint:tri[0].vertIds[0]> <uint:tri[0].vertIds[1]> <uint:tri[0].vertIds[2]> ...
 /// <uint:tri[facesNum-1].vertIds[0]> <uint:tri[facesNum-1].vertIds[1]> <uint:tri[facesNum-1].vertIds[2]>
+/// @endcode
 class Mesh: public Resource
 {
 	public:

+ 3 - 2
src/Resources/SkelAnim.h

@@ -9,10 +9,10 @@
 /// Skeleton animation resource
 ///
 /// The format will be changed to:
-///
+/// @code
 /// skeletonAnimation
 /// {
-/// 	name <same-as-file>
+/// 	name same-as-file
 /// 	keyframes {<val> <val> ... <val>}
 /// 	bones
 /// 	{
@@ -44,6 +44,7 @@
 /// 		}
 /// 	}
 /// }
+/// @endcode
 class SkelAnim: public Resource
 {
 	public:

+ 3 - 3
src/Scene/Light.h

@@ -39,9 +39,9 @@ class Light: public SceneNode
 
 	/// @name Copies of some of the resource properties. The others are camera properties or not changeable
 	/// @{
-	PROPERTY_RW(Vec3, diffuseCol, setDiffuseCo, getDiffuseCol)
-	PROPERTY_RW(Vec3, specularCol, setSpecularCol, getSpecularCol)
-	PROPERTY_RW(bool, castsShadow_, setCastsShadow, castsShadow)
+	PROPERTY_RW(Vec3, diffuseCol, setDiffuseCol, getDiffuseCol) ///< Diffuse color
+	PROPERTY_RW(Vec3, specularCol, setSpecularCol, getSpecularCol) ///< Specular color
+	PROPERTY_RW(bool, castsShadow_, setCastsShadow, castsShadow) ///< Casts shadow
 	/// @}
 
 	public:

+ 31 - 0
src/Util/Properties.h

@@ -0,0 +1,31 @@
+#ifndef PROPERTIES_H
+#define PROPERTIES_H
+
+
+/// Read write property
+///
+/// - It creates a unique type so it can work with pointers
+/// - The get funcs are coming into two flavors, one const and one non-const. The property is read-write after all so
+///   the non-const is acceptable
+/// - Dont use it with semicolon at the end (eg PROPERTY_RW(....);) because of a doxygen bug
+#define PROPERTY_RW(Type__, varName__, setFunc__, getFunc__) \
+	private: \
+		Type__ varName__; \
+	public: \
+		void setFunc__(const Type__& x__) {varName__ = x__;} \
+		const Type__& getFunc__() const {return varName__;} \
+		Type__& getFunc__() {return varName__;}
+
+
+/// Read only property
+///
+/// - It creates a unique type so it can work with pointers
+/// - Dont use it with semicolon at the end (eg PROPERTY_RW(....);) because of a doxygen bug
+#define PROPERTY_R(Type__, varName__, getFunc__) \
+	private: \
+		Type__ varName__; \
+	public: \
+		const Type__& getFunc__() const { return varName__; }
+
+
+#endif

Some files were not shown because too many files changed in this diff