need a little clarification on hkpCollidableQualityType

need a little clarification on hkpCollidableQualityType

Ritratto di Luis Eduardo

Hi,

I need a very tight accuracy in the collisions and cannot afford any tunneling.

but i am confused about some flags.

what is the difference for: HK_COLLIDABLE_QUALITY_CRITICAL, HK_COLLIDABLE_QUALITY_BULLET and HK_COLLIDABLE_QUALITY_MAX ?

i have read the comments in the hkpCollidableQualityType.h structure but still everyone of this 3 appear to be the maximum quality for collisions.

can someone clarify a bit more?

thanks in advance,

- Luis

2 post / 0 new
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di HavokTim

Hi Luis--

One of the enumeration values you listed - HK_COLLIDABLE_QUALITY_MAX - is not actually a valid hkpCollidableQualityType at all, but rather used to track the total number of elements in the enumeration. It can be used for bounds checking or iterating over valid enum values. HK_COLLIDABLE_QUALITY_BULLET is intended for high speed objects that may tunnel by virtue of their speed, and HK_COLLIDABLE_QUALITY_CRITICAL is intended for critical objects that are never allowed to penetrate or leave the world.

The situation is complicated because Havok chooses the quality of collision detection based on the hkpCollidableQualityType of both objects. For example, debris can still penetrate a critical object, but a bullet will generate TOIs to prevent this. On the other hand, Critical objects will invoke a "Cannot Solve" callback if the interpenetration constraint is violated and cannot be resolved, while bullets will not. it There's a table in the documentation that clarifies the issue somewhat - in 2012.1, it's Figure 2.99: Collision Quality Level Dispatch Table.

In your case, I suggest using HK_COLLIDABLE_QUALITY_CRITICAL for objects that cannot tolerate penetration, and avoid using HK_COLLIDABLE_QUALITY_DEBRIS and HK_COLLIDABLE_QUALITY_DEBRIS_SIMPLE_TOI for the objects these critical objects must not penentrate. Increasing the collision quality will also increase the cost of simulation, however, so be judicious and only increase collision quality for objects that need it - namely, small or fast moving objects.

Accedere per lasciare un commento.