[SOLVED] Trying to use NxController with NxOgre

Brakok

25-05-2010 23:45:44

Hi,

I try to use Physx NxController to collide with NxOgre rigidBody, but at the moment that they collide with each other, my application crashes on TimeController:advance().

I just want to know (because I'm fairly new to NxOgre and PhysX) if this issue is raised because of an object that is incorrectly initiated (maybe my NxController) or something else. I don't know if it can help, but that's my NxController construction:

NxBoxControllerDesc boxDesc;

boxDesc.position.x = _startPosition.x ;
boxDesc.position.y = _startPosition.y;
boxDesc.position.z = _startPosition.z;
boxDesc.extents = NxVec3(1,2,1);
boxDesc.skinWidth = 0.1f;
boxDesc.upDirection = NX_Y;
boxDesc.callback = new CollisionHitReport(); //custom class that herits from NxUserControllerHitReport.
boxDesc.slopeLimit = cosf(NxMath::degToRad(45.0f));
boxDesc.stepOffset = 0.5f;

controller = controllerManager->createController(Application::getInstance().getPhysicManager()->getScene()->getScene(), boxDesc);

Any help will be greatly appreciate. Thx.

betajaen

26-05-2010 10:35:10

Unfortunately there is a incompatibility with NxOgre and the NxCharacter code.

Basically what boils down to is, the NxOgre collision detection code expected any NxActor in PhysX to be a NxOgre one, with a userData containing a pointer to it's parent RigidBody class. The NxCharacter doesn't do this at all. It uses it's userData property to contain a string, which NxOgre casts into a pointer - which causes the crash.

Detritus is scheduled to have the NxCharacter code wrapped into in the next commit (or the one after), if you wish to wait.

Brakok

26-05-2010 17:52:48

I saw that u were coding on a wrapper for NxCharacter. I will wait for it and try something else. Keep up the good work :).