NxOgre::createBody() problem

lordmonkey

17-04-2011 13:52:50

Hello,
I have a problem with basic NxOgre program. First of all I wanted to ask if there are some more NxOgre tutorials on the web besides this on the github ?

Secondly I have my simple piece of code :

(NxOgre::) mBody = mRenderSystem->createBody(NxOgre::BoxDescription(1,1,1), NxOgre::Matrix44::IDENTITY, "cube.1m.mesh", bodyDescription);

How can I scale this box ? I know how to do it in the Ogre but I have no idea how to do it with NxOgre entity. I know that if I change the BoxDescription() to bigger e.g. (3,3,3) the collision box with grow. Bot how to change the renderable box size ?

betajaen

17-04-2011 14:00:10

Get the SceneNode of the body and scale it.

mBody->getNode()->setScale(...)

lordmonkey

17-04-2011 16:03:14

Thank you for the response,
although I have a problem with input handling function, namely:
bool OgreApp1::keyPressed(const OIS::KeyEvent& evt)
{

NxOgre::Vec3 force;

if (evt.key == OIS::KC_I)
force.z += 1;
else if (evt.key == OIS::KC_K)
force.z -= 1;
else if (evt.key == OIS::KC_J)
force.x -= 1;
else if (evt.key == OIS::KC_L)
force.x += 1;
else if (evt.key == OIS::KC_U)
force.y += 1;
else if (evt.key == OIS::KC_M)
force.y -= 1;

if (!force.isZero())
mBody->addForce( MaxStrength * force * mLastTimeStep);

if (evt.key == OIS::KC_T)
mBody->setGlobalPosition(NxOgre::Vec3(0,1,0));

return OgreBites::SdkSample::keyPressed(evt);
}


I get the error that
error C2352: 'OgreBites::SdkSample::keyPressed' : illegal call of non-static member function

the same code is contained in the NxOgre tutorial nr 1 (without OgreBites:: scope because it uses the namespace)
Why do I get the error ?