added basic serialization for several constraints including btPoint2PointConstraint, btHingeConstraint, btSliderConstraint, btConeTwistConstraint, btGeneric6DofConstraint

(no motor support or advanced settings yet)
added btStaticPlaneShape serialization
Added toggle in cmake for BenchmarksDemo to enable/disable graphics rendering
This commit is contained in:
erwin.coumans
2010-01-27 02:13:56 +00:00
parent 7003823bed
commit 00f58e5a91
38 changed files with 1873 additions and 342 deletions

View File

@@ -29,6 +29,7 @@
#include "bullet_btTransformFloatData.h"
#include "bullet_btTransformDoubleData.h"
#include "bullet_btCollisionShapeData.h"
#include "bullet_btStaticPlaneShapeData.h"
#include "bullet_btConvexInternalShapeData.h"
#include "bullet_btPositionAndRadius.h"
#include "bullet_btMultiSphereShapeData.h"
@@ -37,9 +38,22 @@
#include "bullet_btMeshPartData.h"
#include "bullet_btStridingMeshInterfaceData.h"
#include "bullet_btTriangleMeshShapeData.h"
#include "bullet_btCompoundShapeChildData.h"
#include "bullet_btCompoundShapeData.h"
#include "bullet_btCylinderShapeData.h"
#include "bullet_btCapsuleShapeData.h"
#include "bullet_btConvexHullShapeData.h"
#include "bullet_btCollisionObjectDoubleData.h"
#include "bullet_btCollisionObjectFloatData.h"
#include "bullet_btRigidBodyFloatData.h"
#include "bullet_btRigidBodyDoubleData.h"
#include "bullet_btConstraintInfo1.h"
#include "bullet_btTypedConstraintData.h"
#include "bullet_btPoint2PointConstraintFloatData.h"
#include "bullet_btPoint2PointConstraintDoubleData.h"
#include "bullet_btHingeConstraintDoubleData.h"
#include "bullet_btHingeConstraintFloatData.h"
#include "bullet_btConeTwistConstraintData.h"
#include "bullet_btGeneric6DofConstraintData.h"
#include "bullet_btSliderConstraintData.h"
#endif//__BULLET_H__

View File

