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

@@ -138,11 +138,26 @@ public:
{
return false;
}
virtual void resetCamera()
{
float dist = 3.5;
float pitch = 136;
float yaw = 32;
float targetPos[3]={0,0,0};
if (m_app->m_renderer && m_app->m_renderer->getActiveCamera())
{
m_app->m_renderer->getActiveCamera()->setCameraDistance(dist);
m_app->m_renderer->getActiveCamera()->setCameraPitch(pitch);
m_app->m_renderer->getActiveCamera()->setCameraYaw(yaw);
m_app->m_renderer->getActiveCamera()->setCameraTargetPosition(targetPos[0],targetPos[1],targetPos[2]);
}
}
};
struct CommonExampleInterface* CoordinateSystemCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option)
struct CommonExampleInterface* CoordinateSystemCreateFunc(struct CommonExampleOptions& options)
{
return new CoordinateSystemDemo(helper->getAppInterface());
return new CoordinateSystemDemo(options.m_guiHelper->getAppInterface());
}

View File

@@ -1,7 +1,7 @@
#ifndef COORDINATE_SYSTEM_DEMO_H
#define COORDINATE_SYSTEM_DEMO_H
class CommonExampleInterface* CoordinateSystemCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option);
class CommonExampleInterface* CoordinateSystemCreateFunc(struct CommonExampleOptions& options);
#endif //COORDINATE_SYSTEM_DEMO_H

View File

@@ -378,7 +378,7 @@ void RaytracerPhysicsSetup::syncPhysicsToGraphics(GraphicsPhysicsBridge& gfxBrid
{
}
CommonExampleInterface* RayTracerCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option)
CommonExampleInterface* RayTracerCreateFunc(struct CommonExampleOptions& options)
{
return new RaytracerPhysicsSetup(helper->getAppInterface());
return new RaytracerPhysicsSetup(options.m_guiHelper->getAppInterface());
}

View File

@@ -1,6 +1,6 @@
#ifndef RAYTRACER_SETUP_H
#define RAYTRACER_SETUP_H
class CommonExampleInterface* RayTracerCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option);
class CommonExampleInterface* RayTracerCreateFunc(struct CommonExampleOptions& options);
#endif //RAYTRACER_SETUP_H

View File

@@ -125,12 +125,27 @@ public:
return false;
}
virtual void resetCamera()
{
float dist = 13;
float pitch = 50;
float yaw = 13;
float targetPos[3]={-1,0,-0.3};
if (m_app->m_renderer && m_app->m_renderer->getActiveCamera())
{
m_app->m_renderer->getActiveCamera()->setCameraDistance(dist);
m_app->m_renderer->getActiveCamera()->setCameraPitch(pitch);
m_app->m_renderer->getActiveCamera()->setCameraYaw(yaw);
m_app->m_renderer->getActiveCamera()->setCameraTargetPosition(targetPos[0],targetPos[1],targetPos[2]);
}
}
};
class CommonExampleInterface* RenderInstancingCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option)
class CommonExampleInterface* RenderInstancingCreateFunc(struct CommonExampleOptions& options)
{
return new RenderInstancingDemo(helper->getAppInterface());
return new RenderInstancingDemo(options.m_guiHelper->getAppInterface());
}
#endif //RENDER_INSTANCING_DEMO_H

View File

@@ -1,6 +1,6 @@
#ifndef RENDER_INSTANCING_DEMO_H
#define RENDER_INSTANCING_DEMO_H
class CommonExampleInterface* RenderInstancingCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option);
class CommonExampleInterface* RenderInstancingCreateFunc(struct CommonExampleOptions& options);
#endif //RENDER_INSTANCING_DEMO_H