prepare for 'custom' multi body creation.

This commit is contained in:
erwin coumans
2015-04-22 18:09:00 -07:00
parent b64f5feba4
commit 51938d642e
7 changed files with 118 additions and 60 deletions

View File

@@ -0,0 +1,64 @@
#include "MultiBodyCustomURDFDemo.h"
#include "BulletDynamics/Featherstone/btMultiBodyLinkCollider.h"
#include "../CommonInterfaces/CommonMultiBodyBase.h"
#include "../Importers/ImportURDFDemo/URDF2Bullet.h"
#include "CustomMultiBodyCreationCallback.h"
struct MultiBodyCustomURDFDemo : public CommonMultiBodyBase
{
btMultiBody* m_multiBody;
public:
MultiBodyCustomURDFDemo(struct GUIHelperInterface* helper);
virtual ~MultiBodyCustomURDFDemo();
virtual void initPhysics();
virtual void stepSimulation(float deltaTime);
};
MultiBodyCustomURDFDemo::MultiBodyCustomURDFDemo(struct GUIHelperInterface* helper)
:CommonMultiBodyBase(helper)
{
}
MultiBodyCustomURDFDemo::~MultiBodyCustomURDFDemo()
{
}
void MultiBodyCustomURDFDemo::initPhysics()
{
int upAxis = 2;
m_guiHelper->setUpAxis(upAxis);
createEmptyDynamicsWorld();
m_guiHelper->createPhysicsDebugDrawer(m_dynamicsWorld);
m_dynamicsWorld->getDebugDrawer()->setDebugMode(
//btIDebugDraw::DBG_DrawConstraints
+btIDebugDraw::DBG_DrawWireframe
+btIDebugDraw::DBG_DrawContactPoints
+btIDebugDraw::DBG_DrawAabb
);//+btIDebugDraw::DBG_DrawConstraintLimits);
}
void MultiBodyCustomURDFDemo::stepSimulation(float deltaTime)
{
m_dynamicsWorld->stepSimulation(deltaTime);
}
class ExampleInterface* MultiBodyCustomURDFDofCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option)
{
return new MultiBodyCustomURDFDemo(helper);
}