So dealing with the global physics file is certainly no easy task. It is a bit confusing. I will try and explain how it works. You can often tinker till things work, but if you are like me, you want to know exactly how and why things do what.
So, here goes.
1. Collision Types are simply definitions. Think of them as a reference.
2. Filters : Explain how an object interacts with other objects. For example if we have bat ={is=["bat"] collides_with = ["ball"] } and we apply this filter to a bat, it will ONLY collide with a ball.
3. Shapes : This area is where we define our bat. THis part is fairly straight forward excepting sweep and triggers.
With sweep we can tell the physics simulation to test between frames for physics collisions. This is VERY intensive though, so unless you need it, try avoiding it. Basically you want to use this for high velocity, small objects (like bullets for example).
example: A bullet is traveling 3 meters per frame. You wall is 1/2 meter thick. If on one frame it is 1 meter in front of the wall and the next frame it is 2 meters behind the wall the physics engine would not register a collision. It would pass through the wall like it was not there. In a case like this, sweep would be used where it would test to see if it ever intersected the wall even between frames.
Wit Trigger : Triggers are pretty obvious too for the most part, but one thing is very tricky with them. Because it is logical to think that a trigger triggers something. In actuallity it is the other way around. Triggers are volumes that trigger The volume must be tested.
Practical example.
Lets say we have a vr player with a bat. Behind the player is a collision. and we have a pitcher that throws a ball.
filter definitions.
bat ={is=["bat"] collides_with = ["ball"] }
ball = {is=["ball"] collides_with_all_except[""]
strike_volume = {is=["strike_volume"] collides_with["ball"]
So, the bat collides with a ball. a ball collides with everything. and the strike_volume collides with the ball.
Now for the shapes, we need to do this.
bat = {sweep="true" collision_filter="bat"}
ball = {sweep="true" collision_filter="ball"}
strike_volume = {trigger="true" collision_filter="strike_volume"}
This will bind the filters to the shapes and define the way they actually act. Now here is the important bit as far as the trigger is concerned. The strike_volume is triggered by the ball. If you test the ball to see if the it has been triggered, it will not reply! ONLY the strike_volume can be tested and produce a reply!!! Once you get that bit, i think you will have an easier time. It had me stumped for a while and caused a lot of confusion till i understood this.
Anyhow, ill go ahead and see if I can setup a small project in a little bit to help demonstrate how to do what you are trying to do.
Paul
Areas of Expertise - MayaLT : Mudbox : 3DS Max : Inventor : Game Dev
Follow me on Twitter : @paulkind3d
Please remember to give kudos freely and mark acceptable answers as solved!
PLEASE do not send me private messages unless asked to do so. If you have a question, start a thread, and ask me on the public forums where answering your question may help others.
Did you know there was a
YouTube learning channel for Autodesk Games? New videos are posted regularly with all sorts of content relative to Stingray, Maya/MayaLT, 3DS Max, and other game related tools. Get your game on @
https://www.youtube.com/user/autodeskgameshowtos