Skip to content

Instantly share code, notes, and snippets.

@Azerothian
Created January 16, 2012 12:28
Show Gist options
  • Save Azerothian/1620645 to your computer and use it in GitHub Desktop.
Save Azerothian/1620645 to your computer and use it in GitHub Desktop.
Intersections
RaySceneQuery SceneQuery = _root.SceneManager.CreateRayQuery(
_camera.GetCameraToViewportRay(
inputReader.AbsoluteMouseX / (float)_renderWindow.Width,
inputReader.AbsoluteMouseY / (float)_renderWindow.Height)
,
0x40000000
);
foreach (RaySceneQueryResultEntry result in SceneQuery.Execute())
{
if (result.SceneObject != null)
result.SceneObject.ShowBoundingBox = true;
//else if (result.worldFragment != null)
//PlayerNode.Position = result.worldFragment.SingleIntersection;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment