VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Events
VisiMath.BaseTransformation Class Reference

Generic transformation stored in transformation matrix with no other data saved Acessing rotation/scaling properties requires recalulcation (slow!) More...

Inheritance diagram for VisiMath.BaseTransformation:

List of all members.

## Public Member Functions
| BaseTransformation ()
| Default constructor.
| BaseTransformation (ref Matrix4 mat)
| Constructs transformation from the already finished matrix.
virtual void | GetAll (out Vector3 pos, out Vector3 rot, out Vector3 scale, out float uniscale)
| Used to quickly get all of the properties with one call.
virtual void | GetAll (out Vector3 pos, out Quaternion rot, out Vector3 scale, out float uniscale)
| Used to quickly get all of the properties with one call.
TransformationState | GetCurrentState ()
virtual void | SetCurrentState (TransformationState state)
virtual void | PushState ()
| Pushes current state of transformation to internal stack.
virtual void | PopState ()
| Pops current state of transformation from internal state stack and sets it as current.
virtual void | UndoPushState ()
| Pops state of transformation from internal stack.
void | Move (ref Vector3 movement)
| Move transformation in world coordinates (translation) Modifies position property.
void | Move (Vector3 movement)
| Move transformation in world coordinates (translation) Modifies position property.
void | Move (ref Quaternion q, float distance)
| Move transformation in world coordinates (translation) in specified angle and distance Modifies position property.
void | Move (ref Vector3 axis, float angle, float distance)
| Move transformation in world coordinates (translation) in specified angle and distance Modifies position property.
void | Move (ref Vector3 direction, float distance)
| Move transformation in world coordinates (translation) in directional vector and distance Modifies position property.
virtual void | MoveLocal (ref Vector3 movement)
| Move transformation in local coordinates.
void | MoveLocal (ref Quaternion q, float distance)
| Move transformation in local coordinates (translation) in specified angle and distance.
void | MoveLocal (ref Vector3 axis, float angle, float distance)
| Move transformation in local coordinates (translation) in specified angle and distance.
void | MoveLocal (ref Vector3 direction, float distance)
| Move transformation in local coordinates (translation) in directional vector and distance.
void | Rotate (ref Quaternion q)
| Rotate whole transformation in world coordinates Calls MulMatrix.
void | Rotate (ref Vector3 axis, float angle)
| Rotate whole transformation in world coordinates Calls MulMatrix.
void | Rotate (ref Vector3 rpy)
| Rotate whole transformation in world coordinates Calls MulMatrix.
void | Rotate (Vector3 rpy)
| Rotate whole transformation in world coordinates Calls MulMatrix.
void | RotateLocal (ref Quaternion q)
| Rotate in local coordinates (around the zero)
void | RotateLocal (ref Vector3 axis, float angle)
| Rotate in local coordinates (around the local zero) Changes Rotation quaternion.
void | RotateLocal (ref Vector3 rpy)
| Rotate in local coordinates (around the local zero) Changes Rotation quaternion.
void | RotateLocal (Vector3 rpy)
| Rotate in local coordinates (around the local zero) Changes Rotation quaternion.
void | Pitch (float angle)
| Rotate in local coordinates (changes pitch) Changes RPY.
void | Yaw (float angle)
| Rotate in local coordinates (changes yaw) Changes RPY.
void | Roll (float angle)
| Rotate in local coordinates (changes roll) Changes RPY.
void | Rescale (float scalefactor)
| Rescale transformation by uniform number Calls MulMatrix.
void | Rescale (ref Vector3 scalefactor)
| Rescale transformation by non-uniform vecotr Calls MulMatrix.
void | RescaleLocal (float scalefactor)
| Local uniform rescale (changes basic scale of the transformation) Changes UniformScale property.
void | RescaleLocal (ref Vector3 scalefactor)
| Local non-uniform rescale (changes basic scale of the transformation) Changes Scale property.
Vector3 | GetPointInWorldSpace (Vector3 point)
| Returns location of point in local space to the world space.
System.Xml.Schema.XmlSchema | GetSchema ()
| Reqired by IXMLserializable.
virtual void | ReadXml (System.Xml.XmlReader reader)
| Deserializes object from XML.
virtual void | WriteXml (System.Xml.XmlWriter writer)
virtual ITransformation | GetCopy ()
| Returns copy of the transformation.
override string | ToString ()
## Protected Member Functions
void | OnChange ()
virtual void | MulMatrix (ref Matrix4 m)
| Multiplies current matrix with another(trans = m*trans)
## Protected Attributes
Matrix4 | trans
| Internaly stored transformation.
Stack< TransformationState > | StateStack = new Stack<TransformationState>(1)
## Properties
virtual bool | Movable`[get]`
| True if object supports movement.
virtual bool | Rotable`[get]`
| True if object supports rotation.
virtual bool | Scalable`[get]`
| True if object supports scaling.
virtual Matrix4 | TransMatrix`[get, set]`
| Gets or sets transformation matrix.
virtual Vector3 | Position`[get, set]`
| Position in vector - virtual so derived classes may override it.
float | X`[get, set]`
| X position from the Position property.
float | Y`[get, set]`
| Y position from the Position property.
float | Z`[get, set]`
| Z position from the Position property.
virtual Quaternion | Rotation`[get, set]`
| Rotation in quaternion, virtual, so derived classes may override it Note: getting quaternion requires deconstructing matrix. Setting quaternion requires deconstructing and new transformation construction. May not be completely accurate for more complicated matrix.
virtual Vector3 | RPY`[get, set]`
| Rotation in roll-pitch-yaw format, virtual, so derived classes may override it Note: getting rotation requires deconstructing matrix. Setting quaternion requires deconstructing and new transformation construction. May not be completely accurate for more complicated matrix.
float | PitchAngle`[get, set]`
| Pitch rotation from RPY.
float | YawAngle`[get, set]`
| Yaw rotation from RPY.
float | RollAngle`[get, set]`
| Roll rotation from RPY.
virtual float | UniformScale`[get, set]`
| Uniform scale, returns zero if scale is not uniform. Note: getting scale requires deconstructing matrix. Setting scale requires deconstructing and new transformation construction. May not be completely accurate for more complicated matrix.
virtual Vector3 | Scale`[get, set]`
| Scale vector, returns zero if scale is not uniform. Note: getting scale requires deconstructing matrix. Setting scale requires deconstructing and new transformation construction. May not be completely accurate for more complicated matrix.
## Events
TransformationCallback | ChangeCallback
| Callback for any transformation change.

