Handling collision

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
ApppStudio
Posts: 9
Joined: Thu Jul 27, 2017 12:28 pm

Handling collision

Post by ApppStudio »

I am trapping the DetectingInitialCollision to check for a tag of CHECKPOINT for a racing game I am trying to do if its a checkpoint I want to setup a timer then ignore the collision so my entity can pass through it is there an easy way to do this? I can tell i have hit the object but my entity then wont travel through it
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Handling collision

Post by Norbo »

You can set the checkpoint object's personal collision rule to NoSolver. Contacts will be generated and events will fire, but the solver won't try to change any velocities.

Check out the CollisionFilteringDemo for more examples.
Holness
Posts: 1
Joined: Sat Dec 09, 2017 9:52 am

Re: Handling collision

Post by Holness »

Hi Norbo, would you recommend the NoSolver option for a racing game or is there a better solution for this type of game?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Handling collision

Post by Norbo »

One option would be to represent the track as a curve and project player positions onto that curve. That boils player position down to a single one dimensional parameter that you could check against checkpoint values easily, since it's just comparing two floats. Also, since you can compute that curve position every frame for every player, it gives you a simple way to compute what place the player is in.

This doesn't actually use anything in the physics engine, and it does require defining a curve for the track (and implementing the projection), but I suspect in the long run it would be simpler and more robust than using collision volumes.
Post Reply