Phantom use

Phantom use

Hi,

I would have some informations concerning the phantom realisation because I have few mistakes after reading the doc :

1a- Does the hkpShapePhantom use a shape to compute the aabb in the world and do all tests on this aabb only (and not on the shape too) ?
1b- And if I use the setTransform method, is the rotation considered on the shape ?

2- I would place a corridor of wind in my world. But this corridor is not aligned with the axes of the world. How could I do this ?

3- In what cases must I use the hkpPhantomCallbackShape instead of a derivated class of hkpPhantom ?

Thanks for your help
Benoit

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Benoit,

I recommend reading more about phantoms in section the Havok Manual under:

Havok_Physics->Havok_Dynamics->Phantoms

Here are some answers to your questions:

1a- Does the hkpShapePhantom use a shape to compute the aabb in the world and do all tests on this aabb only (and not on the shape too) ?

The hkpShapePhantom uses the shape associated with it for narrowphase collision testing and an AABB (computed from that shape) for broadphase collision testing. The advantage of using the hkpShapePhantom is that it gives you the ability to do linear casting and gives access to narrowphase collision data using getPenetrations() and getClosestPoints().

1b- And if I use the setTransform method, is the rotation considered on the shape ?

That's right. when the setTransform method is called, it updateds the transform of the collidable associated with the shape. In addition, it updates the AABB.

2- I would place a corridor of wind in my world. But this corridor is not aligned with the axes of the world. How could I do this ?

A good solution for this is to create a keyframed rigidBody in the corridor with it's collisionResponse set to hkpMaterial::RESPONSE_REPORTING. This will make it so that this rigidbody picks up contact points, but does not actually collide with any other objects. Then add an hkpCollisionListener so that you will recieve these contact point added/removed callbacks in which you can start/stop the wind's affect on the objects.

3- In what cases must I use the hkpPhantomCallbackShape instead of a derivated class of hkpPhantom ?

hkpPhantomCallbackShape are used as triggers that are included in an hkpBvTreeShape or a hkBVShape. They are used for more precise collision detection using a shape instead of just an AABB.

-Yoav

Login to leave a comment.