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:
Erwin Coumans
2014-06-24 10:14:06 -07:00
parent 28f19f1bab
commit 68f798a2da
29 changed files with 746 additions and 655 deletions

View File

@@ -11,9 +11,23 @@
#include "../bullet2/RagdollDemo/RagdollDemo.h"
#include "../bullet2/LuaDemo/LuaDemo.h"
#include "../bullet2/ChainDemo/ChainDemo.h"
#include "../../Demos/CcdPhysicsDemo/CcdPhysicsSetup.h"
static BulletDemoInterface* MyCcdPhysicsDemoCreateFunc(SimpleOpenGL3App* app)
{
CommonPhysicsSetup* physicsSetup = new CcdPhysicsSetup();
return new BasicDemo(app, physicsSetup);
}
static BulletDemoInterface* MyKinematicObjectCreateFunc(SimpleOpenGL3App* app)
{
CommonPhysicsSetup* physicsSetup = new KinematicObjectSetup();
return new BasicDemo(app, physicsSetup);
}
struct BulletDemoEntry
{
int m_menuLevel;
const char* m_name;
BulletDemoInterface::CreateFunc* m_createFunc;
};
@@ -23,23 +37,28 @@ static BulletDemoEntry allDemos[]=
{
//{"emptydemo",EmptyBulletDemo::MyCreateFunc},
{"BasicDemo",BasicDemo::MyCreateFunc},
{"ChainDemo",ChainDemo::MyCreateFunc},
{"SIHingeDemo",HingeDemo::SICreateFunc},
{"PGSHingeDemo",HingeDemo::PGSCreateFunc},
{"DantzigHingeDemo",HingeDemo::DantzigCreateFunc},
{"LemkeHingeDemo",HingeDemo::LemkeCreateFunc},
{"InertiaHingeDemo",HingeDemo::InertiaCreateFunc},
{"ABMHingeDemo",HingeDemo::FeatherstoneCreateFunc},
{"Ragdoll",RagDollDemo::MyCreateFunc},
{"MultiBody1",FeatherstoneDemo1::MyCreateFunc},
// {"MultiBody2",FeatherstoneDemo2::MyCreateFunc},
{0,"API Demos", 0},
{"MultiDofDemo",MultiDofDemo::MyCreateFunc},
{1,"BasicDemo",BasicDemo::MyCreateFunc},
{ 1, "CcdDemo", MyCcdPhysicsDemoCreateFunc },
{ 1, "Kinematic", MyKinematicObjectCreateFunc },
/* {1,"ChainDemo",ChainDemo::MyCreateFunc},
// {0, "Stress tests", 0 },
{1,"SIHingeDemo",HingeDemo::SICreateFunc},
{1,"PGSHingeDemo",HingeDemo::PGSCreateFunc},
{1,"DantzigHingeDemo",HingeDemo::DantzigCreateFunc},
{1,"LemkeHingeDemo",HingeDemo::LemkeCreateFunc},
{1,"InertiaHingeDemo",HingeDemo::InertiaCreateFunc},
{1,"ABMHingeDemo",HingeDemo::FeatherstoneCreateFunc},
{1,"Ragdoll",RagDollDemo::MyCreateFunc},
*/
{ 0, "Multibody" ,0},
{1,"MultiBody1",FeatherstoneDemo1::MyCreateFunc},
// {"MultiBody2",FeatherstoneDemo2::MyCreateFunc},
{1,"MultiDofDemo",MultiDofDemo::MyCreateFunc},
// {"LuaDemo",LuaDemo::MyCreateFunc}
};