Bullet C-Api

tshannon
Posts: 4
Joined: Fri Aug 31, 2012 6:59 pm

Bullet C-Api

Post by tshannon »

I understand the the C-Api is incomplete, but I'm not seeing how the broadphase callbacks will even work.

They are defined in the .h file of the C-api:

Code: Select all

extern plCollisionBroadphaseHandle	plCreateSapBroadphase(btBroadphaseCallback beginCallback,btBroadphaseCallback endCallback);
But that function doesn't actually exist anywhere in Bullet code. What is it referencing?

With the C-api, how do I get a notification that two objects have collided?

The Dino demo doesn't use this portion of the c-api, so there's no example there. I'm guessing it was just never implemented.
tshannon
Posts: 4
Joined: Fri Aug 31, 2012 6:59 pm

Re: Bullet C-Api

Post by tshannon »

Looks like there is a more complete C-api here, that isn't included in Trunk for some reason.
tshannon
Posts: 4
Joined: Fri Aug 31, 2012 6:59 pm

Re: Bullet C-Api

Post by tshannon »

Yeah, the C-api included attached to that issue ticket doesn't actually compile with the latest bullet.

It looks like the only way I can actually tell when a collision happens with the C-api is to cast a ray.

That really doesn't seem practical for most scenarios.

It looks like the broadphase call backs were included for this purpose, but they are only defined in the c-api header file, and not actually written.

Is anyone using the as is C-Api?
tshannon
Posts: 4
Joined: Fri Aug 31, 2012 6:59 pm

Re: Bullet C-Api

Post by tshannon »

Yeah, it looks like the whole Broadphase / Collision World portion of the C-Api isn't actually implimented.

Just defined.

Code: Select all

/** Collision World, not strictly necessary, you can also just create a Dynamics World with Rigid Bodies which internally manages the Collision World with Collision Objects */

	typedef void(*btBroadphaseCallback)(void* clientData, void* object1,void* object2);

	extern plCollisionBroadphaseHandle	plCreateSapBroadphase(btBroadphaseCallback beginCallback,btBroadphaseCallback endCallback);

	extern void	plDestroyBroadphase(plCollisionBroadphaseHandle bp);

	extern 	plBroadphaseProxyHandle plCreateProxy(plCollisionBroadphaseHandle bp, void* clientData, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ);

	extern void plDestroyProxy(plCollisionBroadphaseHandle bp, plBroadphaseProxyHandle proxyHandle);

	extern void plSetBoundingBox(plBroadphaseProxyHandle proxyHandle, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ);

/* todo: add pair cache support with queries like add/remove/find pair */
	
	extern plCollisionWorldHandle plCreateCollisionWorld(plPhysicsSdkHandle physicsSdk);