Code: Select all
// enum in header file
enum queryFlags
{
GROUND_ENTITY = 1<<0
};
// after creating an entity
entity->setQueryFlags(GROUND_ENTITY);
// in method that casts a ray
rayQuery = sceneManager->createRayQuery(Ogre::Ray());
rayQuery->setQueryMask(GROUND_ENTITY);
Ogre::Ray heightRay(ballPosition, Ogre::Vector3::NEGATIVE_UNIT_Y);
queryResult = rayQuery->execute();
P.S. Can I cast multiple rays in different direction instantly with Ogre::RaySceneQuery and after execution get some sort of array of those rays and what they intersect with?
Thanks.