Surface Event Triggers

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Stevemata
Posts: 33
Joined: Sat Mar 17, 2012 11:11 pm

Surface Event Triggers

Post by Stevemata »

First, say I have a dangerous surface, like Lava for instance, what would be the best way to detect the character controller coming into contact with the lava?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Surface Event Triggers

Post by Norbo »

Collision events or scanning the body.CollisionInformation.Pairs list for dangerous things like lava would do the trick. In either case, storing data in Tags will help identify objects. For example, the lava's Tag could be set to some lava game logic object. Then, in the event or the scanning process, you can check the collidable for that Tag. (Note that an entity's Tag is separate from its entity.CollisionInformation.Tag; the entity.CollisionInformation is the BroadPhaseEntry that represents the entity in the collision detection pipeline.)

If you want to handle persistent contact as opposed to a one-time event, the pairs scanning approach is usually more direct.
Stevemata
Posts: 33
Joined: Sat Mar 17, 2012 11:11 pm

Re: Surface Event Triggers

Post by Stevemata »

Right now my levels are a single imported static mesh, the only difference between a lava surface and regular floor surface is the texture. I would prefer not to use the tag property, especially since other data is being stored in it already. Would making lava a second static mesh be a quick and dirty solution?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Surface Event Triggers

Post by Norbo »

Would making lava a second static mesh be a quick and dirty solution?
Yup. Or, in other words, a useful and practical solution :)
Post Reply