today I want to ask a question about Havok Physics 2012.

My havok version is 2014.1.0-r1 (x86 SIMD version), and I'm using Visual Studio 2012 on Windows 8.

My problem is, that once I add a rigid body to the world, the next time I call hkpWorld::stepMultithreaded(), it breaks in some SSE math related function and gives me this error message through my error report function.

C:\NightlyJobs\09-07-Sun-01\Source\Common/Base/Math/Vector/Sse/hkSseVector4Util. inl(307): [0x1FF88F0E] Assert: hkQuaternionf not normalized/invalid!

Here's the stack trace:


Here's how I create and add the rigid body.
It's so basic that I didn't think there would be any room for bizarre error in it...

hkpSphereShape* sphere = new hkpSphereShape(radius);  // radius is 10.0f here.

hkpRigidBodyCinfo rigidBodyInfo;
rigidBodyInfo.m_shape = sphere;

m_RigidBody = new hkpRigidBody(rigidBodyInfo);


I don't set position or rotation of the rigid body myself, so why it breaks in some quaternion related function is beyond me.

I speculated it might be one of those multithreading-related bizarre errors, so I tried changing

m_WorldInfo.m_simulationType = hkpWorldCinfo::SIMULATION_TYPE_MULTITHREADED;


m_WorldInfo.m_simulationType = hkpWorldCinfo::SIMULATION_TYPE_DISCRETE;


m_World->stepMultithreaded(m_JobQueue, m_CpuThreadPool, timeStep);



but the problem persisted.

Do you know something that I could be doing wrong ?
Please tell me in the comments if you need to see some of my other code to help!
Any help would be greatly appreciated, thanks!

  • \$\begingroup\$ I changed my havok to non-SIMD version, and the problem is gone. I tried 16-byte aligned allocations of hkpSphereShape and hkpRigidBody too (instead of just new), so I don't really understand the problem. \$\endgroup\$
    – JamesAMD
    Aug 9 '15 at 22:08

Answering my own question...

It appears that if you're using the SIMD-enabled version of havok, you need to define HK_CONFIG_SIMD=1.

Not setting it with the SIMD-version, and setting it with the non-SIMD-version can both result in a crash.

For future-visitors:
Whichever version of havok you're using, if you encounter SSE-related crashes or errors, make sure you're not accidentally defining or not defining HK_CONFIG_SIMD in your code or in the project settings in your IDE.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.