Imported Upstream version 2.81
[platform/upstream/libbullet.git] / Demos / OpenPL_Demo / OpenPL_Demo.c
1
2 #include "Bullet-C-Api.h"
3
4
5 int main()
6 {
7         float timeStep = 1.f/60.f;
8
9         /* initialize */ 
10         plPhysicsSdkHandle      sdk = plNewBulletSdk();
11         
12         plDynamicsWorldHandle world = plCreateDynamicsWorld(sdk);
13
14
15         float radius = 1.f;
16         plCollisionShapeHandle collisionShape = plNewSphereShape(radius);
17
18         void* user_data = 0;/* can point to a graphics object */
19
20         float mass = 1.f;
21
22         plRigidBodyHandle body = plCreateRigidBody(user_data, mass, collisionShape );
23
24         plAddRigidBody(world, body);
25
26         
27         
28         plStepSimulation(world,0.1f);
29
30         /* cleanup */
31
32         plRemoveRigidBody(world, body);
33
34
35         plDeleteRigidBody(body);
36
37         plDeleteShape( collisionShape);
38
39         plDeleteDynamicsWorld( world);
40
41         plDeletePhysicsSdk(sdk);
42
43         return 0;
44 }