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 | Properties
VisiMath.Collisions.ISpatialCell< TObject > Interface Template Reference

Class dividing world space in portions for optimalization. More...

Inheritance diagram for VisiMath.Collisions.ISpatialCell< TObject >:

List of all members.

## Public Member Functions
bool | ContainsFully (ref ISpatialIndex index)
| Returns true if spatial portion contains spatial index fully.
bool | Contains (ref ISpatialIndex index)
| Returns true if spatial portion contains spatial index at least partially.
ISpatialPortal< TObject > | GetPortal (int index)
| Returns spatial portal with specified index (0 to PortalCount)
ISpatialCell< TObject > | GetNode (ref Vector3 position)
| Returns spatial portion which contains position.
ISpatialCell< TObject > | GetNode (ref Vector3 center, float radius)
| Returns smallest spatial portion which fully contains sphere.
ISpatialCell< TObject > | GetNode (ref Vector3 minimum, ref Vector3 maximum)
| Returns smallest spatial portion which fully contains bounding box.
ISpatialCell< TObject > | GetNode (ref ISpatialIndex index)
| Returns smallest spatial portion which fully contains spatial index.
IEnumerable< TObject > | GetObjects (UInt64 CollisionGroup=UInt64.MaxValue)
| Returns list of the objects directly in the node.
int | GetObjects (List< TObject > list, int startindex, UInt64 CollisionGroup=UInt64.MaxValue)
| Adds objects directly in the node with correct collision group to the list.
int | GetObjectCount (UInt64 CollisionGroup=UInt64.MaxValue)
| Returns number of all objects in the node (and subnodes) with specified collision group.
int | GetObjectCount (ref ISpatialIndex index, UInt64 CollisionGroup=UInt64.MaxValue)
| Returns number of all objects in the node (and subnodes) with specified collision group on speficied spatialindex.
void | AddObject (TObject obj, bool force=false)
| Adds object to spatialindexer (to any subnode unless forced adding is set), should set it's data (cell and spatial index)
void | AddObject (TObject obj, ref ISpatialIndex index, bool force=false)
| Adds object to spatial indexer on specified index (should move objects internal index to new index)
bool | RemoveObject (TObject obj)
| Removes objects from indexer (including subnodes)
ISpatialCell< TObject > | MoveObject (TObject obj, ref ISpatialIndex newindex)
| Moves object to new index.
List< SpatialPair< TObject > > | GenerateCollisions (UInt64 collision=UInt64.MaxValue)
| Generates list of all current collisions in the node for specified collision group.
int | GenerateCollisions (List< SpatialPair< TObject >> list, int startindex, UInt64 collision=UInt64.MaxValue)
| Generates list of all current collisions in the node for specified collision group and adds it on the existing list at starting index.
## Properties
ISpatialCell< TObject > | Owner`[get]`
| Owner of the spatial cell for hiearchical indexing.
ISpatialIndex | Index`[get]`
| Spatial index associated to this cell.
int | PortalCount`[get]`
| Number of portals to adjacent spatialcells.
int | ObjectCount`[get]`
| Number of the objects contained directly in the node.

## Detailed Description

### template<TObject>
interface VisiMath::Collisions::ISpatialCell< TObject >

Class dividing world space in portions for optimalization.

Type Constraints

  TObject | : | ISpatialyIndexable |

## Member Function Documentation

template<TObject >

void VisiMath.Collisions.ISpatialCell< TObject >.AddObject | ( | TObject | obj,
|  | bool | force = `false`
| ) |  |

Adds object to spatialindexer (to any subnode unless forced adding is set), should set it's data (cell and spatial index)

Parameters:

  obj | Object to add
  force | If true, will place object directly in the node, won't search for better fit

Implemented in VisiMath.Collisions.SpatialCell< TObject >, and VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.

template<TObject >

void VisiMath.Collisions.ISpatialCell< TObject >.AddObject | ( | TObject | obj,
|  | ref ISpatialIndex | index,
|  | bool | force = `false`
| ) |  |

Adds object to spatial indexer on specified index (should move objects internal index to new index)

Parameters:

  obj | object to add
  index | Index
  force | If true, will place object directly in the node, won't search for better fit

Implemented in VisiMath.Collisions.SpatialCell< TObject >, and VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.

template<TObject >

bool VisiMath.Collisions.ISpatialCell< TObject >.Contains | ( | ref ISpatialIndex | index | ) |

Returns true if spatial portion contains spatial index at least partially.

Parameters:

  index | Spatial index

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

bool VisiMath.Collisions.ISpatialCell< TObject >.ContainsFully | ( | ref ISpatialIndex | index | ) |

Returns true if spatial portion contains spatial index fully.

Parameters:

  index | Spatial index

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

List<SpatialPair<TObject> > VisiMath.Collisions.ISpatialCell< TObject >.GenerateCollisions | ( | UInt64 | collision = `UInt64.MaxValue` | ) |

Generates list of all current collisions in the node for specified collision group.

Parameters:

  collision | Collision flags

