Havok for CD only?

Havok for CD only?

Imagen de james_b

Hiya,

I'm developing an arcade space game, and I'm handling entity movement myself.

I'd like to use Havok for collision detection and raycasting only, and leave the dynamics simulation out.

Is this possible?

Thanks.

publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de havokmax

Hi, it's possible. The simplest way would be to set the positions of your rigid bodies directly and never step the physics simulation. A better approach is to set the velocities so that the bodies will move where you want them to be in the next frame, and step the physics simulation to update them. So for example, if you have a ship at x=10 that you want to move to x=12 in the next frame, and the timestep is t, then set the x-velocity to (12 - 10) / t. This is more efficient because it allows Havok to batch update all of the broad phase info during the physics step, instead of doing it separately every time you set an body's position.

You can disable collisions in the physics step by using motion type = MOTION_KEYFRAMED for all bodies, and you'll still be able to raycasts and other collision detection queries. There are many demos that show what sort of queries are available, I recommend taking a look at:

Physics\Api\Collide\AsynchronousQueries
Physics\Api\Collide\RayCasting

Thanks
Max

Inicie sesión para dejar un comentario.