Start re-organizing demos so the physics setup can be shared easier (explicit create graphics objects, init/exit physics etc)
Add B3G_RETURN key code, only implemented in Windows so far (todo: Mac, Linux) Fix Windows key management (use WM_CHAR event instead of WM_KEYUP Add Return (OnKeyReturn) key support TreeNode, so we can select an item using the return key.
This commit is contained in:
@@ -7,36 +7,26 @@
|
||||
#include "../../../Demos/BasicDemo/BasicDemoPhysicsSetup.h"
|
||||
|
||||
|
||||
struct MyBasicDemoPhysicsSetup : public BasicDemoPhysicsSetup
|
||||
{
|
||||
SimpleOpenGL3App* m_glApp;
|
||||
|
||||
virtual btRigidBody* createRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape, const btVector4& color);
|
||||
|
||||
virtual btBoxShape* createBoxShape(const btVector3& halfExtents);
|
||||
};
|
||||
|
||||
class BasicDemo : public Bullet2RigidBodyDemo
|
||||
{
|
||||
|
||||
MyBasicDemoPhysicsSetup m_physicsSetup;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
static BulletDemoInterface* MyCreateFunc(SimpleOpenGL3App* app)
|
||||
{
|
||||
return new BasicDemo(app);
|
||||
CommonPhysicsSetup* physicsSetup = new BasicDemoPhysicsSetup();
|
||||
return new BasicDemo(app, physicsSetup);
|
||||
}
|
||||
|
||||
BasicDemo(SimpleOpenGL3App* app);
|
||||
BasicDemo(SimpleOpenGL3App* app, CommonPhysicsSetup* physicsSetup);
|
||||
virtual ~BasicDemo();
|
||||
|
||||
void createGround(int cubeShapeId);
|
||||
|
||||
virtual void initPhysics();
|
||||
virtual void exitPhysics();
|
||||
virtual void renderScene();
|
||||
virtual void stepSimulation(float dt);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user