Static mesh and entity collision
Static mesh and entity collision
I have a static mesh but i dont want it to collide with a specific box. However, this box is dynamically created while the mesh is the level which loads from the start. I wan the static mesh to collide with other things but how do i make it not collide with the box?
Re: Static mesh and entity collision
Most likely, it would be easiest to use a Specific collision rule. For example:
CollisionRules.AddRule(box, mesh, CollisionRule.NoBroadPhase);
Re: Static mesh and entity collision
Problem is i can't access the box because its dynamically created. So i can't assign the rule before the box is created. When i try to assign it at the box side, it can't access the mesh cause its a var and it can't be public
Re: Static mesh and entity collision
If you'd like to maintain that access pattern, then doing something with collision groups might be the best option. Instead of assigning a collision rule between two specific objects, you can create collision groups and define rules between the groups. Then, assign the groups to objects. So long as you have access to the groups during both cases, it would work. Some examples of collision groups can be found here:
http://www.bepu-games.com/forums/viewto ... f=4&t=1238
http://bepuphysics.codeplex.com/wikipag ... umentation
and in the Collision Filtering demo.
There has to be some common access in both areas, though. Depending on how things are set up and what is needed, it may be easier just to make the mesh visible and add the rule on box creation.
http://www.bepu-games.com/forums/viewto ... f=4&t=1238
http://bepuphysics.codeplex.com/wikipag ... umentation
and in the Collision Filtering demo.
There has to be some common access in both areas, though. Depending on how things are set up and what is needed, it may be easier just to make the mesh visible and add the rule on box creation.