enable URDF loading throught the 'File/Open' menu
set a default camera targets for each demo. note that it is only reset when switching to a different demo, so you can restart at your chosen location. no OpenCL pairbench drawing in OpenGL2 (there is no VBO available etc)
This commit is contained in:
@@ -29,6 +29,15 @@ public:
|
||||
|
||||
virtual void stepSimulation(float deltaTime);
|
||||
|
||||
virtual void resetCamera()
|
||||
{
|
||||
float dist = 1;
|
||||
float pitch = 50;
|
||||
float yaw = 35;
|
||||
float targetPos[3]={-3,2.8,-2.5};
|
||||
m_guiHelper->resetCamera(dist,pitch,yaw,targetPos[0],targetPos[1],targetPos[2]);
|
||||
}
|
||||
|
||||
|
||||
btMultiBody* createFeatherstoneMultiBody_testMultiDof(class btMultiBodyDynamicsWorld* world, int numLinks, const btVector3& basePosition, const btVector3 &baseHalfExtents, const btVector3 &linkHalfExtents, bool spherical = false, bool floating = false);
|
||||
void addColliders_testMultiDof(btMultiBody *pMultiBody, btMultiBodyDynamicsWorld *pWorld, const btVector3 &baseHalfExtents, const btVector3 &linkHalfExtents);
|
||||
@@ -76,6 +85,7 @@ void MultiDofDemo::stepSimulation(float deltaTime)
|
||||
void MultiDofDemo::initPhysics()
|
||||
{
|
||||
|
||||
|
||||
m_guiHelper->setUpAxis(1);
|
||||
|
||||
if(g_firstInit)
|
||||
@@ -100,7 +110,7 @@ void MultiDofDemo::initPhysics()
|
||||
btMultiBodyDynamicsWorld* world = new btMultiBodyDynamicsWorld(m_dispatcher,m_broadphase,sol,m_collisionConfiguration);
|
||||
m_dynamicsWorld = world;
|
||||
// m_dynamicsWorld->setDebugDrawer(&gDebugDraw);
|
||||
|
||||
m_guiHelper->createPhysicsDebugDrawer(m_dynamicsWorld);
|
||||
m_dynamicsWorld->setGravity(btVector3(0,-10,0));
|
||||
|
||||
///create a few basic rigid bodies
|
||||
@@ -418,7 +428,7 @@ void MultiDofDemo::addBoxes_testMultiDof()
|
||||
}
|
||||
}
|
||||
|
||||
class CommonExampleInterface* MultiDofCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option)
|
||||
class CommonExampleInterface* MultiDofCreateFunc(struct CommonExampleOptions& options)
|
||||
{
|
||||
return new MultiDofDemo(helper);
|
||||
return new MultiDofDemo(options.m_guiHelper);
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
#ifndef MULTI_DOF_DEMO_H
|
||||
#define MULTI_DOF_DEMO_H
|
||||
|
||||
class CommonExampleInterface* MultiDofCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option);
|
||||
class CommonExampleInterface* MultiDofCreateFunc(struct CommonExampleOptions& options);
|
||||
|
||||
#endif //MULTI_DOF_DEMO_H
|
||||
|
||||
|
||||
@@ -18,6 +18,16 @@ public:
|
||||
|
||||
virtual void stepSimulation(float deltaTime);
|
||||
|
||||
virtual void resetCamera()
|
||||
{
|
||||
float dist = 5;
|
||||
float pitch = 270;
|
||||
float yaw = 21;
|
||||
float targetPos[3]={-1.34,3.4,-0.44};
|
||||
m_guiHelper->resetCamera(dist,pitch,yaw,targetPos[0],targetPos[1],targetPos[2]);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
TestJointTorqueSetup::TestJointTorqueSetup(struct GUIHelperInterface* helper)
|
||||
@@ -270,7 +280,7 @@ void TestJointTorqueSetup::stepSimulation(float deltaTime)
|
||||
}
|
||||
|
||||
|
||||
class CommonExampleInterface* TestJointTorqueCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option)
|
||||
class CommonExampleInterface* TestJointTorqueCreateFunc(struct CommonExampleOptions& options)
|
||||
{
|
||||
return new TestJointTorqueSetup(helper);
|
||||
return new TestJointTorqueSetup(options.m_guiHelper);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef TEST_JOINT_TORQUE_SETUP_H
|
||||
#define TEST_JOINT_TORQUE_SETUP_H
|
||||
|
||||
class CommonExampleInterface* TestJointTorqueCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option);
|
||||
class CommonExampleInterface* TestJointTorqueCreateFunc(struct CommonExampleOptions& options);
|
||||
|
||||
#endif //TEST_JOINT_TORQUE_SETUP_H
|
||||
|
||||
|
||||
Reference in New Issue
Block a user