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
registered
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 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

Hi,

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:
StandAloneDemos\StepByStep\MemoryInit\main.cpp
Let me know if that turns out to be the issue!
Cheers,
--Joel

Hello,

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.

Kissy

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

Hello

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 />

Kissy

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 !

Kissy

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.

Connectez-vous pour laisser un commentaire.