Elspin
04-11-2009 16:41:58
So I've looked through the documentation for PhysX, and I got a raycast working. I'm really not sure how to get useful information out of the raycast though.
This is the raycast I have set up in my framelistener that's controlling buffered input
what I'm trying to do is find a cube I've spawned, which is an OGRE3DBody*. I'm not sure how I could find this using a raycast, aside from possibly making a container to hold all the 3D bodies and then matching the rigid body returned to one of the 3D bodies... Is there a better way, or a different way I should be going about doing this?
This is the raycast I have set up in my framelistener that's controlling buffered input
NxOgre::Vec3 StartPos( mCamNode->getPosition() );
Camera *mCam = static_cast<Camera*>(mCamNode->getAttachedObject("Camera"));
NxOgre::Vec3 Direction( mCam->getDirection() );
NxOgre::Ray CubeRay( StartPos, Direction );
NxOgre::RaycastHit mRayResult = mScene->raycastClosestShape( CubeRay, NxOgre::Enums::ShapesType_All );
what I'm trying to do is find a cube I've spawned, which is an OGRE3DBody*. I'm not sure how I could find this using a raycast, aside from possibly making a container to hold all the 3D bodies and then matching the rigid body returned to one of the 3D bodies... Is there a better way, or a different way I should be going about doing this?