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:
erwincoumans
2015-05-01 11:42:14 -07:00
parent 3dd41b84a8
commit 218e9f9bf9
66 changed files with 562 additions and 217 deletions

View File

@@ -37,6 +37,14 @@ struct BasicExample : public CommonRigidBodyBase
virtual ~BasicExample(){}
virtual void initPhysics();
virtual void renderScene();
void resetCamera()
{
float dist = 41;
float pitch = 52;
float yaw = 35;
float targetPos[3]={0,0.46,0};
m_guiHelper->resetCamera(dist,pitch,yaw,targetPos[0],targetPos[1],targetPos[2]);
}
};
void BasicExample::initPhysics()
@@ -128,9 +136,11 @@ void BasicExample::renderScene()
CommonExampleInterface* BasicExampleCreateFunc(PhysicsInterface* pint, GUIHelperInterface* helper, int option)
CommonExampleInterface* BasicExampleCreateFunc(CommonExampleOptions& options)
{
return new BasicExample(helper);
return new BasicExample(options.m_guiHelper);
}

View File

@@ -16,7 +16,7 @@ subject to the following restrictions:
#ifndef BASIC_EXAMPLE_H
#define BASIC_EXAMPLE_H
class CommonExampleInterface* BasicExampleCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option);
class CommonExampleInterface* BasicExampleCreateFunc(struct CommonExampleOptions& options);
#endif //BASIC_DEMO_PHYSICS_SETUP_H

View File

@@ -28,9 +28,7 @@ int main(int argc, char* argv[])
DummyGUIHelper noGfx;
int option = 0;
CommonExampleInterface* example = BasicExampleCreateFunc(pint, &noGfx, option);
CommonExampleInterface* example = BasicExampleCreateFunc(CommonExampleOptions(&noGfx));
example->initPhysics();
example->stepSimulation(1.f/60.f);