Returns:
  List of colliding pairs

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

int VisiMath.Collisions.ISpatialCell< TObject >.GenerateCollisions | ( | List< SpatialPair< TObject >> | list,
|  | int | startindex,
|  | UInt64 | collision = `UInt64.MaxValue`
| ) |  |

Generates list of all current collisions in the node for specified collision group and adds it on the existing list at starting index.

Parameters:

  collision | Collision flags
  list | List to add collisions
  startindex | Starting index to save collisions

Returns:
  Number of added collision pairs

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

ISpatialCell<TObject> VisiMath.Collisions.ISpatialCell< TObject >.GetNode | ( | ref Vector3 | center,
|  | float | radius
| ) |  |

Returns smallest spatial portion which fully contains sphere.

Parameters:

  center | Sphere center
  radius | Radius of the sphere

Returns:
  Spatial node fully containing object

Implemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >, and VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

ISpatialCell<TObject> VisiMath.Collisions.ISpatialCell< TObject >.GetNode | ( | ref Vector3 | position | ) |

Returns spatial portion which contains position.

Parameters:

  position | Position vector

Returns:
  Spatial node containing object

Implemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >, and VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

ISpatialCell<TObject> VisiMath.Collisions.ISpatialCell< TObject >.GetNode | ( | ref Vector3 | minimum,
|  | ref Vector3 | maximum
| ) |  |

Returns smallest spatial portion which fully contains bounding box.

Parameters:

  minimum | Minimal corner of the box
  maximum | Maximal corner of the box

Returns:
  Spatial node fully containing object

Implemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >, and VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

ISpatialCell<TObject> VisiMath.Collisions.ISpatialCell< TObject >.GetNode | ( | ref ISpatialIndex | index | ) |

Returns smallest spatial portion which fully contains spatial index.

Parameters:

  index | Spatial index

Implemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >, and VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

int VisiMath.Collisions.ISpatialCell< TObject >.GetObjectCount | ( | UInt64 | CollisionGroup = `UInt64.MaxValue` | ) |

Returns number of all objects in the node (and subnodes) with specified collision group.

Parameters:

  CollisionGroup | Collision group flags

Returns:
  Number of object

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

int VisiMath.Collisions.ISpatialCell< TObject >.GetObjectCount | ( | ref ISpatialIndex | index,
|  | UInt64 | CollisionGroup = `UInt64.MaxValue`
| ) |  |

Returns number of all objects in the node (and subnodes) with specified collision group on speficied spatialindex.

Parameters:

  CollisionGroup | Collision group flags
  index | Spatial index to check

Returns:
  Number of object

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

int VisiMath.Collisions.ISpatialCell< TObject >.GetObjects | ( | List< TObject > | list,
|  | int | startindex,
|  | UInt64 | CollisionGroup = `UInt64.MaxValue`
| ) |  |

Adds objects directly in the node with correct collision group to the list.

Parameters:

  CollisionGroup | Collision group flags
  list | List of the objects
  startindex | Starting index in the list

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

IEnumerable<TObject> VisiMath.Collisions.ISpatialCell< TObject >.GetObjects | ( | UInt64 | CollisionGroup = `UInt64.MaxValue` | ) |

Returns list of the objects directly in the node.

Parameters:

  CollisionGroup | Collision group flags

Returns:
  List of objects in node with correct collision group

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

ISpatialPortal<TObject> VisiMath.Collisions.ISpatialCell< TObject >.GetPortal | ( | int | index | ) |

Returns spatial portal with specified index (0 to PortalCount)

Parameters:

  index |

Returns:

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

ISpatialCell<TObject> VisiMath.Collisions.ISpatialCell< TObject >.MoveObject | ( | TObject | obj,
|  | ref ISpatialIndex | newindex
| ) |  |

Moves object to new index.

Parameters:

  obj | Object to move
  newindex | New spatial index

Returns:
  New spatial portion where the object was moved

Implemented in VisiMath.Collisions.SpatialCell< TObject >, and VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.

template<TObject >

bool VisiMath.Collisions.ISpatialCell< TObject >.RemoveObject | ( | TObject | obj | ) |

Removes objects from indexer (including subnodes)

Parameters:

  obj | Object to remove

Returns:
  True if object removed

Implemented in VisiMath.Collisions.SpatialCell< TObject >, and VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.

## Property Documentation

template<TObject >

ISpatialIndex VisiMath.Collisions.ISpatialCell< TObject >.Index`[get]`

Spatial index associated to this cell.

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

int VisiMath.Collisions.ISpatialCell< TObject >.ObjectCount`[get]`

Number of the objects contained directly in the node.

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

ISpatialCell<TObject> VisiMath.Collisions.ISpatialCell< TObject >.Owner`[get]`

Owner of the spatial cell for hiearchical indexing.

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

template<TObject >

int VisiMath.Collisions.ISpatialCell< TObject >.PortalCount`[get]`

Number of portals to adjacent spatialcells.

Implemented in VisiMath.Collisions.SpatialCell< TObject >.

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

- ISpatialPortion.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events