add support for double precision and 64bit serialization (and compatibility between all versions)
fix some issue in serialization of nested array data add some tesing files
This commit is contained in:
@@ -9,6 +9,13 @@ IF (NOT CMAKE_BUILD_TYPE)
|
|||||||
ENDIF (NOT CMAKE_BUILD_TYPE)
|
ENDIF (NOT CMAKE_BUILD_TYPE)
|
||||||
|
|
||||||
|
|
||||||
|
OPTION(USE_DOUBLE_PRECISION "Use double precision" OFF)
|
||||||
|
|
||||||
|
IF (USE_DOUBLE_PRECISION)
|
||||||
|
ADD_DEFINITIONS( -DBT_USE_DOUBLE_PRECISION)
|
||||||
|
ENDIF (USE_DOUBLE_PRECISION)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
OPTION(USE_GLUT "Use Glut" OFF)
|
OPTION(USE_GLUT "Use Glut" OFF)
|
||||||
@@ -63,6 +70,7 @@ IF (USE_GLUT)
|
|||||||
IF (MSVC)
|
IF (MSVC)
|
||||||
MESSAGE ("GLUT NOT FOUND, trying to use Bullet/Glut/glut32.lib for MSVC")
|
MESSAGE ("GLUT NOT FOUND, trying to use Bullet/Glut/glut32.lib for MSVC")
|
||||||
SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/Glut/glut32.lib)
|
SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/Glut/glut32.lib)
|
||||||
|
#SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/Glut/glut64.lib)
|
||||||
ENDIF (MSVC)
|
ENDIF (MSVC)
|
||||||
ENDIF (GLUT_FOUND)
|
ENDIF (GLUT_FOUND)
|
||||||
|
|
||||||
|
|||||||
@@ -439,6 +439,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
|
|||||||
cb.process(desc);
|
cb.process(desc);
|
||||||
//now create some bodies
|
//now create some bodies
|
||||||
|
|
||||||
|
if (1)
|
||||||
{
|
{
|
||||||
btCompoundShape* compound = new btCompoundShape(false);
|
btCompoundShape* compound = new btCompoundShape(false);
|
||||||
m_collisionShapes.push_back (compound);
|
m_collisionShapes.push_back (compound);
|
||||||
@@ -456,6 +457,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
|
|||||||
btRigidBody* body = localCreateRigidBody( 1.0, trans,convexShape);
|
btRigidBody* body = localCreateRigidBody( 1.0, trans,convexShape);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#if 1
|
||||||
btScalar mass=10.f;
|
btScalar mass=10.f;
|
||||||
trans.setOrigin(-convexDecompositionObjectOffset);
|
trans.setOrigin(-convexDecompositionObjectOffset);
|
||||||
btRigidBody* body = localCreateRigidBody( mass, trans,compound);
|
btRigidBody* body = localCreateRigidBody( mass, trans,compound);
|
||||||
@@ -470,7 +472,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
|
|||||||
trans.setOrigin(-convexDecompositionObjectOffset);
|
trans.setOrigin(-convexDecompositionObjectOffset);
|
||||||
body = localCreateRigidBody( mass, trans,compound);
|
body = localCreateRigidBody( mass, trans,compound);
|
||||||
body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
|
body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -499,8 +501,13 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
|
|||||||
setupEmptyDynamicsWorld();
|
setupEmptyDynamicsWorld();
|
||||||
|
|
||||||
btBulletFileLoader* fileLoader = new btBulletFileLoader(m_dynamicsWorld);
|
btBulletFileLoader* fileLoader = new btBulletFileLoader(m_dynamicsWorld);
|
||||||
|
fileLoader->setVerboseMode(true);
|
||||||
|
|
||||||
fileLoader->loadFileFromMemory("testFile.bullet");
|
fileLoader->loadFileFromMemory("testFile.bullet");
|
||||||
|
//fileLoader->loadFileFromMemory("testFile64Double.bullet");
|
||||||
|
//fileLoader->loadFileFromMemory("testFile64Single.bullet");
|
||||||
|
//fileLoader->loadFileFromMemory("testFile32Single.bullet");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
Demos/ConvexDecompositionDemo/testFile32Single.bullet
Normal file
BIN
Demos/ConvexDecompositionDemo/testFile32Single.bullet
Normal file
Binary file not shown.
BIN
Demos/ConvexDecompositionDemo/testFile64Double.bullet
Normal file
BIN
Demos/ConvexDecompositionDemo/testFile64Double.bullet
Normal file
Binary file not shown.
BIN
Demos/ConvexDecompositionDemo/testFile64Single.bullet
Normal file
BIN
Demos/ConvexDecompositionDemo/testFile64Single.bullet
Normal file
Binary file not shown.
@@ -343,7 +343,7 @@ static int gPickingConstraintId = 0;
|
|||||||
static btVector3 gOldPickingPos;
|
static btVector3 gOldPickingPos;
|
||||||
static btVector3 gHitPos(-1,-1,-1);
|
static btVector3 gHitPos(-1,-1,-1);
|
||||||
|
|
||||||
static float gOldPickingDist = 0.f;
|
static btScalar gOldPickingDist = 0.f;
|
||||||
|
|
||||||
bool GL_DialogDynamicsWorld::mouseFunc(int button, int state, int x, int y)
|
bool GL_DialogDynamicsWorld::mouseFunc(int button, int state, int x, int y)
|
||||||
{
|
{
|
||||||
@@ -719,7 +719,7 @@ void GL_DialogDynamicsWorld::mouseMotionFunc(int x,int y)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float dx, dy;
|
btScalar dx, dy;
|
||||||
dx = btScalar(x) - m_mouseOldX;
|
dx = btScalar(x) - m_mouseOldX;
|
||||||
dy = btScalar(y) - m_mouseOldY;
|
dy = btScalar(y) - m_mouseOldY;
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
SUBDIRS( glui ConvexDecomposition BulletColladaConverter LibXML COLLADA_DOM GIMPACTUtils Serialize)
|
SUBDIRS( Serialize ConvexDecomposition GIMPACTUtils )
|
||||||
|
|||||||
@@ -22,11 +22,12 @@
|
|||||||
#include "bullet_PointerArray.h"
|
#include "bullet_PointerArray.h"
|
||||||
#include "bullet_btPhysicsSystem.h"
|
#include "bullet_btPhysicsSystem.h"
|
||||||
#include "bullet_ListBase.h"
|
#include "bullet_ListBase.h"
|
||||||
#include "bullet_btVector3Data.h"
|
|
||||||
#include "bullet_btVector3FloatData.h"
|
#include "bullet_btVector3FloatData.h"
|
||||||
#include "bullet_btVector3DoubleData.h"
|
#include "bullet_btVector3DoubleData.h"
|
||||||
#include "bullet_btMatrix3x3Data.h"
|
#include "bullet_btMatrix3x3FloatData.h"
|
||||||
#include "bullet_btTransformData.h"
|
#include "bullet_btMatrix3x3DoubleData.h"
|
||||||
|
#include "bullet_btTransformFloatData.h"
|
||||||
|
#include "bullet_btTransformDoubleData.h"
|
||||||
#include "bullet_btCollisionShapeData.h"
|
#include "bullet_btCollisionShapeData.h"
|
||||||
#include "bullet_btConvexInternalShapeData.h"
|
#include "bullet_btConvexInternalShapeData.h"
|
||||||
#include "bullet_btPositionAndRadius.h"
|
#include "bullet_btPositionAndRadius.h"
|
||||||
@@ -37,6 +38,8 @@
|
|||||||
#include "bullet_btStridingMeshInterfaceData.h"
|
#include "bullet_btStridingMeshInterfaceData.h"
|
||||||
#include "bullet_btTriangleMeshShapeData.h"
|
#include "bullet_btTriangleMeshShapeData.h"
|
||||||
#include "bullet_btConvexHullShapeData.h"
|
#include "bullet_btConvexHullShapeData.h"
|
||||||
#include "bullet_btCollisionObjectData.h"
|
#include "bullet_btCollisionObjectDoubleData.h"
|
||||||
#include "bullet_btRigidBodyData.h"
|
#include "bullet_btCollisionObjectFloatData.h"
|
||||||
|
#include "bullet_btRigidBodyFloatData.h"
|
||||||
|
#include "bullet_btRigidBodyDoubleData.h"
|
||||||
#endif//__BULLET_H__
|
#endif//__BULLET_H__
|
||||||
@@ -29,11 +29,12 @@ namespace Bullet {
|
|||||||
class PointerArray;
|
class PointerArray;
|
||||||
class btPhysicsSystem;
|
class btPhysicsSystem;
|
||||||
class ListBase;
|
class ListBase;
|
||||||
class btVector3Data;
|
|
||||||
class btVector3FloatData;
|
class btVector3FloatData;
|
||||||
class btVector3DoubleData;
|
class btVector3DoubleData;
|
||||||
class btMatrix3x3Data;
|
class btMatrix3x3FloatData;
|
||||||
class btTransformData;
|
class btMatrix3x3DoubleData;
|
||||||
|
class btTransformFloatData;
|
||||||
|
class btTransformDoubleData;
|
||||||
class btCollisionShapeData;
|
class btCollisionShapeData;
|
||||||
class btConvexInternalShapeData;
|
class btConvexInternalShapeData;
|
||||||
class btPositionAndRadius;
|
class btPositionAndRadius;
|
||||||
@@ -44,7 +45,9 @@ namespace Bullet {
|
|||||||
class btStridingMeshInterfaceData;
|
class btStridingMeshInterfaceData;
|
||||||
class btTriangleMeshShapeData;
|
class btTriangleMeshShapeData;
|
||||||
class btConvexHullShapeData;
|
class btConvexHullShapeData;
|
||||||
class btCollisionObjectData;
|
class btCollisionObjectDoubleData;
|
||||||
class btRigidBodyData;
|
class btCollisionObjectFloatData;
|
||||||
|
class btRigidBodyFloatData;
|
||||||
|
class btRigidBodyDoubleData;
|
||||||
}
|
}
|
||||||
#endif//__BULLETCOMMON_H__
|
#endif//__BULLETCOMMON_H__
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/* Copyright (C) 2006-2009 Erwin Coumans & Charlie C
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
// Auto generated from makesdna dna.c
|
||||||
|
#ifndef __BULLET_BTCOLLISIONOBJECTDOUBLEDATA__H__
|
||||||
|
#define __BULLET_BTCOLLISIONOBJECTDOUBLEDATA__H__
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------- //
|
||||||
|
#include "bullet_Common.h"
|
||||||
|
#include "bullet_btTransformDoubleData.h"
|
||||||
|
#include "bullet_btVector3DoubleData.h"
|
||||||
|
|
||||||
|
namespace Bullet {
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------- //
|
||||||
|
class btCollisionObjectDoubleData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void *m_broadphaseHandle;
|
||||||
|
void *m_collisionShape;
|
||||||
|
btCollisionShapeData *m_rootCollisionShape;
|
||||||
|
void *m_userObjectPointer;
|
||||||
|
btTransformDoubleData m_worldTransform;
|
||||||
|
btTransformDoubleData m_interpolationWorldTransform;
|
||||||
|
btVector3DoubleData m_interpolationLinearVelocity;
|
||||||
|
btVector3DoubleData m_interpolationAngularVelocity;
|
||||||
|
btVector3DoubleData m_anisotropicFriction;
|
||||||
|
double m_contactProcessingThreshold;
|
||||||
|
double m_deactivationTime;
|
||||||
|
double m_friction;
|
||||||
|
double m_restitution;
|
||||||
|
double m_hitFraction;
|
||||||
|
double m_ccdSweptSphereRadius;
|
||||||
|
double m_ccdMotionThreshold;
|
||||||
|
int m_hasAnisotropicFriction;
|
||||||
|
int m_collisionFlags;
|
||||||
|
int m_islandTag1;
|
||||||
|
int m_companionId;
|
||||||
|
int m_activationState1;
|
||||||
|
int m_internalType;
|
||||||
|
int m_checkCollideWith;
|
||||||
|
char m_padding[4];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif//__BULLET_BTCOLLISIONOBJECTDOUBLEDATA__H__
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/* Copyright (C) 2006-2009 Erwin Coumans & Charlie C
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
// Auto generated from makesdna dna.c
|
||||||
|
#ifndef __BULLET_BTCOLLISIONOBJECTFLOATDATA__H__
|
||||||
|
#define __BULLET_BTCOLLISIONOBJECTFLOATDATA__H__
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------- //
|
||||||
|
#include "bullet_Common.h"
|
||||||
|
#include "bullet_btTransformFloatData.h"
|
||||||
|
#include "bullet_btVector3FloatData.h"
|
||||||
|
|
||||||
|
namespace Bullet {
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------- //
|
||||||
|
class btCollisionObjectFloatData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void *m_broadphaseHandle;
|
||||||
|
void *m_collisionShape;
|
||||||
|
btCollisionShapeData *m_rootCollisionShape;
|
||||||
|
void *m_userObjectPointer;
|
||||||
|
btTransformFloatData m_worldTransform;
|
||||||
|
btTransformFloatData m_interpolationWorldTransform;
|
||||||
|
btVector3FloatData m_interpolationLinearVelocity;
|
||||||
|
btVector3FloatData m_interpolationAngularVelocity;
|
||||||
|
btVector3FloatData m_anisotropicFriction;
|
||||||
|
float m_contactProcessingThreshold;
|
||||||
|
float m_deactivationTime;
|
||||||
|
float m_friction;
|
||||||
|
float m_restitution;
|
||||||
|
float m_hitFraction;
|
||||||
|
float m_ccdSweptSphereRadius;
|
||||||
|
float m_ccdMotionThreshold;
|
||||||
|
int m_hasAnisotropicFriction;
|
||||||
|
int m_collisionFlags;
|
||||||
|
int m_islandTag1;
|
||||||
|
int m_companionId;
|
||||||
|
int m_activationState1;
|
||||||
|
int m_internalType;
|
||||||
|
int m_checkCollideWith;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif//__BULLET_BTCOLLISIONOBJECTFLOATDATA__H__
|
||||||
@@ -33,9 +33,10 @@ namespace Bullet {
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
btConvexInternalShapeData m_convexInternalShapeData;
|
btConvexInternalShapeData m_convexInternalShapeData;
|
||||||
btVector3Data *m_unscaledPointsPtr;
|
btVector3FloatData *m_unscaledPointsFloatPtr;
|
||||||
|
btVector3DoubleData *m_unscaledPointsDoublePtr;
|
||||||
int m_numUnscaledPoints;
|
int m_numUnscaledPoints;
|
||||||
char m_padding[4];
|
char m_padding3[4];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
// -------------------------------------------------- //
|
// -------------------------------------------------- //
|
||||||
#include "bullet_Common.h"
|
#include "bullet_Common.h"
|
||||||
#include "bullet_btCollisionShapeData.h"
|
#include "bullet_btCollisionShapeData.h"
|
||||||
#include "bullet_btVector3Data.h"
|
#include "bullet_btVector3FloatData.h"
|
||||||
|
|
||||||
namespace Bullet {
|
namespace Bullet {
|
||||||
|
|
||||||
@@ -34,10 +34,10 @@ namespace Bullet {
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
btCollisionShapeData m_collisionShapeData;
|
btCollisionShapeData m_collisionShapeData;
|
||||||
btVector3Data m_localScaling;
|
btVector3FloatData m_localScaling;
|
||||||
btVector3Data m_implicitShapeDimensions;
|
btVector3FloatData m_implicitShapeDimensions;
|
||||||
btScalar m_collisionMargin;
|
float m_collisionMargin;
|
||||||
char m_padding[4];
|
int m_padding;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/* Copyright (C) 2006-2009 Erwin Coumans & Charlie C
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
// Auto generated from makesdna dna.c
|
||||||
|
#ifndef __BULLET_BTMATRIX3X3DOUBLEDATA__H__
|
||||||
|
#define __BULLET_BTMATRIX3X3DOUBLEDATA__H__
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------- //
|
||||||
|
#include "bullet_Common.h"
|
||||||
|
#include "bullet_btVector3DoubleData.h"
|
||||||
|
|
||||||
|
namespace Bullet {
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------- //
|
||||||
|
class btMatrix3x3DoubleData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
btVector3DoubleData m_el[3];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif//__BULLET_BTMATRIX3X3DOUBLEDATA__H__
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/* Copyright (C) 2006-2009 Erwin Coumans & Charlie C
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
// Auto generated from makesdna dna.c
|
||||||
|
#ifndef __BULLET_BTMATRIX3X3FLOATDATA__H__
|
||||||
|
#define __BULLET_BTMATRIX3X3FLOATDATA__H__
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------- //
|
||||||
|
#include "bullet_Common.h"
|
||||||
|
#include "bullet_btVector3FloatData.h"
|
||||||
|
|
||||||
|
namespace Bullet {
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------- //
|
||||||
|
class btMatrix3x3FloatData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
btVector3FloatData m_el[3];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif//__BULLET_BTMATRIX3X3FLOATDATA__H__
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
// -------------------------------------------------- //
|
// -------------------------------------------------- //
|
||||||
#include "bullet_Common.h"
|
#include "bullet_Common.h"
|
||||||
#include "bullet_btVector3Data.h"
|
#include "bullet_btVector3FloatData.h"
|
||||||
|
|
||||||
namespace Bullet {
|
namespace Bullet {
|
||||||
|
|
||||||
@@ -32,8 +32,8 @@ namespace Bullet {
|
|||||||
class btPositionAndRadius
|
class btPositionAndRadius
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
btVector3Data m_pos;
|
btVector3FloatData m_pos;
|
||||||
btScalar m_radius;
|
float m_radius;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/* Copyright (C) 2006-2009 Erwin Coumans & Charlie C
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
// Auto generated from makesdna dna.c
|
||||||
|
#ifndef __BULLET_BTRIGIDBODYDOUBLEDATA__H__
|
||||||
|
#define __BULLET_BTRIGIDBODYDOUBLEDATA__H__
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------- //
|
||||||
|
#include "bullet_Common.h"
|
||||||
|
#include "bullet_btCollisionObjectDoubleData.h"
|
||||||
|
#include "bullet_btMatrix3x3DoubleData.h"
|
||||||
|
#include "bullet_btVector3DoubleData.h"
|
||||||
|
|
||||||
|
namespace Bullet {
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------- //
|
||||||
|
class btRigidBodyDoubleData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
btCollisionObjectDoubleData m_collisionObjectData;
|
||||||
|
btMatrix3x3DoubleData m_invInertiaTensorWorld;
|
||||||
|
btVector3DoubleData m_linearVelocity;
|
||||||
|
btVector3DoubleData m_angularVelocity;
|
||||||
|
btVector3DoubleData m_angularFactor;
|
||||||
|
btVector3DoubleData m_linearFactor;
|
||||||
|
btVector3DoubleData m_gravity;
|
||||||
|
btVector3DoubleData m_gravity_acceleration;
|
||||||
|
btVector3DoubleData m_invInertiaLocal;
|
||||||
|
btVector3DoubleData m_totalForce;
|
||||||
|
btVector3DoubleData m_totalTorque;
|
||||||
|
double m_inverseMass;
|
||||||
|
double m_linearDamping;
|
||||||
|
double m_angularDamping;
|
||||||
|
double m_additionalDampingFactor;
|
||||||
|
double m_additionalLinearDampingThresholdSqr;
|
||||||
|
double m_additionalAngularDampingThresholdSqr;
|
||||||
|
double m_additionalAngularDampingFactor;
|
||||||
|
double m_linearSleepingThreshold;
|
||||||
|
double m_angularSleepingThreshold;
|
||||||
|
int m_additionalDamping;
|
||||||
|
char m_padding[4];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif//__BULLET_BTRIGIDBODYDOUBLEDATA__H__
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
/* Copyright (C) 2006-2009 Erwin Coumans & Charlie C
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
// Auto generated from makesdna dna.c
|
||||||
|
#ifndef __BULLET_BTRIGIDBODYFLOATDATA__H__
|
||||||
|
#define __BULLET_BTRIGIDBODYFLOATDATA__H__
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------- //
|
||||||
|
#include "bullet_Common.h"
|
||||||
|
#include "bullet_btCollisionObjectFloatData.h"
|
||||||
|
#include "bullet_btMatrix3x3FloatData.h"
|
||||||
|
#include "bullet_btVector3FloatData.h"
|
||||||
|
|
||||||
|
namespace Bullet {
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------- //
|
||||||
|
class btRigidBodyFloatData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
btCollisionObjectFloatData m_collisionObjectData;
|
||||||
|
btMatrix3x3FloatData m_invInertiaTensorWorld;
|
||||||
|
btVector3FloatData m_linearVelocity;
|
||||||
|
btVector3FloatData m_angularVelocity;
|
||||||
|
btVector3FloatData m_angularFactor;
|
||||||
|
btVector3FloatData m_linearFactor;
|
||||||
|
btVector3FloatData m_gravity;
|
||||||
|
btVector3FloatData m_gravity_acceleration;
|
||||||
|
btVector3FloatData m_invInertiaLocal;
|
||||||
|
btVector3FloatData m_totalForce;
|
||||||
|
btVector3FloatData m_totalTorque;
|
||||||
|
float m_inverseMass;
|
||||||
|
float m_linearDamping;
|
||||||
|
float m_angularDamping;
|
||||||
|
float m_additionalDampingFactor;
|
||||||
|
float m_additionalLinearDampingThresholdSqr;
|
||||||
|
float m_additionalAngularDampingThresholdSqr;
|
||||||
|
float m_additionalAngularDampingFactor;
|
||||||
|
float m_linearSleepingThreshold;
|
||||||
|
float m_angularSleepingThreshold;
|
||||||
|
int m_additionalDamping;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif//__BULLET_BTRIGIDBODYFLOATDATA__H__
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
// -------------------------------------------------- //
|
// -------------------------------------------------- //
|
||||||
#include "bullet_Common.h"
|
#include "bullet_Common.h"
|
||||||
#include "bullet_btVector3Data.h"
|
#include "bullet_btVector3FloatData.h"
|
||||||
|
|
||||||
namespace Bullet {
|
namespace Bullet {
|
||||||
|
|
||||||
@@ -33,8 +33,8 @@ namespace Bullet {
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
btMeshPartData *m_meshPartsPtr;
|
btMeshPartData *m_meshPartsPtr;
|
||||||
|
btVector3FloatData m_scaling;
|
||||||
int m_numMeshParts;
|
int m_numMeshParts;
|
||||||
btVector3Data m_scaling;
|
|
||||||
char m_padding[4];
|
char m_padding[4];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/* Copyright (C) 2006-2009 Erwin Coumans & Charlie C
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
// Auto generated from makesdna dna.c
|
||||||
|
#ifndef __BULLET_BTTRANSFORMDOUBLEDATA__H__
|
||||||
|
#define __BULLET_BTTRANSFORMDOUBLEDATA__H__
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------- //
|
||||||
|
#include "bullet_Common.h"
|
||||||
|
#include "bullet_btMatrix3x3DoubleData.h"
|
||||||
|
#include "bullet_btVector3DoubleData.h"
|
||||||
|
|
||||||
|
namespace Bullet {
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------- //
|
||||||
|
class btTransformDoubleData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
btMatrix3x3DoubleData m_basis;
|
||||||
|
btVector3DoubleData m_origin;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif//__BULLET_BTTRANSFORMDOUBLEDATA__H__
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/* Copyright (C) 2006-2009 Erwin Coumans & Charlie C
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
// Auto generated from makesdna dna.c
|
||||||
|
#ifndef __BULLET_BTTRANSFORMFLOATDATA__H__
|
||||||
|
#define __BULLET_BTTRANSFORMFLOATDATA__H__
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------- //
|
||||||
|
#include "bullet_Common.h"
|
||||||
|
#include "bullet_btMatrix3x3FloatData.h"
|
||||||
|
#include "bullet_btVector3FloatData.h"
|
||||||
|
|
||||||
|
namespace Bullet {
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------- //
|
||||||
|
class btTransformFloatData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
btMatrix3x3FloatData m_basis;
|
||||||
|
btVector3FloatData m_origin;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif//__BULLET_BTTRANSFORMFLOATDATA__H__
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
// -------------------------------------------------- //
|
// -------------------------------------------------- //
|
||||||
#include "bullet_Common.h"
|
#include "bullet_Common.h"
|
||||||
|
#include "bullet_btCollisionShapeData.h"
|
||||||
#include "bullet_btStridingMeshInterfaceData.h"
|
#include "bullet_btStridingMeshInterfaceData.h"
|
||||||
|
|
||||||
namespace Bullet {
|
namespace Bullet {
|
||||||
@@ -32,10 +33,10 @@ namespace Bullet {
|
|||||||
class btTriangleMeshShapeData
|
class btTriangleMeshShapeData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bInvalidHandle btCollisionShapeData;
|
btCollisionShapeData m_collisionShapeData;
|
||||||
bInvalidHandle m_collisionShapeData;
|
|
||||||
btStridingMeshInterfaceData m_meshInterface;
|
btStridingMeshInterfaceData m_meshInterface;
|
||||||
btScalar m_collisionMargin;
|
float m_collisionMargin;
|
||||||
|
char m_padding[4];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -187,6 +187,8 @@ void bDNA::initCmpFlags(bDNA *memDNA)
|
|||||||
mCMPFlags[i] = FDF_NONE;
|
mCMPFlags[i] = FDF_NONE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
//char* typeName = mTypes[oldStruct[0]];
|
||||||
|
|
||||||
//#define SLOW_FORWARD_COMPATIBLE 1
|
//#define SLOW_FORWARD_COMPATIBLE 1
|
||||||
#ifdef SLOW_FORWARD_COMPATIBLE
|
#ifdef SLOW_FORWARD_COMPATIBLE
|
||||||
char* typeName = mTypes[oldLookup];
|
char* typeName = mTypes[oldLookup];
|
||||||
@@ -227,6 +229,8 @@ void bDNA::initCmpFlags(bDNA *memDNA)
|
|||||||
for (int j=0; j<elementLength; j++, curStruct+=2, oldStruct+=2)
|
for (int j=0; j<elementLength; j++, curStruct+=2, oldStruct+=2)
|
||||||
{
|
{
|
||||||
// type the same
|
// type the same
|
||||||
|
//const char* typeFileDNA = mTypes[oldStruct[0]];
|
||||||
|
//const char* typeMemDNA = mTypes[curStruct[0]];
|
||||||
if (strcmp(mTypes[oldStruct[0]], memDNA->mTypes[curStruct[0]])!=0)
|
if (strcmp(mTypes[oldStruct[0]], memDNA->mTypes[curStruct[0]])!=0)
|
||||||
{
|
{
|
||||||
isSame=false;
|
isSame=false;
|
||||||
|
|||||||
@@ -109,20 +109,26 @@ void bFile::parseHeader()
|
|||||||
memcpy(header, blenderBuf, SIZEOFBLENDERHEADER);
|
memcpy(header, blenderBuf, SIZEOFBLENDERHEADER);
|
||||||
header[SIZEOFBLENDERHEADER]='\0';
|
header[SIZEOFBLENDERHEADER]='\0';
|
||||||
|
|
||||||
if (strncmp(header, m_headerString, 7)!=0)
|
if (strncmp(header, m_headerString, 6)!=0)
|
||||||
{
|
{
|
||||||
printf ("Invalid blend file...");
|
memcpy(header, m_headerString, SIZEOFBLENDERHEADER);
|
||||||
|
printf ("Invalid %s file...",header);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (header[6] == 'd')
|
||||||
|
{
|
||||||
|
mFlags |= FD_DOUBLE_PRECISION;
|
||||||
|
}
|
||||||
|
|
||||||
char *ver = header+9;
|
char *ver = header+9;
|
||||||
mVersion = atoi(ver);
|
mVersion = atoi(ver);
|
||||||
if (mVersion <= 241)
|
if (mVersion <= 241)
|
||||||
printf ("Warning, %d not fully tested : <= 242\n", mVersion);
|
printf ("Warning, %d not fully tested : <= 242\n", mVersion);
|
||||||
|
|
||||||
|
|
||||||
int endian= 1;
|
int littleEndian= 1;
|
||||||
endian= ((char*)&endian)[0];
|
littleEndian= ((char*)&littleEndian)[0];
|
||||||
|
|
||||||
// swap ptr sizes...
|
// swap ptr sizes...
|
||||||
if (header[7]=='-')
|
if (header[7]=='-')
|
||||||
@@ -134,10 +140,10 @@ void bFile::parseHeader()
|
|||||||
else if (VOID_IS_8) mFlags |= FD_BITS_VARIES;
|
else if (VOID_IS_8) mFlags |= FD_BITS_VARIES;
|
||||||
|
|
||||||
// swap endian...
|
// swap endian...
|
||||||
if (header[8]=='V' && endian ==1)
|
if (header[8]=='V' && littleEndian ==1)
|
||||||
mFlags |= FD_ENDIAN_SWAP;
|
mFlags |= FD_ENDIAN_SWAP;
|
||||||
else
|
else
|
||||||
if (endian==0)
|
if (littleEndian==0)
|
||||||
mFlags |= FD_ENDIAN_SWAP;
|
mFlags |= FD_ENDIAN_SWAP;
|
||||||
|
|
||||||
|
|
||||||
@@ -383,12 +389,25 @@ void bFile::parseStruct(char *strcPtr, char *dtPtr, int old_dna, int new_dna, bo
|
|||||||
cpo = getFileElement(firstStruct, memName, memType, dtPtr, &filePtrOld);
|
cpo = getFileElement(firstStruct, memName, memType, dtPtr, &filePtrOld);
|
||||||
if (cpo)
|
if (cpo)
|
||||||
{
|
{
|
||||||
|
int arrayLen = mFileDNA->getArraySizeNew(filePtrOld[1]);
|
||||||
old_nr = mFileDNA->getReverseType(memType);
|
old_nr = mFileDNA->getReverseType(memType);
|
||||||
new_nr = revType;
|
new_nr = revType;
|
||||||
fpLen = mFileDNA->getElementSize(filePtrOld[0], filePtrOld[1]);
|
fpLen = mFileDNA->getElementSize(filePtrOld[0], filePtrOld[1]);
|
||||||
|
if (arrayLen==1)
|
||||||
|
{
|
||||||
|
parseStruct(cpc, cpo, old_nr, new_nr,fixupPointers);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
char* tmpCpc = cpc;
|
||||||
|
char* tmpCpo = cpo;
|
||||||
|
|
||||||
|
for (int i=0;i<arrayLen;i++)
|
||||||
parseStruct(cpc, cpo, old_nr, new_nr,fixupPointers);
|
{
|
||||||
|
parseStruct(tmpCpc, tmpCpo, old_nr, new_nr,fixupPointers);
|
||||||
|
tmpCpc += size/arrayLen;
|
||||||
|
tmpCpo += fpLen/arrayLen;
|
||||||
|
}
|
||||||
|
}
|
||||||
cpc+=size;
|
cpc+=size;
|
||||||
cpo+=fpLen;
|
cpo+=fpLen;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ namespace bParse {
|
|||||||
FD_ENDIAN_SWAP =4,
|
FD_ENDIAN_SWAP =4,
|
||||||
FD_FILE_64 =8,
|
FD_FILE_64 =8,
|
||||||
FD_BITS_VARIES =16,
|
FD_BITS_VARIES =16,
|
||||||
FD_VERSION_VARIES = 32
|
FD_VERSION_VARIES = 32,
|
||||||
|
FD_DOUBLE_PRECISION =64
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,13 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
|
|
||||||
// 32 && 64 bit versions
|
// 32 && 64 bit versions
|
||||||
|
//#ifdef _WIN64
|
||||||
|
extern unsigned char sBulletDNAstr64[];
|
||||||
|
extern int sBulletDNAlen64;
|
||||||
|
//#else
|
||||||
extern unsigned char sBulletDNAstr[];
|
extern unsigned char sBulletDNAstr[];
|
||||||
extern int sBulletDNAlen;
|
extern int sBulletDNAlen;
|
||||||
|
//#endif //_WIN64
|
||||||
//not yetto. extern unsigned char DNAstr64[];
|
|
||||||
//not yetto. extern int DNAlen64;
|
|
||||||
|
|
||||||
|
|
||||||
using namespace bParse;
|
using namespace bParse;
|
||||||
@@ -33,7 +35,13 @@ btBulletFile::btBulletFile()
|
|||||||
:bFile("", "BULLET ")
|
:bFile("", "BULLET ")
|
||||||
{
|
{
|
||||||
mMemoryDNA = new bDNA();
|
mMemoryDNA = new bDNA();
|
||||||
mMemoryDNA->init((char*)sBulletDNAstr,sBulletDNAlen);
|
//#ifdef _WIN64
|
||||||
|
if (VOID_IS_8)
|
||||||
|
mMemoryDNA->init((char*)sBulletDNAstr64,sBulletDNAlen64);
|
||||||
|
else
|
||||||
|
//#else
|
||||||
|
mMemoryDNA->init((char*)sBulletDNAstr,sBulletDNAlen);
|
||||||
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -128,6 +136,9 @@ void btBulletFile::parseData()
|
|||||||
// {
|
// {
|
||||||
// m_glob = (bStructHandle*) id;
|
// m_glob = (bStructHandle*) id;
|
||||||
// }
|
// }
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
printf("unknown chunk\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// next please!
|
// next please!
|
||||||
@@ -158,17 +169,25 @@ void btBulletFile::writeDNA(FILE* fp)
|
|||||||
|
|
||||||
if (VOID_IS_8)
|
if (VOID_IS_8)
|
||||||
{
|
{
|
||||||
//dataChunk.len = DNAlen64;
|
//#ifdef _WIN64
|
||||||
//dataChunk.oldPtr = DNAstr64;
|
dataChunk.len = sBulletDNAlen64;
|
||||||
//fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
|
dataChunk.oldPtr = sBulletDNAstr64;
|
||||||
//fwrite(DNAstr64, DNAlen64,1,fp);
|
fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
|
||||||
|
fwrite(sBulletDNAstr64, sBulletDNAlen64,1,fp);
|
||||||
|
//#else
|
||||||
|
// btAssert(0);
|
||||||
|
//#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//#ifndef _WIN64
|
||||||
dataChunk.len = sBulletDNAlen;
|
dataChunk.len = sBulletDNAlen;
|
||||||
dataChunk.oldPtr = sBulletDNAstr;
|
dataChunk.oldPtr = sBulletDNAstr;
|
||||||
fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
|
fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
|
||||||
fwrite(sBulletDNAstr, sBulletDNAlen,1,fp);
|
fwrite(sBulletDNAstr, sBulletDNAlen,1,fp);
|
||||||
|
//#else
|
||||||
|
// btAssert(0);
|
||||||
|
//#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,12 +196,19 @@ void btBulletFile::parse(bool verboseDumpAllTypes)
|
|||||||
{
|
{
|
||||||
if (VOID_IS_8)
|
if (VOID_IS_8)
|
||||||
{
|
{
|
||||||
exit(0);
|
//#ifdef _WIN64
|
||||||
//parseInternal(verboseDumpAllTypes,(char*)DNAstr64,DNAlen64);
|
parseInternal(verboseDumpAllTypes,(char*)sBulletDNAstr64,sBulletDNAlen64);
|
||||||
|
//#else
|
||||||
|
// btAssert(0);
|
||||||
|
//#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//#ifndef _WIN64
|
||||||
parseInternal(verboseDumpAllTypes,(char*)sBulletDNAstr,sBulletDNAlen);
|
parseInternal(verboseDumpAllTypes,(char*)sBulletDNAstr,sBulletDNAlen);
|
||||||
|
//#else
|
||||||
|
// btAssert(0);
|
||||||
|
//#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "btBulletDynamicsCommon.h"
|
#include "btBulletDynamicsCommon.h"
|
||||||
|
|
||||||
|
|
||||||
btBulletFileLoader::btBulletFileLoader(btDynamicsWorld* world)
|
btBulletFileLoader::btBulletFileLoader(btDynamicsWorld* world)
|
||||||
:m_dynamicsWorld(world),
|
:m_dynamicsWorld(world),
|
||||||
m_verboseDumpAllTypes(false)
|
m_verboseDumpAllTypes(false)
|
||||||
@@ -12,7 +13,7 @@ m_verboseDumpAllTypes(false)
|
|||||||
|
|
||||||
bool btBulletFileLoader::loadFileFromMemory( char* fileName)
|
bool btBulletFileLoader::loadFileFromMemory( char* fileName)
|
||||||
{
|
{
|
||||||
bParse::btBulletFile* bulletFile2 = new bParse::btBulletFile("testFile.bullet");
|
bParse::btBulletFile* bulletFile2 = new bParse::btBulletFile(fileName);
|
||||||
|
|
||||||
bool result = loadFileFromMemory(bulletFile2);
|
bool result = loadFileFromMemory(bulletFile2);
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ bool btBulletFileLoader::loadFileFromMemory( bParse::btBulletFile* bulletFile2)
|
|||||||
{
|
{
|
||||||
btConvexInternalShapeData* bsd = (btConvexInternalShapeData*)shapeData;
|
btConvexInternalShapeData* bsd = (btConvexInternalShapeData*)shapeData;
|
||||||
btVector3 implicitShapeDimensions;
|
btVector3 implicitShapeDimensions;
|
||||||
implicitShapeDimensions.deSerialize(bsd->m_implicitShapeDimensions);
|
implicitShapeDimensions.deSerializeFloat(bsd->m_implicitShapeDimensions);
|
||||||
btVector3 margin(bsd->m_collisionMargin,bsd->m_collisionMargin,bsd->m_collisionMargin);
|
btVector3 margin(bsd->m_collisionMargin,bsd->m_collisionMargin,bsd->m_collisionMargin);
|
||||||
btCollisionShape* shape = 0;
|
btCollisionShape* shape = 0;
|
||||||
switch (shapeData->m_shapeType)
|
switch (shapeData->m_shapeType)
|
||||||
@@ -107,7 +108,7 @@ bool btBulletFileLoader::loadFileFromMemory( bParse::btBulletFile* bulletFile2)
|
|||||||
tmpPos.resize(numSpheres);
|
tmpPos.resize(numSpheres);
|
||||||
for (int i=0;i<numSpheres;i++)
|
for (int i=0;i<numSpheres;i++)
|
||||||
{
|
{
|
||||||
tmpPos[i].deSerialize(mss->m_localPositionArrayPtr[i].m_pos);
|
tmpPos[i].deSerializeFloat(mss->m_localPositionArrayPtr[i].m_pos);
|
||||||
radii[i] = mss->m_localPositionArrayPtr[i].m_radius;
|
radii[i] = mss->m_localPositionArrayPtr[i].m_radius;
|
||||||
}
|
}
|
||||||
shape = new btMultiSphereShape(&tmpPos[0],&radii[0],numSpheres);
|
shape = new btMultiSphereShape(&tmpPos[0],&radii[0],numSpheres);
|
||||||
@@ -115,6 +116,9 @@ bool btBulletFileLoader::loadFileFromMemory( bParse::btBulletFile* bulletFile2)
|
|||||||
}
|
}
|
||||||
case CONVEX_HULL_SHAPE_PROXYTYPE:
|
case CONVEX_HULL_SHAPE_PROXYTYPE:
|
||||||
{
|
{
|
||||||
|
int sz = sizeof(btConvexHullShapeData);
|
||||||
|
int sz2 = sizeof(btConvexInternalShapeData);
|
||||||
|
int sz3 = sizeof(btCollisionShapeData);
|
||||||
btConvexHullShapeData* convexData = (btConvexHullShapeData*)bsd;
|
btConvexHullShapeData* convexData = (btConvexHullShapeData*)bsd;
|
||||||
int numPoints = convexData->m_numUnscaledPoints;
|
int numPoints = convexData->m_numUnscaledPoints;
|
||||||
|
|
||||||
@@ -122,7 +126,17 @@ bool btBulletFileLoader::loadFileFromMemory( bParse::btBulletFile* bulletFile2)
|
|||||||
tmpPoints.resize(numPoints);
|
tmpPoints.resize(numPoints);
|
||||||
for (int i=0;i<numPoints;i++)
|
for (int i=0;i<numPoints;i++)
|
||||||
{
|
{
|
||||||
tmpPoints[i].deSerialize(convexData->m_unscaledPointsPtr[i]);
|
#ifdef BT_USE_DOUBLE_PRECISION
|
||||||
|
if (convexData->m_unscaledPointsDoublePtr)
|
||||||
|
tmpPoints[i].deSerialize(convexData->m_unscaledPointsDoublePtr[i]);
|
||||||
|
if (convexData->m_unscaledPointsFloatPtr)
|
||||||
|
tmpPoints[i].deSerializeFloat(convexData->m_unscaledPointsFloatPtr[i]);
|
||||||
|
#else
|
||||||
|
if (convexData->m_unscaledPointsFloatPtr)
|
||||||
|
tmpPoints[i].deSerialize(convexData->m_unscaledPointsFloatPtr[i]);
|
||||||
|
if (convexData->m_unscaledPointsDoublePtr)
|
||||||
|
tmpPoints[i].deSerializeDouble(convexData->m_unscaledPointsDoublePtr[i]);
|
||||||
|
#endif //BT_USE_DOUBLE_PRECISION
|
||||||
}
|
}
|
||||||
shape = new btConvexHullShape(&tmpPoints[0].getX(),numPoints,sizeof(btVector3));
|
shape = new btConvexHullShape(&tmpPoints[0].getX(),numPoints,sizeof(btVector3));
|
||||||
break;
|
break;
|
||||||
@@ -137,7 +151,7 @@ bool btBulletFileLoader::loadFileFromMemory( bParse::btBulletFile* bulletFile2)
|
|||||||
{
|
{
|
||||||
shape->setMargin(bsd->m_collisionMargin);
|
shape->setMargin(bsd->m_collisionMargin);
|
||||||
btVector3 localScaling;
|
btVector3 localScaling;
|
||||||
localScaling.deSerialize(bsd->m_localScaling);
|
localScaling.deSerializeFloat(bsd->m_localScaling);
|
||||||
shape->setLocalScaling(localScaling);
|
shape->setLocalScaling(localScaling);
|
||||||
|
|
||||||
shapeMap.insert(shapeData,shape);
|
shapeMap.insert(shapeData,shape);
|
||||||
@@ -179,7 +193,7 @@ bool btBulletFileLoader::loadFileFromMemory( bParse::btBulletFile* bulletFile2)
|
|||||||
|
|
||||||
meshInterface->addIndexedMesh(meshPart);
|
meshInterface->addIndexedMesh(meshPart);
|
||||||
}
|
}
|
||||||
btVector3 scaling; scaling.deSerialize(trimesh->m_meshInterface.m_scaling);
|
btVector3 scaling; scaling.deSerializeFloat(trimesh->m_meshInterface.m_scaling);
|
||||||
meshInterface->setScaling(scaling);
|
meshInterface->setScaling(scaling);
|
||||||
|
|
||||||
btBvhTriangleMeshShape* trimeshShape = new btBvhTriangleMeshShape(meshInterface,true);
|
btBvhTriangleMeshShape* trimeshShape = new btBvhTriangleMeshShape(meshInterface,true);
|
||||||
@@ -198,29 +212,53 @@ bool btBulletFileLoader::loadFileFromMemory( bParse::btBulletFile* bulletFile2)
|
|||||||
}
|
}
|
||||||
for (i=0;i<bulletFile2->m_rigidBodies.size();i++)
|
for (i=0;i<bulletFile2->m_rigidBodies.size();i++)
|
||||||
{
|
{
|
||||||
btRigidBodyData* colObjData = (btRigidBodyData*)bulletFile2->m_rigidBodies[i];
|
if (bulletFile2->getFlags() & bParse::FD_DOUBLE_PRECISION)
|
||||||
btScalar mass = colObjData->m_inverseMass? 1.f/colObjData->m_inverseMass : 0.f;
|
|
||||||
btVector3 localInertia;
|
|
||||||
localInertia.setZero();
|
|
||||||
btCollisionShape** shapePtr = shapeMap.find(colObjData->m_collisionObjectData.m_collisionShape);
|
|
||||||
if (shapePtr && *shapePtr)
|
|
||||||
{
|
{
|
||||||
btTransform startTransform;
|
btRigidBodyDoubleData* colObjData = (btRigidBodyDoubleData*)bulletFile2->m_rigidBodies[i];
|
||||||
startTransform.deSerialize(colObjData->m_collisionObjectData.m_worldTransform);
|
btScalar mass = btScalar(colObjData->m_inverseMass? 1.f/colObjData->m_inverseMass : 0.f);
|
||||||
|
btVector3 localInertia;
|
||||||
btCollisionShape* shape = (btCollisionShape*)*shapePtr;
|
localInertia.setZero();
|
||||||
|
btCollisionShape** shapePtr = shapeMap.find(colObjData->m_collisionObjectData.m_collisionShape);
|
||||||
if (mass)
|
if (shapePtr && *shapePtr)
|
||||||
{
|
{
|
||||||
shape->calculateLocalInertia(mass,localInertia);
|
btTransform startTransform;
|
||||||
|
startTransform.deSerializeDouble(colObjData->m_collisionObjectData.m_worldTransform);
|
||||||
|
// startTransform.setBasis(btMatrix3x3::getIdentity());
|
||||||
|
btCollisionShape* shape = (btCollisionShape*)*shapePtr;
|
||||||
|
if (mass)
|
||||||
|
{
|
||||||
|
shape->calculateLocalInertia(mass,localInertia);
|
||||||
|
}
|
||||||
|
bool isDynamic = mass!=0.f;
|
||||||
|
createRigidBody(isDynamic,mass,startTransform,shape);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
printf("error: no shape found\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isDynamic = mass!=0.f;
|
|
||||||
createRigidBody(isDynamic,mass,startTransform,shape);
|
|
||||||
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
printf("error: no shape found\n");
|
btRigidBodyFloatData* colObjData = (btRigidBodyFloatData*)bulletFile2->m_rigidBodies[i];
|
||||||
|
btScalar mass = btScalar(colObjData->m_inverseMass? 1.f/colObjData->m_inverseMass : 0.f);
|
||||||
|
btVector3 localInertia;
|
||||||
|
localInertia.setZero();
|
||||||
|
btCollisionShape** shapePtr = shapeMap.find(colObjData->m_collisionObjectData.m_collisionShape);
|
||||||
|
if (shapePtr && *shapePtr)
|
||||||
|
{
|
||||||
|
btTransform startTransform;
|
||||||
|
startTransform.deSerializeFloat(colObjData->m_collisionObjectData.m_worldTransform);
|
||||||
|
// startTransform.setBasis(btMatrix3x3::getIdentity());
|
||||||
|
btCollisionShape* shape = (btCollisionShape*)*shapePtr;
|
||||||
|
if (mass)
|
||||||
|
{
|
||||||
|
shape->calculateLocalInertia(mass,localInertia);
|
||||||
|
}
|
||||||
|
bool isDynamic = mass!=0.f;
|
||||||
|
createRigidBody(isDynamic,mass,startTransform,shape);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
printf("error: no shape found\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +282,7 @@ btTypedConstraint* btBulletFileLoader::createUniversalD6Constraint(class btRig
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
btRigidBody* btBulletFileLoader::createRigidBody(bool isDynamic, float mass, const btTransform& startTransform,btCollisionShape* shape)
|
btRigidBody* btBulletFileLoader::createRigidBody(bool isDynamic, btScalar mass, const btTransform& startTransform,btCollisionShape* shape)
|
||||||
{
|
{
|
||||||
btVector3 localInertia;
|
btVector3 localInertia;
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
virtual btRigidBody* createRigidBody(bool isDynamic,
|
virtual btRigidBody* createRigidBody(bool isDynamic,
|
||||||
float mass,
|
btScalar mass,
|
||||||
const btTransform& startTransform,
|
const btTransform& startTransform,
|
||||||
btCollisionShape* shape);
|
btCollisionShape* shape);
|
||||||
|
|
||||||
|
|||||||
@@ -810,6 +810,7 @@ static int calculate_structlens(int firststruct)
|
|||||||
// has_pointer is set or alphalen != len
|
// has_pointer is set or alphalen != len
|
||||||
if (has_pointer || alphalen != len) {
|
if (has_pointer || alphalen != len) {
|
||||||
if (alphalen % 8) {
|
if (alphalen % 8) {
|
||||||
|
printf("alphalen = %d len = %d\n",alphalen,len);
|
||||||
printf("Sizeerror 8 in struct: %s (add %d bytes)\n", types[structtype], alphalen%8);
|
printf("Sizeerror 8 in struct: %s (add %d bytes)\n", types[structtype], alphalen%8);
|
||||||
dna_error = 1;
|
dna_error = 1;
|
||||||
}
|
}
|
||||||
@@ -945,7 +946,6 @@ int make_structDNA(char *baseDirectory, FILE *file)
|
|||||||
add_type("float", 4); /* 7 */
|
add_type("float", 4); /* 7 */
|
||||||
add_type("double", 8); /* 8 */
|
add_type("double", 8); /* 8 */
|
||||||
add_type("void", 0); /* 9 */
|
add_type("void", 0); /* 9 */
|
||||||
add_type("btScalar", 4); /* 10 */ /* 4 bytes in single precision, 8 in double precision */
|
|
||||||
|
|
||||||
// the defines above shouldn't be output in the padding file...
|
// the defines above shouldn't be output in the padding file...
|
||||||
firststruct = nr_types;
|
firststruct = nr_types;
|
||||||
@@ -1175,7 +1175,14 @@ int main(int argc, char ** argv)
|
|||||||
strcpy(baseDirectory, BASE_HEADER);
|
strcpy(baseDirectory, BASE_HEADER);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (file, "unsigned char sBulletDNAstr[]= {\n");
|
if (sizeof(void*)==8)
|
||||||
|
{
|
||||||
|
fprintf (file, "unsigned char sBulletDNAstr64[]= {\n");
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
fprintf (file, "unsigned char sBulletDNAstr[]= {\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (make_structDNA(baseDirectory, file)) {
|
if (make_structDNA(baseDirectory, file)) {
|
||||||
// error
|
// error
|
||||||
fclose(file);
|
fclose(file);
|
||||||
@@ -1183,7 +1190,13 @@ int main(int argc, char ** argv)
|
|||||||
return_status = 1;
|
return_status = 1;
|
||||||
} else {
|
} else {
|
||||||
fprintf(file, "};\n");
|
fprintf(file, "};\n");
|
||||||
fprintf(file, "int sBulletDNAlen= sizeof(sBulletDNAstr);\n");
|
if (sizeof(void*)==8)
|
||||||
|
{
|
||||||
|
fprintf(file, "int sBulletDNAlen64= sizeof(sBulletDNAstr64);\n");
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
fprintf(file, "int sBulletDNAlen= sizeof(sBulletDNAstr);\n");
|
||||||
|
}
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,14 @@ struct btCollisionShapeData;
|
|||||||
|
|
||||||
typedef btAlignedObjectArray<class btCollisionObject*> btCollisionObjectArray;
|
typedef btAlignedObjectArray<class btCollisionObject*> btCollisionObjectArray;
|
||||||
|
|
||||||
|
#ifdef BT_USE_DOUBLE_PRECISION
|
||||||
|
#define btCollisionObjectData btCollisionObjectDoubleData
|
||||||
|
#define btCollisionObjectDataName "btCollisionObjectDoubleData"
|
||||||
|
#else
|
||||||
|
#define btCollisionObjectData btCollisionObjectFloatData
|
||||||
|
#define btCollisionObjectDataName "btCollisionObjectFloatData"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/// btCollisionObject can be used to manage collision detection objects.
|
/// btCollisionObject can be used to manage collision detection objects.
|
||||||
/// btCollisionObject maintains all information that is needed for a collision detection: Shape, Transform and AABB proxy.
|
/// btCollisionObject maintains all information that is needed for a collision detection: Shape, Transform and AABB proxy.
|
||||||
@@ -427,34 +435,67 @@ public:
|
|||||||
///using offsetof for m_vtablePadding might break some compilers, in that case define m_vtablePadding manually
|
///using offsetof for m_vtablePadding might break some compilers, in that case define m_vtablePadding manually
|
||||||
|
|
||||||
///for serialization
|
///for serialization
|
||||||
struct btCollisionObjectData
|
struct btCollisionObjectDoubleData
|
||||||
{
|
{
|
||||||
btTransformData m_worldTransform;
|
|
||||||
btTransformData m_interpolationWorldTransform;
|
|
||||||
btVector3Data m_interpolationLinearVelocity;
|
|
||||||
btVector3Data m_interpolationAngularVelocity;
|
|
||||||
btVector3Data m_anisotropicFriction;
|
|
||||||
int m_hasAnisotropicFriction;
|
|
||||||
btScalar m_contactProcessingThreshold;
|
|
||||||
void *m_broadphaseHandle;
|
void *m_broadphaseHandle;
|
||||||
void *m_collisionShape;
|
void *m_collisionShape;
|
||||||
btCollisionShapeData *m_rootCollisionShape;
|
btCollisionShapeData *m_rootCollisionShape;
|
||||||
|
void *m_userObjectPointer;
|
||||||
|
|
||||||
|
btTransformDoubleData m_worldTransform;
|
||||||
|
btTransformDoubleData m_interpolationWorldTransform;
|
||||||
|
btVector3DoubleData m_interpolationLinearVelocity;
|
||||||
|
btVector3DoubleData m_interpolationAngularVelocity;
|
||||||
|
btVector3DoubleData m_anisotropicFriction;
|
||||||
|
double m_contactProcessingThreshold;
|
||||||
|
double m_deactivationTime;
|
||||||
|
double m_friction;
|
||||||
|
double m_restitution;
|
||||||
|
double m_hitFraction;
|
||||||
|
double m_ccdSweptSphereRadius;
|
||||||
|
double m_ccdMotionThreshold;
|
||||||
|
|
||||||
|
int m_hasAnisotropicFriction;
|
||||||
int m_collisionFlags;
|
int m_collisionFlags;
|
||||||
int m_islandTag1;
|
int m_islandTag1;
|
||||||
int m_companionId;
|
int m_companionId;
|
||||||
int m_activationState1;
|
int m_activationState1;
|
||||||
btScalar m_deactivationTime;
|
|
||||||
btScalar m_friction;
|
|
||||||
btScalar m_restitution;
|
|
||||||
int m_internalType;
|
int m_internalType;
|
||||||
|
int m_checkCollideWith;
|
||||||
|
char m_padding[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct btCollisionObjectFloatData
|
||||||
|
{
|
||||||
|
void *m_broadphaseHandle;
|
||||||
|
void *m_collisionShape;
|
||||||
|
btCollisionShapeData *m_rootCollisionShape;
|
||||||
void *m_userObjectPointer;
|
void *m_userObjectPointer;
|
||||||
btScalar m_hitFraction;
|
|
||||||
btScalar m_ccdSweptSphereRadius;
|
btTransformFloatData m_worldTransform;
|
||||||
btScalar m_ccdMotionThreshold;
|
btTransformFloatData m_interpolationWorldTransform;
|
||||||
|
btVector3FloatData m_interpolationLinearVelocity;
|
||||||
|
btVector3FloatData m_interpolationAngularVelocity;
|
||||||
|
btVector3FloatData m_anisotropicFriction;
|
||||||
|
float m_contactProcessingThreshold;
|
||||||
|
float m_deactivationTime;
|
||||||
|
float m_friction;
|
||||||
|
float m_restitution;
|
||||||
|
float m_hitFraction;
|
||||||
|
float m_ccdSweptSphereRadius;
|
||||||
|
float m_ccdMotionThreshold;
|
||||||
|
|
||||||
|
int m_hasAnisotropicFriction;
|
||||||
|
int m_collisionFlags;
|
||||||
|
int m_islandTag1;
|
||||||
|
int m_companionId;
|
||||||
|
int m_activationState1;
|
||||||
|
int m_internalType;
|
||||||
int m_checkCollideWith;
|
int m_checkCollideWith;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE int btCollisionObject::calculateSerializeBufferSize() const
|
SIMD_FORCE_INLINE int btCollisionObject::calculateSerializeBufferSize() const
|
||||||
{
|
{
|
||||||
return sizeof(btCollisionObjectData);
|
return sizeof(btCollisionObjectData);
|
||||||
@@ -491,7 +532,7 @@ SIMD_FORCE_INLINE const char* btCollisionObject::serialize(void* dataBuffer) con
|
|||||||
dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
|
dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
|
||||||
dataOut->m_checkCollideWith = m_checkCollideWith;
|
dataOut->m_checkCollideWith = m_checkCollideWith;
|
||||||
|
|
||||||
return "btCollisionObjectData";
|
return btCollisionObjectDataName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -189,22 +189,32 @@ bool btConvexHullShape::isInside(const btVector3& ,btScalar ) const
|
|||||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||||
const char* btConvexHullShape::serialize(void* dataBuffer, btSerializer* serializer) const
|
const char* btConvexHullShape::serialize(void* dataBuffer, btSerializer* serializer) const
|
||||||
{
|
{
|
||||||
|
int szc = sizeof(btConvexHullShapeData);
|
||||||
btConvexHullShapeData* shapeData = (btConvexHullShapeData*) dataBuffer;
|
btConvexHullShapeData* shapeData = (btConvexHullShapeData*) dataBuffer;
|
||||||
btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData, serializer);
|
btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData, serializer);
|
||||||
|
|
||||||
int numElem = m_unscaledPoints.size();
|
int numElem = m_unscaledPoints.size();
|
||||||
shapeData->m_numUnscaledPoints = numElem;
|
shapeData->m_numUnscaledPoints = numElem;
|
||||||
shapeData->m_unscaledPointsPtr = numElem ? (btVector3Data*)&m_unscaledPoints[0]: 0;
|
#ifdef BT_USE_DOUBLE_PRECISION
|
||||||
|
shapeData->m_unscaledPointsFloatPtr = 0;
|
||||||
|
shapeData->m_unscaledPointsDoublePtr = numElem ? (btVector3Data*)&m_unscaledPoints[0]: 0;
|
||||||
|
#else
|
||||||
|
shapeData->m_unscaledPointsFloatPtr = numElem ? (btVector3Data*)&m_unscaledPoints[0]: 0;
|
||||||
|
shapeData->m_unscaledPointsDoublePtr = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (numElem)
|
if (numElem)
|
||||||
{
|
{
|
||||||
btChunk* chunk = serializer->allocate(sizeof(btVector3Data),numElem);
|
int sz = sizeof(btVector3Data);
|
||||||
|
int sz2 = sizeof(btVector3DoubleData);
|
||||||
|
int sz3 = sizeof(btVector3FloatData);
|
||||||
|
btChunk* chunk = serializer->allocate(sz,numElem);
|
||||||
btVector3Data* memPtr = (btVector3Data*)chunk->m_oldPtr;
|
btVector3Data* memPtr = (btVector3Data*)chunk->m_oldPtr;
|
||||||
for (int i=0;i<numElem;i++,memPtr++)
|
for (int i=0;i<numElem;i++,memPtr++)
|
||||||
{
|
{
|
||||||
m_unscaledPoints[i].serialize(*memPtr);
|
m_unscaledPoints[i].serialize(*memPtr);
|
||||||
}
|
}
|
||||||
serializer->finalizeChunk(chunk,"btVector3Data",BT_ARRAY_CODE,(void*)&m_unscaledPoints[0]);
|
serializer->finalizeChunk(chunk,btVector3DataName,BT_ARRAY_CODE,(void*)&m_unscaledPoints[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return "btConvexHullShapeData";
|
return "btConvexHullShapeData";
|
||||||
|
|||||||
@@ -101,12 +101,15 @@ struct btConvexHullShapeData
|
|||||||
{
|
{
|
||||||
btConvexInternalShapeData m_convexInternalShapeData;
|
btConvexInternalShapeData m_convexInternalShapeData;
|
||||||
|
|
||||||
btVector3Data *m_unscaledPointsPtr;
|
btVector3FloatData *m_unscaledPointsFloatPtr;
|
||||||
|
btVector3DoubleData *m_unscaledPointsDoublePtr;
|
||||||
|
|
||||||
int m_numUnscaledPoints;
|
int m_numUnscaledPoints;
|
||||||
char m_padding[4];
|
char m_padding3[4];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE int btConvexHullShape::calculateSerializeBufferSize()
|
SIMD_FORCE_INLINE int btConvexHullShape::calculateSerializeBufferSize()
|
||||||
{
|
{
|
||||||
return sizeof(btConvexHullShapeData);
|
return sizeof(btConvexHullShapeData);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ subject to the following restrictions:
|
|||||||
#include "btConvexShape.h"
|
#include "btConvexShape.h"
|
||||||
#include "LinearMath/btAabbUtil2.h"
|
#include "LinearMath/btAabbUtil2.h"
|
||||||
|
|
||||||
|
|
||||||
///The btConvexInternalShape is an internal base class, shared by most convex shape implementations.
|
///The btConvexInternalShape is an internal base class, shared by most convex shape implementations.
|
||||||
class btConvexInternalShape : public btConvexShape
|
class btConvexInternalShape : public btConvexShape
|
||||||
{
|
{
|
||||||
@@ -118,19 +119,17 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct btConvexInternalShapeData
|
struct btConvexInternalShapeData
|
||||||
{
|
{
|
||||||
btCollisionShapeData m_collisionShapeData;
|
btCollisionShapeData m_collisionShapeData;
|
||||||
|
|
||||||
btVector3Data m_localScaling;
|
btVector3FloatData m_localScaling;
|
||||||
|
|
||||||
btVector3Data m_implicitShapeDimensions;
|
btVector3FloatData m_implicitShapeDimensions;
|
||||||
|
|
||||||
btScalar m_collisionMargin;
|
float m_collisionMargin;
|
||||||
|
|
||||||
char m_padding[4];
|
int m_padding;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -147,9 +146,9 @@ SIMD_FORCE_INLINE const char* btConvexInternalShape::serialize(void* dataBuffer,
|
|||||||
btConvexInternalShapeData* shapeData = (btConvexInternalShapeData*) dataBuffer;
|
btConvexInternalShapeData* shapeData = (btConvexInternalShapeData*) dataBuffer;
|
||||||
btCollisionShape::serialize(&shapeData->m_collisionShapeData, serializer);
|
btCollisionShape::serialize(&shapeData->m_collisionShapeData, serializer);
|
||||||
|
|
||||||
m_implicitShapeDimensions.serialize(shapeData->m_implicitShapeDimensions);
|
m_implicitShapeDimensions.serializeFloat(shapeData->m_implicitShapeDimensions);
|
||||||
m_localScaling.serialize(shapeData->m_localScaling);
|
m_localScaling.serializeFloat(shapeData->m_localScaling);
|
||||||
shapeData->m_collisionMargin = m_collisionMargin;
|
shapeData->m_collisionMargin = float(m_collisionMargin);
|
||||||
|
|
||||||
return "btConvexInternalShapeData";
|
return "btConvexInternalShapeData";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,8 +155,8 @@ const char* btMultiSphereShape::serialize(void* dataBuffer, btSerializer* serial
|
|||||||
btPositionAndRadius* memPtr = (btPositionAndRadius*)chunk->m_oldPtr;
|
btPositionAndRadius* memPtr = (btPositionAndRadius*)chunk->m_oldPtr;
|
||||||
for (int i=0;i<numElem;i++,memPtr++)
|
for (int i=0;i<numElem;i++,memPtr++)
|
||||||
{
|
{
|
||||||
m_localPositionArray[i].serialize(memPtr->m_pos);
|
m_localPositionArray[i].serializeFloat(memPtr->m_pos);
|
||||||
memPtr->m_radius = m_radiArray[i];
|
memPtr->m_radius = float(m_radiArray[i]);
|
||||||
}
|
}
|
||||||
serializer->finalizeChunk(chunk,"btPositionAndRadius",BT_ARRAY_CODE,(void*)&m_localPositionArray[0]);
|
serializer->finalizeChunk(chunk,"btPositionAndRadius",BT_ARRAY_CODE,(void*)&m_localPositionArray[0]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ subject to the following restrictions:
|
|||||||
#include "LinearMath/btAlignedObjectArray.h"
|
#include "LinearMath/btAlignedObjectArray.h"
|
||||||
#include "LinearMath/btAabbUtil2.h"
|
#include "LinearMath/btAabbUtil2.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///The btMultiSphereShape represents the convex hull of a collection of spheres. You can create special capsules or other smooth volumes.
|
///The btMultiSphereShape represents the convex hull of a collection of spheres. You can create special capsules or other smooth volumes.
|
||||||
///It is possible to animate the spheres for deformation, but call 'recalcLocalAabb' after changing any sphere position/radius
|
///It is possible to animate the spheres for deformation, but call 'recalcLocalAabb' after changing any sphere position/radius
|
||||||
class btMultiSphereShape : public btConvexInternalAabbCachingShape
|
class btMultiSphereShape : public btConvexInternalAabbCachingShape
|
||||||
@@ -69,10 +71,11 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct btPositionAndRadius
|
struct btPositionAndRadius
|
||||||
{
|
{
|
||||||
btVector3Data m_pos;
|
btVector3FloatData m_pos;
|
||||||
btScalar m_radius;
|
float m_radius;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct btMultiSphereShapeData
|
struct btMultiSphereShapeData
|
||||||
@@ -82,9 +85,10 @@ struct btMultiSphereShapeData
|
|||||||
btPositionAndRadius *m_localPositionArrayPtr;
|
btPositionAndRadius *m_localPositionArrayPtr;
|
||||||
int m_localPositionArraySize;
|
int m_localPositionArraySize;
|
||||||
char m_padding[4];
|
char m_padding[4];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE int btMultiSphereShape::calculateSerializeBufferSize()
|
SIMD_FORCE_INLINE int btMultiSphereShape::calculateSerializeBufferSize()
|
||||||
{
|
{
|
||||||
return sizeof(btMultiSphereShapeData);
|
return sizeof(btMultiSphereShapeData);
|
||||||
|
|||||||
@@ -327,6 +327,6 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
m_scaling.serialize(trimeshData->m_scaling);
|
m_scaling.serializeFloat(trimeshData->m_scaling);
|
||||||
return "btStridingMeshInterfaceData";
|
return "btStridingMeshInterfaceData";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// The btStridingMeshInterface is the interface class for high performance generic access to triangle meshes, used in combination with btBvhTriangleMeshShape and some other collision shapes.
|
/// The btStridingMeshInterface is the interface class for high performance generic access to triangle meshes, used in combination with btBvhTriangleMeshShape and some other collision shapes.
|
||||||
/// Using index striding of 3*sizeof(integer) it can use triangle arrays, using index striding of 1*sizeof(integer) it can handle triangle strips.
|
/// Using index striding of 3*sizeof(integer) it can use triangle arrays, using index striding of 1*sizeof(integer) it can handle triangle strips.
|
||||||
/// It allows for sharing graphics and collision meshes. Also it provides locking/unlocking of graphics meshes that are in gpu memory.
|
/// It allows for sharing graphics and collision meshes. Also it provides locking/unlocking of graphics meshes that are in gpu memory.
|
||||||
@@ -118,19 +120,18 @@ struct btMeshPartData
|
|||||||
int m_numVertices;
|
int m_numVertices;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct btStridingMeshInterfaceData
|
struct btStridingMeshInterfaceData
|
||||||
{
|
{
|
||||||
btMeshPartData *m_meshPartsPtr;
|
btMeshPartData *m_meshPartsPtr;
|
||||||
|
btVector3FloatData m_scaling;
|
||||||
int m_numMeshParts;
|
int m_numMeshParts;
|
||||||
|
|
||||||
btVector3Data m_scaling;
|
|
||||||
|
|
||||||
char m_padding[4];
|
char m_padding[4];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE int btStridingMeshInterface::calculateSerializeBufferSize()
|
SIMD_FORCE_INLINE int btStridingMeshInterface::calculateSerializeBufferSize()
|
||||||
{
|
{
|
||||||
return sizeof(btStridingMeshInterfaceData);
|
return sizeof(btStridingMeshInterfaceData);
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ const char* btTriangleMeshShape::serialize(void* dataBuffer, btSerializer* seria
|
|||||||
|
|
||||||
m_meshInterface->serialize(&trimeshData->m_meshInterface, serializer);
|
m_meshInterface->serialize(&trimeshData->m_meshInterface, serializer);
|
||||||
|
|
||||||
trimeshData->m_collisionMargin = m_collisionMargin;
|
trimeshData->m_collisionMargin = float(m_collisionMargin);
|
||||||
|
|
||||||
return "btTriangleMeshShapeData";
|
return "btTriangleMeshShapeData";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ subject to the following restrictions:
|
|||||||
#include "btStridingMeshInterface.h"
|
#include "btStridingMeshInterface.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///The btTriangleMeshShape is an internal concave triangle mesh interface. Don't use this class directly, use btBvhTriangleMeshShape instead.
|
///The btTriangleMeshShape is an internal concave triangle mesh interface. Don't use this class directly, use btBvhTriangleMeshShape instead.
|
||||||
class btTriangleMeshShape : public btConcaveShape
|
class btTriangleMeshShape : public btConcaveShape
|
||||||
{
|
{
|
||||||
@@ -90,14 +91,16 @@ public:
|
|||||||
|
|
||||||
struct btTriangleMeshShapeData
|
struct btTriangleMeshShapeData
|
||||||
{
|
{
|
||||||
//btConcaveShapeData m_concaveShapeData;
|
|
||||||
btCollisionShapeData m_collisionShapeData;
|
btCollisionShapeData m_collisionShapeData;
|
||||||
|
|
||||||
btStridingMeshInterfaceData m_meshInterface;
|
btStridingMeshInterfaceData m_meshInterface;
|
||||||
|
|
||||||
btScalar m_collisionMargin;
|
float m_collisionMargin;
|
||||||
|
|
||||||
|
char m_padding[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE int btTriangleMeshShape::calculateSerializeBufferSize()
|
SIMD_FORCE_INLINE int btTriangleMeshShape::calculateSerializeBufferSize()
|
||||||
{
|
{
|
||||||
return sizeof(btTriangleMeshShapeData);
|
return sizeof(btTriangleMeshShapeData);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ protected:
|
|||||||
|
|
||||||
bool m_useGhostObjectSweepTest;
|
bool m_useGhostObjectSweepTest;
|
||||||
bool m_useWalkDirection;
|
bool m_useWalkDirection;
|
||||||
float m_velocityTimeInterval;
|
btScalar m_velocityTimeInterval;
|
||||||
int m_upAxis;
|
int m_upAxis;
|
||||||
|
|
||||||
btVector3 computeReflectionDirection (const btVector3& direction, const btVector3& normal);
|
btVector3 computeReflectionDirection (const btVector3& direction, const btVector3& normal);
|
||||||
|
|||||||
@@ -350,6 +350,6 @@ const char* btRigidBody::serialize(void* dataBuffer) const
|
|||||||
rbd->m_linearSleepingThreshold=m_linearSleepingThreshold;
|
rbd->m_linearSleepingThreshold=m_linearSleepingThreshold;
|
||||||
rbd->m_angularSleepingThreshold = m_angularSleepingThreshold;
|
rbd->m_angularSleepingThreshold = m_angularSleepingThreshold;
|
||||||
|
|
||||||
return "btRigidBodyData";
|
return btRigidBodyDataName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,16 @@ class btTypedConstraint;
|
|||||||
extern btScalar gDeactivationTime;
|
extern btScalar gDeactivationTime;
|
||||||
extern bool gDisableDeactivation;
|
extern bool gDisableDeactivation;
|
||||||
|
|
||||||
|
#ifdef BT_USE_DOUBLE_PRECISION
|
||||||
|
#define btRigidBodyData btRigidBodyDoubleData
|
||||||
|
#define btRigidBodyDataName "btRigidBodyDoubleData"
|
||||||
|
#else
|
||||||
|
#define btRigidBodyData btRigidBodyFloatData
|
||||||
|
#define btRigidBodyDataName "btRigidBodyFloatData"
|
||||||
|
#endif //BT_USE_DOUBLE_PRECISION
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///The btRigidBody is the main class for rigid body objects. It is derived from btCollisionObject, so it keeps a pointer to a btCollisionShape.
|
///The btRigidBody is the main class for rigid body objects. It is derived from btCollisionObject, so it keeps a pointer to a btCollisionShape.
|
||||||
///It is recommended for performance and memory use to share btCollisionShape objects whenever possible.
|
///It is recommended for performance and memory use to share btCollisionShape objects whenever possible.
|
||||||
@@ -504,36 +514,55 @@ public:
|
|||||||
|
|
||||||
//@todo add m_optionalMotionState and m_constraintRefs to btRigidBodyData
|
//@todo add m_optionalMotionState and m_constraintRefs to btRigidBodyData
|
||||||
///btRigidBodyData is used for btRigidBody serialization
|
///btRigidBodyData is used for btRigidBody serialization
|
||||||
struct btRigidBodyData
|
struct btRigidBodyFloatData
|
||||||
{
|
{
|
||||||
btCollisionObjectData m_collisionObjectData;
|
btCollisionObjectFloatData m_collisionObjectData;
|
||||||
|
btMatrix3x3FloatData m_invInertiaTensorWorld;
|
||||||
|
btVector3FloatData m_linearVelocity;
|
||||||
|
btVector3FloatData m_angularVelocity;
|
||||||
|
btVector3FloatData m_angularFactor;
|
||||||
|
btVector3FloatData m_linearFactor;
|
||||||
|
btVector3FloatData m_gravity;
|
||||||
|
btVector3FloatData m_gravity_acceleration;
|
||||||
|
btVector3FloatData m_invInertiaLocal;
|
||||||
|
btVector3FloatData m_totalForce;
|
||||||
|
btVector3FloatData m_totalTorque;
|
||||||
|
float m_inverseMass;
|
||||||
|
float m_linearDamping;
|
||||||
|
float m_angularDamping;
|
||||||
|
float m_additionalDampingFactor;
|
||||||
|
float m_additionalLinearDampingThresholdSqr;
|
||||||
|
float m_additionalAngularDampingThresholdSqr;
|
||||||
|
float m_additionalAngularDampingFactor;
|
||||||
|
float m_linearSleepingThreshold;
|
||||||
|
float m_angularSleepingThreshold;
|
||||||
|
int m_additionalDamping;
|
||||||
|
};
|
||||||
|
|
||||||
btMatrix3x3Data m_invInertiaTensorWorld;
|
struct btRigidBodyDoubleData
|
||||||
btVector3Data m_linearVelocity;
|
{
|
||||||
btVector3Data m_angularVelocity;
|
btCollisionObjectDoubleData m_collisionObjectData;
|
||||||
btScalar m_inverseMass;
|
btMatrix3x3DoubleData m_invInertiaTensorWorld;
|
||||||
btVector3Data m_angularFactor;
|
btVector3DoubleData m_linearVelocity;
|
||||||
btVector3Data m_linearFactor;
|
btVector3DoubleData m_angularVelocity;
|
||||||
|
btVector3DoubleData m_angularFactor;
|
||||||
btVector3Data m_gravity;
|
btVector3DoubleData m_linearFactor;
|
||||||
btVector3Data m_gravity_acceleration;
|
btVector3DoubleData m_gravity;
|
||||||
btVector3Data m_invInertiaLocal;
|
btVector3DoubleData m_gravity_acceleration;
|
||||||
btVector3Data m_totalForce;
|
btVector3DoubleData m_invInertiaLocal;
|
||||||
btVector3Data m_totalTorque;
|
btVector3DoubleData m_totalForce;
|
||||||
|
btVector3DoubleData m_totalTorque;
|
||||||
btScalar m_linearDamping;
|
double m_inverseMass;
|
||||||
btScalar m_angularDamping;
|
double m_linearDamping;
|
||||||
|
double m_angularDamping;
|
||||||
int m_additionalDamping;
|
double m_additionalDampingFactor;
|
||||||
btScalar m_additionalDampingFactor;
|
double m_additionalLinearDampingThresholdSqr;
|
||||||
btScalar m_additionalLinearDampingThresholdSqr;
|
double m_additionalAngularDampingThresholdSqr;
|
||||||
btScalar m_additionalAngularDampingThresholdSqr;
|
double m_additionalAngularDampingFactor;
|
||||||
btScalar m_additionalAngularDampingFactor;
|
double m_linearSleepingThreshold;
|
||||||
|
double m_angularSleepingThreshold;
|
||||||
|
int m_additionalDamping;
|
||||||
btScalar m_linearSleepingThreshold;
|
char m_padding[4];
|
||||||
btScalar m_angularSleepingThreshold;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1011,9 +1011,9 @@ bool HullLibrary::CleanupVertices(unsigned int svcount,
|
|||||||
btScalar y = v[1];
|
btScalar y = v[1];
|
||||||
btScalar z = v[2];
|
btScalar z = v[2];
|
||||||
|
|
||||||
btScalar dx = fabsf(x - px );
|
btScalar dx = btFabs(x - px );
|
||||||
btScalar dy = fabsf(y - py );
|
btScalar dy = btFabs(y - py );
|
||||||
btScalar dz = fabsf(z - pz );
|
btScalar dz = btFabs(z - pz );
|
||||||
|
|
||||||
if ( dx < normalepsilon && dy < normalepsilon && dz < normalepsilon )
|
if ( dx < normalepsilon && dy < normalepsilon && dz < normalepsilon )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ subject to the following restrictions:
|
|||||||
#include "btVector3.h"
|
#include "btVector3.h"
|
||||||
#include "btQuaternion.h"
|
#include "btQuaternion.h"
|
||||||
|
|
||||||
|
#ifdef BT_USE_DOUBLE_PRECISION
|
||||||
|
#define btMatrix3x3Data btMatrix3x3DoubleData
|
||||||
|
#else
|
||||||
|
#define btMatrix3x3Data btMatrix3x3FloatData
|
||||||
|
#endif //BT_USE_DOUBLE_PRECISION
|
||||||
|
|
||||||
|
|
||||||
/**@brief The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with btQuaternion, btTransform and btVector3.
|
/**@brief The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with btQuaternion, btTransform and btVector3.
|
||||||
@@ -500,6 +505,10 @@ public:
|
|||||||
|
|
||||||
void deSerialize(const struct btMatrix3x3Data& dataIn);
|
void deSerialize(const struct btMatrix3x3Data& dataIn);
|
||||||
|
|
||||||
|
void deSerializeFloat(const struct btMatrix3x3FloatData& dataIn);
|
||||||
|
|
||||||
|
void deSerializeDouble(const struct btMatrix3x3DoubleData& dataIn);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -628,11 +637,18 @@ SIMD_FORCE_INLINE bool operator==(const btMatrix3x3& m1, const btMatrix3x3& m2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
///for serialization
|
///for serialization
|
||||||
struct btMatrix3x3Data
|
struct btMatrix3x3FloatData
|
||||||
{
|
{
|
||||||
btVector3Data m_el[3];
|
btVector3FloatData m_el[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
///for serialization
|
||||||
|
struct btMatrix3x3DoubleData
|
||||||
|
{
|
||||||
|
btVector3DoubleData m_el[3];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE void btMatrix3x3::serialize(struct btMatrix3x3Data& dataOut) const
|
SIMD_FORCE_INLINE void btMatrix3x3::serialize(struct btMatrix3x3Data& dataOut) const
|
||||||
{
|
{
|
||||||
@@ -640,11 +656,24 @@ SIMD_FORCE_INLINE void btMatrix3x3::serialize(struct btMatrix3x3Data& dataOut) c
|
|||||||
m_el[i].serialize(dataOut.m_el[i]);
|
m_el[i].serialize(dataOut.m_el[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE void btMatrix3x3::deSerialize(const struct btMatrix3x3Data& dataIn)
|
SIMD_FORCE_INLINE void btMatrix3x3::deSerialize(const struct btMatrix3x3Data& dataIn)
|
||||||
{
|
{
|
||||||
for (int i=0;i<3;i++)
|
for (int i=0;i<3;i++)
|
||||||
m_el[i].deSerialize(dataIn.m_el[i]);
|
m_el[i].deSerialize(dataIn.m_el[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void btMatrix3x3::deSerializeFloat(const struct btMatrix3x3FloatData& dataIn)
|
||||||
|
{
|
||||||
|
for (int i=0;i<3;i++)
|
||||||
|
m_el[i].deSerializeFloat(dataIn.m_el[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void btMatrix3x3::deSerializeDouble(const struct btMatrix3x3DoubleData& dataIn)
|
||||||
|
{
|
||||||
|
for (int i=0;i<3;i++)
|
||||||
|
m_el[i].deSerializeDouble(dataIn.m_el[i]);
|
||||||
|
}
|
||||||
|
|
||||||
#endif //BT_MATRIX3x3_H
|
#endif //BT_MATRIX3x3_H
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
unsigned char sBulletDNAstr[]= {
|
|
||||||
83,68,78,65,78,65,77,69,83,0,0,0,109,95,115,105,122,101,0,109,
|
unsigned char sBulletDNAstr64[]= {
|
||||||
|
83,68,78,65,78,65,77,69,85,0,0,0,109,95,115,105,122,101,0,109,
|
||||||
95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
|
95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
|
||||||
99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
|
99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
|
||||||
108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
|
108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
|
||||||
@@ -12,115 +13,275 @@ unsigned char sBulletDNAstr[]= {
|
|||||||
109,95,108,111,99,97,108,83,99,97,108,105,110,103,0,109,95,105,109,112,
|
109,95,108,111,99,97,108,83,99,97,108,105,110,103,0,109,95,105,109,112,
|
||||||
108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
|
108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
|
||||||
0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
|
0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
|
||||||
95,112,111,115,0,109,95,114,97,100,105,117,115,0,109,95,99,111,110,118,
|
95,112,97,100,100,105,110,103,0,109,95,112,111,115,0,109,95,114,97,100,
|
||||||
101,120,73,110,116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,
|
105,117,115,0,109,95,99,111,110,118,101,120,73,110,116,101,114,110,97,108,
|
||||||
42,109,95,108,111,99,97,108,80,111,115,105,116,105,111,110,65,114,114,97,
|
83,104,97,112,101,68,97,116,97,0,42,109,95,108,111,99,97,108,80,111,
|
||||||
121,80,116,114,0,109,95,108,111,99,97,108,80,111,115,105,116,105,111,110,
|
115,105,116,105,111,110,65,114,114,97,121,80,116,114,0,109,95,108,111,99,
|
||||||
65,114,114,97,121,83,105,122,101,0,109,95,118,97,108,117,101,0,105,110,
|
97,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0,
|
||||||
116,0,42,109,95,118,101,114,116,105,99,101,115,51,102,0,42,109,95,118,
|
109,95,118,97,108,117,101,0,105,110,116,0,42,109,95,118,101,114,116,105,
|
||||||
101,114,116,105,99,101,115,51,100,0,42,109,95,105,110,100,105,99,101,115,
|
99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115,51,100,0,
|
||||||
51,50,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,117,
|
42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,105,110,100,105,
|
||||||
109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,116,
|
99,101,115,49,54,0,109,95,110,117,109,84,114,105,97,110,103,108,101,115,
|
||||||
105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,114,
|
0,109,95,110,117,109,86,101,114,116,105,99,101,115,0,42,109,95,109,101,
|
||||||
0,109,95,110,117,109,77,101,115,104,80,97,114,116,115,0,109,95,115,99,
|
115,104,80,97,114,116,115,80,116,114,0,109,95,115,99,97,108,105,110,103,
|
||||||
97,108,105,110,103,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,
|
0,109,95,110,117,109,77,101,115,104,80,97,114,116,115,0,109,95,109,101,
|
||||||
112,101,68,97,116,97,0,109,95,109,101,115,104,73,110,116,101,114,102,97,
|
115,104,73,110,116,101,114,102,97,99,101,0,42,109,95,117,110,115,99,97,
|
||||||
99,101,0,42,109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,
|
108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42,109,
|
||||||
80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,111,105,
|
95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98,108,
|
||||||
110,116,115,0,109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,
|
101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,111,
|
||||||
0,109,95,105,110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,
|
105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0,42,
|
||||||
100,84,114,97,110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,
|
109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0,42,
|
||||||
108,97,116,105,111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,
|
109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109,95,
|
||||||
0,109,95,105,110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,
|
114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,
|
||||||
108,97,114,86,101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,
|
109,95,117,115,101,114,79,98,106,101,99,116,80,111,105,110,116,101,114,0,
|
||||||
114,111,112,105,99,70,114,105,99,116,105,111,110,0,109,95,104,97,115,65,
|
109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,
|
||||||
110,105,115,111,116,114,111,112,105,99,70,114,105,99,116,105,111,110,0,109,
|
110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,
|
||||||
95,99,111,110,116,97,99,116,80,114,111,99,101,115,115,105,110,103,84,104,
|
110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,
|
||||||
114,101,115,104,111,108,100,0,42,109,95,98,114,111,97,100,112,104,97,115,
|
111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,
|
||||||
101,72,97,110,100,108,101,0,42,109,95,99,111,108,108,105,115,105,111,110,
|
110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,
|
||||||
83,104,97,112,101,0,42,109,95,114,111,111,116,67,111,108,108,105,115,105,
|
101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,
|
||||||
111,110,83,104,97,112,101,0,109,95,99,111,108,108,105,115,105,111,110,70,
|
99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80,
|
||||||
108,97,103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,
|
114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109,
|
||||||
99,111,109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,
|
95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,
|
||||||
116,105,111,110,83,116,97,116,101,49,0,109,95,100,101,97,99,116,105,118,
|
102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,
|
||||||
97,116,105,111,110,84,105,109,101,0,109,95,102,114,105,99,116,105,111,110,
|
111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99,
|
||||||
0,109,95,114,101,115,116,105,116,117,116,105,111,110,0,109,95,105,110,116,
|
99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0,
|
||||||
101,114,110,97,108,84,121,112,101,0,42,109,95,117,115,101,114,79,98,106,
|
109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100,
|
||||||
101,99,116,80,111,105,110,116,101,114,0,109,95,104,105,116,70,114,97,99,
|
0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,
|
||||||
116,105,111,110,0,109,95,99,99,100,83,119,101,112,116,83,112,104,101,114,
|
99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,
|
||||||
101,82,97,100,105,117,115,0,109,95,99,99,100,77,111,116,105,111,110,84,
|
103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,
|
||||||
104,114,101,115,104,111,108,100,0,109,95,99,104,101,99,107,67,111,108,108,
|
109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,
|
||||||
105,100,101,87,105,116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,
|
111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84,
|
||||||
98,106,101,99,116,68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,
|
121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
|
||||||
105,97,84,101,110,115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,
|
116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
|
||||||
97,114,86,101,108,111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,
|
68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
|
||||||
86,101,108,111,99,105,116,121,0,109,95,105,110,118,101,114,115,101,77,97,
|
115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
|
||||||
115,115,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,109,
|
111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
|
||||||
95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,118,
|
105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,
|
||||||
105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,101,
|
109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,
|
||||||
114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,76,
|
118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,
|
||||||
111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,95,
|
101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,
|
||||||
116,111,116,97,108,84,111,114,113,117,101,0,109,95,108,105,110,101,97,114,
|
76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,
|
||||||
68,97,109,112,105,110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,
|
95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114,
|
||||||
112,105,110,103,0,109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,
|
115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
|
||||||
112,105,110,103,0,109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,
|
110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
|
||||||
112,105,110,103,70,97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,
|
109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
|
||||||
110,97,108,76,105,110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,
|
97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
|
||||||
115,104,111,108,100,83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,
|
110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
|
||||||
108,65,110,103,117,108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,
|
83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
|
||||||
104,111,108,100,83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,
|
108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
|
||||||
65,110,103,117,108,97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,
|
113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
|
||||||
0,109,95,108,105,110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,
|
97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
|
||||||
101,115,104,111,108,100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,
|
110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
|
||||||
112,105,110,103,84,104,114,101,115,104,111,108,100,0,0,0,84,89,80,69,
|
100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
|
||||||
32,0,0,0,99,104,97,114,0,117,99,104,97,114,0,115,104,111,114,116,
|
104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97,
|
||||||
0,117,115,104,111,114,116,0,105,110,116,0,108,111,110,103,0,117,108,111,
|
108,68,97,109,112,105,110,103,0,0,0,0,84,89,80,69,33,0,0,0,
|
||||||
110,103,0,102,108,111,97,116,0,100,111,117,98,108,101,0,118,111,105,100,
|
99,104,97,114,0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,
|
||||||
0,98,116,83,99,97,108,97,114,0,80,111,105,110,116,101,114,65,114,114,
|
111,114,116,0,105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,
|
||||||
97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,109,0,76,
|
108,111,97,116,0,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,
|
||||||
105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,68,97,116,
|
110,116,101,114,65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,
|
||||||
97,0,98,116,86,101,99,116,111,114,51,70,108,111,97,116,68,97,116,97,
|
121,115,116,101,109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,
|
||||||
0,98,116,86,101,99,116,111,114,51,68,111,117,98,108,101,68,97,116,97,
|
116,111,114,51,70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,
|
||||||
0,98,116,77,97,116,114,105,120,51,120,51,68,97,116,97,0,98,116,84,
|
111,114,51,68,111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,
|
||||||
114,97,110,115,102,111,114,109,68,97,116,97,0,98,116,67,111,108,108,105,
|
105,120,51,120,51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,
|
||||||
115,105,111,110,83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,
|
114,105,120,51,120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,
|
||||||
101,120,73,110,116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,
|
114,97,110,115,102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,
|
||||||
98,116,80,111,115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,
|
84,114,97,110,115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,
|
||||||
98,116,77,117,108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,
|
98,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,68,97,116,97,
|
||||||
116,97,0,98,116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,
|
0,98,116,67,111,110,118,101,120,73,110,116,101,114,110,97,108,83,104,97,
|
||||||
83,104,111,114,116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,
|
112,101,68,97,116,97,0,98,116,80,111,115,105,116,105,111,110,65,110,100,
|
||||||
77,101,115,104,80,97,114,116,68,97,116,97,0,98,116,83,116,114,105,100,
|
82,97,100,105,117,115,0,98,116,77,117,108,116,105,83,112,104,101,114,101,
|
||||||
105,110,103,77,101,115,104,73,110,116,101,114,102,97,99,101,68,97,116,97,
|
83,104,97,112,101,68,97,116,97,0,98,116,73,110,116,73,110,100,101,120,
|
||||||
0,98,116,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,
|
68,97,116,97,0,98,116,83,104,111,114,116,73,110,116,73,110,100,101,120,
|
||||||
68,97,116,97,0,109,95,99,111,110,99,97,118,101,83,104,97,112,101,68,
|
68,97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,
|
||||||
97,116,97,59,0,98,116,67,111,110,118,101,120,72,117,108,108,83,104,97,
|
98,116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,
|
||||||
112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,79,98,
|
97,99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,
|
||||||
106,101,99,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
|
115,104,83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,
|
||||||
68,97,116,97,0,0,0,0,84,76,69,78,1,0,1,0,2,0,2,0,
|
72,117,108,108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,
|
||||||
4,0,4,0,4,0,4,0,8,0,0,0,4,0,12,0,36,0,8,0,
|
105,115,105,111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,
|
||||||
16,0,16,0,32,0,48,0,64,0,12,0,52,0,20,0,64,0,4,0,
|
97,0,98,116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,
|
||||||
4,0,24,0,28,0,0,0,0,0,64,0,-8,0,-32,1,83,84,82,67,
|
108,111,97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
|
||||||
20,0,0,0,11,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,
|
70,108,111,97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,
|
||||||
12,0,3,0,11,0,3,0,11,0,4,0,11,0,5,0,13,0,2,0,
|
121,68,111,117,98,108,101,68,97,116,97,0,84,76,69,78,1,0,1,0,
|
||||||
9,0,6,0,9,0,7,0,14,0,1,0,10,0,8,0,15,0,1,0,
|
2,0,2,0,4,0,4,0,4,0,4,0,8,0,0,0,16,0,48,0,
|
||||||
7,0,8,0,16,0,1,0,8,0,8,0,17,0,1,0,14,0,9,0,
|
16,0,16,0,32,0,48,0,96,0,64,0,-128,0,16,0,56,0,20,0,
|
||||||
18,0,2,0,17,0,10,0,14,0,11,0,19,0,3,0,9,0,12,0,
|
72,0,4,0,4,0,40,0,32,0,56,0,80,0,-40,1,8,1,-16,1,
|
||||||
4,0,13,0,0,0,14,0,20,0,5,0,19,0,15,0,14,0,16,0,
|
-88,3,0,0,83,84,82,67,23,0,0,0,10,0,3,0,4,0,0,0,
|
||||||
14,0,17,0,10,0,18,0,0,0,14,0,21,0,2,0,14,0,19,0,
|
4,0,1,0,9,0,2,0,11,0,3,0,10,0,3,0,10,0,4,0,
|
||||||
10,0,20,0,22,0,4,0,20,0,21,0,21,0,22,0,4,0,23,0,
|
10,0,5,0,12,0,2,0,9,0,6,0,9,0,7,0,13,0,1,0,
|
||||||
0,0,14,0,23,0,1,0,4,0,24,0,24,0,2,0,2,0,25,0,
|
7,0,8,0,14,0,1,0,8,0,8,0,15,0,1,0,13,0,9,0,
|
||||||
2,0,24,0,25,0,6,0,15,0,26,0,16,0,27,0,23,0,28,0,
|
16,0,1,0,14,0,9,0,17,0,2,0,15,0,10,0,13,0,11,0,
|
||||||
24,0,29,0,4,0,30,0,4,0,31,0,26,0,4,0,25,0,32,0,
|
18,0,2,0,16,0,10,0,14,0,11,0,19,0,3,0,9,0,12,0,
|
||||||
4,0,33,0,14,0,34,0,0,0,14,0,27,0,4,0,28,0,35,0,
|
4,0,13,0,0,0,14,0,20,0,5,0,19,0,15,0,13,0,16,0,
|
||||||
28,0,15,0,26,0,36,0,10,0,18,0,29,0,4,0,20,0,21,0,
|
13,0,17,0,7,0,18,0,4,0,19,0,21,0,2,0,13,0,20,0,
|
||||||
14,0,37,0,4,0,38,0,0,0,14,0,30,0,23,0,18,0,39,0,
|
7,0,21,0,22,0,4,0,20,0,22,0,21,0,23,0,4,0,24,0,
|
||||||
18,0,40,0,14,0,41,0,14,0,42,0,14,0,43,0,4,0,44,0,
|
0,0,14,0,23,0,1,0,4,0,25,0,24,0,2,0,2,0,26,0,
|
||||||
10,0,45,0,9,0,46,0,9,0,47,0,19,0,48,0,4,0,49,0,
|
2,0,25,0,25,0,6,0,13,0,27,0,14,0,28,0,23,0,29,0,
|
||||||
4,0,50,0,4,0,51,0,4,0,52,0,10,0,53,0,10,0,54,0,
|
24,0,30,0,4,0,31,0,4,0,32,0,26,0,4,0,25,0,33,0,
|
||||||
10,0,55,0,4,0,56,0,9,0,57,0,10,0,58,0,10,0,59,0,
|
13,0,34,0,4,0,35,0,0,0,14,0,27,0,4,0,19,0,15,0,
|
||||||
10,0,60,0,4,0,61,0,31,0,21,0,30,0,62,0,17,0,63,0,
|
26,0,36,0,7,0,18,0,0,0,14,0,28,0,5,0,20,0,22,0,
|
||||||
14,0,64,0,14,0,65,0,10,0,66,0,14,0,67,0,14,0,68,0,
|
13,0,37,0,14,0,38,0,4,0,39,0,0,0,40,0,29,0,24,0,
|
||||||
14,0,69,0,14,0,70,0,14,0,71,0,14,0,72,0,14,0,73,0,
|
9,0,41,0,9,0,42,0,19,0,43,0,9,0,44,0,18,0,45,0,
|
||||||
10,0,74,0,10,0,75,0,4,0,76,0,10,0,77,0,10,0,78,0,
|
18,0,46,0,14,0,47,0,14,0,48,0,14,0,49,0,8,0,50,0,
|
||||||
10,0,79,0,10,0,80,0,10,0,81,0,10,0,82,0,};
|
8,0,51,0,8,0,52,0,8,0,53,0,8,0,54,0,8,0,55,0,
|
||||||
|
8,0,56,0,4,0,57,0,4,0,58,0,4,0,59,0,4,0,60,0,
|
||||||
|
4,0,61,0,4,0,62,0,4,0,63,0,0,0,14,0,30,0,23,0,
|
||||||
|
9,0,41,0,9,0,42,0,19,0,43,0,9,0,44,0,17,0,45,0,
|
||||||
|
17,0,46,0,13,0,47,0,13,0,48,0,13,0,49,0,7,0,50,0,
|
||||||
|
7,0,51,0,7,0,52,0,7,0,53,0,7,0,54,0,7,0,55,0,
|
||||||
|
7,0,56,0,4,0,57,0,4,0,58,0,4,0,59,0,4,0,60,0,
|
||||||
|
4,0,61,0,4,0,62,0,4,0,63,0,31,0,21,0,30,0,64,0,
|
||||||
|
15,0,65,0,13,0,66,0,13,0,67,0,13,0,68,0,13,0,69,0,
|
||||||
|
13,0,70,0,13,0,71,0,13,0,72,0,13,0,73,0,13,0,74,0,
|
||||||
|
7,0,75,0,7,0,76,0,7,0,77,0,7,0,78,0,7,0,79,0,
|
||||||
|
7,0,80,0,7,0,81,0,7,0,82,0,7,0,83,0,4,0,84,0,
|
||||||
|
32,0,22,0,29,0,64,0,16,0,65,0,14,0,66,0,14,0,67,0,
|
||||||
|
14,0,68,0,14,0,69,0,14,0,70,0,14,0,71,0,14,0,72,0,
|
||||||
|
14,0,73,0,14,0,74,0,8,0,75,0,8,0,76,0,8,0,77,0,
|
||||||
|
8,0,78,0,8,0,79,0,8,0,80,0,8,0,81,0,8,0,82,0,
|
||||||
|
8,0,83,0,4,0,84,0,0,0,14,0,};
|
||||||
|
int sBulletDNAlen64= sizeof(sBulletDNAstr64);
|
||||||
|
|
||||||
|
|
||||||
|
unsigned char sBulletDNAstr[]= {
|
||||||
|
83,68,78,65,78,65,77,69,85,0,0,0,109,95,115,105,122,101,0,109,
|
||||||
|
95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
|
||||||
|
99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
|
||||||
|
108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
|
||||||
|
115,116,114,97,105,110,116,115,0,42,102,105,114,115,116,0,42,108,97,115,
|
||||||
|
116,0,109,95,102,108,111,97,116,115,91,52,93,0,109,95,101,108,91,51,
|
||||||
|
93,0,109,95,98,97,115,105,115,0,109,95,111,114,105,103,105,110,0,42,
|
||||||
|
109,95,117,115,101,114,80,111,105,110,116,101,114,0,109,95,115,104,97,112,
|
||||||
|
101,84,121,112,101,0,109,95,112,97,100,100,105,110,103,91,52,93,0,109,
|
||||||
|
95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,68,97,116,97,0,
|
||||||
|
109,95,108,111,99,97,108,83,99,97,108,105,110,103,0,109,95,105,109,112,
|
||||||
|
108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
|
||||||
|
0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
|
||||||
|
95,112,97,100,100,105,110,103,0,109,95,112,111,115,0,109,95,114,97,100,
|
||||||
|
105,117,115,0,109,95,99,111,110,118,101,120,73,110,116,101,114,110,97,108,
|
||||||
|
83,104,97,112,101,68,97,116,97,0,42,109,95,108,111,99,97,108,80,111,
|
||||||
|
115,105,116,105,111,110,65,114,114,97,121,80,116,114,0,109,95,108,111,99,
|
||||||
|
97,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0,
|
||||||
|
109,95,118,97,108,117,101,0,105,110,116,0,42,109,95,118,101,114,116,105,
|
||||||
|
99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115,51,100,0,
|
||||||
|
42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,105,110,100,105,
|
||||||
|
99,101,115,49,54,0,109,95,110,117,109,84,114,105,97,110,103,108,101,115,
|
||||||
|
0,109,95,110,117,109,86,101,114,116,105,99,101,115,0,42,109,95,109,101,
|
||||||
|
115,104,80,97,114,116,115,80,116,114,0,109,95,115,99,97,108,105,110,103,
|
||||||
|
0,109,95,110,117,109,77,101,115,104,80,97,114,116,115,0,109,95,109,101,
|
||||||
|
115,104,73,110,116,101,114,102,97,99,101,0,42,109,95,117,110,115,99,97,
|
||||||
|
108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42,109,
|
||||||
|
95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98,108,
|
||||||
|
101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,111,
|
||||||
|
105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0,42,
|
||||||
|
109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0,42,
|
||||||
|
109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109,95,
|
||||||
|
114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,
|
||||||
|
109,95,117,115,101,114,79,98,106,101,99,116,80,111,105,110,116,101,114,0,
|
||||||
|
109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,
|
||||||
|
110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,
|
||||||
|
110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,
|
||||||
|
111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,
|
||||||
|
110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,
|
||||||
|
101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,
|
||||||
|
99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80,
|
||||||
|
114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109,
|
||||||
|
95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,
|
||||||
|
102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,
|
||||||
|
111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99,
|
||||||
|
99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0,
|
||||||
|
109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100,
|
||||||
|
0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,
|
||||||
|
99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,
|
||||||
|
103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,
|
||||||
|
109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,
|
||||||
|
111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84,
|
||||||
|
121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
|
||||||
|
116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
|
||||||
|
68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
|
||||||
|
115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
|
||||||
|
111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
|
||||||
|
105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,
|
||||||
|
109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,
|
||||||
|
118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,
|
||||||
|
101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,
|
||||||
|
76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,
|
||||||
|
95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114,
|
||||||
|
115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
|
||||||
|
110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
|
||||||
|
109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
|
||||||
|
97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
|
||||||
|
110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
|
||||||
|
83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
|
||||||
|
108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
|
||||||
|
113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
|
||||||
|
97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
|
||||||
|
110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
|
||||||
|
100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
|
||||||
|
104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97,
|
||||||
|
108,68,97,109,112,105,110,103,0,0,0,0,84,89,80,69,33,0,0,0,
|
||||||
|
99,104,97,114,0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,
|
||||||
|
111,114,116,0,105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,
|
||||||
|
108,111,97,116,0,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,
|
||||||
|
110,116,101,114,65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,
|
||||||
|
121,115,116,101,109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,
|
||||||
|
116,111,114,51,70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,
|
||||||
|
111,114,51,68,111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,
|
||||||
|
105,120,51,120,51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,
|
||||||
|
114,105,120,51,120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,
|
||||||
|
114,97,110,115,102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,
|
||||||
|
84,114,97,110,115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,
|
||||||
|
98,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,68,97,116,97,
|
||||||
|
0,98,116,67,111,110,118,101,120,73,110,116,101,114,110,97,108,83,104,97,
|
||||||
|
112,101,68,97,116,97,0,98,116,80,111,115,105,116,105,111,110,65,110,100,
|
||||||
|
82,97,100,105,117,115,0,98,116,77,117,108,116,105,83,112,104,101,114,101,
|
||||||
|
83,104,97,112,101,68,97,116,97,0,98,116,73,110,116,73,110,100,101,120,
|
||||||
|
68,97,116,97,0,98,116,83,104,111,114,116,73,110,116,73,110,100,101,120,
|
||||||
|
68,97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,
|
||||||
|
98,116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,
|
||||||
|
97,99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,
|
||||||
|
115,104,83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,
|
||||||
|
72,117,108,108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,
|
||||||
|
105,115,105,111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,
|
||||||
|
97,0,98,116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,
|
||||||
|
108,111,97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
|
||||||
|
70,108,111,97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,
|
||||||
|
121,68,111,117,98,108,101,68,97,116,97,0,84,76,69,78,1,0,1,0,
|
||||||
|
2,0,2,0,4,0,4,0,4,0,4,0,8,0,0,0,12,0,36,0,
|
||||||
|
8,0,16,0,32,0,48,0,96,0,64,0,-128,0,12,0,52,0,20,0,
|
||||||
|
64,0,4,0,4,0,24,0,28,0,48,0,68,0,-56,1,-8,0,-32,1,
|
||||||
|
-104,3,0,0,83,84,82,67,23,0,0,0,10,0,3,0,4,0,0,0,
|
||||||
|
4,0,1,0,9,0,2,0,11,0,3,0,10,0,3,0,10,0,4,0,
|
||||||
|
10,0,5,0,12,0,2,0,9,0,6,0,9,0,7,0,13,0,1,0,
|
||||||
|
7,0,8,0,14,0,1,0,8,0,8,0,15,0,1,0,13,0,9,0,
|
||||||
|
16,0,1,0,14,0,9,0,17,0,2,0,15,0,10,0,13,0,11,0,
|
||||||
|
18,0,2,0,16,0,10,0,14,0,11,0,19,0,3,0,9,0,12,0,
|
||||||
|
4,0,13,0,0,0,14,0,20,0,5,0,19,0,15,0,13,0,16,0,
|
||||||
|
13,0,17,0,7,0,18,0,4,0,19,0,21,0,2,0,13,0,20,0,
|
||||||
|
7,0,21,0,22,0,4,0,20,0,22,0,21,0,23,0,4,0,24,0,
|
||||||
|
0,0,14,0,23,0,1,0,4,0,25,0,24,0,2,0,2,0,26,0,
|
||||||
|
2,0,25,0,25,0,6,0,13,0,27,0,14,0,28,0,23,0,29,0,
|
||||||
|
24,0,30,0,4,0,31,0,4,0,32,0,26,0,4,0,25,0,33,0,
|
||||||
|
13,0,34,0,4,0,35,0,0,0,14,0,27,0,4,0,19,0,15,0,
|
||||||
|
26,0,36,0,7,0,18,0,0,0,14,0,28,0,5,0,20,0,22,0,
|
||||||
|
13,0,37,0,14,0,38,0,4,0,39,0,0,0,40,0,29,0,24,0,
|
||||||
|
9,0,41,0,9,0,42,0,19,0,43,0,9,0,44,0,18,0,45,0,
|
||||||
|
18,0,46,0,14,0,47,0,14,0,48,0,14,0,49,0,8,0,50,0,
|
||||||
|
8,0,51,0,8,0,52,0,8,0,53,0,8,0,54,0,8,0,55,0,
|
||||||
|
8,0,56,0,4,0,57,0,4,0,58,0,4,0,59,0,4,0,60,0,
|
||||||
|
4,0,61,0,4,0,62,0,4,0,63,0,0,0,14,0,30,0,23,0,
|
||||||
|
9,0,41,0,9,0,42,0,19,0,43,0,9,0,44,0,17,0,45,0,
|
||||||
|
17,0,46,0,13,0,47,0,13,0,48,0,13,0,49,0,7,0,50,0,
|
||||||
|
7,0,51,0,7,0,52,0,7,0,53,0,7,0,54,0,7,0,55,0,
|
||||||
|
7,0,56,0,4,0,57,0,4,0,58,0,4,0,59,0,4,0,60,0,
|
||||||
|
4,0,61,0,4,0,62,0,4,0,63,0,31,0,21,0,30,0,64,0,
|
||||||
|
15,0,65,0,13,0,66,0,13,0,67,0,13,0,68,0,13,0,69,0,
|
||||||
|
13,0,70,0,13,0,71,0,13,0,72,0,13,0,73,0,13,0,74,0,
|
||||||
|
7,0,75,0,7,0,76,0,7,0,77,0,7,0,78,0,7,0,79,0,
|
||||||
|
7,0,80,0,7,0,81,0,7,0,82,0,7,0,83,0,4,0,84,0,
|
||||||
|
32,0,22,0,29,0,64,0,16,0,65,0,14,0,66,0,14,0,67,0,
|
||||||
|
14,0,68,0,14,0,69,0,14,0,70,0,14,0,71,0,14,0,72,0,
|
||||||
|
14,0,73,0,14,0,74,0,8,0,75,0,8,0,76,0,8,0,77,0,
|
||||||
|
8,0,78,0,8,0,79,0,8,0,80,0,8,0,81,0,8,0,82,0,
|
||||||
|
8,0,83,0,4,0,84,0,0,0,14,0,};
|
||||||
int sBulletDNAlen= sizeof(sBulletDNAstr);
|
int sBulletDNAlen= sizeof(sBulletDNAstr);
|
||||||
|
|||||||
@@ -23,9 +23,14 @@ subject to the following restrictions:
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///only the 32bit versions for now
|
///only the 32bit versions for now
|
||||||
extern unsigned char sBulletDNAstr[];
|
extern unsigned char sBulletDNAstr[];
|
||||||
extern int sBulletDNAlen;
|
extern int sBulletDNAlen;
|
||||||
|
extern unsigned char sBulletDNAstr64[];
|
||||||
|
extern int sBulletDNAlen64;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class btChunk
|
class btChunk
|
||||||
{
|
{
|
||||||
@@ -263,12 +268,18 @@ public:
|
|||||||
|
|
||||||
if (VOID_IS_8)
|
if (VOID_IS_8)
|
||||||
{
|
{
|
||||||
//64bit not yet supported (soon)
|
//#if _WIN64
|
||||||
btAssert(0);
|
initDNA((const char*)sBulletDNAstr64,sBulletDNAlen64);
|
||||||
return;
|
//#else
|
||||||
|
// btAssert(0);
|
||||||
|
//#endif
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
//#ifndef _WIN64
|
||||||
initDNA((const char*)sBulletDNAstr,sBulletDNAlen);
|
initDNA((const char*)sBulletDNAstr,sBulletDNAlen);
|
||||||
|
//#else
|
||||||
|
// btAssert(0);
|
||||||
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -282,28 +293,35 @@ public:
|
|||||||
{
|
{
|
||||||
m_currentSize = BT_HEADER_LENGTH;
|
m_currentSize = BT_HEADER_LENGTH;
|
||||||
|
|
||||||
memcpy(m_buffer, "BULLET ", 7);
|
#ifdef BT_USE_DOUBLE_PRECISION
|
||||||
int endian= 1;
|
memcpy(m_buffer, "BULLETd", 7);
|
||||||
endian= ((char*)&endian)[0];
|
#else
|
||||||
|
memcpy(m_buffer, "BULLETf", 7);
|
||||||
|
#endif //BT_USE_DOUBLE_PRECISION
|
||||||
|
|
||||||
|
int littleEndian= 1;
|
||||||
|
littleEndian= ((char*)&littleEndian)[0];
|
||||||
|
|
||||||
if (endian)
|
|
||||||
{
|
|
||||||
m_buffer[7] = '_';
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
m_buffer[7] = '-';
|
|
||||||
}
|
|
||||||
if (sizeof(void*)==8)
|
if (sizeof(void*)==8)
|
||||||
{
|
{
|
||||||
m_buffer[8]='V';
|
m_buffer[7] = '-';
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
m_buffer[8]='v';
|
m_buffer[7] = '_';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (littleEndian)
|
||||||
|
{
|
||||||
|
m_buffer[8]='v';
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
m_buffer[8]='V';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
m_buffer[9] = '2';
|
m_buffer[9] = '2';
|
||||||
m_buffer[10] = '7';
|
m_buffer[10] = '7';
|
||||||
m_buffer[11] = '5';
|
m_buffer[11] = '6';
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -327,6 +345,7 @@ public:
|
|||||||
virtual void finalizeChunk(btChunk* chunk, const char* structType, int chunkCode,void* oldPtr) const
|
virtual void finalizeChunk(btChunk* chunk, const char* structType, int chunkCode,void* oldPtr) const
|
||||||
{
|
{
|
||||||
chunk->m_dna_nr = getReverseType(structType);
|
chunk->m_dna_nr = getReverseType(structType);
|
||||||
|
|
||||||
chunk->m_chunkCode = chunkCode;
|
chunk->m_chunkCode = chunkCode;
|
||||||
chunk->m_oldPtr = oldPtr;
|
chunk->m_oldPtr = oldPtr;
|
||||||
}
|
}
|
||||||
@@ -339,14 +358,14 @@ public:
|
|||||||
{
|
{
|
||||||
|
|
||||||
unsigned char* ptr = m_buffer+m_currentSize;
|
unsigned char* ptr = m_buffer+m_currentSize;
|
||||||
m_currentSize += size*numElements+sizeof(btChunk);
|
m_currentSize += int(size)*numElements+sizeof(btChunk);
|
||||||
|
|
||||||
unsigned char* data = ptr + sizeof(btChunk);
|
unsigned char* data = ptr + sizeof(btChunk);
|
||||||
|
|
||||||
btChunk* chunk = (btChunk*)ptr;
|
btChunk* chunk = (btChunk*)ptr;
|
||||||
chunk->m_chunkCode = 0;
|
chunk->m_chunkCode = 0;
|
||||||
chunk->m_oldPtr = data;
|
chunk->m_oldPtr = data;
|
||||||
chunk->m_length = size*numElements;
|
chunk->m_length = int(size)*numElements;
|
||||||
chunk->m_number = numElements;
|
chunk->m_number = numElements;
|
||||||
|
|
||||||
m_chunkPtrs.push_back(chunk);
|
m_chunkPtrs.push_back(chunk);
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
#include "btMatrix3x3.h"
|
#include "btMatrix3x3.h"
|
||||||
|
|
||||||
|
#ifdef BT_USE_DOUBLE_PRECISION
|
||||||
|
#define btTransformData btTransformDoubleData
|
||||||
|
#else
|
||||||
|
#define btTransformData btTransformFloatData
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**@brief The btTransform class supports rigid transforms with only translation and rotation and no scaling/shear.
|
/**@brief The btTransform class supports rigid transforms with only translation and rotation and no scaling/shear.
|
||||||
@@ -205,6 +212,10 @@ public:
|
|||||||
|
|
||||||
void deSerialize(const struct btTransformData& dataIn);
|
void deSerialize(const struct btTransformData& dataIn);
|
||||||
|
|
||||||
|
void deSerializeDouble(const struct btTransformDoubleData& dataIn);
|
||||||
|
|
||||||
|
void deSerializeFloat(const struct btTransformFloatData& dataIn);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -237,13 +248,22 @@ SIMD_FORCE_INLINE bool operator==(const btTransform& t1, const btTransform& t2)
|
|||||||
t1.getOrigin() == t2.getOrigin() );
|
t1.getOrigin() == t2.getOrigin() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///for serialization
|
///for serialization
|
||||||
struct btTransformData
|
struct btTransformFloatData
|
||||||
{
|
{
|
||||||
btMatrix3x3Data m_basis;
|
btMatrix3x3FloatData m_basis;
|
||||||
btVector3Data m_origin;
|
btVector3FloatData m_origin;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct btTransformDoubleData
|
||||||
|
{
|
||||||
|
btMatrix3x3DoubleData m_basis;
|
||||||
|
btVector3DoubleData m_origin;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE void btTransform::serialize(btTransformData& dataOut) const
|
SIMD_FORCE_INLINE void btTransform::serialize(btTransformData& dataOut) const
|
||||||
{
|
{
|
||||||
m_basis.serialize(dataOut.m_basis);
|
m_basis.serialize(dataOut.m_basis);
|
||||||
@@ -256,6 +276,19 @@ SIMD_FORCE_INLINE void btTransform::deSerialize(const btTransformData& dataIn)
|
|||||||
m_origin.deSerialize(dataIn.m_origin);
|
m_origin.deSerialize(dataIn.m_origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void btTransform::deSerializeFloat(const btTransformFloatData& dataIn)
|
||||||
|
{
|
||||||
|
m_basis.deSerializeFloat(dataIn.m_basis);
|
||||||
|
m_origin.deSerializeFloat(dataIn.m_origin);
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void btTransform::deSerializeDouble(const btTransformDoubleData& dataIn)
|
||||||
|
{
|
||||||
|
m_basis.deSerializeDouble(dataIn.m_basis);
|
||||||
|
m_origin.deSerializeDouble(dataIn.m_origin);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ subject to the following restrictions:
|
|||||||
#include "btScalar.h"
|
#include "btScalar.h"
|
||||||
#include "btMinMax.h"
|
#include "btMinMax.h"
|
||||||
|
|
||||||
|
#ifdef BT_USE_DOUBLE_PRECISION
|
||||||
|
#define btVector3Data btVector3DoubleData
|
||||||
|
#define btVector3DataName "btVector3DoubleData"
|
||||||
|
#else
|
||||||
|
#define btVector3Data btVector3FloatData
|
||||||
|
#define btVector3DataName "btVector3FloatData"
|
||||||
|
#endif //BT_USE_DOUBLE_PRECISION
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -330,10 +338,18 @@ public:
|
|||||||
return length2() < SIMD_EPSILON;
|
return length2() < SIMD_EPSILON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE void serialize(struct btVector3Data& dataOut) const;
|
SIMD_FORCE_INLINE void serialize(struct btVector3Data& dataOut) const;
|
||||||
|
|
||||||
SIMD_FORCE_INLINE void deSerialize(const struct btVector3Data& dataIn);
|
SIMD_FORCE_INLINE void deSerialize(const struct btVector3Data& dataIn);
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void serializeFloat(struct btVector3FloatData& dataOut) const;
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void deSerializeFloat(const struct btVector3FloatData& dataIn);
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void serializeDouble(struct btVector3DoubleData& dataOut) const;
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void deSerializeDouble(const struct btVector3DoubleData& dataIn);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**@brief Return the sum of two vectors (Point symantics)*/
|
/**@brief Return the sum of two vectors (Point symantics)*/
|
||||||
@@ -671,10 +687,6 @@ SIMD_FORCE_INLINE void btPlaneSpace1 (const btVector3& n, btVector3& p, btVector
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct btVector3Data
|
|
||||||
{
|
|
||||||
btScalar m_floats[4];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct btVector3FloatData
|
struct btVector3FloatData
|
||||||
{
|
{
|
||||||
@@ -684,8 +696,37 @@ struct btVector3FloatData
|
|||||||
struct btVector3DoubleData
|
struct btVector3DoubleData
|
||||||
{
|
{
|
||||||
double m_floats[4];
|
double m_floats[4];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void btVector3::serializeFloat(struct btVector3FloatData& dataOut) const
|
||||||
|
{
|
||||||
|
///could also do a memcpy, check if it is worth it
|
||||||
|
for (int i=0;i<4;i++)
|
||||||
|
dataOut.m_floats[i] = float(m_floats[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void btVector3::deSerializeFloat(const struct btVector3FloatData& dataIn)
|
||||||
|
{
|
||||||
|
for (int i=0;i<4;i++)
|
||||||
|
m_floats[i] = btScalar(dataIn.m_floats[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void btVector3::serializeDouble(struct btVector3DoubleData& dataOut) const
|
||||||
|
{
|
||||||
|
///could also do a memcpy, check if it is worth it
|
||||||
|
for (int i=0;i<4;i++)
|
||||||
|
dataOut.m_floats[i] = double(m_floats[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE void btVector3::deSerializeDouble(const struct btVector3DoubleData& dataIn)
|
||||||
|
{
|
||||||
|
for (int i=0;i<4;i++)
|
||||||
|
m_floats[i] = btScalar(dataIn.m_floats[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE void btVector3::serialize(struct btVector3Data& dataOut) const
|
SIMD_FORCE_INLINE void btVector3::serialize(struct btVector3Data& dataOut) const
|
||||||
{
|
{
|
||||||
///could also do a memcpy, check if it is worth it
|
///could also do a memcpy, check if it is worth it
|
||||||
|
|||||||
Reference in New Issue
Block a user