Add the old Bullet 2.x obsolete demos, and CMake buildsystem files, and gradually move them to newer Bullet 3.x structure
Use statically linked freeglut, instead of dynamic glut for the obsolete Bullet 2.x demos Add the 'reset' method to b3GpuDynamicsWorld, and use it in the BasicGpuDemo (pretty slow in debug mode, use release mode) Don't crash in btCollisionWorld, if there is no collision dispatcher
This commit is contained in:
44
ObsoleteDemos/OpenPL_Demo/OpenPL_Demo.c
Normal file
44
ObsoleteDemos/OpenPL_Demo/OpenPL_Demo.c
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
#include "Bullet-C-Api.h"
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
float timeStep = 1.f/60.f;
|
||||
|
||||
/* initialize */
|
||||
plPhysicsSdkHandle sdk = plNewBulletSdk();
|
||||
|
||||
plDynamicsWorldHandle world = plCreateDynamicsWorld(sdk);
|
||||
|
||||
|
||||
float radius = 1.f;
|
||||
plCollisionShapeHandle collisionShape = plNewSphereShape(radius);
|
||||
|
||||
void* user_data = 0;/* can point to a graphics object */
|
||||
|
||||
float mass = 1.f;
|
||||
|
||||
plRigidBodyHandle body = plCreateRigidBody(user_data, mass, collisionShape );
|
||||
|
||||
plAddRigidBody(world, body);
|
||||
|
||||
|
||||
|
||||
plStepSimulation(world,0.1f);
|
||||
|
||||
/* cleanup */
|
||||
|
||||
plRemoveRigidBody(world, body);
|
||||
|
||||
|
||||
plDeleteRigidBody(body);
|
||||
|
||||
plDeleteShape( collisionShape);
|
||||
|
||||
plDeleteDynamicsWorld( world);
|
||||
|
||||
plDeletePhysicsSdk(sdk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user