## Detailed Description

Generic transformation stored in transformation matrix with no other data saved Acessing rotation/scaling properties requires recalulcation (slow!)

## Constructor & Destructor Documentation

VisiMath.BaseTransformation.BaseTransformation | ( |  | ) |

Default constructor.

VisiMath.BaseTransformation.BaseTransformation | ( | ref Matrix4 | mat | ) |

Constructs transformation from the already finished matrix.

Parameters:

  mat | Transformation matrix

## Member Function Documentation

virtual void VisiMath.BaseTransformation.GetAll | ( | out Vector3 | pos,
|  | out Vector3 | rot,
|  | out Vector3 | scale,
|  | out float | uniscale
| ) |  | `[virtual]`

Used to quickly get all of the properties with one call.

Parameters:

  pos | Position vector
  rot | RPY rotation
  scale | Scale
  uniscale | Uniform Scale

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.MoveTransformation, VisiMath.RPYTransformation, VisiMath.QTransformation, and VisiMath.Transformation.

virtual void VisiMath.BaseTransformation.GetAll | ( | out Vector3 | pos,
|  | out Quaternion | rot,
|  | out Vector3 | scale,
|  | out float | uniscale
| ) |  | `[virtual]`

Used to quickly get all of the properties with one call.

Parameters:

  pos | Position vector
  rot | quaternion rotation
  scale | Scale
  uniscale | Uniform Scale

