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
VisimBox.Physics.CollisionChecker Class Reference

Brute force collision checker without any spatial optimization. More...

Inheritance diagram for VisimBox.Physics.CollisionChecker:

List of all members.

## Public Member Functions
| CollisionChecker (int rigidbodies, int staticcols)
bool | Check (RigidBody rb1, RigidBody rb2)
| Quick check for collision between two rigid bodies, doesn't use more complicated algs.
bool | CheckStatic (RigidBody body)
| Quick check for collisions between rigid body and static collisions.
bool | Check (RigidBody body)
| performs quick check for collision for rigid body (used by editor)
int | AddContact (List< PhysicalContact > List, int index)
| generates all collision contacts for physical scene
void | AddStatic (StaticCollision sc)
void | RemoveStatic (StaticCollision sc)
void | AddStatic (IGeometry geo, ITransformation trans, PhysMaterial mat)
| Adds new static collision to static collisions - this collision will be unmovable / unchangeable.
void | UpdateStatic (StaticCollision sc)
| Updates static collision (either transformation or material) - slow in most implemntations, requires locating collision, removing it from precalculated data and storing it again.
void | RecalcStaticCollisions ()
| Recalculates static collisions from registered statics - in effect forces updatestaticCol for every registered staticcollision body Force added (with addstaticcol) collisions will be unchanged.
void | AddRigid (RigidBody body)
| Adds rigid body to watch.
bool | RemoveRigid (RigidBody body)
| removes rigid body
void | Clear ()
| Clears collision checker.
## Protected Member Functions
bool | AddContact (RigidBody r1, RigidBody r2, List< PhysicalContact > list, int index)
int | AddContact (RigidBody r1, StaticCollision sc, List< PhysicalContact > list, int index)
## Protected Attributes
List< RigidBody > | _RigidBodies
List< StaticCollision > | _StaticCollisions
List< IGeometry > | _SavedStatics
## Properties
List< RigidBody > | RigidBodies`[get]`
| registered rigid bodies
List< StaticCollision > | StaticCollisions`[get]`
| registered static collisions (used by editor)

## Detailed Description

Brute force collision checker without any spatial optimization.

## Constructor & Destructor Documentation

VisimBox.Physics.CollisionChecker.CollisionChecker | ( | int | rigidbodies,
|  | int | staticcols
| ) |  |

## Member Function Documentation

bool VisimBox.Physics.CollisionChecker.AddContact | ( | RigidBody | r1,
|  | RigidBody | r2,
|  | List< PhysicalContact > | list,
|  | int | index
| ) |  | `[protected]`

int VisimBox.Physics.CollisionChecker.AddContact | ( | RigidBody | r1,
|  | StaticCollision | sc,
|  | List< PhysicalContact > | list,
|  | int | index
| ) |  | `[protected]`

int VisimBox.Physics.CollisionChecker.AddContact | ( | List< PhysicalContact > | List,
|  | int | index
| ) |  |

generates all collision contacts for physical scene

Parameters:

  List | List to save contact into
  index | Starting index

Returns:
  Number of added contacts

Implements VisimBox.Physics.IContactGenerator.

void VisimBox.Physics.CollisionChecker.AddRigid | ( | RigidBody | body | ) |

Adds rigid body to watch.

Parameters:

  body |

void VisimBox.Physics.CollisionChecker.AddStatic | ( | IGeometry | geo,
|  | ITransformation | trans,
|  | PhysMaterial | mat
| ) |  |

Adds new static collision to static collisions - this collision will be unmovable / unchangeable.

Parameters:

  geo | Geometry object
  trans | Transformation (may be null)
  mat | Physical material (may be null - default values used)

void VisimBox.Physics.CollisionChecker.AddStatic | ( | StaticCollision | sc | ) |

bool VisimBox.Physics.CollisionChecker.Check | ( | RigidBody | rb1,
|  | RigidBody | rb2
| ) |  |

Quick check for collision between two rigid bodies, doesn't use more complicated algs.

Parameters:

  rb1 | Rigid body 1
  rb2 | Rigid body 2

Returns:
  True if rigid body collide or migth collide

bool VisimBox.Physics.CollisionChecker.Check | ( | RigidBody | body | ) |

performs quick check for collision for rigid body (used by editor)

Parameters:

  body | Rigid body

Returns:
  True if rigid body collides (simple pass) with any other rigid body or static geometry

bool VisimBox.Physics.CollisionChecker.CheckStatic | ( | RigidBody | body | ) |

Quick check for collisions between rigid body and static collisions.

Parameters:

  rb | Rigid body

Returns:
  True if rigid body collide or migth collide

void VisimBox.Physics.CollisionChecker.Clear | ( |  | ) |

Clears collision checker.

void VisimBox.Physics.CollisionChecker.RecalcStaticCollisions | ( |  | ) |

Recalculates static collisions from registered statics - in effect forces updatestaticCol for every registered staticcollision body Force added (with addstaticcol) collisions will be unchanged.

bool VisimBox.Physics.CollisionChecker.RemoveRigid | ( | RigidBody | body | ) |

removes rigid body

Parameters:

  body |

Returns:

void VisimBox.Physics.CollisionChecker.RemoveStatic | ( | StaticCollision | sc | ) |

void VisimBox.Physics.CollisionChecker.UpdateStatic | ( | StaticCollision | sc | ) |

Updates static collision (either transformation or material) - slow in most implemntations, requires locating collision, removing it from precalculated data and storing it again.

Parameters:

  sc | registered Static collision

## Member Data Documentation

List<RigidBody> VisimBox.Physics.CollisionChecker._RigidBodies`[protected]`

List<IGeometry> VisimBox.Physics.CollisionChecker._SavedStatics`[protected]`

List<StaticCollision> VisimBox.Physics.CollisionChecker._StaticCollisions`[protected]`

## Property Documentation

List<RigidBody> VisimBox.Physics.CollisionChecker.RigidBodies`[get]`

registered rigid bodies

List<StaticCollision> VisimBox.Physics.CollisionChecker.StaticCollisions`[get]`

registered static collisions (used by editor)

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

- CollisionChecker.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events