Files
bullet3/btgui/Bullet3AppSupport/Bullet2RigidBodyDemo.h
erwincoumans a159fbac69 Improved URDF support for btMultiBody and separate graphics/collision/inertial frames and shapes
Fix WinXP GetTickCount64 with a typedef
Expose debug drawing mode/flags in UI (hot keys A,D,L,W for now, buttons later)
GLInstancingRenderer: tweak near/far planes to allow closer approach of camera
btDiscreteDynamicsWorld: enable debug drawing for btGeneric6DofSpring2Constraint
btMultiBodyDynamicsWorld: enable basic debug drawing for btMultiBody
btMultibody: allow center-of-mass shift for prismatic and fixed constraint
2015-01-22 17:56:24 -08:00

56 lines
1.2 KiB
C++

#ifndef BULLET2_RIGIDBODY_DEMO_H
#define BULLET2_RIGIDBODY_DEMO_H
#include "LinearMath/btVector3.h"
#include "BulletDemoInterface.h"
#include "OpenGLWindow/b3gWindowInterface.h"
#include "CommonPhysicsSetup.h"
class Bullet2RigidBodyDemo : public BulletDemoInterface
{
CommonPhysicsSetup* m_physicsSetup;
public:
bool m_controlPressed;
bool m_altPressed;
public:
struct CommonGraphicsApp* m_glApp;
Bullet2RigidBodyDemo(CommonGraphicsApp* app, CommonPhysicsSetup* physicsSetup);
virtual void initPhysics();
virtual void exitPhysics();
virtual void renderScene();
virtual void physicsDebugDraw(int debugDrawFlags);
virtual void stepSimulation(float dt);
virtual CommonPhysicsSetup* getPhysicsSetup()
{
return m_physicsSetup;
}
virtual ~Bullet2RigidBodyDemo();
btVector3 getRayTo(int x,int y);
virtual bool mouseMoveCallback(float x,float y);
virtual bool mouseButtonCallback(int button, int state, float x, float y);
virtual bool keyboardCallback(int key, int state)
{
if (key==B3G_CONTROL)
{
m_controlPressed = (state==1);
}
if (key==B3G_ALT)
{
m_altPressed = (state==1);
}
return false;
}
};
#endif //BULLET2_RIGIDBODY_DEMO_H