Character collision error

s0lidnuts

12-07-2007 04:10:18

error -> return mActor->isDynamic(); from nxogreactor.cpp

the character is being set up this way
NxOgre::Character *nxCharacter = mNxScene->createCharacter("Player", _sceneMgr->getSceneNode("Box")->getPosition() + Ogre::Vector3(0, 40, 0), "type: box, dimensions: 1 1 1");
It seems that when the characters collides with something, the error happens.

Call stack
> NxOgre_d.dll!NxOgre::Actor::isDynamic() Line 383 + 0xc bytes C++
NxOgre_d.dll!NxOgre::BaseCharacterHitReport::onActor(NxOgre::Character * __formal=0x010eccc0, NxOgre::Actor * a=0x010eecf0, NxOgre::Character * __formal=0x010eccc0, NxOgre::Character * __formal=0x010eccc0, const NxControllerShapeHit & h={...}) Line 33 + 0x8 bytes C++
NxOgre_d.dll!NxOgre::CharacterController::onShapeHit(const NxControllerShapeHit & hit={...}) Line 170 + 0x28 bytes C++

and mActor is null aparently

Aiursrage2k

12-07-2007 05:58:10

The problem has already been reported in a few threads.

From the Version 9 thread.



Joined: 07 Mar 2006
Posts: 1932
Location: Wales, UK

PostPosted: Thu Jul 05, 2007 2:05 pm Post subject: Reply with quote
Okay, got a Fix. It was to do with the UserData. Which was a NxActorUserData (which now it's suppose to be), and it was casted into an Actor. Which causes the crash.

In "NxOgreCharacterController.cpp", add the line to the include lines

Code:
#include "NxOgreUserData.h"


In the same file, change the line 159/160 to:

Code:
Actor* actor = (static_cast<NxActorUserData*>(hit.shape->getActor().userData))->toActor();


It should work then.

http://www.ogre3d.org/phpBB2addons/view ... &start=270
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=4789