Collision Callbacks question

Collision Callbacks question

EDIT: It seems that I can get collision points and easily do the collision with trigger volumes, but whenever my keyframed ragdoll passes into my keyframed trigger volume and triggers the callback, I still get the warning about keyframed and fixed bodies. How do I get rid of this warning? 

Original Post:

I am trying to implement a hitbox system with havok, and oftentimes the hitboxes do not line up with ragdoll joints or anything and must be manually animated. This is fine with me and I am able to import the spheres that I will be using as hitboxes and I am able to animate them without a problem. The problem arises because I do not know how to set them up in the engine so that they can collide with ragdolls and use callbacks correctly. It seems like there are many options with trigger volumes and phantom shapes and stuff, so I was hoping I could get a good answer here.

I need some sort of entity that can collide with my ragdoll and give a callback (without reacting to physics at all, although I may use actions). I DO need the contact point, and I am not sure if that brings up any conflicts with any of the methods. I am currently using a rigid keyframed body for the hitboxes, and rigid keyframed bodies for the bones of the ragdoll, and this might work but it brings up tons of warnings that I am colliding two keyframed or fixed bodies. Help?

7 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Hi Fiction,
It sounds like the motion types and/or quality types of the bodies you are using are not what Havok expects. Can you tell me some more about the motion and quality types of the bodies you are colliding, and the specific text of the warning you're getting?

Josh S. Havok Developer Support Engineer

I have a keyframed ragdoll with each bone having motion type MOTION_KEYFRAMED and quality type HK_COLLIDABLE_QUALITY_KEYFRAMED_REPORTING. I have a trigger volume with the same settings. The warning is:
"Warning: Creating an agent between two fixed or keyframed objects. Check the quality types. "
I basically have a ragdoll that's running around to a keyframed run animation, and when it runs into the trigger volume I want to be able to get the point of entry and collision specifics. I am able to get the callback from what I can tell, but the warning is still showing up.

Best Reply

It sounds like the functionality is what you want, in which case it is probably safe to disable this warning (id 0xad16c0e6). here's how to disable a warning or assert in Havok (from Havok manual):

4.4. Disabling errors, warnings and asserts
Be careful! If Havok raises an assert then it usually means that something is fundamentally wrong. Disabling an assert may well let you continue development but should only be done as a short term measure. You should ensure that you address the underlying cause of the assert.

In Havok all warnings and asserts have unique ids which are persistent across releases. Occasionally you may not want to be notified by Havok with an assert or warning every time a certain event happens. To disable warnings, errors or asserts for a particular line of code, you can use the setEnabled( int id, hkBool enabled ) method, passing it the appropriate assert ID. You can find the ID by examining the output after a particular assert etc. is triggered.

#include <Common/Base/System/Error/hkError.h>
// Disable the assert by its id (a hexadecimal number).
hkError::getInstance().setEnabled( 0x44444444, false );

Josh S. Havok Developer Support Engineer

Ah, thank you very much! Exactly what I needed and glad I'm not doing anything too horrible :)

Edit: As a bit of a piggyback question, and to avoid creating another thread, how do I get a contact point between a trigger body and a rigid body. Is it possible to do in collisionAddedCallback?

You don't have direct access to contact points in collisionAddedCallback, but you should be able to use contactPointCallback. Take a look at Physics -> Api -> Collide -> Contact Point Callbacks -> Contact State for some sample code.

Josh S. Havok Developer Support Engineer

Okay thank you. You are most helpful :)

Faça login para deixar um comentário.