add support for 16bit indices and 3-float vertices (instead of btVector3 which is 4float) in
in btTriangleMesh container and ColladaConverter. compile issue with PlatformDefinitions in GDC demo.
This commit is contained in:
@@ -177,7 +177,9 @@ ColladaConverter::ColladaConverter(btDynamicsWorld* dynaWorld)
|
||||
m_collada(0),
|
||||
m_dom(0),
|
||||
m_filename(0),
|
||||
m_unitMeterScaling(1.f)
|
||||
m_unitMeterScaling(1.f),
|
||||
m_use32bitIndices(true),
|
||||
m_use4componentVertices(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2692,6 +2694,8 @@ void ColladaConverter::ConvertRigidBodyRef( btRigidBodyInput& rbInput,btRigidBod
|
||||
{
|
||||
|
||||
btTriangleMesh* trimesh = new btTriangleMesh();
|
||||
trimesh->setUse32bitIndices(m_use32bitIndices);
|
||||
trimesh->setUse4componentVertices(m_use4componentVertices);
|
||||
|
||||
for (unsigned int tg = 0;tg<meshRef->getTriangles_array().getCount();tg++)
|
||||
{
|
||||
|
||||
@@ -39,6 +39,8 @@ protected:
|
||||
char* m_filename;
|
||||
|
||||
float m_unitMeterScaling;
|
||||
bool m_use32bitIndices;
|
||||
bool m_use4componentVertices;
|
||||
|
||||
void PreparePhysicsObject(struct btRigidBodyInput& input, bool isDynamics, float mass,btCollisionShape* colShape, btVector3 linearVelocity, btVector3 angularVelocity);
|
||||
|
||||
@@ -101,6 +103,26 @@ public:
|
||||
///if the filename is left empty, modify the filename used during loading
|
||||
bool save(const char* filename = 0);
|
||||
|
||||
void setUse32bitIndices(bool use32bitIndices)
|
||||
{
|
||||
m_use32bitIndices = use32bitIndices;
|
||||
}
|
||||
bool setUse32bitIndices() const
|
||||
{
|
||||
return m_use32bitIndices;
|
||||
}
|
||||
|
||||
void setUse4componentVertices(bool use4componentVertices)
|
||||
{
|
||||
m_use4componentVertices = use4componentVertices;
|
||||
}
|
||||
bool getUse4componentVertices() const
|
||||
{
|
||||
return m_use4componentVertices;
|
||||
}
|
||||
|
||||
|
||||
|
||||
///those virtuals are called by load and save.
|
||||
virtual btTypedConstraint* createUniversalD6Constraint(
|
||||
class btRigidBody* body0,class btRigidBody* otherBody,
|
||||
@@ -125,6 +147,7 @@ public:
|
||||
virtual void setCameraInfo(const btVector3& up, int forwardAxis)
|
||||
{
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif //COLLADA_CONVERTER_H
|
||||
|
||||
Reference in New Issue
Block a user