DXGfxLib.MathUtil Class Reference

This class is not meant to be instanciated. It is just a convenient way to regroup helper functions. They are defined as static method of the class. More...

List of all members.

Static Public Member Functions

static void RayFromScreenPos (Viewport viewport, Matrix proj, Matrix view, Vector2 screenPos, out Vector3 rayOrig, out Vector3 rayDir)
 This build a ray in 3D space from screen positions. This is usefull for example when we click on the application window and we know on which object in our 3D world we did click. This needs a valid viewport and the right projection and view matrices that has been used to render the image currently displayed.
static Vector3 PositionFromMat (Matrix mat)
 Extract a vector from a 4x4 matrix. If the 4x4 matrix is the world matrix used to position a node in 3D space this will extract the node position.
static Vector3 YawPitchRollFromQuat (Quaternion quat)
 This does extract Yaw Pitch Roll value from a quaternion. Values are in radiant. Yaw = returnVector.X Pitch = returnVector.Y Roll = returnVector.Z.
static Vector3 YawPitchRollFromMat (Matrix mat)
 This does extract Yaw Pitch Roll from a 4x4 matrix. Please see above for description of the return vector. Once again values are radiant.
static float ResetToNullIfTooSmall (float val, double threshold)
static Vector3 YawPitchRollFromMatInDegree (Matrix mat)
 Same as YawPitchRollFromMat except the return values are in degrees.
static Vector3 RadianToDegree (Vector3 yawpitchroll)
 In case you need to transform radian to degree the result from YawPitchRoll functions.
static Vector3 DegreeToRadian (Vector3 yawpitchroll)
 Symetric function to RadianToDegree.
static double Clamp (double val, double low, double high)
 The return value will be val clamped by low and high.
static float SignedDistance (Plane plane, Vector3 point)
 This does return the signed distance to a plane. Interesting to know on which side we stand.
static planeRelativePosition GetPlaneRelativePosition (Plane plane, BBox bbox)
 This function is helpful to determine on which side we stand or if we do intersect. See PlaneRelativePosition enumeration for possible results.
static float GetSmallest (float[] vec)
 This function will return the smallest value from the provided vector.
static float GetHighest (float[] vec)
 Will return the highest value in the procided vector.
static void CopyMatrixValues (Matrix matDest, Matrix matSrc)
 Will copy the values from matSrc to matDest values.
static float Distance (SceneNode n1, SceneNode n2)
 Compute the distance of one scene node to another.
static float Distance (Vector3 v1, Vector3 v2)
 Compute the distance from one point in space to another.
static Matrix ExtractRot (Matrix mat)
 Extract a rotation only matrix from a 4x4 matrix.
static Vector3 ExtractPosition (Matrix mat)
 Extract position from a 4x4 matrix.
static void RayFromScreenPos (Viewport viewport, Matrix proj, Matrix view, Vector2 screenPos, out Vector3 rayOrig, out Vector3 rayDir)
 This build a ray in 3D space from screen positions. This is usefull for example when we click on the application window and we know on which object in our 3D world we did click. This needs a valid viewport and the right projection and view matrices that has been used to render the image currently displayed.
static Vector3 PositionFromMat (Matrix mat)
 Extract a vector from a 4x4 matrix. If the 4x4 matrix is the world matrix used to position a node in 3D space this will extract the node position.
static Vector3 YawPitchRollFromQuat (Quaternion quat)
 This does extract Yaw Pitch Roll value from a quaternion. Values are in radiant. Yaw = returnVector.X Pitch = returnVector.Y Roll = returnVector.Z.
static Vector3 YawPitchRollFromMat (Matrix mat)
 This does extract Yaw Pitch Roll from a 4x4 matrix. Please see above for description of the return vector. Once again values are radiant.
static float ResetToNullIfTooSmall (float val, double threshold)
static Vector3 YawPitchRollFromMatInDegree (Matrix mat)
 Same as YawPitchRollFromMat except the return values are in degrees.
static Vector3 RadianToDegree (Vector3 yawpitchroll)
 In case you need to transform radian to degree the result from YawPitchRoll functions.
