C#Code
C#Code
Public Member Functions | Protected Attributes
Libraries.ScreenPicking.ScreenPicker Class Reference

List of all members.

Public Member Functions

void CalculateRay (Microsoft.Xna.Framework.Point screenPos, Libraries._3D.Camera3D camera, Microsoft.Xna.Framework.Graphics.GraphicsDevice device)
void CalculateRay (Microsoft.Xna.Framework.Point screenPos, Libraries._3D.Camera3D camera, Microsoft.Xna.Framework.Graphics.GraphicsDevice device, Microsoft.Xna.Framework.Matrix worldTransform)
bool CheckForLineIntersection (Microsoft.Xna.Framework.Graphics.VertexPositionNormalTexture[] verts, Microsoft.Xna.Framework.Matrix mat)
bool CheckForLineIntersection (Microsoft.Xna.Framework.Graphics.VertexPositionNormalTexture[] verts, Microsoft.Xna.Framework.Matrix mat, ref float dist)
Microsoft.Xna.Framework.Ray GetIntersectionRay ()
void CalculateRay (Microsoft.Xna.Framework.Point screenPos, Libraries._3D.Camera3D camera, Microsoft.Xna.Framework.Graphics.GraphicsDevice device)
void CalculateRay (Microsoft.Xna.Framework.Point screenPos, Libraries._3D.Camera3D camera, Microsoft.Xna.Framework.Graphics.GraphicsDevice device, Microsoft.Xna.Framework.Matrix worldTransform)
bool CheckForLineIntersection (Microsoft.Xna.Framework.Graphics.VertexPositionNormalTexture[] verts, Microsoft.Xna.Framework.Matrix mat)
bool CheckForLineIntersection (Microsoft.Xna.Framework.Graphics.VertexPositionNormalTexture[] verts, Microsoft.Xna.Framework.Matrix mat, ref float dist)
Microsoft.Xna.Framework.Ray GetIntersectionRay ()

Protected Attributes

Microsoft.Xna.Framework.Ray m_intersectionRay
 Intersection ray to use.

Detailed Description

Used to perform screen picking. Screen picking takes a point in screen space and turns it into a line in world space that can be checked for collision with 3D objects in the world. This then allows objects to be picked by a mouse or something else.


Member Function Documentation

void Libraries.ScreenPicking.ScreenPicker.CalculateRay ( Microsoft.Xna.Framework.Point  screenPos,
Libraries._3D.Camera3D  camera,
Microsoft.Xna.Framework.Graphics.GraphicsDevice  device 
)

Calculate and store the intersection ray. Uses the indentity matrix as the world transform.

screenPos - Screen space position that the line goes from.
camera - 3D camera to use when calculating the intersection line.
device - Graphics device to use for untransforming the point.
void Libraries.ScreenPicking.ScreenPicker.CalculateRay ( Microsoft.Xna.Framework.Point  screenPos,
Libraries._3D.Camera3D  camera,
Microsoft.Xna.Framework.Graphics.GraphicsDevice  device,
Microsoft.Xna.Framework.Matrix  worldTransform 
)

Calculate and store the intersection ray.

screenPos - Screen space position that the line goes from.
camera - 3D camera to use when calculating the intersection line.
device - Graphics device to use for untransforming the point.
worldTransform - Transformation matrix the world uses.
void Libraries.ScreenPicking.ScreenPicker.CalculateRay ( Microsoft.Xna.Framework.Point  screenPos,
Libraries._3D.Camera3D  camera,
Microsoft.Xna.Framework.Graphics.GraphicsDevice  device 
)

Calculate and store the intersection ray. Uses the indentity matrix as the world transform.

screenPos - Screen space position that the line goes from.
camera - 3D camera to use when calculating the intersection line.
device - Graphics device to use for untransforming the point.
void Libraries.ScreenPicking.ScreenPicker.CalculateRay ( Microsoft.Xna.Framework.Point  screenPos,
Libraries._3D.Camera3D  camera,
Microsoft.Xna.Framework.Graphics.GraphicsDevice  device,
Microsoft.Xna.Framework.Matrix  worldTransform 
)

Calculate and store the intersection ray.

screenPos - Screen space position that the line goes from.
camera - 3D camera to use when calculating the intersection line.
device - Graphics device to use for untransforming the point.
worldTransform - Transformation matrix the world uses.
bool Libraries.ScreenPicking.ScreenPicker.CheckForLineIntersection ( Microsoft.Xna.Framework.Graphics.VertexPositionNormalTexture[]  verts,
Microsoft.Xna.Framework.Matrix  mat,
ref float  dist 
)

Checks if the shape intersects with the intersection line. The intersection ray is treated as a line.

verts - Verticies to check. They are stored as triangles, where every three entries is one triangle. Triangles do not share points.
mat - Matrix to apply to the verticies.

Return:
Value is true if the intersection ray collided with a triangle, false if not.
bool Libraries.ScreenPicking.ScreenPicker.CheckForLineIntersection ( Microsoft.Xna.Framework.Graphics.VertexPositionNormalTexture[]  verts,
Microsoft.Xna.Framework.Matrix  mat,
ref float  dist 
)

Checks if the shape intersects with the intersection line. The intersection ray is treated as a line.

verts - Verticies to check. They are stored as triangles, where every three entries is one triangle. Triangles do not share points.
mat - Matrix to apply to the verticies.

Return:
Value is true if the intersection ray collided with a triangle, false if not.
bool Libraries.ScreenPicking.ScreenPicker.CheckForLineIntersection ( Microsoft.Xna.Framework.Graphics.VertexPositionNormalTexture[]  verts,
Microsoft.Xna.Framework.Matrix  mat 
)

Checks if the shape intersects with the intersection line. The intersection ray is treated as a line.

verts - Verticies to check. They are stored as triangles, where every three entries is one triangle. Triangles do not share points. mat - Matrix to apply to the verticies.

Return:
Value is true if the intersection ray collided with a triangle, false if not.
bool Libraries.ScreenPicking.ScreenPicker.CheckForLineIntersection ( Microsoft.Xna.Framework.Graphics.VertexPositionNormalTexture[]  verts,
Microsoft.Xna.Framework.Matrix  mat 
)

Checks if the shape intersects with the intersection line. The intersection ray is treated as a line.

verts - Verticies to check. They are stored as triangles, where every three entries is one triangle. Triangles do not share points. mat - Matrix to apply to the verticies.

Return:
Value is true if the intersection ray collided with a triangle, false if not.
Microsoft.Xna.Framework.Ray Libraries.ScreenPicking.ScreenPicker.GetIntersectionRay ( )

Get the last intersection ray that was calculated.

Return:
Value is the intersection ray.

Microsoft.Xna.Framework.Ray Libraries.ScreenPicking.ScreenPicker.GetIntersectionRay ( )

Get the last intersection ray that was calculated.

Return:
Value is the intersection ray.


Member Data Documentation

Microsoft Xna Framework Ray Libraries::ScreenPicking.ScreenPicker::m_intersectionRay [protected]

Intersection ray to use.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Properties