diff --git a/Demos/ColladaDemo/ColladaConverter.cpp b/Demos/ColladaDemo/ColladaConverter.cpp index 7105bd7a7..e3f4fb0cc 100644 --- a/Demos/ColladaDemo/ColladaConverter.cpp +++ b/Demos/ColladaDemo/ColladaConverter.cpp @@ -17,6 +17,7 @@ subject to the following restrictions: #include "btBulletDynamicsCommon.h" #include "dae.h" #include "dom/domCOLLADA.h" +#include "dae/domAny.h" #include "BulletCollision/CollisionShapes/btBoxShape.h" #include "BulletCollision/CollisionShapes/btSphereShape.h" @@ -926,9 +927,58 @@ void ColladaConverter::ConvertRigidBodyRef( btRigidBodyInput& rbInput,btRigidBod { rbOutput.m_isDynamics = techniqueRef->getDynamic()->getValue(); } + //a hack to interpret PhysX profile: + //when is true, make false... + //using the DOM is a pain... + const domExtra_Array& extraArray = rbInput.m_rigidBodyRef2->getExtra_array(); + unsigned int s=0; + + for (s = 0;s< extraArray.getCount();s++) + { + const domExtraRef extraRef = extraArray[s]; + const domTechnique_Array techniqueArray = extraRef->getTechnique_array(); + unsigned int t=0; + for (t=0;tgetContents(); + unsigned int u = 0; + for (u=0;ugetElementName(); + if (!strcmp(elemName,"kinematic")) + { + daeMemoryRef memRef = elemRef->getValuePointer(); + + daeBool hasVal = elemRef->hasValue(); + + COLLADA_TYPE::TypeEnum mytype = elemRef->getElementType(); + //how can I make this cast safe? + const domAny* myAny = (const domAny*)elemRef.cast(); + daeString myVal = myAny->getValue(); + if (myVal) + { + if (!strcmp(myVal,"true")) + { + printf("revert bug in PhysX .dae export -> true means false\n"); + rbOutput.m_isDynamics = false; + } + } + } + } + } + } + +// +// +// 0.399999976 +// false + + //shapes - for (unsigned int s=0;sgetShape_array().getCount();s++) + for (s=0;sgetShape_array().getCount();s++) { domRigid_body::domTechnique_common::domShapeRef shapeRef = techniqueRef->getShape_array()[s];