Page 1 of 1

Model to Trigger

Posted: Sun Mar 31, 2013 9:44 pm
by Stevemata
I have been fumbling around all morning trying to figure out how to use a model for a trigger.

If my character controller is touching or inside of my model, I would like to trigger an event. I have my functions working with the Box object, but using a model alludes me.

Any help/guidance would be greatly appreciated.

Thanks in advance Norbo

Re: Model to Trigger

Posted: Sun Mar 31, 2013 10:12 pm
by Norbo
StaticMeshes, InstancedMeshes, Terrains, and all entity types (including mobile meshes and compound bodies) have contact events which work the same way. They can all be used for detector purposes by changing their collision rules.

Another option is the DetectorVolume. It's a mesh-only volume designed for detecting intersection and containment, but it cannot detect contact data.

Re: Model to Trigger

Posted: Sun Mar 31, 2013 10:44 pm
by Stevemata
detectorvolume works well, but how do i filter it from ray casts?

Re: Model to Trigger

Posted: Mon Apr 01, 2013 12:28 am
by Norbo
DetectorVolume is a BroadPhaseEntry and so has a Tag property; you could use that to filter it. Or, use a type cast attempt and filter if it fails to cast to an EntityCollidable or whatever the target was. Another option is to filter based on collision rules (and give the detector volume some appropriate collision rule).