Collisions

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Jesseyay
Posts: 4
Joined: Wed May 21, 2008 12:22 pm

Collisions

Post by Jesseyay »

Hello.

Does anybody know how to test if two Entities have collided?
I've found the Toolbox.areObjectsColliding method but it slows down too much when called more than 100 times per frame.

I want something usable so that I can detect collisions between players and bullets and subtract health etc.

Thanks.
User avatar
Zukarakox
Not a Site Admin
Posts: 426
Joined: Mon Jul 10, 2006 4:28 am

Re: Collisions

Post by Zukarakox »

I made a method that does it until Norbo makes his own and puts it into the physics engine.

http://www.bepu-games.com/forums/viewto ... ?f=9&t=309

tell me if you have any problems, I made that for v0.4.0 so it might need a bit of updating.

Bullets move too fast to see really, so you might just want to do a ray vs world test to see what they hit, and if it hits a player, subtract health.
i has multiple toes
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Collisions

Post by Norbo »

The idea behind identifying colliding objects is determining which object pairs (controllers) have contacts in them. Collision pairs are automatically sorted out inside the engine, and the associated space keeps a listing of them around. Checking through each one and identifying the ones with contacts will find all colliding pairs.

A more direct method is planned in v0.6.0.
Post Reply