static Vector3 DegreeToRadian (Vector3 yawpitchroll)
 Symetric function to RadianToDegree.
static double Clamp (double val, double low, double high)
 The return value will be val clamped by low and high.
static float SignedDistance (Plane plane, Vector3 point)
 This does return the signed distance to a plane. Interesting to know on which side we stand.
static planeRelativePosition GetPlaneRelativePosition (Plane plane, BBox bbox)
 This function is helpful to determine on which side we stand or if we do intersect. See PlaneRelativePosition enumeration for possible results.
static float GetSmallest (float[] vec)
 This function will return the smallest value from the provided vector.
static float GetHighest (float[] vec)
 Will return the highest value in the procided vector.
static void CopyMatrixValues (Matrix matDest, Matrix matSrc)
 Will copy the values from matSrc to matDest values.
static float Distance (SceneNode n1, SceneNode n2)
 Compute the distance of one scene node to another.
static float Distance (Vector3 v1, Vector3 v2)
 Compute the distance from one point in space to another.
static Matrix ExtractRot (Matrix mat)
 Extract a rotation only matrix from a 4x4 matrix.
static Vector3 ExtractPosition (Matrix mat)
 Extract position from a 4x4 matrix.


Detailed Description

This class is not meant to be instanciated. It is just a convenient way to regroup helper functions. They are defined as static method of the class.

Definition at line 651 of file MathUtil.cs.


Member Function Documentation

static double DXGfxLib.MathUtil.Clamp ( double  val,
double  low,
double  high 
) [static]

The return value will be val clamped by low and high.

Parameters:
val 
low 
high 
Returns:

Definition at line 796 of file MathUtil.cs.

static double DXGfxLib.MathUtil.Clamp ( double  val,
double  low,
double  high 
) [static]

The return value will be val clamped by low and high.

Parameters:
val 
low 
high 
Returns:

Definition at line 796 of file MathUtil.cs.

static void DXGfxLib.MathUtil.CopyMatrixValues ( Matrix  matDest,
Matrix  matSrc 
) [static]

Will copy the values from matSrc to matDest values.

Parameters:
matDest 
matSrc 

Definition at line 919 of file MathUtil.cs.

static void DXGfxLib.MathUtil.CopyMatrixValues ( Matrix  matDest,
Matrix  matSrc 
) [static]

Will copy the values from matSrc to matDest values.

Parameters:
matDest 
matSrc 

Definition at line 919 of file MathUtil.cs.

Here is the caller graph for this function:

static Vector3 DXGfxLib.MathUtil.DegreeToRadian ( Vector3  yawpitchroll  )  [static]

Symetric function to RadianToDegree.

Parameters:
yawpitchroll 
Returns:

Definition at line 780 of file MathUtil.cs.

static Vector3 DXGfxLib.MathUtil.DegreeToRadian ( Vector3  yawpitchroll  )  [static]

Symetric function to RadianToDegree.

Parameters:
yawpitchroll 
Returns:

Definition at line 780 of file MathUtil.cs.

static float DXGfxLib.MathUtil.Distance ( Vector3  v1,
Vector3  v2 
) [static]

Compute the distance from one point in space to another.

Parameters:
v1 
v2 
Returns:

Definition at line 959 of file MathUtil.cs.

static float DXGfxLib.MathUtil.Distance ( SceneNode  n1,
SceneNode  n2 
) [static]

Compute the distance of one scene node to another.

Parameters:
n1 
n2 
Returns:

Definition at line 948 of file MathUtil.cs.

Here is the call graph for this function:

static float DXGfxLib.MathUtil.Distance ( Vector3  v1,
Vector3  v2 
) [static]

Compute the distance from one point in space to another.

Parameters:
v1 
v2 
Returns:

Definition at line 959 of file MathUtil.cs.

static float DXGfxLib.MathUtil.Distance ( SceneNode  n1,
SceneNode  n2 
) [static]

Compute the distance of one scene node to another.

Parameters:
n1 
n2 
Returns:

Definition at line 948 of file MathUtil.cs.

Here is the caller graph for this function:

static Vector3 DXGfxLib.MathUtil.ExtractPosition ( Matrix  mat  )  [static]