Reimplemented in VisiMath.MoveTransformation, VisiMath.RPYTransformation, VisiMath.QTransformation, and VisiMath.Transformation.

virtual ITransformation VisiMath.BaseTransformation.GetCopy | ( |  | ) | `[virtual]`

Returns copy of the transformation.

Returns:

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.MoveTransformation, VisiMath.RPYTransformation, VisiMath.QTransformation, VisiMath.Transformation, VisimBox.Renderer.StandardCamera, and VisimBox.Renderer.FPSCamera.

TransformationState VisiMath.BaseTransformation.GetCurrentState | ( |  | ) |

Vector3 VisiMath.BaseTransformation.GetPointInWorldSpace | ( | Vector3 | point | ) |

Returns location of point in local space to the world space.

Parameters:

  point | position in local space

Returns:
  position in world space

Implements VisiMath.ITransformation.

System.Xml.Schema.XmlSchema VisiMath.BaseTransformation.GetSchema | ( |  | ) |

Reqired by IXMLserializable.

Returns:
  Null

void VisiMath.BaseTransformation.Move | ( | ref Vector3 | movement | ) |

Move transformation in world coordinates (translation) Modifies position property.

Parameters:

  movement | Translation vector

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.Move | ( | Vector3 | movement | ) |

Move transformation in world coordinates (translation) Modifies position property.

Parameters:

  movement | Translation vector

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.Move | ( | ref Quaternion | q,
|  | float | distance
| ) |  |

Move transformation in world coordinates (translation) in specified angle and distance Modifies position property.

Parameters:

  q | rotation
  distance | distance

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.Move | ( | ref Vector3 | axis,
|  | float | angle,
|  | float | distance
| ) |  |

Move transformation in world coordinates (translation) in specified angle and distance Modifies position property.

Parameters:

  axis | Rotation axis
  angle | Rotation angle
  distance | distance

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.Move | ( | ref Vector3 | direction,
|  | float | distance
| ) |  |

Move transformation in world coordinates (translation) in directional vector and distance Modifies position property.

Parameters:

  direction | Directional vector (should be normalized)
  distance | distance

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.MoveLocal | ( | ref Quaternion | q,
|  | float | distance
| ) |  |

Move transformation in local coordinates (translation) in specified angle and distance.

Parameters:

  q | rotation
  distance | distance

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.MoveLocal | ( | ref Vector3 | axis,
|  | float | angle,
|  | float | distance
| ) |  |

Move transformation in local coordinates (translation) in specified angle and distance.

Parameters:

  axis | rotation axis
  angle | angle
  distance | distance

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.MoveLocal | ( | ref Vector3 | direction,
|  | float | distance
| ) |  |

Move transformation in local coordinates (translation) in directional vector and distance.

Parameters:

  direction | Directional vector (should be normalized)
  distance | distance

Implements VisiMath.ITransformation.

virtual void VisiMath.BaseTransformation.MoveLocal | ( | ref Vector3 | movement | ) | `[virtual]`

Move transformation in local coordinates.

Parameters:

  movement | Translation vector

Implements VisiMath.ITransformation.

virtual void VisiMath.BaseTransformation.MulMatrix | ( | ref Matrix4 | m | ) | `[protected, virtual]`

Multiplies current matrix with another(trans = m*trans)

Parameters:

  m | another transformation

Reimplemented in VisiMath.MoveTransformation.

void VisiMath.BaseTransformation.OnChange | ( |  | ) | `[protected]`

void VisiMath.BaseTransformation.Pitch | ( | float | angle | ) |

Rotate in local coordinates (changes pitch) Changes RPY.

Parameters:

  angle | angle in radians

Implements VisiMath.ITransformation.

virtual void VisiMath.BaseTransformation.PopState | ( |  | ) | `[virtual]`

Pops current state of transformation from internal state stack and sets it as current.

Implements VisiMath.ITransformation.

virtual void VisiMath.BaseTransformation.PushState | ( |  | ) | `[virtual]`

Pushes current state of transformation to internal stack.

Implements VisiMath.ITransformation.

