zzzzrrr
Joined: 17 Feb 2007 Posts: 139 Location: Washington, DC
|
Posted: Sat May 31, 2008 10:09 pm Post subject: Collision Callbacks |
|
|
I've taken a first stab at implementing a collision callback system, based on Box2D, in the trunk. Look in blaze.dynamics.ContactListener for the abstract class:
Code: | abstract class ContactListener
{
/// Method flags - enable method functionality
bool ADD, PERSIST, REMOVE, RESULT;
/// Called when a contact point is added. This includes the geometry
/// and the forces.
abstract void add(ContactPoint point);
/// Called when a contact point persists. This includes the geometry
/// and the forces.
abstract void persist(ContactPoint point);
/// Called when a contact point is removed. This includes the last
/// computed geometry and forces.
abstract void remove(ContactPoint point);
/// Called after a contact point is solved.
abstract void result(ContactResult point);
} |
Also look in blaze-demos at Demo.d and CollisionCallBack.d for a VERY basic introduction.
Comments/complaints/suggestions are welcome.
Regards,
Mason |
|