Access violations while running update havok

Access violations while running update havok

Imagen de havokisking3344

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()

{

PhysicalWorld->stepDeltaTime(0.063f);

return 1;

}

and i'm calling it like this:

while(lContinue)

{

if(GetTickCount() - Speed >= 30)

{

Havok.UpdateTime();

Speed = GetTickCount();

}

//....rendered stuff.

Ok, now my access violation hex is this:

0x00000008

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

publicaciones de 7 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de havokchris

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?

-Chris

Imagen de havokisking3344

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

hkpWorld* CHavok::CreateWorld()

{

this->PhysicalWorld;

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);

MemoryManager->removeReference();

int stackSize = 0x100000;

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

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

return 1;

if(!CreateWorld())

{

#if defined(WIN32_LEAN_AND_MEAN)

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

#else

printf("Could not create World");

#endif

}

}

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

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.

Imagen de havokisking3344

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

Imagen de havokisking3344

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.

Imagen de havokchris

Hi,
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?

-Chris

Inicie sesión para dejar un comentario.