Detect if Character Collides With Static Mesh

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Hadzz
Posts: 1
Joined: Sat Feb 09, 2013 5:31 pm

Detect if Character Collides With Static Mesh

Post by Hadzz »

I am using the character controller class from the demo in my game. My levels mainly consist of StaticMeshes and Boxes.

This one level I am working on has a part where you jump across platforms, and if you fall, you land in quicksand. I need to be able to detect if there is a collision between the character (a cylinder) and the quicksand model (a StaticMesh) so I can't switch to a different screen, reset the character, etc.. As you can see below, I can't use a bounding box because the sand angles down into the center.

Image

I know this is probably a newbie question, but any help is much appreciated.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Detect if Character Collides With Static Mesh

Post by Norbo »

The most direct option would be to use collision events. Another option would be to watch the y component of the character body's position, assuming the quicksand is always below a certain height.
Post Reply