[10097] Update G3D up to v8.0b4

+ Got rid of zip lib requirement in G3D...
  Still can re-enable code by defining _HAVE_ZIP...

+ Remove silly X11 lib dependency from G3D
  Code doesn't seem to do anything yet anyway, and even if, we don't want it :p

+ Fix another weird G3D build problem...

+ Remove some __asm usage in g3d, which is not available on Win64
  My editor also decided to remove a ton of trailing white spaces...tss...

+ Reapply G3D fixes for 64bit VC

+ not use SSE specific header when SSE not enabled in *nix

+ Updated project files

+ New vmap_assembler VC90/VC80 Project

+ vmap assembler binaries updates

NOTE: Old vmap fikes expected work (as tests show) with new library version.
      But better use new generated versions. Its different in small parts to bad or good...

(based on Lynx3d's repo commit 44798d3)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Lynx3d 2010-06-23 04:01:54 +04:00 committed by VladimirMangos
parent 2f3c518935
commit ae3ad10bcf
235 changed files with 58189 additions and 4547 deletions

View file

@ -3,7 +3,7 @@
3x3 matrix class
@maintainer Morgan McGuire, matrix@graphics3d.com
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@cite Portions based on Dave Eberly's Magic Software Library at <A HREF="http://www.magic-software.com">http://www.magic-software.com</A>
@ -11,16 +11,26 @@
@edited 2006-04-05
*/
#ifndef G3D_MATRIX3_H
#define G3D_MATRIX3_H
#ifndef G3D_Matrix3_h
#define G3D_Matrix3_h
#include "G3D/platform.h"
#include "G3D/System.h"
#include "G3D/Vector3.h"
#include "G3D/Vector4.h"
#include "G3D/debugAssert.h"
#include <cstring>
namespace G3D {
#ifdef _MSC_VER
// Turn off "conditional expression is constant" warning; MSVC generates this
// for debug assertions in inlined methods.
# pragma warning (disable : 4127)
#endif
class Any;
/**
3x3 matrix. Do not subclass.
*/
@ -37,23 +47,33 @@ private:
public:
Matrix3(const Any& any);
operator Any() const;
/** Initial values are undefined for performance. See also
Matrix3::zero(), Matrix3::identity(), Matrix3::fromAxisAngle, etc.*/
inline Matrix3() {}
Matrix3 (class BinaryInput& b);
Matrix3 (const float aafEntry[3][3]);
Matrix3 (const Matrix3& rkMatrix);
Matrix3 (float fEntry00, float fEntry01, float fEntry02,
float fEntry10, float fEntry11, float fEntry12,
float fEntry20, float fEntry21, float fEntry22);
bool fuzzyEq(const Matrix3& b) const;
bool fuzzyEq(const Matrix3& b) const;
/** Constructs a matrix from a quaternion.
@cite Graphics Gems II, p. 351--354
@cite Implementation from Watt and Watt, pg 362*/
Matrix3(const class Quat& q);
void serialize(class BinaryOutput& b) const;
void deserialize(class BinaryInput& b);
/** Returns true if column(0).cross(column(1)).dot(column(2)) > 0. */
bool isRightHanded() const;
/**
Sets all elements.
@ -84,15 +104,16 @@ public:
inline operator const float* () const{
return (const float*)&elt[0][0];
}
Vector3 column(int c) const;
const Vector3& row(int r) const;
Vector3 getColumn (int iCol) const;
Vector3 getRow (int iRow) const;
void setColumn(int iCol, const Vector3 &vector);
void setRow(int iRow, const Vector3 &vector);
// assignment and comparison
inline Matrix3& operator= (const Matrix3& rkMatrix) {
System::memcpy(elt, rkMatrix.elt, 9 * sizeof(float));
memcpy(elt, rkMatrix.elt, 9 * sizeof(float));
return *this;
}
@ -143,6 +164,10 @@ public:
friend Matrix3 operator* (float fScalar, const Matrix3& rkMatrix);
friend Matrix3 operator* (int fScalar, const Matrix3& rkMatrix);
Matrix3& operator*= (float k);
Matrix3& operator/= (float k);
private:
/** Multiplication where out != A and out != B */
static void _mul(const Matrix3& A, const Matrix3& B, Matrix3& out);
@ -202,11 +227,46 @@ public:
void qDUDecomposition (Matrix3& rkQ, Vector3& rkD,
Vector3& rkU) const;
/**
Polar decomposition of a matrix. Based on pseudocode from Nicholas J
Higham, "Computing the Polar Decomposition -- with Applications Siam
Journal of Science and Statistical Computing, Vol 7, No. 4, October
1986.
Decomposes A into R*S, where R is orthogonal and S is symmetric.
Ken Shoemake's "Matrix animation and polar decomposition"
in Proceedings of the conference on Graphics interface '92
seems to be better known in the world of graphics, but Higham's version
uses a scaling constant that can lead to faster convergence than
Shoemake's when the initial matrix is far from orthogonal.
*/
void polarDecomposition(Matrix3 &R, Matrix3 &S) const;
/**
* Matrix norms.
*/
float spectralNorm () const;
float squaredFrobeniusNorm() const;
float frobeniusNorm() const;
float l1Norm() const;
float lInfNorm() const;
float diffOneNorm(const Matrix3 &y) const;
/** matrix must be orthonormal */
void toAxisAngle(Vector3& rkAxis, float& rfRadians) const;
static Matrix3 fromDiagonal(const Vector3& d) {
return Matrix3(d.x, 0, 0,
0, d.y, 0,
0, 0, d.z);
}
static Matrix3 fromAxisAngle(const Vector3& rkAxis, float fRadians);
/**
@ -239,7 +299,7 @@ public:
static void tensorProduct (const Vector3& rkU, const Vector3& rkV,
Matrix3& rkProduct);
std::string toString() const;
std::string toString() const;
static const float EPSILON;
@ -252,7 +312,7 @@ public:
// "You might be tempted to write [...] them as inline functions
// inside their respective header files, but this is something you
// must definitely not do. An inline function can be duplicated
// in every file in which it appears and this duplication
// in every file in which it appears œóõ½ and this duplication
// includes the static object definition. Because inline functions
// automatically default to internal linkage, this would result in
// having multiple static objects across the various translation
@ -264,13 +324,8 @@ public:
static const Matrix3& zero();
static const Matrix3& identity();
// Deprecated.
/** @deprecated Use Matrix3::zero() */
static const Matrix3 ZERO;
/** @deprecated Use Matrix3::identity() */
static const Matrix3 IDENTITY;
protected:
// support for eigensolver
void tridiagonal (float afDiag[3], float afSubDiag[3]);
bool qLAlgorithm (float afDiag[3], float afSubDiag[3]);