virtual void VisiMath.BaseTransformation.ReadXml | ( | System.Xml.XmlReader | reader | ) | `[virtual]`

Deserializes object from XML.

Parameters:

  reader | XML reader

Reimplemented in VisiMath.MoveTransformation, VisiMath.RPYTransformation, VisiMath.QTransformation, VisiMath.Transformation, VisimBox.Renderer.StandardCamera, and VisimBox.Renderer.FPSCamera.

void VisiMath.BaseTransformation.Rescale | ( | float | scalefactor | ) |

Rescale transformation by uniform number Calls MulMatrix.

Parameters:

  scalefactor | uniform scale

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.Rescale | ( | ref Vector3 | scalefactor | ) |

Rescale transformation by non-uniform vecotr Calls MulMatrix.

Parameters:

  scalefactor | Scales fo all three axis

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.RescaleLocal | ( | float | scalefactor | ) |

Local uniform rescale (changes basic scale of the transformation) Changes UniformScale property.

Parameters:

  scalefactor | uniform scale

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.RescaleLocal | ( | ref Vector3 | scalefactor | ) |

Local non-uniform rescale (changes basic scale of the transformation) Changes Scale property.

Parameters:

  scalefactor | Scales fo all three axis

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.Roll | ( | float | angle | ) |

Rotate in local coordinates (changes roll) Changes RPY.

Parameters:

  angle | angle in radians

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.Rotate | ( | ref Vector3 | axis,
|  | float | angle
| ) |  |

Rotate whole transformation in world coordinates Calls MulMatrix.

Parameters:

  axis | rotation axis
  angle | angle in radians

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.Rotate | ( | ref Vector3 | rpy | ) |

Rotate whole transformation in world coordinates Calls MulMatrix.

Parameters:

  RPY | Roll-pitch-yaw rotation

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.Rotate | ( | Vector3 | rpy | ) |

Rotate whole transformation in world coordinates Calls MulMatrix.

Parameters:

  RPY | Roll-pitch-yaw rotation

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.Rotate | ( | ref Quaternion | q | ) |

Rotate whole transformation in world coordinates Calls MulMatrix.

Parameters:

  q | rotation

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.RotateLocal | ( | ref Vector3 | axis,
|  | float | angle
| ) |  |

Rotate in local coordinates (around the local zero) Changes Rotation quaternion.

Parameters:

  axis | rotation axis
  angle | angle in radians

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.RotateLocal | ( | Vector3 | rpy | ) |

Rotate in local coordinates (around the local zero) Changes Rotation quaternion.

Parameters:

  rpy | rotation in roll-pitch-yaw

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.RotateLocal | ( | ref Vector3 | rpy | ) |

Rotate in local coordinates (around the local zero) Changes Rotation quaternion.

Parameters:

  rpy | rotation in roll-pitch-yaw

Implements VisiMath.ITransformation.

void VisiMath.BaseTransformation.RotateLocal | ( | ref Quaternion | q | ) |

Rotate in local coordinates (around the zero)

Parameters:

  q | rotation

Implements VisiMath.ITransformation.

virtual void VisiMath.BaseTransformation.SetCurrentState | ( | TransformationState | state | ) | `[virtual]`

Reimplemented in VisiMath.MoveTransformation, VisiMath.RPYTransformation, VisiMath.QTransformation, and VisiMath.Transformation.

override string VisiMath.BaseTransformation.ToString | ( |  | ) |

Reimplemented in VisiMath.MoveTransformation, VisiMath.RPYTransformation, VisiMath.QTransformation, VisiMath.Transformation, VisimBox.Renderer.StandardCamera, and VisimBox.Renderer.FPSCamera.

virtual void VisiMath.BaseTransformation.UndoPushState | ( |  | ) | `[virtual]`

Pops state of transformation from internal stack.

Implements VisiMath.ITransformation.

virtual void VisiMath.BaseTransformation.WriteXml | ( | System.Xml.XmlWriter | writer | ) | `[virtual]`

