WolverinePL
20-08-2007 13:57:49
Hi, first of all I'd like to thank authors for PhysX wrapper for Ogre, it saved me a lot of time to implement physics in my game. Unfortunately there is no way to write an application without any problems 
I want to use this code to trace a ray in nx scene:
and the result is that it does nothing (the castShape function is always throwing false - can't see any of this messages on the log, and yes, I'm sure that code is being executed
). Ofcourse I have some bodies on the scene - a big trimesh representing a terrain and some boxes with the camera facing them.
mCharacter is object of my class representing player with NxOgre::Character as mCharacter in it.
Application is a singleton with such things like ogre's scene mgr, nx scene, world etc. I don't use framelistener (instead of that I use simulate and render method - other physics works fine with it).
Hope my post is understandable

I want to use this code to trace a ray in nx scene:
NxOgre::RayCaster rc(
mCharacter->mCharacter->getNode()->getPosition(),
Application::getSingleton().mCamera->getDirection().normalisedCopy(),
8000,
NxOgre::RayCaster::RCT_CLOSEST,
Application::getSingleton().mNxScene );
if( rc.castShape( NxOgre::RayCaster::ActorFilter::AF_NONE ) )
{
LogManager::getSingleton().logMessage( "castShape returned true" );
NxOgre::Actor * a = rc.getClosestActor();
if( a )
{
LogManager::getSingleton().logMessage( "Actor hit!" );
a->addForce( Application::getSingleton().mCamera->getDirection() * 10 );
}
}
and the result is that it does nothing (the castShape function is always throwing false - can't see any of this messages on the log, and yes, I'm sure that code is being executed

mCharacter is object of my class representing player with NxOgre::Character as mCharacter in it.
Application is a singleton with such things like ogre's scene mgr, nx scene, world etc. I don't use framelistener (instead of that I use simulate and render method - other physics works fine with it).
Hope my post is understandable