Extract position from a 4x4 matrix.

Parameters:
mat 
Returns:

Definition at line 988 of file MathUtil.cs.

static Vector3 DXGfxLib.MathUtil.ExtractPosition ( Matrix  mat  )  [static]

Extract position from a 4x4 matrix.

Parameters:
mat 
Returns:

Definition at line 988 of file MathUtil.cs.

static Matrix DXGfxLib.MathUtil.ExtractRot ( Matrix  mat  )  [static]

Extract a rotation only matrix from a 4x4 matrix.

Parameters:
mat 
Returns:

Definition at line 970 of file MathUtil.cs.

Here is the call graph for this function:

static Matrix DXGfxLib.MathUtil.ExtractRot ( Matrix  mat  )  [static]

Extract a rotation only matrix from a 4x4 matrix.

Parameters:
mat 
Returns:

Definition at line 970 of file MathUtil.cs.

Here is the call graph for this function:

static float DXGfxLib.MathUtil.GetHighest ( float[]  vec  )  [static]

Will return the highest value in the procided vector.

Parameters:
vec 
Returns:

Definition at line 902 of file MathUtil.cs.

static float DXGfxLib.MathUtil.GetHighest ( float[]  vec  )  [static]

Will return the highest value in the procided vector.

Parameters:
vec 
Returns:

Definition at line 902 of file MathUtil.cs.

static planeRelativePosition DXGfxLib.MathUtil.GetPlaneRelativePosition ( Plane  plane,
BBox  bbox 
) [static]

This function is helpful to determine on which side we stand or if we do intersect. See PlaneRelativePosition enumeration for possible results.

Parameters:
plane 
bbox 
Returns:

Definition at line 828 of file MathUtil.cs.

Here is the call graph for this function:

static planeRelativePosition DXGfxLib.MathUtil.GetPlaneRelativePosition ( Plane  plane,
BBox  bbox 
) [static]

This function is helpful to determine on which side we stand or if we do intersect. See PlaneRelativePosition enumeration for possible results.

Parameters:
plane 
bbox 
Returns:

Definition at line 828 of file MathUtil.cs.

Here is the call graph for this function:

static float DXGfxLib.MathUtil.GetSmallest ( float[]  vec  )  [static]

This function will return the smallest value from the provided vector.

Parameters:
vec 
Returns:

Definition at line 885 of file MathUtil.cs.

static float DXGfxLib.MathUtil.GetSmallest ( float[]  vec  )  [static]

This function will return the smallest value from the provided vector.

Parameters:
vec 
Returns:

Definition at line 885 of file MathUtil.cs.

static Vector3 DXGfxLib.MathUtil.PositionFromMat ( Matrix  mat  )  [static]

Extract a vector from a 4x4 matrix. If the 4x4 matrix is the world matrix used to position a node in 3D space this will extract the node position.

Parameters:
mat 
Returns:

Definition at line 683 of file MathUtil.cs.

static Vector3 DXGfxLib.MathUtil.PositionFromMat ( Matrix  mat  )  [static]

Extract a vector from a 4x4 matrix. If the 4x4 matrix is the world matrix used to position a node in 3D space this will extract the node position.

Parameters:
mat 
Returns:

Definition at line 683 of file MathUtil.cs.

static Vector3 DXGfxLib.MathUtil.RadianToDegree ( Vector3  yawpitchroll  )  [static]

In case you need to transform radian to degree the result from YawPitchRoll functions.

Parameters:
yawpitchroll 
Returns:

Definition at line 766 of file MathUtil.cs.

static Vector3 DXGfxLib.MathUtil.RadianToDegree ( Vector3  yawpitchroll  )  [static]

In case you need to transform radian to degree the result from YawPitchRoll functions.

Parameters:
yawpitchroll 
Returns:

Definition at line 766 of file MathUtil.cs.

static void DXGfxLib.MathUtil.RayFromScreenPos ( Viewport  viewport,
Matrix  proj,
Matrix  view,
Vector2  screenPos,
out Vector3  rayOrig,
out Vector3  rayDir 
) [static]

