added first draft of C-API, btConvexHullShape takes float* instead of btPoint*, added getGravity to btRigidBody

This commit is contained in:
ejcoumans
2006-10-11 06:07:14 +00:00
parent 919e8def68
commit a337372905
13 changed files with 350 additions and 12 deletions

View 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;
}