SceneGeometry Callback

mapeki

21-10-2009 04:40:34

Hello, first post newbie here.

Little background first I suppose. I'm a 4th year computer science student doing a game for my final project. The game is a physics intensive sidescroller.

I can't seem to get any callbacks from SceneGeometry, do they not not give callbacks for some reason? I create the SceneGeometry ( a plane ) with this:

// Create the plane geometry
NxOgre::SceneGeometry* pl = mScene->createSceneGeometry(new NxOgre::PlaneGeometry(0, NxOgre::Vec3(0, 1, 0)), Matrix44_Identity);


This is the object I want to get a callback for if it hits the plane. Its a regular capsule as far as I know. I have set up a class to inherit the callback functions and
here is the code I used to create the capsule.


NxOgre::RigidBodyDescription capsuleDesc;
capsuleDesc.mBodyFlags = NxOgre::Enums::BodyFlags_FreezePositionZ
| NxOgre::Enums::BodyFlags_FreezeRotation;

// This is where we create the material description and the material
NxOgre::MaterialDescription matDesc;
matDesc.mRestitution = 0.2;
capsuleMaterial_ = scene_->createMaterial(matDesc); // Declared else where

// The ShapeBlueprint
NxOgre::ShapeBlueprint* sb = new NxOgre::ShapeBlueprint();
sb->mMaterial = capsuleMaterial_->getIdentifier();
capsuleShape_ = new NxOgre::Capsule(capsuleRadius_,capsuleHeight_, sb);

OGRE3DBody* body_;
body_ = renderSystem_->createBody(capsuleShape_, NxOgre::Vec3(0, capsuleHeight_, 0), meshName_,capsuleDesc);
body_->setContactCallback(this);



I also can't seem to get volumes/triggers to do anything with the plane either. Do they not create a callback for that?

I'm really just looking for an easy way to check if the capsule's bottom is touching the ground.


Any help is greatly appreciated