Access violations while running update havok

Access violations while running update havok

Ok, this is really annoying, am i the only one who can't get Havok to work?! i get access violations in the update function i created. here is my update function.

int CHavok::UpdateTime()



return 1;


and i'm calling it like this:



if(GetTickCount() - Speed >= 30)



Speed = GetTickCount();


//....rendered stuff.

Ok, now my access violation hex is this:


and looking it up it says:

Not enough storage is available to process this command.

and it says that some symbols can't be found and some expressions can't be evalueted. any help will be great as i've had this problem since havok came out!!

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

That sounds like a plain old NULL pointer somewhere. How are you setting up the world? Are you running the debug configuration so that you can get some asserts? What's Havok part of the callstack when you get the crash?


Well, this is how i'm creating the world:

hkpWorld* CHavok::CreateWorld()



this->Info.m_simulationType = hkpWorldCinfo::SIMULATION_TYPE_CONTINUOUS;

PhysicalWorld = new hkpWorld(Info);

return PhysicalWorld;


and this is how i'm initializing Havok:

int CHavok::Init_PhysicsEngine()


MemoryManager = new hkPoolMemory();

threadMemory = new hkThreadMemory(MemoryManager, 16);

hkBaseSystem::init(MemoryManager, threadMemory, MessageHandler);


int stackSize = 0x100000;

stackBuffer = hkAllocate<char>(stackSize, HK_MEMORY_CLASS_BASE);

hkThreadMemory::getInstance().setStackArea(stackBuffer, stackSize);

return 1;



#if defined(WIN32_LEAN_AND_MEAN)

MessageBoxA(NULL,"World could not be created",0,MB_OK);


printf("Could not create World");




and havok initialkies in the console window, but for some reason, the update function

According to your hkBaseSystem::init statement, your error handler is "MessageHandler". My error handler looks like this:

static void HK_CALL errorReport(const char* msg, void*) {

printf("%s", msg);


Set a breakpoint on the printf statement and see if it gets hit. If it does, see what msg contains.

Ok, should I remove the updatehavok? because it i leave it in it gives me access violations......

The message is Base System initialized, so Havok is initialized, but for some reason, it gives access violations, if you want i could give you the access violations.

You shouldn't remove the call to updatehavok because then nothing will move. The physics wouldn't look very good then :)

Are you calling updatehavok from the same thread that you do the setup?

When you're running from Visual Studio and you hit the access violation, you should see a callstack. Can you copy and paste that here?


Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!