Crash on new hkpWorld

Crash on new hkpWorld

Hi.After i call "m_world = new hkpWorld(m_worldInfo);"i get message:World\\hkpWorld.cpp(2899): [0x7372AB86] Assert: hkp3AxisSweepBroadPhase is not
Stack trace is:y:\\build\\20120119_200004_pcxsperpetualkeycode\\source\\common\\base\\system\\error\\hkdefaulterror.cpp(137):'hkDefaultError::message'y:\\build\\20120119_200004_pcxsperpetualkeycode\\source\\physics\\dynamics\\world\\hkpworld.cpp(2899):'hkpWorld::hkpWorld'd:\\space armada\\spacearmada\\notsosimpledx\\main.cpp(36):'WinMain'f:\\dd\\vctools\\crt_bld\\self_x86\\crt\\src\\crtexe.c(547):'__tmainCRTStartup'f:\\dd\\vctools\\crt_bld\\self_x86\\crt\\src\\crtexe.c(370):'WinMainCRTStartup'(null)(0):'BaseThreadInitThunk'(null)(0):'RtlInitializeExceptionChain'This is my hkpWorld initialization code:

hkpWorldCinfo m_worldInfo; hkpWorld* m_world=HK_NULL; { m_worldInfo.m_simulationType = hkpWorldCinfo::SIMULATION_TYPE_MULTITHREADED; } { m_worldInfo.m_broadPhaseBorderBehaviour = hkpWorldCinfo::BROADPHASE_BORDER_REMOVE_ENTITY; m_worldInfo.m_gravity.set(0,0.0f,0); //m_worldInfo.setupSolverInfo(hkpWorldCinfo::SOLVER_TYPE_8ITERS_MEDIUM); m_worldInfo.m_collisionTolerance = 0.1f; //m_worldInfo.setupSolverInfo(hkpWorldCinfo::SOLVER_TYPE_4ITERS_MEDIUM); m_worldInfo.setBroadPhaseWorldSize(5000.0f); //initialize world with created info m_world = new hkpWorld(m_worldInfo); m_world->m_wantDeactivation = false; m_world->markForWrite(); hkpAgentRegisterUtil::registerAllAgents( m_world->getCollisionDispatcher() ); m_world->unmarkForWrite(); }

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


This is most likely caused by not calling hkBaseSystem::init before setting up your world. In the documentation, take a look at Base Library -> The Base System -> 2.3 Runtime Initialization. There is also a good example of this in the following demo:
Let me know if that turns out to be the issue!


I have exactly the same assertion error with the latest version of Havok (2011.3), however I did call :

	hkMemoryRouter* memoryRouter = hkMemoryInitUtil::initDefault( hkMallocAllocator::m_defaultMallocAllocator, hkMemorySystem::FrameInfo( 500* 1024 ) );
	hkBaseSystem::init( memoryRouter, ErrorReport );

before trying to new hkpWorld.

I can't find exactly the reason in the documentation or other.


Just looked and it appears my issue is the same as this... I also have the latest version of Havok. Just downloaded it today.


Is your engine the one that is posted in Ogre Forum : "Interactive Engine - Online FPS Engine" ?
For more information, I am using the debug multithreaded lib (not dll).< br />


Hello Kissy... Yes it is.

I'm using the dll one... So it seems to be an issue with all build types.

I think I have found the reason of this error.
You cannot include the file "Common/Base/keycode.cxx" before other base / physics includes.
I moved the keycode.cxx include after all havok includes and just before hkProductFeatures.cxx

and the error is fixed !


Could you by any chance post your initialization code? I had the keycode and productfeatures includes in my cpp file after all of the Physics includes but I then decided to move it to the header. Still getting the same error.

I have actually copied and pasted everything from the SingleMultithreadedConsole demo
in the same order. Then I compared to my code, and that's why I found the issue :)

Ok I believe I have found my issue. I wasn't initializing everything correctly. I'm setting up another test before I integrate it into my engine and start the Ogre3D Specific stuff.

Leave a Comment

Please sign in to add a comment. Not a member? Join today