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 | Public Attributes | Protected Member Functions | Protected Attributes | Properties
VisimBox.Physics.RigidBody Class Reference

Object describing rigid body. More...

Inheritance diagram for VisimBox.Physics.RigidBody:

List of all members.

## Public Member Functions
void | AddVelocity (Vector3 vel)
| Increases velocity by speficied ammount;.
void | AddVelocity (ref Vector3 vel)
| Increases velocity by speficied ammount;.
void | AddAngularVelocity (Vector3 vec)
| Increases angular velocity by specified ammount.
void | AddAngularVelocity (ref Vector3 vec)
| Increases angular velocity by specified ammount.
| RigidBody ()
| Do NOT use unless you're really sure!
| RigidBody (System.Xml.XmlReader reader)
| RigidBody (Node physworld)
virtual bool | Intergrator (float time)
| Integrates states of the object.
void | ClearAccumulator ()
| Clears force accumulator.
virtual bool | PhysicalTimeTick (double time)
| Performs physical time tick.
void | AddForce (Vector3 force)
| Gives object force impulse (working directly on the centre of the mass of the object)
virtual void | AddForce (ref Vector3 force)
| Gives object force impulse (working directly on the centre of the mass of the object)
void | AddForce (Vector3 location, Vector3 force)
| Hit object on the specified point (in local coordinates) with specified force.
void | AddForce (ref Vector3 location, ref Vector3 force)
| Hit object on the specified point (in local coordinates) with specified force.
void | AddForceWorld (Vector3 location, Vector3 force)
| Hit object on the specified point (in world coordinates) with specified force.
void | AddForceWorld (ref Vector3 location, ref Vector3 force)
| Hit object on the specified point (in world coordinates) with specified force.
void | AddTorque (Vector3 torq)
| Adds torque to object.
void | AddTorque (ref Vector3 torq)
| Adds torque to object.
void | UpdateValues ()
| Updates derived values.
Vector3 | GetPointInWorldSpace (Vector3 point)
| Returns location of point in local space to the world space.
Vector3 | GetPointInLocalSpace (Vector3 point)
| Returns location of point in world space to the local space.
virtual int | AddContact (List< PhysicalContact > List, int index)
| Physical Scene callback - node should check for any collisions and save them at physical contact at index and beyond Note: node should NOT increase the contact list size (HW limit)
override bool | ReadInternalData (System.Xml.XmlReader reader)
| Reads one item of internal data. Should return true if recognized value (for overloading)
override void | WriteInternalData (System.Xml.XmlWriter writer)
| Write internal data of the node to XML, without subnodes (called from WriteXML)
override void | RenderGeometry (Renderer.RendererEventArgs args)
| Activate object in the physical scene. If staticobject is set to true, object will be static inmovable (for terrain)
## Public Attributes
float | Motion
| Motion of the object (used to set sleep state)
## Protected Member Functions
override void | CopyData (Node targetNode)
## Protected Attributes
Node | WorldNode
| world node used for calculations
Vector3 | _velocity
bool | _sleeping
bool | _standardGravity = true
Vector3 | _accelLastFrame
Vector3 | _angularVelocity
float | _invertedMass
Matrix3 | _invertedInertia = Matrix3.Identitity
bool | _validData = false
Matrix3 | InvertedInertiaWorld = new Matrix3()
| Inverted inertia converted to world coordinates.
## Properties
Vector3 | Position`[get, set]`
Vector3 | Velocity`[get, set]`
| Linear velocity.
Vector3 | Acceleration`[get, set]`
| Linear acceleration.
Vector3 | AccelerationLastFrame`[get]`
| Acceleration in the last frame.
Quaternion | Rotation`[get, set]`
Vector3 | AngularVelocity`[get, set]`
| Angular velocity.
Vector3 | AngularAcceleration`[get, set]`
| Angular acceleration.
float | Damping`[get, set]`
| Speed damping.
DampingType | DampingType`[get, set]`
| Type of the linear speed damping.
float | AngularDamping`[get, set]`
| Speed damping.
DampingType | AngularDampingType`[get, set]`
| Type of the angular speed damping.
float | Density`[get, set]`
| Density of the body.
float | Mass`[get, set]`
| Total weight of the body.
float | InvertedMass`[get, set]`
| Inverted total weigth of the body.
Matrix3 | InertiaTensor`[get, set]`
| Inertia tensor for rotations (calculates invert from stored _invertedInertia)
Matrix3 | InvertedInertia`[get, set]`
| Inverted inertia tensor for rotations.
bool | Sleeping`[get, set]`
| Is object sleeping (ie no updates unless hit from outside.
float | MotionEpsilon`[get, set]`
| Motion epsilon (if motion is below this value, object will sleep.
bool | CanSleep`[get, set]`
| Can object sleep?
bool | IsStaticObject`[get, set]`
| Is object static immovable object?
bool | HasStandardGravity`[get, set]`
| Does global world gravity apply to this object?
PhysMaterial | Material`[get, set]`
| Material describing the surface of the body.
IVolumetric | PhysicalBody`[get, set]`
override RenderFlags | DefaultRenderFlags`[get]`
| Default render flags for the node (node will be rendered only if flags are correct)

## Detailed Description

Object describing rigid body.

## Constructor & Destructor Documentation

VisimBox.Physics.RigidBody.RigidBody | ( |  | ) |

Do NOT use unless you're really sure!

VisimBox.Physics.RigidBody.RigidBody | ( | System.Xml.XmlReader | reader | ) |

VisimBox.Physics.RigidBody.RigidBody | ( | Node | physworld | ) |

## Member Function Documentation

void VisimBox.Physics.RigidBody.AddAngularVelocity | ( | Vector3 | vec | ) |

Increases angular velocity by specified ammount.

Parameters:

  vec | Angular velocity change

void VisimBox.Physics.RigidBody.AddAngularVelocity | ( | ref Vector3 | vec | ) |

Increases angular velocity by specified ammount.

Parameters:

  vec | Angular velocity change

virtual int VisimBox.Physics.RigidBody.AddContact | ( | List< PhysicalContact > | List,
|  | int | index
| ) |  | `[virtual]`

Physical Scene callback - node should check for any collisions and save them at physical contact at index and beyond Note: node should NOT increase the contact list size (HW limit)

Parameters:

  List | List to save contact into
  index | Starting index

Returns:
  Number of added contacts

Implements VisimBox.Physics.IContactGenerator.

Reimplemented in VisimBoxDemos.MarsRover.PhysSphere, and VisimBoxDemos.MarsRover.Rover.

void VisimBox.Physics.RigidBody.AddForce | ( | Vector3 | force | ) |

Gives object force impulse (working directly on the centre of the mass of the object)

Parameters:

  force | Force vector

virtual void VisimBox.Physics.RigidBody.AddForce | ( | ref Vector3 | force | ) | `[virtual]`

Gives object force impulse (working directly on the centre of the mass of the object)

Parameters:

  force | Force vector

void VisimBox.Physics.RigidBody.AddForce | ( | Vector3 | location,
|  | Vector3 | force
| ) |  |

Hit object on the specified point (in local coordinates) with specified force.

Parameters:

  location | Position on the body in local coordinates
  force | Force

void VisimBox.Physics.RigidBody.AddForce | ( | ref Vector3 | location,
|  | ref Vector3 | force
| ) |  |

Hit object on the specified point (in local coordinates) with specified force.

Parameters:

  location | Position on the body in local coordinates
  force | Force

void VisimBox.Physics.RigidBody.AddForceWorld | ( | Vector3 | location,
|  | Vector3 | force
| ) |  |

Hit object on the specified point (in world coordinates) with specified force.

Parameters:

  location | Position on the body in WORLD coordinates
  force | Force

void VisimBox.Physics.RigidBody.AddForceWorld | ( | ref Vector3 | location,
|  | ref Vector3 | force
| ) |  |

Hit object on the specified point (in world coordinates) with specified force.

Parameters:

  location | Position on the body in WORLD coordinates
  force | Force

void VisimBox.Physics.RigidBody.AddTorque | ( | Vector3 | torq | ) |

Adds torque to object.

Parameters:

  torq | torque

void VisimBox.Physics.RigidBody.AddTorque | ( | ref Vector3 | torq | ) |

Adds torque to object.

Parameters:

  torq | torque

void VisimBox.Physics.RigidBody.AddVelocity | ( | ref Vector3 | vel | ) |

Increases velocity by speficied ammount;.

Parameters:

  vel | velocity change

void VisimBox.Physics.RigidBody.AddVelocity | ( | Vector3 | vel | ) |

Increases velocity by speficied ammount;.

Parameters:

  vel | velocity change

void VisimBox.Physics.RigidBody.ClearAccumulator | ( |  | ) |

Clears force accumulator.

override void VisimBox.Physics.RigidBody.CopyData | ( | Node | targetNode | ) | `[protected, virtual]`

Reimplemented from VisimBox.Physics.PhysNode.

Vector3 VisimBox.Physics.RigidBody.GetPointInLocalSpace | ( | Vector3 | point | ) |

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

Parameters:

  point | position in world space

Returns:
  position in local space

Vector3 VisimBox.Physics.RigidBody.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

virtual bool VisimBox.Physics.RigidBody.Intergrator | ( | float | time | ) | `[virtual]`

Integrates states of the object.

Parameters:

  time |

Returns:

virtual bool VisimBox.Physics.RigidBody.PhysicalTimeTick | ( | double | time | ) | `[virtual]`

Performs physical time tick.

Parameters:

  time | Elapsed time

Returns:
  True if object changed

Reimplemented in VisimBoxDemos.MarsRover.Rover.

override bool VisimBox.Physics.RigidBody.ReadInternalData | ( | System.Xml.XmlReader | reader | ) | `[virtual]`

Reads one item of internal data. Should return true if recognized value (for overloading)

Parameters:

  reader | Reader to read from

Returns:
  True if value was handled, false if not

Reimplemented from VisimBox.Scene.RenderableNode.

override void VisimBox.Physics.RigidBody.RenderGeometry | ( | Renderer.RendererEventArgs | args | ) |

Activate object in the physical scene. If staticobject is set to true, object will be static inmovable (for terrain)

void VisimBox.Physics.RigidBody.UpdateValues | ( |  | ) |

Updates derived values.

override void VisimBox.Physics.RigidBody.WriteInternalData | ( | System.Xml.XmlWriter | writer | ) | `[virtual]`

Write internal data of the node to XML, without subnodes (called from WriteXML)

Parameters:

  writer | XML Writer

Reimplemented from VisimBox.Scene.RenderableNode.

## Member Data Documentation

Vector3 VisimBox.Physics.RigidBody._accelLastFrame`[protected]`

Vector3 VisimBox.Physics.RigidBody._angularVelocity`[protected]`

Matrix3 VisimBox.Physics.RigidBody._invertedInertia = Matrix3.Identitity`[protected]`

float VisimBox.Physics.RigidBody._invertedMass`[protected]`

bool VisimBox.Physics.RigidBody._sleeping`[protected]`

bool VisimBox.Physics.RigidBody._standardGravity = true`[protected]`

bool VisimBox.Physics.RigidBody._validData = false`[protected]`

Vector3 VisimBox.Physics.RigidBody._velocity`[protected]`

Matrix3 VisimBox.Physics.RigidBody.InvertedInertiaWorld = new Matrix3()`[protected]`

Inverted inertia converted to world coordinates.

float VisimBox.Physics.RigidBody.Motion

Motion of the object (used to set sleep state)

Node VisimBox.Physics.RigidBody.WorldNode`[protected]`

world node used for calculations

## Property Documentation

Vector3 VisimBox.Physics.RigidBody.Acceleration`[get, set]`

Linear acceleration.

Vector3 VisimBox.Physics.RigidBody.AccelerationLastFrame`[get]`

Acceleration in the last frame.

Vector3 VisimBox.Physics.RigidBody.AngularAcceleration`[get, set]`

Angular acceleration.

float VisimBox.Physics.RigidBody.AngularDamping`[get, set]`

Speed damping.

DampingType VisimBox.Physics.RigidBody.AngularDampingType`[get, set]`

Type of the angular speed damping.

Vector3 VisimBox.Physics.RigidBody.AngularVelocity`[get, set]`

Angular velocity.

bool VisimBox.Physics.RigidBody.CanSleep`[get, set]`

Can object sleep?

float VisimBox.Physics.RigidBody.Damping`[get, set]`

Speed damping.

DampingType VisimBox.Physics.RigidBody.DampingType`[get, set]`

Type of the linear speed damping.

override RenderFlags VisimBox.Physics.RigidBody.DefaultRenderFlags`[get]`

Default render flags for the node (node will be rendered only if flags are correct)

Reimplemented from VisimBox.Physics.PhysNode.

float VisimBox.Physics.RigidBody.Density`[get, set]`

Density of the body.

bool VisimBox.Physics.RigidBody.HasStandardGravity`[get, set]`

Does global world gravity apply to this object?

Matrix3 VisimBox.Physics.RigidBody.InertiaTensor`[get, set]`

Inertia tensor for rotations (calculates invert from stored _invertedInertia)

Matrix3 VisimBox.Physics.RigidBody.InvertedInertia`[get, set]`

Inverted inertia tensor for rotations.

float VisimBox.Physics.RigidBody.InvertedMass`[get, set]`

Inverted total weigth of the body.

bool VisimBox.Physics.RigidBody.IsStaticObject`[get, set]`

Is object static immovable object?

float VisimBox.Physics.RigidBody.Mass`[get, set]`

Total weight of the body.

PhysMaterial VisimBox.Physics.RigidBody.Material`[get, set]`

Material describing the surface of the body.

float VisimBox.Physics.RigidBody.MotionEpsilon`[get, set]`

Motion epsilon (if motion is below this value, object will sleep.

IVolumetric VisimBox.Physics.RigidBody.PhysicalBody`[get, set]`

Vector3 VisimBox.Physics.RigidBody.Position`[get, set]`

Quaternion VisimBox.Physics.RigidBody.Rotation`[get, set]`

bool VisimBox.Physics.RigidBody.Sleeping`[get, set]`

Is object sleeping (ie no updates unless hit from outside.

Vector3 VisimBox.Physics.RigidBody.Velocity`[get, set]`

Linear velocity.

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

- PhysNodes.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events