isTangible vs makeNonDynamic

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
imtrobin
Posts: 101
Joined: Thu Jun 11, 2009 3:03 am

isTangible vs makeNonDynamic

Post by imtrobin »

Hi

I like to clarfiy on isTangible vs makeNonDynamic feature. What I'm doing is to create a pool of tanks, which I calculate their movement on a path myself, and I want to have physics shape follow it. So I do not need physic calculations (no terrain). In terms of Physx, it would be considered a kinematic actor.

So would it be better to implement as a nonDynamic or isTangible to Move/set CenterPosition? From what I'm seeing, they can both go to sleep. What is the difference between them?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: isTangible vs makeNonDynamic

Post by Norbo »

isTangible shapes can be either dynamic or kinematic. For example, despite having isTangible=false, an entity could still be affected by the force of gravity if it is still dynamic. The main difference between being kinematic and the isTangible flag is that when an object has isTangible=false, it will skip all narrow phase collision detection. No contacts are generated, so no collision response can take place.

Kinematic objects, on the other hand, will still perform narrow phase collision detection, detect contacts, and go through collision response. Kinematic entities are considered to have effectively infinite inertia so their velocities will be completely unchanged by any collision. Kinematic objects do not undergo collision detection/response with other kinematic entities.

So for your purposes, I would recommend using kinematic entities.
imtrobin
Posts: 101
Joined: Thu Jun 11, 2009 3:03 am

Re: isTangible vs makeNonDynamic

Post by imtrobin »

I see. Thanks, that's much clearer. So is there a good example for the use for inTangible? It's doesn't participate in narrow phase but in broadphase, it's not exactly Disabled either.

I would assume kinematic trigger (isDetector=true) would still collide with kinematic entities.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: isTangible vs makeNonDynamic

Post by Norbo »

One common application of intangibility is in the collection of local collision pairs. You can see it in action in the demo character controller finding candidate support entities which are later checked for validity. Multiple components of the engine will also respond when an object comes close, such as the triangles of a StaticTriangleGroup or Terrain. The intangible entity can activate these triangles but will not collide with them, allowing other systems (such as a character or vehicle) to use them in other calculations.

And yes, there is a special case that allows kinematic-kinematic narrow phase collision detection where one of the two is a detector.
imtrobin
Posts: 101
Joined: Thu Jun 11, 2009 3:03 am

Re: isTangible vs makeNonDynamic

Post by imtrobin »

Cool, thanks.
Post Reply