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:
@@ -3,23 +3,43 @@
|
||||
#ifndef COMMON_EXAMPLE_INTERFACE_H
|
||||
#define COMMON_EXAMPLE_INTERFACE_H
|
||||
|
||||
struct CommonExampleOptions
|
||||
{
|
||||
struct GUIHelperInterface* m_guiHelper;
|
||||
|
||||
//Those are optional, some examples will use them others don't. Each example should work with them being 0.
|
||||
int m_option;
|
||||
const char* m_fileName;
|
||||
|
||||
|
||||
CommonExampleOptions(struct GUIHelperInterface* helper, int option=0)
|
||||
:m_guiHelper(helper),
|
||||
m_option(option),
|
||||
m_fileName(0)
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class CommonExampleInterface
|
||||
{
|
||||
public:
|
||||
|
||||
typedef class CommonExampleInterface* (CreateFunc)(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option);
|
||||
typedef class CommonExampleInterface* (CreateFunc)(CommonExampleOptions& options);
|
||||
|
||||
virtual ~CommonExampleInterface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual void initPhysics()=0;
|
||||
virtual void exitPhysics()=0;
|
||||
virtual void stepSimulation(float deltaTime)=0;
|
||||
virtual void renderScene()=0;
|
||||
virtual void physicsDebugDraw(int debugFlags)=0;//for now we reuse the flags in Bullet/src/LinearMath/btIDebugDraw.h
|
||||
//reset camera is only called when switching demo. this way you can restart (initPhysics) and watch in a specific location easier
|
||||
virtual void resetCamera(){};
|
||||
virtual bool mouseMoveCallback(float x,float y)=0;
|
||||
virtual bool mouseButtonCallback(int button, int state, float x, float y)=0;
|
||||
virtual bool keyboardCallback(int key, int state)=0;
|
||||
|
||||
@@ -43,6 +43,8 @@ struct GUIHelperInterface
|
||||
|
||||
virtual void setUpAxis(int axis)=0;
|
||||
|
||||
virtual void resetCamera(float camDist, float pitch, float yaw, float camPosX,float camPosY, float camPosZ)=0;
|
||||
|
||||
virtual void autogenerateGraphicsObjects(btDiscreteDynamicsWorld* rbWorld) =0;
|
||||
|
||||
virtual void drawText3D( const char* txt, float posX, float posZY, float posZ, float size)=0;
|
||||
@@ -97,6 +99,9 @@ struct DummyGUIHelper : public GUIHelperInterface
|
||||
virtual void setUpAxis(int axis)
|
||||
{
|
||||
}
|
||||
virtual void resetCamera(float camDist, float pitch, float yaw, float camPosX,float camPosY, float camPosZ)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void autogenerateGraphicsObjects(btDiscreteDynamicsWorld* rbWorld)
|
||||
{
|
||||
|
||||
@@ -51,6 +51,10 @@ struct CommonRenderInterface
|
||||
|
||||
virtual void writeTransforms()=0;
|
||||
virtual void enableBlend(bool blend)=0;
|
||||
|
||||
//This is internal access to OpenGL3+ features, mainly used for OpenCL-OpenGL interop
|
||||
//Only the GLInstancingRenderer supports it, just return 0 otherwise.
|
||||
virtual struct GLInstanceRendererInternalData* getInternalData()=0;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user