bt -> b3 and BT -> B3 rename for content and filenames
This commit is contained in:
@@ -27,59 +27,59 @@ typedef struct bInvalidHandle {
|
||||
}bInvalidHandle;
|
||||
|
||||
class PointerArray;
|
||||
class btPhysicsSystem;
|
||||
class b3PhysicsSystem;
|
||||
class ListBase;
|
||||
class btVector3FloatData;
|
||||
class btVector3DoubleData;
|
||||
class btMatrix3x3FloatData;
|
||||
class btMatrix3x3DoubleData;
|
||||
class btTransformFloatData;
|
||||
class btTransformDoubleData;
|
||||
class btBvhSubtreeInfoData;
|
||||
class btOptimizedBvhNodeFloatData;
|
||||
class btOptimizedBvhNodeDoubleData;
|
||||
class btQuantizedBvhNodeData;
|
||||
class btQuantizedBvhFloatData;
|
||||
class btQuantizedBvhDoubleData;
|
||||
class btCollisionShapeData;
|
||||
class btStaticPlaneShapeData;
|
||||
class btConvexInternalShapeData;
|
||||
class btPositionAndRadius;
|
||||
class btMultiSphereShapeData;
|
||||
class btIntIndexData;
|
||||
class btShortIntIndexData;
|
||||
class btShortIntIndexTripletData;
|
||||
class btCharIndexTripletData;
|
||||
class btMeshPartData;
|
||||
class btStridingMeshInterfaceData;
|
||||
class btTriangleMeshShapeData;
|
||||
class btScaledTriangleMeshShapeData;
|
||||
class btCompoundShapeChildData;
|
||||
class btCompoundShapeData;
|
||||
class btCylinderShapeData;
|
||||
class btCapsuleShapeData;
|
||||
class btTriangleInfoData;
|
||||
class btTriangleInfoMapData;
|
||||
class btGImpactMeshShapeData;
|
||||
class btConvexHullShapeData;
|
||||
class btCollisionObjectDoubleData;
|
||||
class btCollisionObjectFloatData;
|
||||
class btDynamicsWorldDoubleData;
|
||||
class btDynamicsWorldFloatData;
|
||||
class btRigidBodyFloatData;
|
||||
class btRigidBodyDoubleData;
|
||||
class btConstraintInfo1;
|
||||
class btTypedConstraintData;
|
||||
class btPoint2PointConstraintFloatData;
|
||||
class btPoint2PointConstraintDoubleData;
|
||||
class btHingeConstraintDoubleData;
|
||||
class btHingeConstraintFloatData;
|
||||
class btConeTwistConstraintData;
|
||||
class btGeneric6DofConstraintData;
|
||||
class btGeneric6DofSpringConstraintData;
|
||||
class btSliderConstraintData;
|
||||
class btContactSolverInfoDoubleData;
|
||||
class btContactSolverInfoFloatData;
|
||||
class b3Vector3FloatData;
|
||||
class b3Vector3DoubleData;
|
||||
class b3Matrix3x3FloatData;
|
||||
class b3Matrix3x3DoubleData;
|
||||
class b3TransformFloatData;
|
||||
class b3TransformDoubleData;
|
||||
class b3BvhSubtreeInfoData;
|
||||
class b3OptimizedBvhNodeFloatData;
|
||||
class b3OptimizedBvhNodeDoubleData;
|
||||
class b3QuantizedBvhNodeData;
|
||||
class b3QuantizedBvhFloatData;
|
||||
class b3QuantizedBvhDoubleData;
|
||||
class b3CollisionShapeData;
|
||||
class b3StaticPlaneShapeData;
|
||||
class b3ConvexInternalShapeData;
|
||||
class b3PositionAndRadius;
|
||||
class b3MultiSphereShapeData;
|
||||
class b3IntIndexData;
|
||||
class b3ShortIntIndexData;
|
||||
class b3ShortIntIndexTripletData;
|
||||
class b3CharIndexTripletData;
|
||||
class b3MeshPartData;
|
||||
class b3StridingMeshInterfaceData;
|
||||
class b3TriangleMeshShapeData;
|
||||
class b3ScaledTriangleMeshShapeData;
|
||||
class b3CompoundShapeChildData;
|
||||
class b3CompoundShapeData;
|
||||
class b3CylinderShapeData;
|
||||
class b3CapsuleShapeData;
|
||||
class b3TriangleInfoData;
|
||||
class b3TriangleInfoMapData;
|
||||
class b3GImpactMeshShapeData;
|
||||
class b3ConvexHullShapeData;
|
||||
class b3CollisionObjectDoubleData;
|
||||
class b3CollisionObjectFloatData;
|
||||
class b3DynamicsWorldDoubleData;
|
||||
class b3DynamicsWorldFloatData;
|
||||
class b3RigidBodyFloatData;
|
||||
class b3RigidBodyDoubleData;
|
||||
class b3ConstraintInfo1;
|
||||
class b3TypedConstraintData;
|
||||
class b3Point2PointConstraintFloatData;
|
||||
class b3Point2PointConstraintDoubleData;
|
||||
class b3HingeConstraintDoubleData;
|
||||
class b3HingeConstraintFloatData;
|
||||
class b3ConeTwistConstraintData;
|
||||
class b3Generic6DofConstraintData;
|
||||
class b3Generic6DofSpringConstraintData;
|
||||
class b3SliderConstraintData;
|
||||
class b3ContactSolverInfoDoubleData;
|
||||
class b3ContactSolverInfoFloatData;
|
||||
class SoftBodyMaterialData;
|
||||
class SoftBodyNodeData;
|
||||
class SoftBodyLinkData;
|
||||
@@ -89,8 +89,8 @@ typedef struct bInvalidHandle {
|
||||
class SoftBodyConfigData;
|
||||
class SoftBodyPoseData;
|
||||
class SoftBodyClusterData;
|
||||
class btSoftBodyJointData;
|
||||
class btSoftBodyFloatData;
|
||||
class b3SoftBodyJointData;
|
||||
class b3SoftBodyFloatData;
|
||||
// -------------------------------------------------- //
|
||||
class PointerArray
|
||||
{
|
||||
@@ -102,7 +102,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btPhysicsSystem
|
||||
class b3PhysicsSystem
|
||||
{
|
||||
public:
|
||||
PointerArray m_collisionShapes;
|
||||
@@ -121,7 +121,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btVector3FloatData
|
||||
class b3Vector3FloatData
|
||||
{
|
||||
public:
|
||||
float m_floats[4];
|
||||
@@ -129,7 +129,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btVector3DoubleData
|
||||
class b3Vector3DoubleData
|
||||
{
|
||||
public:
|
||||
double m_floats[4];
|
||||
@@ -137,41 +137,41 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btMatrix3x3FloatData
|
||||
class b3Matrix3x3FloatData
|
||||
{
|
||||
public:
|
||||
btVector3FloatData m_el[3];
|
||||
b3Vector3FloatData m_el[3];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btMatrix3x3DoubleData
|
||||
class b3Matrix3x3DoubleData
|
||||
{
|
||||
public:
|
||||
btVector3DoubleData m_el[3];
|
||||
b3Vector3DoubleData m_el[3];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btTransformFloatData
|
||||
class b3TransformFloatData
|
||||
{
|
||||
public:
|
||||
btMatrix3x3FloatData m_basis;
|
||||
btVector3FloatData m_origin;
|
||||
b3Matrix3x3FloatData m_basis;
|
||||
b3Vector3FloatData m_origin;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btTransformDoubleData
|
||||
class b3TransformDoubleData
|
||||
{
|
||||
public:
|
||||
btMatrix3x3DoubleData m_basis;
|
||||
btVector3DoubleData m_origin;
|
||||
b3Matrix3x3DoubleData m_basis;
|
||||
b3Vector3DoubleData m_origin;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btBvhSubtreeInfoData
|
||||
class b3BvhSubtreeInfoData
|
||||
{
|
||||
public:
|
||||
int m_rootNodeIndex;
|
||||
@@ -182,11 +182,11 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btOptimizedBvhNodeFloatData
|
||||
class b3OptimizedBvhNodeFloatData
|
||||
{
|
||||
public:
|
||||
btVector3FloatData m_aabbMinOrg;
|
||||
btVector3FloatData m_aabbMaxOrg;
|
||||
b3Vector3FloatData m_aabbMinOrg;
|
||||
b3Vector3FloatData m_aabbMaxOrg;
|
||||
int m_escapeIndex;
|
||||
int m_subPart;
|
||||
int m_triangleIndex;
|
||||
@@ -195,11 +195,11 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btOptimizedBvhNodeDoubleData
|
||||
class b3OptimizedBvhNodeDoubleData
|
||||
{
|
||||
public:
|
||||
btVector3DoubleData m_aabbMinOrg;
|
||||
btVector3DoubleData m_aabbMaxOrg;
|
||||
b3Vector3DoubleData m_aabbMinOrg;
|
||||
b3Vector3DoubleData m_aabbMaxOrg;
|
||||
int m_escapeIndex;
|
||||
int m_subPart;
|
||||
int m_triangleIndex;
|
||||
@@ -208,7 +208,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btQuantizedBvhNodeData
|
||||
class b3QuantizedBvhNodeData
|
||||
{
|
||||
public:
|
||||
short m_quantizedAabbMin[3];
|
||||
@@ -218,45 +218,45 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btQuantizedBvhFloatData
|
||||
class b3QuantizedBvhFloatData
|
||||
{
|
||||
public:
|
||||
btVector3FloatData m_bvhAabbMin;
|
||||
btVector3FloatData m_bvhAabbMax;
|
||||
btVector3FloatData m_bvhQuantization;
|
||||
b3Vector3FloatData m_bvhAabbMin;
|
||||
b3Vector3FloatData m_bvhAabbMax;
|
||||
b3Vector3FloatData m_bvhQuantization;
|
||||
int m_curNodeIndex;
|
||||
int m_useQuantization;
|
||||
int m_numContiguousLeafNodes;
|
||||
int m_numQuantizedContiguousNodes;
|
||||
btOptimizedBvhNodeFloatData *m_contiguousNodesPtr;
|
||||
btQuantizedBvhNodeData *m_quantizedContiguousNodesPtr;
|
||||
btBvhSubtreeInfoData *m_subTreeInfoPtr;
|
||||
b3OptimizedBvhNodeFloatData *m_contiguousNodesPtr;
|
||||
b3QuantizedBvhNodeData *m_quantizedContiguousNodesPtr;
|
||||
b3BvhSubtreeInfoData *m_subTreeInfoPtr;
|
||||
int m_traversalMode;
|
||||
int m_numSubtreeHeaders;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btQuantizedBvhDoubleData
|
||||
class b3QuantizedBvhDoubleData
|
||||
{
|
||||
public:
|
||||
btVector3DoubleData m_bvhAabbMin;
|
||||
btVector3DoubleData m_bvhAabbMax;
|
||||
btVector3DoubleData m_bvhQuantization;
|
||||
b3Vector3DoubleData m_bvhAabbMin;
|
||||
b3Vector3DoubleData m_bvhAabbMax;
|
||||
b3Vector3DoubleData m_bvhQuantization;
|
||||
int m_curNodeIndex;
|
||||
int m_useQuantization;
|
||||
int m_numContiguousLeafNodes;
|
||||
int m_numQuantizedContiguousNodes;
|
||||
btOptimizedBvhNodeDoubleData *m_contiguousNodesPtr;
|
||||
btQuantizedBvhNodeData *m_quantizedContiguousNodesPtr;
|
||||
b3OptimizedBvhNodeDoubleData *m_contiguousNodesPtr;
|
||||
b3QuantizedBvhNodeData *m_quantizedContiguousNodesPtr;
|
||||
int m_traversalMode;
|
||||
int m_numSubtreeHeaders;
|
||||
btBvhSubtreeInfoData *m_subTreeInfoPtr;
|
||||
b3BvhSubtreeInfoData *m_subTreeInfoPtr;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btCollisionShapeData
|
||||
class b3CollisionShapeData
|
||||
{
|
||||
public:
|
||||
char *m_name;
|
||||
@@ -266,51 +266,51 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btStaticPlaneShapeData
|
||||
class b3StaticPlaneShapeData
|
||||
{
|
||||
public:
|
||||
btCollisionShapeData m_collisionShapeData;
|
||||
btVector3FloatData m_localScaling;
|
||||
btVector3FloatData m_planeNormal;
|
||||
b3CollisionShapeData m_collisionShapeData;
|
||||
b3Vector3FloatData m_localScaling;
|
||||
b3Vector3FloatData m_planeNormal;
|
||||
float m_planeConstant;
|
||||
char m_pad[4];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btConvexInternalShapeData
|
||||
class b3ConvexInternalShapeData
|
||||
{
|
||||
public:
|
||||
btCollisionShapeData m_collisionShapeData;
|
||||
btVector3FloatData m_localScaling;
|
||||
btVector3FloatData m_implicitShapeDimensions;
|
||||
b3CollisionShapeData m_collisionShapeData;
|
||||
b3Vector3FloatData m_localScaling;
|
||||
b3Vector3FloatData m_implicitShapeDimensions;
|
||||
float m_collisionMargin;
|
||||
int m_padding;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btPositionAndRadius
|
||||
class b3PositionAndRadius
|
||||
{
|
||||
public:
|
||||
btVector3FloatData m_pos;
|
||||
b3Vector3FloatData m_pos;
|
||||
float m_radius;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btMultiSphereShapeData
|
||||
class b3MultiSphereShapeData
|
||||
{
|
||||
public:
|
||||
btConvexInternalShapeData m_convexInternalShapeData;
|
||||
btPositionAndRadius *m_localPositionArrayPtr;
|
||||
b3ConvexInternalShapeData m_convexInternalShapeData;
|
||||
b3PositionAndRadius *m_localPositionArrayPtr;
|
||||
int m_localPositionArraySize;
|
||||
char m_padding[4];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btIntIndexData
|
||||
class b3IntIndexData
|
||||
{
|
||||
public:
|
||||
int m_value;
|
||||
@@ -318,7 +318,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btShortIntIndexData
|
||||
class b3ShortIntIndexData
|
||||
{
|
||||
public:
|
||||
short m_value;
|
||||
@@ -327,7 +327,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btShortIntIndexTripletData
|
||||
class b3ShortIntIndexTripletData
|
||||
{
|
||||
public:
|
||||
short m_values[3];
|
||||
@@ -336,7 +336,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btCharIndexTripletData
|
||||
class b3CharIndexTripletData
|
||||
{
|
||||
public:
|
||||
char m_values[3];
|
||||
@@ -345,98 +345,98 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btMeshPartData
|
||||
class b3MeshPartData
|
||||
{
|
||||
public:
|
||||
btVector3FloatData *m_vertices3f;
|
||||
btVector3DoubleData *m_vertices3d;
|
||||
btIntIndexData *m_indices32;
|
||||
btShortIntIndexTripletData *m_3indices16;
|
||||
btCharIndexTripletData *m_3indices8;
|
||||
btShortIntIndexData *m_indices16;
|
||||
b3Vector3FloatData *m_vertices3f;
|
||||
b3Vector3DoubleData *m_vertices3d;
|
||||
b3IntIndexData *m_indices32;
|
||||
b3ShortIntIndexTripletData *m_3indices16;
|
||||
b3CharIndexTripletData *m_3indices8;
|
||||
b3ShortIntIndexData *m_indices16;
|
||||
int m_numTriangles;
|
||||
int m_numVertices;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btStridingMeshInterfaceData
|
||||
class b3StridingMeshInterfaceData
|
||||
{
|
||||
public:
|
||||
btMeshPartData *m_meshPartsPtr;
|
||||
btVector3FloatData m_scaling;
|
||||
b3MeshPartData *m_meshPartsPtr;
|
||||
b3Vector3FloatData m_scaling;
|
||||
int m_numMeshParts;
|
||||
char m_padding[4];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btTriangleMeshShapeData
|
||||
class b3TriangleMeshShapeData
|
||||
{
|
||||
public:
|
||||
btCollisionShapeData m_collisionShapeData;
|
||||
btStridingMeshInterfaceData m_meshInterface;
|
||||
btQuantizedBvhFloatData *m_quantizedFloatBvh;
|
||||
btQuantizedBvhDoubleData *m_quantizedDoubleBvh;
|
||||
btTriangleInfoMapData *m_triangleInfoMap;
|
||||
b3CollisionShapeData m_collisionShapeData;
|
||||
b3StridingMeshInterfaceData m_meshInterface;
|
||||
b3QuantizedBvhFloatData *m_quantizedFloatBvh;
|
||||
b3QuantizedBvhDoubleData *m_quantizedDoubleBvh;
|
||||
b3TriangleInfoMapData *m_triangleInfoMap;
|
||||
float m_collisionMargin;
|
||||
char m_pad3[4];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btScaledTriangleMeshShapeData
|
||||
class b3ScaledTriangleMeshShapeData
|
||||
{
|
||||
public:
|
||||
btTriangleMeshShapeData m_trimeshShapeData;
|
||||
btVector3FloatData m_localScaling;
|
||||
b3TriangleMeshShapeData m_trimeshShapeData;
|
||||
b3Vector3FloatData m_localScaling;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btCompoundShapeChildData
|
||||
class b3CompoundShapeChildData
|
||||
{
|
||||
public:
|
||||
btTransformFloatData m_transform;
|
||||
btCollisionShapeData *m_childShape;
|
||||
b3TransformFloatData m_transform;
|
||||
b3CollisionShapeData *m_childShape;
|
||||
int m_childShapeType;
|
||||
float m_childMargin;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btCompoundShapeData
|
||||
class b3CompoundShapeData
|
||||
{
|
||||
public:
|
||||
btCollisionShapeData m_collisionShapeData;
|
||||
btCompoundShapeChildData *m_childShapePtr;
|
||||
b3CollisionShapeData m_collisionShapeData;
|
||||
b3CompoundShapeChildData *m_childShapePtr;
|
||||
int m_numChildShapes;
|
||||
float m_collisionMargin;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btCylinderShapeData
|
||||
class b3CylinderShapeData
|
||||
{
|
||||
public:
|
||||
btConvexInternalShapeData m_convexInternalShapeData;
|
||||
b3ConvexInternalShapeData m_convexInternalShapeData;
|
||||
int m_upAxis;
|
||||
char m_padding[4];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btCapsuleShapeData
|
||||
class b3CapsuleShapeData
|
||||
{
|
||||
public:
|
||||
btConvexInternalShapeData m_convexInternalShapeData;
|
||||
b3ConvexInternalShapeData m_convexInternalShapeData;
|
||||
int m_upAxis;
|
||||
char m_padding[4];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btTriangleInfoData
|
||||
class b3TriangleInfoData
|
||||
{
|
||||
public:
|
||||
int m_flags;
|
||||
@@ -447,12 +447,12 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btTriangleInfoMapData
|
||||
class b3TriangleInfoMapData
|
||||
{
|
||||
public:
|
||||
int *m_hashTablePtr;
|
||||
int *m_nextPtr;
|
||||
btTriangleInfoData *m_valueArrayPtr;
|
||||
b3TriangleInfoData *m_valueArrayPtr;
|
||||
int *m_keyArrayPtr;
|
||||
float m_convexEpsilon;
|
||||
float m_planarEpsilon;
|
||||
@@ -468,42 +468,42 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btGImpactMeshShapeData
|
||||
class b3GImpactMeshShapeData
|
||||
{
|
||||
public:
|
||||
btCollisionShapeData m_collisionShapeData;
|
||||
btStridingMeshInterfaceData m_meshInterface;
|
||||
btVector3FloatData m_localScaling;
|
||||
b3CollisionShapeData m_collisionShapeData;
|
||||
b3StridingMeshInterfaceData m_meshInterface;
|
||||
b3Vector3FloatData m_localScaling;
|
||||
float m_collisionMargin;
|
||||
int m_gimpactSubType;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btConvexHullShapeData
|
||||
class b3ConvexHullShapeData
|
||||
{
|
||||
public:
|
||||
btConvexInternalShapeData m_convexInternalShapeData;
|
||||
btVector3FloatData *m_unscaledPointsFloatPtr;
|
||||
btVector3DoubleData *m_unscaledPointsDoublePtr;
|
||||
b3ConvexInternalShapeData m_convexInternalShapeData;
|
||||
b3Vector3FloatData *m_unscaledPointsFloatPtr;
|
||||
b3Vector3DoubleData *m_unscaledPointsDoublePtr;
|
||||
int m_numUnscaledPoints;
|
||||
char m_padding3[4];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btCollisionObjectDoubleData
|
||||
class b3CollisionObjectDoubleData
|
||||
{
|
||||
public:
|
||||
void *m_broadphaseHandle;
|
||||
void *m_collisionShape;
|
||||
btCollisionShapeData *m_rootCollisionShape;
|
||||
b3CollisionShapeData *m_rootCollisionShape;
|
||||
char *m_name;
|
||||
btTransformDoubleData m_worldTransform;
|
||||
btTransformDoubleData m_interpolationWorldTransform;
|
||||
btVector3DoubleData m_interpolationLinearVelocity;
|
||||
btVector3DoubleData m_interpolationAngularVelocity;
|
||||
btVector3DoubleData m_anisotropicFriction;
|
||||
b3TransformDoubleData m_worldTransform;
|
||||
b3TransformDoubleData m_interpolationWorldTransform;
|
||||
b3Vector3DoubleData m_interpolationLinearVelocity;
|
||||
b3Vector3DoubleData m_interpolationAngularVelocity;
|
||||
b3Vector3DoubleData m_anisotropicFriction;
|
||||
double m_contactProcessingThreshold;
|
||||
double m_deactivationTime;
|
||||
double m_friction;
|
||||
@@ -524,18 +524,18 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btCollisionObjectFloatData
|
||||
class b3CollisionObjectFloatData
|
||||
{
|
||||
public:
|
||||
void *m_broadphaseHandle;
|
||||
void *m_collisionShape;
|
||||
btCollisionShapeData *m_rootCollisionShape;
|
||||
b3CollisionShapeData *m_rootCollisionShape;
|
||||
char *m_name;
|
||||
btTransformFloatData m_worldTransform;
|
||||
btTransformFloatData m_interpolationWorldTransform;
|
||||
btVector3FloatData m_interpolationLinearVelocity;
|
||||
btVector3FloatData m_interpolationAngularVelocity;
|
||||
btVector3FloatData m_anisotropicFriction;
|
||||
b3TransformFloatData m_worldTransform;
|
||||
b3TransformFloatData m_interpolationWorldTransform;
|
||||
b3Vector3FloatData m_interpolationLinearVelocity;
|
||||
b3Vector3FloatData m_interpolationAngularVelocity;
|
||||
b3Vector3FloatData m_anisotropicFriction;
|
||||
float m_contactProcessingThreshold;
|
||||
float m_deactivationTime;
|
||||
float m_friction;
|
||||
@@ -557,20 +557,20 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btRigidBodyFloatData
|
||||
class b3RigidBodyFloatData
|
||||
{
|
||||
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;
|
||||
b3CollisionObjectFloatData m_collisionObjectData;
|
||||
b3Matrix3x3FloatData m_invInertiaTensorWorld;
|
||||
b3Vector3FloatData m_linearVelocity;
|
||||
b3Vector3FloatData m_angularVelocity;
|
||||
b3Vector3FloatData m_angularFactor;
|
||||
b3Vector3FloatData m_linearFactor;
|
||||
b3Vector3FloatData m_gravity;
|
||||
b3Vector3FloatData m_gravity_acceleration;
|
||||
b3Vector3FloatData m_invInertiaLocal;
|
||||
b3Vector3FloatData m_totalForce;
|
||||
b3Vector3FloatData m_totalTorque;
|
||||
float m_inverseMass;
|
||||
float m_linearDamping;
|
||||
float m_angularDamping;
|
||||
@@ -585,20 +585,20 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btRigidBodyDoubleData
|
||||
class b3RigidBodyDoubleData
|
||||
{
|
||||
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;
|
||||
b3CollisionObjectDoubleData m_collisionObjectData;
|
||||
b3Matrix3x3DoubleData m_invInertiaTensorWorld;
|
||||
b3Vector3DoubleData m_linearVelocity;
|
||||
b3Vector3DoubleData m_angularVelocity;
|
||||
b3Vector3DoubleData m_angularFactor;
|
||||
b3Vector3DoubleData m_linearFactor;
|
||||
b3Vector3DoubleData m_gravity;
|
||||
b3Vector3DoubleData m_gravity_acceleration;
|
||||
b3Vector3DoubleData m_invInertiaLocal;
|
||||
b3Vector3DoubleData m_totalForce;
|
||||
b3Vector3DoubleData m_totalTorque;
|
||||
double m_inverseMass;
|
||||
double m_linearDamping;
|
||||
double m_angularDamping;
|
||||
@@ -614,7 +614,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btConstraintInfo1
|
||||
class b3ConstraintInfo1
|
||||
{
|
||||
public:
|
||||
int m_numConstraintRows;
|
||||
@@ -623,7 +623,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btTypedConstraintData
|
||||
class b3TypedConstraintData
|
||||
{
|
||||
public:
|
||||
bInvalidHandle *m_rbA;
|
||||
@@ -643,32 +643,32 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btPoint2PointConstraintFloatData
|
||||
class b3Point2PointConstraintFloatData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintData m_typeConstraintData;
|
||||
btVector3FloatData m_pivotInA;
|
||||
btVector3FloatData m_pivotInB;
|
||||
b3TypedConstraintData m_typeConstraintData;
|
||||
b3Vector3FloatData m_pivotInA;
|
||||
b3Vector3FloatData m_pivotInB;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btPoint2PointConstraintDoubleData
|
||||
class b3Point2PointConstraintDoubleData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintData m_typeConstraintData;
|
||||
btVector3DoubleData m_pivotInA;
|
||||
btVector3DoubleData m_pivotInB;
|
||||
b3TypedConstraintData m_typeConstraintData;
|
||||
b3Vector3DoubleData m_pivotInA;
|
||||
b3Vector3DoubleData m_pivotInB;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btHingeConstraintDoubleData
|
||||
class b3HingeConstraintDoubleData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintData m_typeConstraintData;
|
||||
btTransformDoubleData m_rbAFrame;
|
||||
btTransformDoubleData m_rbBFrame;
|
||||
b3TypedConstraintData m_typeConstraintData;
|
||||
b3TransformDoubleData m_rbAFrame;
|
||||
b3TransformDoubleData m_rbBFrame;
|
||||
int m_useReferenceFrameA;
|
||||
int m_angularOnly;
|
||||
int m_enableAngularMotor;
|
||||
@@ -683,12 +683,12 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btHingeConstraintFloatData
|
||||
class b3HingeConstraintFloatData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintData m_typeConstraintData;
|
||||
btTransformFloatData m_rbAFrame;
|
||||
btTransformFloatData m_rbBFrame;
|
||||
b3TypedConstraintData m_typeConstraintData;
|
||||
b3TransformFloatData m_rbAFrame;
|
||||
b3TransformFloatData m_rbBFrame;
|
||||
int m_useReferenceFrameA;
|
||||
int m_angularOnly;
|
||||
int m_enableAngularMotor;
|
||||
@@ -703,12 +703,12 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btConeTwistConstraintData
|
||||
class b3ConeTwistConstraintData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintData m_typeConstraintData;
|
||||
btTransformFloatData m_rbAFrame;
|
||||
btTransformFloatData m_rbBFrame;
|
||||
b3TypedConstraintData m_typeConstraintData;
|
||||
b3TransformFloatData m_rbAFrame;
|
||||
b3TransformFloatData m_rbBFrame;
|
||||
float m_swingSpan1;
|
||||
float m_swingSpan2;
|
||||
float m_twistSpan;
|
||||
@@ -721,26 +721,26 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btGeneric6DofConstraintData
|
||||
class b3Generic6DofConstraintData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintData m_typeConstraintData;
|
||||
btTransformFloatData m_rbAFrame;
|
||||
btTransformFloatData m_rbBFrame;
|
||||
btVector3FloatData m_linearUpperLimit;
|
||||
btVector3FloatData m_linearLowerLimit;
|
||||
btVector3FloatData m_angularUpperLimit;
|
||||
btVector3FloatData m_angularLowerLimit;
|
||||
b3TypedConstraintData m_typeConstraintData;
|
||||
b3TransformFloatData m_rbAFrame;
|
||||
b3TransformFloatData m_rbBFrame;
|
||||
b3Vector3FloatData m_linearUpperLimit;
|
||||
b3Vector3FloatData m_linearLowerLimit;
|
||||
b3Vector3FloatData m_angularUpperLimit;
|
||||
b3Vector3FloatData m_angularLowerLimit;
|
||||
int m_useLinearReferenceFrameA;
|
||||
int m_useOffsetForConstraintFrame;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btGeneric6DofSpringConstraintData
|
||||
class b3Generic6DofSpringConstraintData
|
||||
{
|
||||
public:
|
||||
btGeneric6DofConstraintData m_6dofData;
|
||||
b3Generic6DofConstraintData m_6dofData;
|
||||
int m_springEnabled[6];
|
||||
float m_equilibriumPoint[6];
|
||||
float m_springStiffness[6];
|
||||
@@ -749,12 +749,12 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btSliderConstraintData
|
||||
class b3SliderConstraintData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintData m_typeConstraintData;
|
||||
btTransformFloatData m_rbAFrame;
|
||||
btTransformFloatData m_rbBFrame;
|
||||
b3TypedConstraintData m_typeConstraintData;
|
||||
b3TransformFloatData m_rbAFrame;
|
||||
b3TransformFloatData m_rbBFrame;
|
||||
float m_linearUpperLimit;
|
||||
float m_linearLowerLimit;
|
||||
float m_angularUpperLimit;
|
||||
@@ -765,7 +765,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btContactSolverInfoDoubleData
|
||||
class b3ContactSolverInfoDoubleData
|
||||
{
|
||||
public:
|
||||
double m_tau;
|
||||
@@ -794,7 +794,7 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btContactSolverInfoFloatData
|
||||
class b3ContactSolverInfoFloatData
|
||||
{
|
||||
public:
|
||||
float m_tau;
|
||||
@@ -823,20 +823,20 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btDynamicsWorldDoubleData
|
||||
class b3DynamicsWorldDoubleData
|
||||
{
|
||||
public:
|
||||
btContactSolverInfoDoubleData m_solverInfo;
|
||||
btVector3DoubleData m_gravity;
|
||||
b3ContactSolverInfoDoubleData m_solverInfo;
|
||||
b3Vector3DoubleData m_gravity;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btDynamicsWorldFloatData
|
||||
class b3DynamicsWorldFloatData
|
||||
{
|
||||
public:
|
||||
btContactSolverInfoFloatData m_solverInfo;
|
||||
btVector3FloatData m_gravity;
|
||||
b3ContactSolverInfoFloatData m_solverInfo;
|
||||
b3Vector3FloatData m_gravity;
|
||||
};
|
||||
|
||||
|
||||
@@ -857,11 +857,11 @@ typedef struct bInvalidHandle {
|
||||
{
|
||||
public:
|
||||
SoftBodyMaterialData *m_material;
|
||||
btVector3FloatData m_position;
|
||||
btVector3FloatData m_previousPosition;
|
||||
btVector3FloatData m_velocity;
|
||||
btVector3FloatData m_accumulatedForce;
|
||||
btVector3FloatData m_normal;
|
||||
b3Vector3FloatData m_position;
|
||||
b3Vector3FloatData m_previousPosition;
|
||||
b3Vector3FloatData m_velocity;
|
||||
b3Vector3FloatData m_accumulatedForce;
|
||||
b3Vector3FloatData m_normal;
|
||||
float m_inverseMass;
|
||||
float m_area;
|
||||
int m_attach;
|
||||
@@ -884,7 +884,7 @@ typedef struct bInvalidHandle {
|
||||
class SoftBodyFaceData
|
||||
{
|
||||
public:
|
||||
btVector3FloatData m_normal;
|
||||
b3Vector3FloatData m_normal;
|
||||
SoftBodyMaterialData *m_material;
|
||||
int m_nodeIndices[3];
|
||||
float m_restArea;
|
||||
@@ -895,7 +895,7 @@ typedef struct bInvalidHandle {
|
||||
class SoftBodyTetraData
|
||||
{
|
||||
public:
|
||||
btVector3FloatData m_c0[4];
|
||||
b3Vector3FloatData m_c0[4];
|
||||
SoftBodyMaterialData *m_material;
|
||||
int m_nodeIndices[4];
|
||||
float m_restVolume;
|
||||
@@ -909,9 +909,9 @@ typedef struct bInvalidHandle {
|
||||
class SoftRigidAnchorData
|
||||
{
|
||||
public:
|
||||
btMatrix3x3FloatData m_c0;
|
||||
btVector3FloatData m_c1;
|
||||
btVector3FloatData m_localFrame;
|
||||
b3Matrix3x3FloatData m_c0;
|
||||
b3Vector3FloatData m_c1;
|
||||
b3Vector3FloatData m_localFrame;
|
||||
bInvalidHandle *m_rigidBody;
|
||||
int m_nodeIndex;
|
||||
float m_c2;
|
||||
@@ -955,11 +955,11 @@ typedef struct bInvalidHandle {
|
||||
class SoftBodyPoseData
|
||||
{
|
||||
public:
|
||||
btMatrix3x3FloatData m_rot;
|
||||
btMatrix3x3FloatData m_scale;
|
||||
btMatrix3x3FloatData m_aqq;
|
||||
btVector3FloatData m_com;
|
||||
btVector3FloatData *m_positions;
|
||||
b3Matrix3x3FloatData m_rot;
|
||||
b3Matrix3x3FloatData m_scale;
|
||||
b3Matrix3x3FloatData m_aqq;
|
||||
b3Vector3FloatData m_com;
|
||||
b3Vector3FloatData *m_positions;
|
||||
float *m_weights;
|
||||
int m_numPositions;
|
||||
int m_numWeigts;
|
||||
@@ -974,15 +974,15 @@ typedef struct bInvalidHandle {
|
||||
class SoftBodyClusterData
|
||||
{
|
||||
public:
|
||||
btTransformFloatData m_framexform;
|
||||
btMatrix3x3FloatData m_locii;
|
||||
btMatrix3x3FloatData m_invwi;
|
||||
btVector3FloatData m_com;
|
||||
btVector3FloatData m_vimpulses[2];
|
||||
btVector3FloatData m_dimpulses[2];
|
||||
btVector3FloatData m_lv;
|
||||
btVector3FloatData m_av;
|
||||
btVector3FloatData *m_framerefs;
|
||||
b3TransformFloatData m_framexform;
|
||||
b3Matrix3x3FloatData m_locii;
|
||||
b3Matrix3x3FloatData m_invwi;
|
||||
b3Vector3FloatData m_com;
|
||||
b3Vector3FloatData m_vimpulses[2];
|
||||
b3Vector3FloatData m_dimpulses[2];
|
||||
b3Vector3FloatData m_lv;
|
||||
b3Vector3FloatData m_av;
|
||||
b3Vector3FloatData *m_framerefs;
|
||||
int *m_nodeIndices;
|
||||
float *m_masses;
|
||||
int m_numFrameRefs;
|
||||
@@ -1005,17 +1005,17 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btSoftBodyJointData
|
||||
class b3SoftBodyJointData
|
||||
{
|
||||
public:
|
||||
void *m_bodyA;
|
||||
void *m_bodyB;
|
||||
btVector3FloatData m_refs[2];
|
||||
b3Vector3FloatData m_refs[2];
|
||||
float m_cfm;
|
||||
float m_erp;
|
||||
float m_split;
|
||||
int m_delete;
|
||||
btVector3FloatData m_relPosition[2];
|
||||
b3Vector3FloatData m_relPosition[2];
|
||||
int m_bodyAtype;
|
||||
int m_bodyBtype;
|
||||
int m_jointType;
|
||||
@@ -1024,10 +1024,10 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btSoftBodyFloatData
|
||||
class b3SoftBodyFloatData
|
||||
{
|
||||
public:
|
||||
btCollisionObjectFloatData m_collisionObjectData;
|
||||
b3CollisionObjectFloatData m_collisionObjectData;
|
||||
SoftBodyPoseData *m_pose;
|
||||
SoftBodyMaterialData **m_materials;
|
||||
SoftBodyNodeData *m_nodes;
|
||||
@@ -1036,7 +1036,7 @@ typedef struct bInvalidHandle {
|
||||
SoftBodyTetraData *m_tetrahedra;
|
||||
SoftRigidAnchorData *m_anchors;
|
||||
SoftBodyClusterData *m_clusters;
|
||||
btSoftBodyJointData *m_joints;
|
||||
b3SoftBodyJointData *m_joints;
|
||||
int m_numMaterials;
|
||||
int m_numNodes;
|
||||
int m_numLinks;
|
||||
|
||||
@@ -13,7 +13,7 @@ subject to the following restrictions:
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#include "btBulletFile.h"
|
||||
#include "b3BulletFile.h"
|
||||
#include "bDefines.h"
|
||||
#include "bDNA.h"
|
||||
|
||||
@@ -24,7 +24,7 @@ subject to the following restrictions:
|
||||
|
||||
|
||||
// 32 && 64 bit versions
|
||||
#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#ifdef B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#ifdef _WIN64
|
||||
extern char sBulletDNAstr64[];
|
||||
extern int sBulletDNAlen64;
|
||||
@@ -32,18 +32,18 @@ extern int sBulletDNAlen64;
|
||||
extern char sBulletDNAstr[];
|
||||
extern int sBulletDNAlen;
|
||||
#endif //_WIN64
|
||||
#else//BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#else//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
|
||||
extern char sBulletDNAstr64[];
|
||||
extern int sBulletDNAlen64;
|
||||
extern char sBulletDNAstr[];
|
||||
extern int sBulletDNAlen;
|
||||
|
||||
#endif //BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#endif //B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
|
||||
using namespace bParse;
|
||||
|
||||
btBulletFile::btBulletFile()
|
||||
b3BulletFile::b3BulletFile()
|
||||
:bFile("", "BULLET ")
|
||||
{
|
||||
mMemoryDNA = new bDNA(); //this memory gets released in the bFile::~bFile destructor,@todo not consistent with the rule 'who allocates it, has to deallocate it"
|
||||
@@ -51,35 +51,35 @@ btBulletFile::btBulletFile()
|
||||
m_DnaCopy = 0;
|
||||
|
||||
|
||||
#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#ifdef B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#ifdef _WIN64
|
||||
m_DnaCopy = (char*)btAlignedAlloc(sBulletDNAlen64,16);
|
||||
m_DnaCopy = (char*)b3AlignedAlloc(sBulletDNAlen64,16);
|
||||
memcpy(m_DnaCopy,sBulletDNAstr64,sBulletDNAlen64);
|
||||
mMemoryDNA->init(m_DnaCopy,sBulletDNAlen64);
|
||||
#else//_WIN64
|
||||
m_DnaCopy = (char*)btAlignedAlloc(sBulletDNAlen,16);
|
||||
m_DnaCopy = (char*)b3AlignedAlloc(sBulletDNAlen,16);
|
||||
memcpy(m_DnaCopy,sBulletDNAstr,sBulletDNAlen);
|
||||
mMemoryDNA->init(m_DnaCopy,sBulletDNAlen);
|
||||
#endif//_WIN64
|
||||
#else//BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#else//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
if (VOID_IS_8)
|
||||
{
|
||||
m_DnaCopy = (char*) btAlignedAlloc(sBulletDNAlen64,16);
|
||||
m_DnaCopy = (char*) b3AlignedAlloc(sBulletDNAlen64,16);
|
||||
memcpy(m_DnaCopy,sBulletDNAstr64,sBulletDNAlen64);
|
||||
mMemoryDNA->init(m_DnaCopy,sBulletDNAlen64);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_DnaCopy =(char*) btAlignedAlloc(sBulletDNAlen,16);
|
||||
m_DnaCopy =(char*) b3AlignedAlloc(sBulletDNAlen,16);
|
||||
memcpy(m_DnaCopy,sBulletDNAstr,sBulletDNAlen);
|
||||
mMemoryDNA->init(m_DnaCopy,sBulletDNAlen);
|
||||
}
|
||||
#endif//BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#endif//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
}
|
||||
|
||||
|
||||
|
||||
btBulletFile::btBulletFile(const char* fileName)
|
||||
b3BulletFile::b3BulletFile(const char* fileName)
|
||||
:bFile(fileName, "BULLET ")
|
||||
{
|
||||
m_DnaCopy = 0;
|
||||
@@ -87,17 +87,17 @@ btBulletFile::btBulletFile(const char* fileName)
|
||||
|
||||
|
||||
|
||||
btBulletFile::btBulletFile(char *memoryBuffer, int len)
|
||||
b3BulletFile::b3BulletFile(char *memoryBuffer, int len)
|
||||
:bFile(memoryBuffer,len, "BULLET ")
|
||||
{
|
||||
m_DnaCopy = 0;
|
||||
}
|
||||
|
||||
|
||||
btBulletFile::~btBulletFile()
|
||||
b3BulletFile::~b3BulletFile()
|
||||
{
|
||||
if (m_DnaCopy)
|
||||
btAlignedFree(m_DnaCopy);
|
||||
b3AlignedFree(m_DnaCopy);
|
||||
|
||||
|
||||
while (m_dataBlocks.size())
|
||||
@@ -112,7 +112,7 @@ btBulletFile::~btBulletFile()
|
||||
|
||||
|
||||
// ----------------------------------------------------- //
|
||||
void btBulletFile::parseData()
|
||||
void b3BulletFile::parseData()
|
||||
{
|
||||
// printf ("Building datablocks");
|
||||
// printf ("Chunk size = %d",CHUNK_HEADER_LEN);
|
||||
@@ -143,7 +143,7 @@ void btBulletFile::parseData()
|
||||
|
||||
while (dataChunk.code != DNA1)
|
||||
{
|
||||
if (!brokenDNA || (dataChunk.code != BT_QUANTIZED_BVH_CODE) )
|
||||
if (!brokenDNA || (dataChunk.code != B3_QUANTIZED_BVH_CODE) )
|
||||
{
|
||||
|
||||
// one behind
|
||||
@@ -169,42 +169,42 @@ void btBulletFile::parseData()
|
||||
// listID->push_back((bStructHandle*)id);
|
||||
}
|
||||
|
||||
if (dataChunk.code == BT_SOFTBODY_CODE)
|
||||
if (dataChunk.code == B3_SOFTBODY_CODE)
|
||||
{
|
||||
m_softBodies.push_back((bStructHandle*) id);
|
||||
}
|
||||
|
||||
if (dataChunk.code == BT_RIGIDBODY_CODE)
|
||||
if (dataChunk.code == B3_RIGIDBODY_CODE)
|
||||
{
|
||||
m_rigidBodies.push_back((bStructHandle*) id);
|
||||
}
|
||||
|
||||
if (dataChunk.code == BT_DYNAMICSWORLD_CODE)
|
||||
if (dataChunk.code == B3_DYNAMICSWORLD_CODE)
|
||||
{
|
||||
m_dynamicsWorldInfo.push_back((bStructHandle*) id);
|
||||
}
|
||||
|
||||
if (dataChunk.code == BT_CONSTRAINT_CODE)
|
||||
if (dataChunk.code == B3_CONSTRAINT_CODE)
|
||||
{
|
||||
m_constraints.push_back((bStructHandle*) id);
|
||||
}
|
||||
|
||||
if (dataChunk.code == BT_QUANTIZED_BVH_CODE)
|
||||
if (dataChunk.code == B3_QUANTIZED_BVH_CODE)
|
||||
{
|
||||
m_bvhs.push_back((bStructHandle*) id);
|
||||
}
|
||||
|
||||
if (dataChunk.code == BT_TRIANLGE_INFO_MAP)
|
||||
if (dataChunk.code == B3_TRIANLGE_INFO_MAP)
|
||||
{
|
||||
m_triangleInfoMaps.push_back((bStructHandle*) id);
|
||||
}
|
||||
|
||||
if (dataChunk.code == BT_COLLISIONOBJECT_CODE)
|
||||
if (dataChunk.code == B3_COLLISIONOBJECT_CODE)
|
||||
{
|
||||
m_collisionObjects.push_back((bStructHandle*) id);
|
||||
}
|
||||
|
||||
if (dataChunk.code == BT_SHAPE_CODE)
|
||||
if (dataChunk.code == B3_SHAPE_CODE)
|
||||
{
|
||||
m_collisionShapes.push_back((bStructHandle*) id);
|
||||
}
|
||||
@@ -221,7 +221,7 @@ void btBulletFile::parseData()
|
||||
}
|
||||
} else
|
||||
{
|
||||
printf("skipping BT_QUANTIZED_BVH_CODE due to broken DNA\n");
|
||||
printf("skipping B3_QUANTIZED_BVH_CODE due to broken DNA\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ void btBulletFile::parseData()
|
||||
|
||||
}
|
||||
|
||||
void btBulletFile::addDataBlock(char* dataBlock)
|
||||
void b3BulletFile::addDataBlock(char* dataBlock)
|
||||
{
|
||||
m_dataBlocks.push_back(dataBlock);
|
||||
|
||||
@@ -246,14 +246,14 @@ void btBulletFile::addDataBlock(char* dataBlock)
|
||||
|
||||
|
||||
|
||||
void btBulletFile::writeDNA(FILE* fp)
|
||||
void b3BulletFile::writeDNA(FILE* fp)
|
||||
{
|
||||
|
||||
bChunkInd dataChunk;
|
||||
dataChunk.code = DNA1;
|
||||
dataChunk.dna_nr = 0;
|
||||
dataChunk.nr = 1;
|
||||
#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#ifdef B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
if (VOID_IS_8)
|
||||
{
|
||||
#ifdef _WIN64
|
||||
@@ -262,7 +262,7 @@ void btBulletFile::writeDNA(FILE* fp)
|
||||
fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
|
||||
fwrite(sBulletDNAstr64, sBulletDNAlen64,1,fp);
|
||||
#else
|
||||
btAssert(0);
|
||||
b3Assert(0);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -273,10 +273,10 @@ void btBulletFile::writeDNA(FILE* fp)
|
||||
fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
|
||||
fwrite(sBulletDNAstr, sBulletDNAlen,1,fp);
|
||||
#else//_WIN64
|
||||
btAssert(0);
|
||||
b3Assert(0);
|
||||
#endif//_WIN64
|
||||
}
|
||||
#else//BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#else//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
if (VOID_IS_8)
|
||||
{
|
||||
dataChunk.len = sBulletDNAlen64;
|
||||
@@ -291,24 +291,24 @@ void btBulletFile::writeDNA(FILE* fp)
|
||||
fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
|
||||
fwrite(sBulletDNAstr, sBulletDNAlen,1,fp);
|
||||
}
|
||||
#endif//BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#endif//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
}
|
||||
|
||||
|
||||
void btBulletFile::parse(int verboseMode)
|
||||
void b3BulletFile::parse(int verboseMode)
|
||||
{
|
||||
#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#ifdef B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
if (VOID_IS_8)
|
||||
{
|
||||
#ifdef _WIN64
|
||||
|
||||
if (m_DnaCopy)
|
||||
delete m_DnaCopy;
|
||||
m_DnaCopy = (char*)btAlignedAlloc(sBulletDNAlen64,16);
|
||||
m_DnaCopy = (char*)b3AlignedAlloc(sBulletDNAlen64,16);
|
||||
memcpy(m_DnaCopy,sBulletDNAstr64,sBulletDNAlen64);
|
||||
parseInternal(verboseMode,(char*)sBulletDNAstr64,sBulletDNAlen64);
|
||||
#else
|
||||
btAssert(0);
|
||||
b3Assert(0);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -317,19 +317,19 @@ void btBulletFile::parse(int verboseMode)
|
||||
|
||||
if (m_DnaCopy)
|
||||
delete m_DnaCopy;
|
||||
m_DnaCopy = (char*)btAlignedAlloc(sBulletDNAlen,16);
|
||||
m_DnaCopy = (char*)b3AlignedAlloc(sBulletDNAlen,16);
|
||||
memcpy(m_DnaCopy,sBulletDNAstr,sBulletDNAlen);
|
||||
parseInternal(verboseMode,m_DnaCopy,sBulletDNAlen);
|
||||
#else
|
||||
btAssert(0);
|
||||
b3Assert(0);
|
||||
#endif
|
||||
}
|
||||
#else//BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#else//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
if (VOID_IS_8)
|
||||
{
|
||||
if (m_DnaCopy)
|
||||
delete m_DnaCopy;
|
||||
m_DnaCopy = (char*)btAlignedAlloc(sBulletDNAlen64,16);
|
||||
m_DnaCopy = (char*)b3AlignedAlloc(sBulletDNAlen64,16);
|
||||
memcpy(m_DnaCopy,sBulletDNAstr64,sBulletDNAlen64);
|
||||
parseInternal(verboseMode,m_DnaCopy,sBulletDNAlen64);
|
||||
}
|
||||
@@ -337,11 +337,11 @@ void btBulletFile::parse(int verboseMode)
|
||||
{
|
||||
if (m_DnaCopy)
|
||||
delete m_DnaCopy;
|
||||
m_DnaCopy = (char*)btAlignedAlloc(sBulletDNAlen,16);
|
||||
m_DnaCopy = (char*)b3AlignedAlloc(sBulletDNAlen,16);
|
||||
memcpy(m_DnaCopy,sBulletDNAstr,sBulletDNAlen);
|
||||
parseInternal(verboseMode,m_DnaCopy,sBulletDNAlen);
|
||||
}
|
||||
#endif//BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#endif//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
|
||||
//the parsing will convert to cpu endian
|
||||
mFlags &=~FD_ENDIAN_SWAP;
|
||||
@@ -354,7 +354,7 @@ void btBulletFile::parse(int verboseMode)
|
||||
}
|
||||
|
||||
// experimental
|
||||
int btBulletFile::write(const char* fileName, bool fixupPointers)
|
||||
int b3BulletFile::write(const char* fileName, bool fixupPointers)
|
||||
{
|
||||
FILE *fp = fopen(fileName, "wb");
|
||||
if (fp)
|
||||
@@ -401,7 +401,7 @@ int btBulletFile::write(const char* fileName, bool fixupPointers)
|
||||
|
||||
|
||||
|
||||
void btBulletFile::addStruct(const char* structType,void* data, int len, void* oldPtr, int code)
|
||||
void b3BulletFile::addStruct(const char* structType,void* data, int len, void* oldPtr, int code)
|
||||
{
|
||||
|
||||
bParse::bChunkInd dataChunk;
|
||||
@@ -13,22 +13,22 @@ subject to the following restrictions:
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#ifndef BT_BULLET_FILE_H
|
||||
#define BT_BULLET_FILE_H
|
||||
#ifndef B3_BULLET_FILE_H
|
||||
#define B3_BULLET_FILE_H
|
||||
|
||||
|
||||
#include "bFile.h"
|
||||
#include "Bullet3Common/b3AlignedObjectArray.h"
|
||||
#include "bDefines.h"
|
||||
|
||||
#include "Bullet3Serialize/Bullet2FileLoader/btSerializer.h"
|
||||
#include "Bullet3Serialize/Bullet2FileLoader/b3Serializer.h"
|
||||
|
||||
|
||||
|
||||
namespace bParse {
|
||||
|
||||
// ----------------------------------------------------- //
|
||||
class btBulletFile : public bFile
|
||||
class b3BulletFile : public bFile
|
||||
{
|
||||
|
||||
|
||||
@@ -55,13 +55,13 @@ namespace bParse {
|
||||
b3AlignedObjectArray<bStructHandle*> m_dynamicsWorldInfo;
|
||||
|
||||
b3AlignedObjectArray<char*> m_dataBlocks;
|
||||
btBulletFile();
|
||||
b3BulletFile();
|
||||
|
||||
btBulletFile(const char* fileName);
|
||||
b3BulletFile(const char* fileName);
|
||||
|
||||
btBulletFile(char *memoryBuffer, int len);
|
||||
b3BulletFile(char *memoryBuffer, int len);
|
||||
|
||||
virtual ~btBulletFile();
|
||||
virtual ~b3BulletFile();
|
||||
|
||||
virtual void addDataBlock(char* dataBlock);
|
||||
|
||||
@@ -80,4 +80,4 @@ namespace bParse {
|
||||
};
|
||||
};
|
||||
|
||||
#endif //BT_BULLET_FILE_H
|
||||
#endif //B3_BULLET_FILE_H
|
||||
@@ -13,8 +13,8 @@ subject to the following restrictions:
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#ifndef BT_SERIALIZER_H
|
||||
#define BT_SERIALIZER_H
|
||||
#ifndef B3_SERIALIZER_H
|
||||
#define B3_SERIALIZER_H
|
||||
|
||||
#include "Bullet3Common/b3Scalar.h" // has definitions like SIMD_FORCE_INLINE
|
||||
#include "Bullet3Common/b3StackAlloc.h"
|
||||
@@ -33,7 +33,7 @@ extern int sBulletDNAlen;
|
||||
extern char sBulletDNAstr64[];
|
||||
extern int sBulletDNAlen64;
|
||||
|
||||
SIMD_FORCE_INLINE int btStrLen(const char* str)
|
||||
SIMD_FORCE_INLINE int b3StrLen(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
return(0);
|
||||
@@ -49,7 +49,7 @@ SIMD_FORCE_INLINE int btStrLen(const char* str)
|
||||
}
|
||||
|
||||
|
||||
class btChunk
|
||||
class b3Chunk
|
||||
{
|
||||
public:
|
||||
int m_chunkCode;
|
||||
@@ -59,27 +59,27 @@ public:
|
||||
int m_number;
|
||||
};
|
||||
|
||||
enum btSerializationFlags
|
||||
enum b3SerializationFlags
|
||||
{
|
||||
BT_SERIALIZE_NO_BVH = 1,
|
||||
BT_SERIALIZE_NO_TRIANGLEINFOMAP = 2,
|
||||
BT_SERIALIZE_NO_DUPLICATE_ASSERT = 4
|
||||
B3_SERIALIZE_NO_BVH = 1,
|
||||
B3_SERIALIZE_NO_TRIANGLEINFOMAP = 2,
|
||||
B3_SERIALIZE_NO_DUPLICATE_ASSERT = 4
|
||||
};
|
||||
|
||||
class btSerializer
|
||||
class b3Serializer
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
virtual ~btSerializer() {}
|
||||
virtual ~b3Serializer() {}
|
||||
|
||||
virtual const unsigned char* getBufferPointer() const = 0;
|
||||
|
||||
virtual int getCurrentBufferSize() const = 0;
|
||||
|
||||
virtual btChunk* allocate(size_t size, int numElements) = 0;
|
||||
virtual b3Chunk* allocate(size_t size, int numElements) = 0;
|
||||
|
||||
virtual void finalizeChunk(btChunk* chunk, const char* structType, int chunkCode,void* oldPtr)= 0;
|
||||
virtual void finalizeChunk(b3Chunk* chunk, const char* structType, int chunkCode,void* oldPtr)= 0;
|
||||
|
||||
virtual void* findPointer(void* oldPtr) = 0;
|
||||
|
||||
@@ -104,29 +104,29 @@ public:
|
||||
|
||||
|
||||
|
||||
#define BT_HEADER_LENGTH 12
|
||||
#define B3_HEADER_LENGTH 12
|
||||
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
|
||||
# define BT_MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
||||
# define B3_MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
||||
#else
|
||||
# define BT_MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
||||
# define B3_MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
||||
#endif
|
||||
|
||||
#define BT_SOFTBODY_CODE BT_MAKE_ID('S','B','D','Y')
|
||||
#define BT_COLLISIONOBJECT_CODE BT_MAKE_ID('C','O','B','J')
|
||||
#define BT_RIGIDBODY_CODE BT_MAKE_ID('R','B','D','Y')
|
||||
#define BT_CONSTRAINT_CODE BT_MAKE_ID('C','O','N','S')
|
||||
#define BT_BOXSHAPE_CODE BT_MAKE_ID('B','O','X','S')
|
||||
#define BT_QUANTIZED_BVH_CODE BT_MAKE_ID('Q','B','V','H')
|
||||
#define BT_TRIANLGE_INFO_MAP BT_MAKE_ID('T','M','A','P')
|
||||
#define BT_SHAPE_CODE BT_MAKE_ID('S','H','A','P')
|
||||
#define BT_ARRAY_CODE BT_MAKE_ID('A','R','A','Y')
|
||||
#define BT_SBMATERIAL_CODE BT_MAKE_ID('S','B','M','T')
|
||||
#define BT_SBNODE_CODE BT_MAKE_ID('S','B','N','D')
|
||||
#define BT_DYNAMICSWORLD_CODE BT_MAKE_ID('D','W','L','D')
|
||||
#define BT_DNA_CODE BT_MAKE_ID('D','N','A','1')
|
||||
#define B3_SOFTBODY_CODE B3_MAKE_ID('S','B','D','Y')
|
||||
#define B3_COLLISIONOBJECT_CODE B3_MAKE_ID('C','O','B','J')
|
||||
#define B3_RIGIDBODY_CODE B3_MAKE_ID('R','B','D','Y')
|
||||
#define B3_CONSTRAINT_CODE B3_MAKE_ID('C','O','N','S')
|
||||
#define B3_BOXSHAPE_CODE B3_MAKE_ID('B','O','X','S')
|
||||
#define B3_QUANTIZED_BVH_CODE B3_MAKE_ID('Q','B','V','H')
|
||||
#define B3_TRIANLGE_INFO_MAP B3_MAKE_ID('T','M','A','P')
|
||||
#define B3_SHAPE_CODE B3_MAKE_ID('S','H','A','P')
|
||||
#define B3_ARRAY_CODE B3_MAKE_ID('A','R','A','Y')
|
||||
#define B3_SBMATERIAL_CODE B3_MAKE_ID('S','B','M','T')
|
||||
#define B3_SBNODE_CODE B3_MAKE_ID('S','B','N','D')
|
||||
#define B3_DYNAMICSWORLD_CODE B3_MAKE_ID('D','W','L','D')
|
||||
#define B3_DNA_CODE B3_MAKE_ID('D','N','A','1')
|
||||
|
||||
|
||||
struct btPointerUid
|
||||
struct b3PointerUid
|
||||
{
|
||||
union
|
||||
{
|
||||
@@ -135,24 +135,24 @@ struct btPointerUid
|
||||
};
|
||||
};
|
||||
|
||||
///The btDefaultSerializer is the main Bullet serialization class.
|
||||
///The b3DefaultSerializer is the main Bullet serialization class.
|
||||
///The constructor takes an optional argument for backwards compatibility, it is recommended to leave this empty/zero.
|
||||
class btDefaultSerializer : public btSerializer
|
||||
class b3DefaultSerializer : public b3Serializer
|
||||
{
|
||||
|
||||
|
||||
b3AlignedObjectArray<char*> mTypes;
|
||||
b3AlignedObjectArray<short*> mStructs;
|
||||
b3AlignedObjectArray<short> mTlens;
|
||||
b3HashMap<btHashInt, int> mStructReverse;
|
||||
b3HashMap<btHashString,int> mTypeLookup;
|
||||
b3HashMap<b3HashInt, int> mStructReverse;
|
||||
b3HashMap<b3HashString,int> mTypeLookup;
|
||||
|
||||
|
||||
b3HashMap<btHashPtr,void*> m_chunkP;
|
||||
b3HashMap<b3HashPtr,void*> m_chunkP;
|
||||
|
||||
b3HashMap<btHashPtr,const char*> m_nameMap;
|
||||
b3HashMap<b3HashPtr,const char*> m_nameMap;
|
||||
|
||||
b3HashMap<btHashPtr,btPointerUid> m_uniquePointers;
|
||||
b3HashMap<b3HashPtr,b3PointerUid> m_uniquePointers;
|
||||
int m_uniqueIdGenerator;
|
||||
|
||||
int m_totalSize;
|
||||
@@ -164,7 +164,7 @@ class btDefaultSerializer : public btSerializer
|
||||
int m_serializationFlags;
|
||||
|
||||
|
||||
b3AlignedObjectArray<btChunk*> m_chunkPtrs;
|
||||
b3AlignedObjectArray<b3Chunk*> m_chunkPtrs;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -182,15 +182,15 @@ protected:
|
||||
|
||||
void writeDNA()
|
||||
{
|
||||
btChunk* dnaChunk = allocate(m_dnaLength,1);
|
||||
b3Chunk* dnaChunk = allocate(m_dnaLength,1);
|
||||
memcpy(dnaChunk->m_oldPtr,m_dna,m_dnaLength);
|
||||
finalizeChunk(dnaChunk,"DNA1",BT_DNA_CODE, m_dna);
|
||||
finalizeChunk(dnaChunk,"DNA1",B3_DNA_CODE, m_dna);
|
||||
}
|
||||
|
||||
int getReverseType(const char *type) const
|
||||
{
|
||||
|
||||
btHashString key(type);
|
||||
b3HashString key(type);
|
||||
const int* valuePtr = mTypeLookup.find(key);
|
||||
if (valuePtr)
|
||||
return *valuePtr;
|
||||
@@ -208,7 +208,7 @@ protected:
|
||||
littleEndian= ((char*)&littleEndian)[0];
|
||||
|
||||
|
||||
m_dna = btAlignedAlloc(dnalen,16);
|
||||
m_dna = b3AlignedAlloc(dnalen,16);
|
||||
memcpy(m_dna,bdnaOrg,dnalen);
|
||||
m_dnaLength = dnalen;
|
||||
|
||||
@@ -233,7 +233,7 @@ protected:
|
||||
|
||||
// Parse names
|
||||
if (!littleEndian)
|
||||
*intPtr = btSwapEndian(*intPtr);
|
||||
*intPtr = b3SwapEndian(*intPtr);
|
||||
|
||||
dataLen = *intPtr;
|
||||
|
||||
@@ -247,7 +247,7 @@ protected:
|
||||
while (*cp)cp++;
|
||||
cp++;
|
||||
}
|
||||
cp = btAlignPointer(cp,4);
|
||||
cp = b3AlignPointer(cp,4);
|
||||
|
||||
/*
|
||||
TYPE (4 bytes)
|
||||
@@ -257,10 +257,10 @@ protected:
|
||||
*/
|
||||
|
||||
intPtr = (int*)cp;
|
||||
btAssert(strncmp(cp, "TYPE", 4)==0); intPtr++;
|
||||
b3Assert(strncmp(cp, "TYPE", 4)==0); intPtr++;
|
||||
|
||||
if (!littleEndian)
|
||||
*intPtr = btSwapEndian(*intPtr);
|
||||
*intPtr = b3SwapEndian(*intPtr);
|
||||
|
||||
dataLen = *intPtr;
|
||||
intPtr++;
|
||||
@@ -274,7 +274,7 @@ protected:
|
||||
cp++;
|
||||
}
|
||||
|
||||
cp = btAlignPointer(cp,4);
|
||||
cp = b3AlignPointer(cp,4);
|
||||
|
||||
|
||||
/*
|
||||
@@ -285,7 +285,7 @@ protected:
|
||||
|
||||
// Parse type lens
|
||||
intPtr = (int*)cp;
|
||||
btAssert(strncmp(cp, "TLEN", 4)==0); intPtr++;
|
||||
b3Assert(strncmp(cp, "TLEN", 4)==0); intPtr++;
|
||||
|
||||
dataLen = (int)mTypes.size();
|
||||
|
||||
@@ -293,7 +293,7 @@ protected:
|
||||
for (i=0; i<dataLen; i++, shtPtr++)
|
||||
{
|
||||
if (!littleEndian)
|
||||
shtPtr[0] = btSwapEndian(shtPtr[0]);
|
||||
shtPtr[0] = b3SwapEndian(shtPtr[0]);
|
||||
mTlens.push_back(shtPtr[0]);
|
||||
}
|
||||
|
||||
@@ -312,10 +312,10 @@ protected:
|
||||
|
||||
intPtr = (int*)shtPtr;
|
||||
cp = (char*)intPtr;
|
||||
btAssert(strncmp(cp, "STRC", 4)==0); intPtr++;
|
||||
b3Assert(strncmp(cp, "STRC", 4)==0); intPtr++;
|
||||
|
||||
if (!littleEndian)
|
||||
*intPtr = btSwapEndian(*intPtr);
|
||||
*intPtr = b3SwapEndian(*intPtr);
|
||||
dataLen = *intPtr ;
|
||||
intPtr++;
|
||||
|
||||
@@ -327,16 +327,16 @@ protected:
|
||||
|
||||
if (!littleEndian)
|
||||
{
|
||||
shtPtr[0]= btSwapEndian(shtPtr[0]);
|
||||
shtPtr[1]= btSwapEndian(shtPtr[1]);
|
||||
shtPtr[0]= b3SwapEndian(shtPtr[0]);
|
||||
shtPtr[1]= b3SwapEndian(shtPtr[1]);
|
||||
|
||||
int len = shtPtr[1];
|
||||
shtPtr+= 2;
|
||||
|
||||
for (int a=0; a<len; a++, shtPtr+=2)
|
||||
{
|
||||
shtPtr[0]= btSwapEndian(shtPtr[0]);
|
||||
shtPtr[1]= btSwapEndian(shtPtr[1]);
|
||||
shtPtr[0]= b3SwapEndian(shtPtr[0]);
|
||||
shtPtr[1]= b3SwapEndian(shtPtr[1]);
|
||||
}
|
||||
|
||||
} else
|
||||
@@ -350,7 +350,7 @@ protected:
|
||||
{
|
||||
short *strc = mStructs.at(i);
|
||||
mStructReverse.insert(strc[0], i);
|
||||
mTypeLookup.insert(btHashString(mTypes[strc[0]]),i);
|
||||
mTypeLookup.insert(b3HashString(mTypes[strc[0]]),i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,35 +359,35 @@ public:
|
||||
|
||||
|
||||
|
||||
btDefaultSerializer(int totalSize=0)
|
||||
b3DefaultSerializer(int totalSize=0)
|
||||
:m_totalSize(totalSize),
|
||||
m_currentSize(0),
|
||||
m_dna(0),
|
||||
m_dnaLength(0),
|
||||
m_serializationFlags(0)
|
||||
{
|
||||
m_buffer = m_totalSize?(unsigned char*)btAlignedAlloc(totalSize,16):0;
|
||||
m_buffer = m_totalSize?(unsigned char*)b3AlignedAlloc(totalSize,16):0;
|
||||
|
||||
const bool VOID_IS_8 = ((sizeof(void*)==8));
|
||||
|
||||
#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#ifdef B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
if (VOID_IS_8)
|
||||
{
|
||||
#if _WIN64
|
||||
initDNA((const char*)sBulletDNAstr64,sBulletDNAlen64);
|
||||
#else
|
||||
btAssert(0);
|
||||
b3Assert(0);
|
||||
#endif
|
||||
} else
|
||||
{
|
||||
#ifndef _WIN64
|
||||
initDNA((const char*)sBulletDNAstr,sBulletDNAlen);
|
||||
#else
|
||||
btAssert(0);
|
||||
b3Assert(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#else //BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#else //B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
if (VOID_IS_8)
|
||||
{
|
||||
initDNA((const char*)sBulletDNAstr64,sBulletDNAlen64);
|
||||
@@ -395,27 +395,27 @@ public:
|
||||
{
|
||||
initDNA((const char*)sBulletDNAstr,sBulletDNAlen);
|
||||
}
|
||||
#endif //BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
#endif //B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
|
||||
|
||||
}
|
||||
|
||||
virtual ~btDefaultSerializer()
|
||||
virtual ~b3DefaultSerializer()
|
||||
{
|
||||
if (m_buffer)
|
||||
btAlignedFree(m_buffer);
|
||||
b3AlignedFree(m_buffer);
|
||||
if (m_dna)
|
||||
btAlignedFree(m_dna);
|
||||
b3AlignedFree(m_dna);
|
||||
}
|
||||
|
||||
void writeHeader(unsigned char* buffer) const
|
||||
{
|
||||
|
||||
|
||||
#ifdef BT_USE_DOUBLE_PRECISION
|
||||
#ifdef B3_USE_DOUBLE_PRECISION
|
||||
memcpy(buffer, "BULLETd", 7);
|
||||
#else
|
||||
memcpy(buffer, "BULLETf", 7);
|
||||
#endif //BT_USE_DOUBLE_PRECISION
|
||||
#endif //B3_USE_DOUBLE_PRECISION
|
||||
|
||||
int littleEndian= 1;
|
||||
littleEndian= ((char*)&littleEndian)[0];
|
||||
@@ -448,7 +448,7 @@ public:
|
||||
m_uniqueIdGenerator= 1;
|
||||
if (m_totalSize)
|
||||
{
|
||||
unsigned char* buffer = internalAlloc(BT_HEADER_LENGTH);
|
||||
unsigned char* buffer = internalAlloc(B3_HEADER_LENGTH);
|
||||
writeHeader(buffer);
|
||||
}
|
||||
|
||||
@@ -463,20 +463,20 @@ public:
|
||||
if (!m_totalSize)
|
||||
{
|
||||
if (m_buffer)
|
||||
btAlignedFree(m_buffer);
|
||||
b3AlignedFree(m_buffer);
|
||||
|
||||
m_currentSize += BT_HEADER_LENGTH;
|
||||
m_buffer = (unsigned char*)btAlignedAlloc(m_currentSize,16);
|
||||
m_currentSize += B3_HEADER_LENGTH;
|
||||
m_buffer = (unsigned char*)b3AlignedAlloc(m_currentSize,16);
|
||||
|
||||
unsigned char* currentPtr = m_buffer;
|
||||
writeHeader(m_buffer);
|
||||
currentPtr += BT_HEADER_LENGTH;
|
||||
mysize+=BT_HEADER_LENGTH;
|
||||
currentPtr += B3_HEADER_LENGTH;
|
||||
mysize+=B3_HEADER_LENGTH;
|
||||
for (int i=0;i< m_chunkPtrs.size();i++)
|
||||
{
|
||||
int curLength = sizeof(btChunk)+m_chunkPtrs[i]->m_length;
|
||||
int curLength = sizeof(b3Chunk)+m_chunkPtrs[i]->m_length;
|
||||
memcpy(currentPtr,m_chunkPtrs[i], curLength);
|
||||
btAlignedFree(m_chunkPtrs[i]);
|
||||
b3AlignedFree(m_chunkPtrs[i]);
|
||||
currentPtr+=curLength;
|
||||
mysize+=curLength;
|
||||
}
|
||||
@@ -498,14 +498,14 @@ public:
|
||||
if (!oldPtr)
|
||||
return 0;
|
||||
|
||||
btPointerUid* uptr = (btPointerUid*)m_uniquePointers.find(oldPtr);
|
||||
b3PointerUid* uptr = (b3PointerUid*)m_uniquePointers.find(oldPtr);
|
||||
if (uptr)
|
||||
{
|
||||
return uptr->m_ptr;
|
||||
}
|
||||
m_uniqueIdGenerator++;
|
||||
|
||||
btPointerUid uid;
|
||||
b3PointerUid uid;
|
||||
uid.m_uniqueIds[0] = m_uniqueIdGenerator;
|
||||
uid.m_uniqueIds[1] = m_uniqueIdGenerator;
|
||||
m_uniquePointers.insert(oldPtr,uid);
|
||||
@@ -523,11 +523,11 @@ public:
|
||||
return m_currentSize;
|
||||
}
|
||||
|
||||
virtual void finalizeChunk(btChunk* chunk, const char* structType, int chunkCode,void* oldPtr)
|
||||
virtual void finalizeChunk(b3Chunk* chunk, const char* structType, int chunkCode,void* oldPtr)
|
||||
{
|
||||
if (!(m_serializationFlags&BT_SERIALIZE_NO_DUPLICATE_ASSERT))
|
||||
if (!(m_serializationFlags&B3_SERIALIZE_NO_DUPLICATE_ASSERT))
|
||||
{
|
||||
btAssert(!findPointer(oldPtr));
|
||||
b3Assert(!findPointer(oldPtr));
|
||||
}
|
||||
|
||||
chunk->m_dna_nr = getReverseType(structType);
|
||||
@@ -550,10 +550,10 @@ public:
|
||||
{
|
||||
ptr = m_buffer+m_currentSize;
|
||||
m_currentSize += int(size);
|
||||
btAssert(m_currentSize<m_totalSize);
|
||||
b3Assert(m_currentSize<m_totalSize);
|
||||
} else
|
||||
{
|
||||
ptr = (unsigned char*)btAlignedAlloc(size,16);
|
||||
ptr = (unsigned char*)b3AlignedAlloc(size,16);
|
||||
m_currentSize += int(size);
|
||||
}
|
||||
return ptr;
|
||||
@@ -561,14 +561,14 @@ public:
|
||||
|
||||
|
||||
|
||||
virtual btChunk* allocate(size_t size, int numElements)
|
||||
virtual b3Chunk* allocate(size_t size, int numElements)
|
||||
{
|
||||
|
||||
unsigned char* ptr = internalAlloc(int(size)*numElements+sizeof(btChunk));
|
||||
unsigned char* ptr = internalAlloc(int(size)*numElements+sizeof(b3Chunk));
|
||||
|
||||
unsigned char* data = ptr + sizeof(btChunk);
|
||||
unsigned char* data = ptr + sizeof(b3Chunk);
|
||||
|
||||
btChunk* chunk = (btChunk*)ptr;
|
||||
b3Chunk* chunk = (b3Chunk*)ptr;
|
||||
chunk->m_chunkCode = 0;
|
||||
chunk->m_oldPtr = data;
|
||||
chunk->m_length = int(size)*numElements;
|
||||
@@ -602,7 +602,7 @@ public:
|
||||
if (findPointer((void*)name))
|
||||
return;
|
||||
|
||||
int len = btStrLen(name);
|
||||
int len = b3StrLen(name);
|
||||
if (len)
|
||||
{
|
||||
|
||||
@@ -611,14 +611,14 @@ public:
|
||||
newLen += padding;
|
||||
|
||||
//serialize name string now
|
||||
btChunk* chunk = allocate(sizeof(char),newLen);
|
||||
b3Chunk* chunk = allocate(sizeof(char),newLen);
|
||||
char* destinationName = (char*)chunk->m_oldPtr;
|
||||
for (int i=0;i<len;i++)
|
||||
{
|
||||
destinationName[i] = name[i];
|
||||
}
|
||||
destinationName[len] = 0;
|
||||
finalizeChunk(chunk,"char",BT_ARRAY_CODE,(void*)name);
|
||||
finalizeChunk(chunk,"char",B3_ARRAY_CODE,(void*)name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -636,5 +636,5 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#endif //BT_SERIALIZER_H
|
||||
#endif //B3_SERIALIZER_H
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace bParse {
|
||||
// delete void* undefined
|
||||
typedef struct bStructHandle {int unused;}bStructHandle;
|
||||
typedef b3AlignedObjectArray<bStructHandle*> bListBasePtr;
|
||||
typedef b3HashMap<btHashPtr, bStructHandle*> bPtrMap;
|
||||
typedef b3HashMap<b3HashPtr, bStructHandle*> bPtrMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ int bDNA::getReverseType(short type)
|
||||
int bDNA::getReverseType(const char *type)
|
||||
{
|
||||
|
||||
btHashString key(type);
|
||||
b3HashString key(type);
|
||||
int* valuePtr = mTypeLookup.find(key);
|
||||
if (valuePtr)
|
||||
return *valuePtr;
|
||||
@@ -514,7 +514,7 @@ void bDNA::init(char *data, int len, bool swap)
|
||||
}
|
||||
|
||||
mStructReverse.insert(strc[0], i);
|
||||
mTypeLookup.insert(btHashString(mTypes[strc[0]]),i);
|
||||
mTypeLookup.insert(b3HashString(mTypes[strc[0]]),i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ namespace bParse {
|
||||
b3AlignedObjectArray<char*> mTypes;
|
||||
b3AlignedObjectArray<short*> mStructs;
|
||||
b3AlignedObjectArray<short> mTlens;
|
||||
b3HashMap<btHashInt, int> mStructReverse;
|
||||
b3HashMap<btHashString,int> mTypeLookup;
|
||||
b3HashMap<b3HashInt, int> mStructReverse;
|
||||
b3HashMap<b3HashString,int> mTypeLookup;
|
||||
|
||||
int mPtrLen;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ subject to the following restrictions:
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "bDefines.h"
|
||||
#include "Bullet3Serialize/Bullet2FileLoader/btSerializer.h"
|
||||
#include "Bullet3Serialize/Bullet2FileLoader/b3Serializer.h"
|
||||
#include "Bullet3Common/b3AlignedAllocator.h"
|
||||
#include "Bullet3Common/b3MinMax.h"
|
||||
|
||||
@@ -33,7 +33,7 @@ const char* getCleanName(const char* memName, char* buffer)
|
||||
{
|
||||
int slen = strlen(memName);
|
||||
assert(slen<MAX_STRLEN);
|
||||
slen=btMin(slen,MAX_STRLEN);
|
||||
slen=b3Min(slen,MAX_STRLEN);
|
||||
for (int i=0;i<slen;i++)
|
||||
{
|
||||
if (memName[i]==']'||memName[i]=='[')
|
||||
@@ -662,11 +662,11 @@ char* bFile::readStruct(char *head, bChunkInd& dataChunk)
|
||||
|
||||
if ((mFlags&FD_BROKEN_DNA)!=0)
|
||||
{
|
||||
if ((strcmp(oldType,"btQuantizedBvhNodeData")==0)&&oldLen==20)
|
||||
if ((strcmp(oldType,"b3QuantizedBvhNodeData")==0)&&oldLen==20)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if ((strcmp(oldType,"btShortIntIndexData")==0))
|
||||
if ((strcmp(oldType,"b3ShortIntIndexData")==0))
|
||||
{
|
||||
int allocLen = 2;
|
||||
char *dataAlloc = new char[(dataChunk.nr*allocLen)+1];
|
||||
@@ -935,8 +935,8 @@ void bFile::safeSwapPtr(char *dst, const char *src)
|
||||
}
|
||||
else if (ptrMem==4 && ptrFile==8)
|
||||
{
|
||||
btPointerUid* oldPtr = (btPointerUid*)src;
|
||||
btPointerUid* newPtr = (btPointerUid*)dst;
|
||||
b3PointerUid* oldPtr = (b3PointerUid*)src;
|
||||
b3PointerUid* newPtr = (b3PointerUid*)dst;
|
||||
|
||||
if (oldPtr->m_uniqueIds[0] == oldPtr->m_uniqueIds[1])
|
||||
{
|
||||
@@ -957,8 +957,8 @@ void bFile::safeSwapPtr(char *dst, const char *src)
|
||||
}
|
||||
else if (ptrMem==8 && ptrFile==4)
|
||||
{
|
||||
btPointerUid* oldPtr = (btPointerUid*)src;
|
||||
btPointerUid* newPtr = (btPointerUid*)dst;
|
||||
b3PointerUid* oldPtr = (b3PointerUid*)src;
|
||||
b3PointerUid* newPtr = (b3PointerUid*)dst;
|
||||
if (oldPtr->m_uniqueIds[0] == oldPtr->m_uniqueIds[1])
|
||||
{
|
||||
newPtr->m_uniqueIds[0] = oldPtr->m_uniqueIds[0];
|
||||
@@ -1192,7 +1192,7 @@ void bFile::resolvePointersMismatch()
|
||||
int p = 0;
|
||||
while (blockLen-- > 0)
|
||||
{
|
||||
btPointerUid dp = {0};
|
||||
b3PointerUid dp = {0};
|
||||
safeSwapPtr((char*)dp.m_uniqueIds, oldPtr);
|
||||
|
||||
void **tptr = (void**)(newPtr + p * ptrMem);
|
||||
@@ -1456,7 +1456,7 @@ void bFile::resolvePointers(int verboseMode)
|
||||
{
|
||||
printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
||||
int numitems = m_chunks.size();
|
||||
printf("<bullet_physics version=%d itemcount = %d>\n", btGetVersion(), numitems);
|
||||
printf("<bullet_physics version=%d itemcount = %d>\n", b3GetVersion(), numitems);
|
||||
}
|
||||
for (int i=0;i<m_chunks.size();i++)
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace bParse {
|
||||
b3AlignedObjectArray<char*> m_pointerPtrFixupArray;
|
||||
|
||||
b3AlignedObjectArray<bChunkInd> m_chunks;
|
||||
b3HashMap<btHashPtr, bChunkInd> m_chunkPtrPtrMap;
|
||||
b3HashMap<b3HashPtr, bChunkInd> m_chunkPtrPtrMap;
|
||||
|
||||
//
|
||||
|
||||
|
||||
Reference in New Issue
Block a user