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.PhysicalContact Class Reference
Inheritance diagram for VisimBox.Physics.PhysicalContact:

List of all members.

## Public Member Functions
void | SetBodyData (RigidBody first, RigidBody second, float fr, float res)
| Sets data for this contact point.
void | SetAwake ()
| Awakes sleeping nodes.
void | ApplyVelocityChange (ref Vector3 velocityChange1, ref Vector3 velocityChange2, ref Vector3 rotationChange1, ref Vector3 rotationChange2)
| Applies velocity changes to bodies and returns used values.
void | ApplyPositionChange (ref Vector3 linear1, ref Vector3 linear2, ref Vector3 angular1, ref Vector3 angular2)
| Applies position changes to bodies and returns used values.
void | CalcInternal (float time)
| Calculate internal values.
## Public Attributes
RigidBody[] | Bodies = new RigidBody[2]
| Rigid bodies in contact.
float | Friction
| Lateral friction coefficient.
float | Restitution
| Restitution coefficient.
Matrix3 | ContactToWorld
| Rotational matrix converting coordinates in contact to world.
Vector3 | ContactVelocity
| Closing velocity.
float | DesiredDeltaV
| change in velocity for resolving the contact
Vector3[] | RelativeContactPos = new Vector3[2]
| World space position of contact relative to center of both bodies.
## Protected Member Functions
void | SwapBodies ()
| Swaps bodies.
Vector3 | FrictionLessImpulse (ref Matrix3 invtens1, ref Matrix3 invtens2)
| Calculate impulse without any friction.
Vector3 | FrictionImpulse (ref Matrix3 invtens1, ref Matrix3 invtens2)
| Calculate impulse with friction.
void | CalculateDeltaV (float time)
| Calculates needed Delta V.
void | CalcContactToWorld ()
| Updates Matrix ContactToWorld.
Vector3 | LocalVelocity (int index, float time)
| Calculates local velocity for body.
## Protected Attributes
float | DeltaVSpeedLimit = 0.25f
float | AngularLimit = 0.2f
Vector3[] | tangents = new Vector3[2]
## Properties
RigidBody | First`[get, set]`
| First rigid body in contact.
RigidBody | Second`[get, set]`
| Second rigid body in contact.

## Member Function Documentation

void VisimBox.Physics.PhysicalContact.ApplyPositionChange | ( | ref Vector3 | linear1,
|  | ref Vector3 | linear2,
|  | ref Vector3 | angular1,
|  | ref Vector3 | angular2
| ) |  |

Applies position changes to bodies and returns used values.

Parameters:

  linear1 | Linear position change for first body
  linear2 | Linear position change for second body
  angular1 | Angular position change for first body
  angular2 | Angular position change for second body

void VisimBox.Physics.PhysicalContact.ApplyVelocityChange | ( | ref Vector3 | velocityChange1,
|  | ref Vector3 | velocityChange2,
|  | ref Vector3 | rotationChange1,
|  | ref Vector3 | rotationChange2
| ) |  |

Applies velocity changes to bodies and returns used values.

Parameters:

  linear1 | Linear change for first body
  linear2 | Linear change for second body
  angular1 | Angular change for first body
  angular2 | Angular change for second body

void VisimBox.Physics.PhysicalContact.CalcContactToWorld | ( |  | ) | `[protected]`

Updates Matrix ContactToWorld.

void VisimBox.Physics.PhysicalContact.CalcInternal | ( | float | time | ) |

Calculate internal values.

Parameters:

  time | elapsed time

void VisimBox.Physics.PhysicalContact.CalculateDeltaV | ( | float | time | ) | `[protected]`

Calculates needed Delta V.

Parameters:

  time | Elapsed time

Vector3 VisimBox.Physics.PhysicalContact.FrictionImpulse | ( | ref Matrix3 | invtens1,
|  | ref Matrix3 | invtens2
| ) |  | `[protected]`

Calculate impulse with friction.

Parameters:

  invtens1 |
  invtens2 |

Returns:
  Impulse vector

Vector3 VisimBox.Physics.PhysicalContact.FrictionLessImpulse | ( | ref Matrix3 | invtens1,
|  | ref Matrix3 | invtens2
| ) |  | `[protected]`

Calculate impulse without any friction.

Parameters:

  invtens1 |
  invtens2 |

Returns:
  Impulse vector

Vector3 VisimBox.Physics.PhysicalContact.LocalVelocity | ( | int | index,
|  | float | time
| ) |  | `[protected]`

Calculates local velocity for body.

Parameters:

  index | 0 or 1 for first or second body
  time | Elapsed time

Returns:
  Calculated velocity

!! transposed transformation?

void VisimBox.Physics.PhysicalContact.SetAwake | ( |  | ) |

Awakes sleeping nodes.

void VisimBox.Physics.PhysicalContact.SetBodyData | ( | RigidBody | first,
|  | RigidBody | second,
|  | float | fr,
|  | float | res
| ) |  |

Sets data for this contact point.

Parameters:

  first | First body
  second | Second body
  fr | Friction
  res | Restitution

void VisimBox.Physics.PhysicalContact.SwapBodies | ( |  | ) | `[protected]`

Swaps bodies.

## Member Data Documentation

float VisimBox.Physics.PhysicalContact.AngularLimit = 0.2f`[protected]`

RigidBody [] VisimBox.Physics.PhysicalContact.Bodies = new RigidBody[2]

Rigid bodies in contact.

Matrix3 VisimBox.Physics.PhysicalContact.ContactToWorld

Rotational matrix converting coordinates in contact to world.

Vector3 VisimBox.Physics.PhysicalContact.ContactVelocity

Closing velocity.

float VisimBox.Physics.PhysicalContact.DeltaVSpeedLimit = 0.25f`[protected]`

float VisimBox.Physics.PhysicalContact.DesiredDeltaV

change in velocity for resolving the contact

float VisimBox.Physics.PhysicalContact.Friction

Lateral friction coefficient.

Vector3 [] VisimBox.Physics.PhysicalContact.RelativeContactPos = new Vector3[2]

World space position of contact relative to center of both bodies.

float VisimBox.Physics.PhysicalContact.Restitution

Restitution coefficient.

Vector3 [] VisimBox.Physics.PhysicalContact.tangents = new Vector3[2]`[protected]`

## Property Documentation

RigidBody VisimBox.Physics.PhysicalContact.First`[get, set]`

First rigid body in contact.

RigidBody VisimBox.Physics.PhysicalContact.Second`[get, set]`

Second rigid body in contact.

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

- PhysicalContact.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events