@@ -36,6 +36,7 @@ namespace Bullet {
class btTransformFloatData;
class btTransformDoubleData;
class btCollisionShapeData;
class btStaticPlaneShapeData;
class btConvexInternalShapeData;
class btPositionAndRadius;
class btMultiSphereShapeData;
@@ -44,10 +45,23 @@ namespace Bullet {
class btMeshPartData;
class btStridingMeshInterfaceData;
class btTriangleMeshShapeData;
class btCompoundShapeChildData;
class btCompoundShapeData;
class btCylinderShapeData;
class btCapsuleShapeData;
class btConvexHullShapeData;
class btCollisionObjectDoubleData;
class btCollisionObjectFloatData;
class btRigidBodyFloatData;
class btRigidBodyDoubleData;
class btConstraintInfo1;
class btTypedConstraintData;
class btPoint2PointConstraintFloatData;
class btPoint2PointConstraintDoubleData;
class btHingeConstraintDoubleData;
class btHingeConstraintFloatData;
class btConeTwistConstraintData;
class btGeneric6DofConstraintData;
class btSliderConstraintData;
}
#endif//__BULLETCOMMON_H__

View File

@@ -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_BTCAPSULESHAPEDATA__H__
#define __BULLET_BTCAPSULESHAPEDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btConvexInternalShapeData.h"
namespace Bullet {
// ---------------------------------------------- //
class btCapsuleShapeData
{
public:
btConvexInternalShapeData m_convexInternalShapeData;
int m_upAxis;
char m_padding[4];
};
}
#endif//__BULLET_BTCAPSULESHAPEDATA__H__

View File

@@ -0,0 +1,43 @@
/* 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_BTCOMPOUNDSHAPECHILDDATA__H__
#define __BULLET_BTCOMPOUNDSHAPECHILDDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btTransformFloatData.h"
namespace Bullet {
// ---------------------------------------------- //
class btCompoundShapeChildData
{
public:
btTransformFloatData m_transform;
btCollisionShapeData *m_childShape;
int m_childShapeType;
float m_childMargin;
};
}
#endif//__BULLET_BTCOMPOUNDSHAPECHILDDATA__H__

View File

@@ -0,0 +1,43 @@
/* 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_BTCOMPOUNDSHAPEDATA__H__
#define __BULLET_BTCOMPOUNDSHAPEDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btCollisionShapeData.h"
namespace Bullet {
// ---------------------------------------------- //
class btCompoundShapeData
{
public:
btCollisionShapeData m_collisionShapeData;
btCompoundShapeChildData *m_childShapePtr;
int m_numChildShapes;
float m_collisionMargin;
};
}
#endif//__BULLET_BTCOMPOUNDSHAPEDATA__H__

View File

@@ -0,0 +1,51 @@
/* 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_BTCONETWISTCONSTRAINTDATA__H__
#define __BULLET_BTCONETWISTCONSTRAINTDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btTransformFloatData.h"
#include "bullet_btTypedConstraintData.h"
namespace Bullet {
// ---------------------------------------------- //
class btConeTwistConstraintData
{
public:
btTypedConstraintData m_typeConstraintData;
btTransformFloatData m_rbAFrame;
btTransformFloatData m_rbBFrame;
float m_swingSpan1;
float m_swingSpan2;
float m_twistSpan;
float m_limitSoftness;
float m_biasFactor;
float m_relaxationFactor;
float m_damping;
char m_pad[4];
};
}
#endif//__BULLET_BTCONETWISTCONSTRAINTDATA__H__

View File

@@ -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_BTCONSTRAINTINFO1__H__
#define __BULLET_BTCONSTRAINTINFO1__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
namespace Bullet {
// ---------------------------------------------- //
class btConstraintInfo1
{
public:
int m_numConstraintRows;
int nub;
};
}
#endif//__BULLET_BTCONSTRAINTINFO1__H__

View File

@@ -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_BTCYLINDERSHAPEDATA__H__
#define __BULLET_BTCYLINDERSHAPEDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btConvexInternalShapeData.h"
namespace Bullet {
// ---------------------------------------------- //
class btCylinderShapeData
{
public:
btConvexInternalShapeData m_convexInternalShapeData;
int m_upAxis;
char m_padding[4];
};
}
#endif//__BULLET_BTCYLINDERSHAPEDATA__H__

View File

@@ -0,0 +1,50 @@
/* 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_BTGENERIC6DOFCONSTRAINTDATA__H__
#define __BULLET_BTGENERIC6DOFCONSTRAINTDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btTransformFloatData.h"
#include "bullet_btTypedConstraintData.h"
#include "bullet_btVector3FloatData.h"
namespace Bullet {
// ---------------------------------------------- //
class btGeneric6DofConstraintData
{
public:
btTypedConstraintData m_typeConstraintData;
btTransformFloatData m_rbAFrame;
btTransformFloatData m_rbBFrame;
btVector3FloatData m_linearUpperLimit;
btVector3FloatData m_linearLowerLimit;
btVector3FloatData m_angularUpperLimit;
btVector3FloatData m_angularLowerLimit;
int m_useLinearReferenceFrameA;
int m_useOffsetForConstraintFrame;
};
}
#endif//__BULLET_BTGENERIC6DOFCONSTRAINTDATA__H__

View File

@@ -0,0 +1,53 @@
/* 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_BTHINGECONSTRAINTDOUBLEDATA__H__
#define __BULLET_BTHINGECONSTRAINTDOUBLEDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btTransformDoubleData.h"
#include "bullet_btTypedConstraintData.h"
namespace Bullet {
// ---------------------------------------------- //
class btHingeConstraintDoubleData
{
public:
btTypedConstraintData m_typeConstraintData;
btTransformDoubleData m_rbAFrame;
btTransformDoubleData m_rbBFrame;
int m_useReferenceFrameA;
int m_angularOnly;
int m_enableAngularMotor;
float m_motorTargetVelocity;
float m_maxMotorImpulse;
float m_lowerLimit;
float m_upperLimit;
float m_limitSoftness;
float m_biasFactor;
float m_relaxationFactor;
};
}
#endif//__BULLET_BTHINGECONSTRAINTDOUBLEDATA__H__

View File

@@ -0,0 +1,53 @@
/* 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_BTHINGECONSTRAINTFLOATDATA__H__
#define __BULLET_BTHINGECONSTRAINTFLOATDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btTransformFloatData.h"
#include "bullet_btTypedConstraintData.h"
namespace Bullet {
// ---------------------------------------------- //
class btHingeConstraintFloatData
{
public:
btTypedConstraintData m_typeConstraintData;
btTransformFloatData m_rbAFrame;
btTransformFloatData m_rbBFrame;
int m_useReferenceFrameA;
int m_angularOnly;
int m_enableAngularMotor;
float m_motorTargetVelocity;
float m_maxMotorImpulse;
float m_lowerLimit;
float m_upperLimit;
float m_limitSoftness;
float m_biasFactor;
float m_relaxationFactor;
};
}
#endif//__BULLET_BTHINGECONSTRAINTFLOATDATA__H__

View File

@@ -0,0 +1,43 @@
/* 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_BTPOINT2POINTCONSTRAINTDOUBLEDATA__H__
#define __BULLET_BTPOINT2POINTCONSTRAINTDOUBLEDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btTypedConstraintData.h"
#include "bullet_btVector3DoubleData.h"
namespace Bullet {
// ---------------------------------------------- //
class btPoint2PointConstraintDoubleData
{
public:
btTypedConstraintData m_typeConstraintData;
btVector3DoubleData m_pivotInA;
btVector3DoubleData m_pivotInB;
};
}
#endif//__BULLET_BTPOINT2POINTCONSTRAINTDOUBLEDATA__H__

View File

@@ -0,0 +1,43 @@
/* 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_BTPOINT2POINTCONSTRAINTFLOATDATA__H__
#define __BULLET_BTPOINT2POINTCONSTRAINTFLOATDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btTypedConstraintData.h"
#include "bullet_btVector3FloatData.h"
namespace Bullet {
// ---------------------------------------------- //
class btPoint2PointConstraintFloatData
{
public:
btTypedConstraintData m_typeConstraintData;
btVector3FloatData m_pivotInA;
btVector3FloatData m_pivotInB;
};
}
#endif//__BULLET_BTPOINT2POINTCONSTRAINTFLOATDATA__H__

View File

@@ -0,0 +1,49 @@
/* 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_BTSLIDERCONSTRAINTDATA__H__
#define __BULLET_BTSLIDERCONSTRAINTDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btTransformFloatData.h"
#include "bullet_btTypedConstraintData.h"
namespace Bullet {
// ---------------------------------------------- //
class btSliderConstraintData
{
public:
btTypedConstraintData m_typeConstraintData;
btTransformFloatData m_rbAFrame;
btTransformFloatData m_rbBFrame;
float m_linearUpperLimit;
float m_linearLowerLimit;
float m_angularUpperLimit;
float m_angularLowerLimit;
int m_useLinearReferenceFrameA;
int m_useOffsetForConstraintFrame;
};
}
#endif//__BULLET_BTSLIDERCONSTRAINTDATA__H__

View File

@@ -0,0 +1,45 @@
/* 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_BTSTATICPLANESHAPEDATA__H__
#define __BULLET_BTSTATICPLANESHAPEDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btCollisionShapeData.h"
#include "bullet_btVector3FloatData.h"
namespace Bullet {
// ---------------------------------------------- //
class btStaticPlaneShapeData
{
public:
btCollisionShapeData m_collisionShapeData;
btVector3FloatData m_localScaling;
btVector3FloatData m_planeNormal;
float m_planeConstant;
char m_pad[4];
};
}
#endif//__BULLET_BTSTATICPLANESHAPEDATA__H__

View File

@@ -0,0 +1,52 @@
/* 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_BTTYPEDCONSTRAINTDATA__H__
#define __BULLET_BTTYPEDCONSTRAINTDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btVector3FloatData.h"
namespace Bullet {
// ---------------------------------------------- //
class btTypedConstraintData
{
public:
bInvalidHandle *m_rbA;
bInvalidHandle *m_rbB;
btVector3FloatData m_appliedLinearImpulse;
btVector3FloatData m_appliedAngularImpulseA;
btVector3FloatData m_appliedAngularImpulseB;
int m_objectType;
int m_userConstraintType;
int m_userConstraintId;
int m_needsFeedback;
float m_appliedImpulse;
float m_dbgDrawSize;
int m_disableCollisionsBetweenLinkedBodies;
char m_pad[4];
};
}
#endif//__BULLET_BTTYPEDCONSTRAINTDATA__H__

View File

@@ -423,6 +423,7 @@ void bFile::parseStruct(char *strcPtr, char *dtPtr, int old_dna, int new_dna, bo
}
}
// ----------------------------------------------------- //
static void getElement(int arrayLen, const char *cur, const char *old, char *oldPtr, char *curData)
{
@@ -436,7 +437,7 @@ static void getElement(int arrayLen, const char *cur, const char *old, char *old
#define setEle(value, current, type, cast, size, ptr)\
if (strcmp(current, type)==0)\
{\
(*(cast*)ptr) = value;\
(*(cast*)ptr) = (cast)value;\
ptr += size;\
}
double value = 0.0;

View File

@@ -121,7 +121,12 @@ void btBulletFile::parseData()
{
m_rigidBodies.push_back((bStructHandle*) id);
}
if (dataChunk.code == BT_CONSTRAINT_CODE)
{
m_constraints.push_back((bStructHandle*) id);
}
if (dataChunk.code == BT_COLLISIONOBJECT_CODE)
{
m_collisionObjects.push_back((bStructHandle*) id);

View File

@@ -23,6 +23,7 @@ subject to the following restrictions:
#define BT_COLLISIONOBJECT_CODE MAKE_ID('C','O','B','J')
#define BT_RIGIDBODY_CODE MAKE_ID('R','B','D','Y')
#define BT_CONSTRAINT_CODE MAKE_ID('C','O','N','S')
#define BT_BOXSHAPE_CODE MAKE_ID('B','O','X','S')
#define BT_SHAPE_CODE MAKE_ID('S','H','A','P')
@@ -44,6 +45,8 @@ namespace bParse {
btAlignedObjectArray<bStructHandle*> m_collisionShapes;
btAlignedObjectArray<bStructHandle*> m_constraints;
btBulletFile();
btBulletFile(const char* fileName);