This build a ray in 3D space from screen positions. This is usefull for example when we click on the application window and we know on which object in our 3D world we did click. This needs a valid viewport and the right projection and view matrices that has been used to render the image currently displayed.

Parameters:
viewport 
proj 
view 
screenPos 
rayOrig 
rayDir 

Definition at line 664 of file MathUtil.cs.

static void DXGfxLib.MathUtil.RayFromScreenPos ( Viewport  viewport,
Matrix  proj,
Matrix  view,
Vector2  screenPos,
out Vector3  rayOrig,
out Vector3  rayDir 
) [static]

This build a ray in 3D space from screen positions. This is usefull for example when we click on the application window and we know on which object in our 3D world we did click. This needs a valid viewport and the right projection and view matrices that has been used to render the image currently displayed.

Parameters:
viewport 
proj 
view 
screenPos 
rayOrig 
rayDir 

Definition at line 664 of file MathUtil.cs.

static float DXGfxLib.MathUtil.ResetToNullIfTooSmall ( float  val,
double  threshold 
) [static]

Definition at line 738 of file MathUtil.cs.

static float DXGfxLib.MathUtil.ResetToNullIfTooSmall ( float  val,
double  threshold 
) [static]

Definition at line 738 of file MathUtil.cs.

static float DXGfxLib.MathUtil.SignedDistance ( Plane  plane,
Vector3  point 
) [static]

This does return the signed distance to a plane. Interesting to know on which side we stand.

Parameters:
plane 
point 
Returns:

Definition at line 816 of file MathUtil.cs.

static float DXGfxLib.MathUtil.SignedDistance ( Plane  plane,
Vector3  point 
) [static]

This does return the signed distance to a plane. Interesting to know on which side we stand.

Parameters:
plane 
point 
Returns:

Definition at line 816 of file MathUtil.cs.

Here is the caller graph for this function:

static Vector3 DXGfxLib.MathUtil.YawPitchRollFromMat ( Matrix  mat  )  [static]

This does extract Yaw Pitch Roll from a 4x4 matrix. Please see above for description of the return vector. Once again values are radiant.

Parameters:
mat 
Returns:

Definition at line 706 of file MathUtil.cs.

static Vector3 DXGfxLib.MathUtil.YawPitchRollFromMat ( Matrix  mat  )  [static]

This does extract Yaw Pitch Roll from a 4x4 matrix. Please see above for description of the return vector. Once again values are radiant.

Parameters:
mat 
Returns:

Definition at line 706 of file MathUtil.cs.

Here is the caller graph for this function:

static Vector3 DXGfxLib.MathUtil.YawPitchRollFromMatInDegree ( Matrix  mat  )  [static]

Same as YawPitchRollFromMat except the return values are in degrees.

Parameters:
mat 
Returns:

Definition at line 753 of file MathUtil.cs.

Here is the call graph for this function:

static Vector3 DXGfxLib.MathUtil.YawPitchRollFromMatInDegree ( Matrix  mat  )  [static]

Same as YawPitchRollFromMat except the return values are in degrees.

Parameters:
mat 
Returns:

Definition at line 753 of file MathUtil.cs.

Here is the call graph for this function:

static Vector3 DXGfxLib.MathUtil.YawPitchRollFromQuat ( Quaternion  quat  )  [static]

This does extract Yaw Pitch Roll value from a quaternion. Values are in radiant. Yaw = returnVector.X Pitch = returnVector.Y Roll = returnVector.Z.

Parameters:
quat 
Returns:

Definition at line 694 of file MathUtil.cs.

Here is the call graph for this function:

static Vector3 DXGfxLib.MathUtil.YawPitchRollFromQuat ( Quaternion  quat  )  [static]

This does extract Yaw Pitch Roll value from a quaternion. Values are in radiant. Yaw = returnVector.X Pitch = returnVector.Y Roll = returnVector.Z.

Parameters:
quat 
Returns:

Definition at line 694 of file MathUtil.cs.

Here is the call graph for this function:


The documentation for this class was generated from the following files:

Generated on Thu Jan 8 20:48:58 2009 for DXGfx by  doxygen 1.5.8