Reimplemented in VisiMath.MoveTransformation, VisiMath.RPYTransformation, VisiMath.QTransformation, VisiMath.Transformation, VisimBox.Renderer.StandardCamera, and VisimBox.Renderer.FPSCamera.

void VisiMath.BaseTransformation.Yaw | ( | float | angle | ) |

Rotate in local coordinates (changes yaw) Changes RPY.

Parameters:

  angle | angle in radians

Implements VisiMath.ITransformation.

## Member Data Documentation

Stack<TransformationState> VisiMath.BaseTransformation.StateStack = new Stack<TransformationState>(1)`[protected]`

Matrix4 VisiMath.BaseTransformation.trans`[protected]`

Internaly stored transformation.

## Property Documentation

virtual bool VisiMath.BaseTransformation.Movable`[get]`

True if object supports movement.

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.MoveTransformation.

float VisiMath.BaseTransformation.PitchAngle`[get, set]`

Pitch rotation from RPY.

Implements VisiMath.ITransformation.

virtual Vector3 VisiMath.BaseTransformation.Position`[get, set]`

Position in vector - virtual so derived classes may override it.

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.MoveTransformation.

float VisiMath.BaseTransformation.RollAngle`[get, set]`

Roll rotation from RPY.

Implements VisiMath.ITransformation.

virtual bool VisiMath.BaseTransformation.Rotable`[get]`

True if object supports rotation.

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.RPYTransformation, and VisiMath.QTransformation.

virtual Quaternion VisiMath.BaseTransformation.Rotation`[get, set]`

Rotation in quaternion, virtual, so derived classes may override it Note: getting quaternion requires deconstructing matrix. Setting quaternion requires deconstructing and new transformation construction. May not be completely accurate for more complicated matrix.

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.MoveTransformation, VisiMath.RPYTransformation, VisiMath.QTransformation, and VisimBox.Renderer.FPSCamera.

virtual Vector3 VisiMath.BaseTransformation.RPY`[get, set]`

Rotation in roll-pitch-yaw format, virtual, so derived classes may override it Note: getting rotation requires deconstructing matrix. Setting quaternion requires deconstructing and new transformation construction. May not be completely accurate for more complicated matrix.

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.MoveTransformation, VisiMath.RPYTransformation, and VisiMath.QTransformation.

virtual bool VisiMath.BaseTransformation.Scalable`[get]`

True if object supports scaling.

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.Transformation.

virtual Vector3 VisiMath.BaseTransformation.Scale`[get, set]`

Scale vector, returns zero if scale is not uniform. Note: getting scale requires deconstructing matrix. Setting scale requires deconstructing and new transformation construction. May not be completely accurate for more complicated matrix.

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.MoveTransformation, and VisiMath.Transformation.

virtual Matrix4 VisiMath.BaseTransformation.TransMatrix`[get, set]`

Gets or sets transformation matrix.

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.MoveTransformation.

virtual float VisiMath.BaseTransformation.UniformScale`[get, set]`

Uniform scale, returns zero if scale is not uniform. Note: getting scale requires deconstructing matrix. Setting scale requires deconstructing and new transformation construction. May not be completely accurate for more complicated matrix.

Implements VisiMath.ITransformation.

Reimplemented in VisiMath.MoveTransformation, and VisiMath.Transformation.

float VisiMath.BaseTransformation.X`[get, set]`

X position from the Position property.

Implements VisiMath.ITransformation.

float VisiMath.BaseTransformation.Y`[get, set]`

Y position from the Position property.

Implements VisiMath.ITransformation.

float VisiMath.BaseTransformation.YawAngle`[get, set]`

Yaw rotation from RPY.

Implements VisiMath.ITransformation.

float VisiMath.BaseTransformation.Z`[get, set]`

Z position from the Position property.

Implements VisiMath.ITransformation.

## Event Documentation

TransformationCallback VisiMath.BaseTransformation.ChangeCallback

Callback for any transformation change.

Implements VisiMath.ITransformation.

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

- Transformation.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events