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.PhysicalScene Class Reference

One physical scene. More...

List of all members.

## Public Member Functions
| PhysicalScene (int bodies=20, int maxcontactgen=100, int maxcontacts=200, int iterations=4)
void | RegisterBody (RigidBody body)
| Registers new rigid body to physical scene.
void | UnregisterBody (RigidBody body)
| Removes rigid body from register.
void | RegisterStaticCol (StaticCollision sc)
| Registers new static collision object in collision system - might be slow depending on implementation and type of static collision Note, this should be used only for editors etc - for normal use you should use prebuilt saved static collision.
void | UpdateStaticCol (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 | UnRegisterStaticCol (StaticCollision sc)
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 | AddStaticCol (IGeometry geo, ITransformation trans, PhysMaterial mat)
| Adds new static collision to static collisions - this collision will be unmovable / unchangeable.
void | RegisterContactGenerator (IContactGenerator gen)
| Registers new contact generator (each registered generator will be polled each frame to provide any contacts)
void | UnRegisterContactGenerator (IContactGenerator gen)
| Removes contact generator from registered.
void | StartFrame ()
| Start physical frame.
void | TimeTick (float time)
| Perform timetick.
int | GenerateContacts ()
| Generates contacts - checks collision system and all directly registered contact generators.
bool | CheckRigidBodyCollision (RigidBody body)
| performs quick check for collision for rigid body (used by editor)
void | Clear ()
| Cleans physical scene, unregisters rigidbodies, static cols, cleans lists...
void | Dispose ()
## Public Attributes
bool | CalculateIterations
## Protected Member Functions
void | SetGravity (Vector3 newgravity)
| gravity was changed
void | RemoveG (RigidBody rb)
| Removes default gravity from rigid body (used on cleaning);.
## Protected Attributes
Vector3 | _Gravity = new Vector3(0, 0, -9.81f)
List< PhysicalContact > | ContactList
List< IContactGenerator > | ContactGenerators
ContactResolver | Resolver
CollisionChecker | ColChecker
## Properties
int | MaximumContacts`[get, set]`
| Maximal number of contacts permited per frame.
Vector3 | Gravity`[get, set]`
| Global gravity in the scene which is applied to any registered body. Changing gravity will attempt to change internal fixed acceleration of any registered rigid body.
List< RigidBody > | RigidBodies`[get]`
List< StaticCollision > | StaticCollisions`[get]`

## Detailed Description

One physical scene.

## Constructor & Destructor Documentation

VisimBox.Physics.PhysicalScene.PhysicalScene | ( | int | bodies = `20`,
|  | int | maxcontactgen = `100`,
|  | int | maxcontacts = `200`,
|  | int | iterations = `4`
| ) |  |

## Member Function Documentation

void VisimBox.Physics.PhysicalScene.AddStaticCol | ( | 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)

bool VisimBox.Physics.PhysicalScene.CheckRigidBodyCollision | ( | 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

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

Cleans physical scene, unregisters rigidbodies, static cols, cleans lists...

void VisimBox.Physics.PhysicalScene.Dispose | ( |  | ) |

int VisimBox.Physics.PhysicalScene.GenerateContacts | ( |  | ) |

Generates contacts - checks collision system and all directly registered contact generators.

Returns:
  Number of used contacts

void VisimBox.Physics.PhysicalScene.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 VisimBox.Physics.PhysicalScene.RegisterBody | ( | RigidBody | body | ) |

Registers new rigid body to physical scene.

Parameters:

  body | Body to register

void VisimBox.Physics.PhysicalScene.RegisterContactGenerator | ( | IContactGenerator | gen | ) |

Registers new contact generator (each registered generator will be polled each frame to provide any contacts)

Parameters:

  gen | Contact generator

void VisimBox.Physics.PhysicalScene.RegisterStaticCol | ( | StaticCollision | sc | ) |

Registers new static collision object in collision system - might be slow depending on implementation and type of static collision Note, this should be used only for editors etc - for normal use you should use prebuilt saved static collision.

Parameters:

  sc | Static collision to register

void VisimBox.Physics.PhysicalScene.RemoveG | ( | RigidBody | rb | ) | `[protected]`

Removes default gravity from rigid body (used on cleaning);.

Parameters:

  rb |

void VisimBox.Physics.PhysicalScene.SetGravity | ( | Vector3 | newgravity | ) | `[protected]`

gravity was changed

void VisimBox.Physics.PhysicalScene.StartFrame | ( |  | ) |

Start physical frame.

void VisimBox.Physics.PhysicalScene.TimeTick | ( | float | time | ) |

Perform timetick.

Parameters:

  time |

void VisimBox.Physics.PhysicalScene.UnregisterBody | ( | RigidBody | body | ) |

Removes rigid body from register.

Parameters:

  body |

void VisimBox.Physics.PhysicalScene.UnRegisterContactGenerator | ( | IContactGenerator | gen | ) |

Removes contact generator from registered.

Parameters:

  gen | Contac generator

void VisimBox.Physics.PhysicalScene.UnRegisterStaticCol | ( | StaticCollision | sc | ) |

void VisimBox.Physics.PhysicalScene.UpdateStaticCol | ( | 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

Vector3 VisimBox.Physics.PhysicalScene._Gravity = new Vector3(0, 0, -9.81f)`[protected]`

bool VisimBox.Physics.PhysicalScene.CalculateIterations

CollisionChecker VisimBox.Physics.PhysicalScene.ColChecker`[protected]`

List<IContactGenerator> VisimBox.Physics.PhysicalScene.ContactGenerators`[protected]`

List<PhysicalContact> VisimBox.Physics.PhysicalScene.ContactList`[protected]`

ContactResolver VisimBox.Physics.PhysicalScene.Resolver`[protected]`

## Property Documentation

Vector3 VisimBox.Physics.PhysicalScene.Gravity`[get, set]`

Global gravity in the scene which is applied to any registered body. Changing gravity will attempt to change internal fixed acceleration of any registered rigid body.

int VisimBox.Physics.PhysicalScene.MaximumContacts`[get, set]`

Maximal number of contacts permited per frame.

List<RigidBody> VisimBox.Physics.PhysicalScene.RigidBodies`[get, protected]`

List<StaticCollision> VisimBox.Physics.PhysicalScene.StaticCollisions`[get, protected]`

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

- PhysicalScene.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events