Boxes resting on edges? (screenshot included)

Boxes resting on edges? (screenshot included)

I put together my first Havok program today that drops 20 box rigidbodies from the sky as they bounce around.

It looks pretty good but I noticed many of the boxes end up stationary on their edges as they come to rest. How can I fix this?

Screenshot of this behavior: http://i48.tinypic.com/2ik78ed.png

7 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Hey Chris,

Could you give us a little bit more information on how set up your scene? I would be particularly interested to know:

1) How you defined your hkpWorldCInfo.
2) How you defined your ground and boxes hkpRigidBodyCInfo.
3) Did you define your boxes and ground using 'hkpBoxShape's or are they made up of another type of shape?
4) Did these boxes bounce a little bit or did they directly end up stationary on one of their edge?

Thanks for letting us know,

and Welcome to the Havok World!
David.

David G. Developer Support Engineer Havok www.havok.com
Best Reply

Hi, thanks for the consideration.

Ended up being my quaternion math was wrong, so the physics was just fine - just my code was off. All is well now.

Hey Chris,

I'd be interested in knowing where exactly your quaternion math error came from: Was it due to how you defined one of the hkpRigidBodies? Or how you synced physics to graphics? or something else?

Thanks for letting me know,
David.

David G. Developer Support Engineer Havok www.havok.com

It was how I was syncing physics to graphics. I pulled the rotation quaternion from Havok into the constructor of my own Quaternion class. I guess my own quaternion class had an inverted w component because when I put a negative in front in my constructor it worked and matched the visual debugger. So somewhere in my quaternion class I have some math wrong as i trust Havoks quaternions far more than mine :)

Hey Chris,

Thanks for the info,

Your solution doesn't seem to be very strong though. Are you sure that the method you are using to convert from a Quaternion to a Matrix is working properly?

Cheers,
David.

David G. Developer Support Engineer Havok www.havok.com

It really wasn't a strong solution, and so I replaced my own Quaternion/Vector classes with Havok's classes.

No weird trickery now to get things to work, it all works as expected and even with a performance boost (probably from SSE optimizations or something)

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen