Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/Core/Math/Headers/MathClasses.h

Diff revisions: vs.
  @@ -307,9 +307,9 @@
307 307 }
308 308
309 309 inline bool isIdentity() const {
310 - return ( FLOAT_COMPARE( this->mat[0], 1.0 ) && IS_ZERO( this->mat[1] ) && IS_ZERO( this->mat[2] ) &&
311 - IS_ZERO( this->mat[3] ) && FLOAT_COMPARE( this->mat[4], 1.0 ) && IS_ZERO( this->mat[5] ) &&
312 - IS_ZERO( this->mat[6] ) && IS_ZERO( this->mat[7] ) && FLOAT_COMPARE( this->mat[8], 1.0 ) );
310 + return (FLOAT_COMPARE(this->mat[0], 1.0) && IS_ZERO(this->mat[1]) && IS_ZERO(this->mat[2]) &&
311 + IS_ZERO(this->mat[3]) && FLOAT_COMPARE(this->mat[4], 1.0) && IS_ZERO(this->mat[5]) &&
312 + IS_ZERO(this->mat[6]) && IS_ZERO(this->mat[7]) && FLOAT_COMPARE(this->mat[8], 1.0));
313 313
314 314 }
315 315
  @@ -632,17 +632,19 @@
632 632 }
633 633
634 634 mat4 operator+(const mat4 &matrix) const {
635 - return mat4(this->mat[0] + matrix[0], this->mat[1] + matrix[1], this->mat[2] + matrix[2], this->mat[3] + matrix[3],
636 - this->mat[4] + matrix[4], this->mat[5] + matrix[5], this->mat[6] + matrix[6], this->mat[7] + matrix[7],
637 - this->mat[8] + matrix[8], this->mat[9] + matrix[9], this->mat[10] + matrix[10], this->mat[11] + matrix[11],
638 - this->mat[12] + matrix[12], this->mat[13] + matrix[13], this->mat[14] + matrix[14], this->mat[15] + matrix[15]);
635 + F32* m = this->mat;
636 + return mat4(m[ 0] + matrix[ 0], m[ 1] + matrix[ 1], m[ 2] + matrix[ 2], m[ 3] + matrix[ 3],
637 + m[ 4] + matrix[ 4], m[ 5] + matrix[ 5], m[ 6] + matrix[ 6], m[ 7] + matrix[ 7],
638 + m[ 8] + matrix[ 8], m[ 9] + matrix[ 9], m[10] + matrix[10], m[11] + matrix[11],
639 + m[12] + matrix[12], m[13] + matrix[13], m[14] + matrix[14], m[15] + matrix[15]);
639 640 }
640 641
641 642 mat4 operator-(const mat4 &matrix) const {
642 - return mat4(this->mat[0] - matrix[0], this->mat[1] - matrix[1], this->mat[2] - matrix[2], this->mat[3] - matrix[3],
643 - this->mat[4] - matrix[4], this->mat[5] - matrix[5], this->mat[6] - matrix[6], this->mat[7] - matrix[7],
644 - this->mat[8] - matrix[8], this->mat[9] - matrix[9], this->mat[10] - matrix[10], this->mat[11] - matrix[11],
645 - this->mat[12] - matrix[12], this->mat[13] - matrix[13], this->mat[14] - matrix[14], this->mat[15] - matrix[15]);
643 + F32* m = this->mat;
644 + return mat4(m[ 0] - matrix[ 0], m[ 1] - matrix[ 1], m[ 2] - matrix[ 2], m[ 3] - matrix[ 3],
645 + m[ 4] - matrix[ 4], m[ 5] - matrix[ 5], m[ 6] - matrix[ 6], m[ 7] - matrix[ 7],
646 + m[ 8] - matrix[ 8], m[ 9] - matrix[ 9], m[10] - matrix[10], m[11] - matrix[11],
647 + m[12] - matrix[12], m[13] - matrix[13], m[14] - matrix[14], m[15] - matrix[15]);
646 648 }
647 649
648 650 inline T &element(I8 row, I8 column, bool rowMajor = false) {
  @@ -991,7 +993,7 @@
991 993
992 994 /// Converts a point from world coordinates to projection coordinates
993 995 ///(from Y = depth, Z = up to Y = up, Z = depth)
994 - template <class T>
996 + template<typename T>
995 997 inline void projectPoint( const vec3<T>& position, vec3<T>& output ) {
996 998 output.set( position.x, position.z, position.y );
997 999 }
  @@ -1005,9 +1007,11 @@
1005 1007 {
1006 1008 }
1007 1009
1008 - Line( const vec3<F32>& startPoint, const vec3<F32>& endPoint, const vec4<U8>& color ) : _startPoint( startPoint ),
1009 - _endPoint( endPoint ),
1010 - _color( color )
1010 + Line( const vec3<F32>& startPoint,
1011 + const vec3<F32>& endPoint,
1012 + const vec4<U8>& color ) : _startPoint( startPoint ),
1013 + _endPoint( endPoint ),
1014 + _color( color )
1011 1015 {
1012 1016 }
1013 1017 };
  @@ -1020,8 +1024,11 @@
1020 1024
1021 1025 namespace Mat4 {
1022 1026 // ----------------------------------------------------------------------------------------
1023 - template <typename T>
1024 - inline void decompose( const mat4<T>& matrix, vec3<T>& scale, Quaternion<T>& rotation, vec3<T>& position ) {
1027 + template<typename T>
1028 + inline void decompose( const mat4<T>& matrix,
1029 + vec3<T>& scale,
1030 + Quaternion<T>& rotation,
1031 + vec3<T>& position ) {
1025 1032
1026 1033 // extract translation
1027 1034 position.set( matrix.m[0][3], matrix.m[1][3], matrix.m[2][3] );
  @@ -1060,8 +1067,10 @@
1060 1067 }
1061 1068
1062 1069 // ----------------------------------------------------------------------------------------
1063 - template <typename T>
1064 - inline void decomposeNoScaling(const mat4<T>& matrix, Quaternion<T>& rotation, vec3<T>& position) {
1070 + template<typename T>
1071 + inline void decomposeNoScaling(const mat4<T>& matrix,
1072 + Quaternion<T>& rotation,
1073 + vec3<T>& position) {
1065 1074 // extract translation
1066 1075 position.set( matrix.m[0][3], matrix.m[1][3], matrix.m[2][3] );
1067 1076 // extract rotation