make btTransform::getIdentity a static const reference, returning a static, and add getIdentity to btMatrix3x3 and btQuaternion class

Thanks to ejtttje and martijn for the suggestions:
http://code.google.com/p/bullet/issues/detail?id=139
This commit is contained in:
erwin.coumans
2009-02-06 19:30:50 +00:00
parent 41af960e7a
commit 0a94209df1
3 changed files with 18 additions and 4 deletions

View File

@@ -192,6 +192,15 @@ class btMatrix3x3 {
btScalar(0.0), btScalar(1.0), btScalar(0.0),
btScalar(0.0), btScalar(0.0), btScalar(1.0));
}
static const btMatrix3x3& getIdentity()
{
static const btMatrix3x3 identityMatrix(btScalar(1.0), btScalar(0.0), btScalar(0.0),
btScalar(0.0), btScalar(1.0), btScalar(0.0),
btScalar(0.0), btScalar(0.0), btScalar(1.0));
return identityMatrix;
}
/**@brief Fill the values of the matrix into a 9 element array
* @param m The array to be filled */
void getOpenGLSubMatrix(btScalar *m) const