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 Attributes | Properties
VisiMath.Collisions.SpatialCell< TObject > Class Template Reference

Basic spatial cell. More...

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

List of all members.

## Public Member Functions
| SpatialCell (SpatialCell< TObject > owner=null)
virtual bool | ContainsFully (ref ISpatialIndex index)
| Returns true if spatial portion contains spatial index fully.
virtual 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)
virtual ISpatialCell< TObject > | GetNode (ref Vector3 position)
| Returns spatial portion which contains position.
virtual ISpatialCell< TObject > | GetNode (ref Vector3 center, float radius)
| Returns smallest spatial portion which fully contains sphere.
virtual ISpatialCell< TObject > | GetNode (ref Vector3 minimum, ref Vector3 maximum)
| Returns smallest spatial portion which fully contains bounding box.
virtual ISpatialIndex | GetPrefferedIndex (ref Vector3 position)
| Creates spatial index of prefered type.
virtual ISpatialIndex | GetPrefferedIndex (ref Vector3 center, float radius)
| Creates spatial index of prefered type.
virtual ISpatialIndex | GetPrefferedIndex (ref Vector3 min, ref Vector3 max)
| Creates spatial index of prefered type.
virtual ISpatialCell< TObject > | GetNode (ISpatialIndex index)
| Returns smallest spatial portion which fully contains spatial index.
virtual ISpatialCell< TObject > | GetNode (ref ISpatialIndex index)
| Returns smallest spatial portion which fully contains spatial index.
virtual IEnumerable< TObject > | GetObjects (UInt64 CollisionGroup=UInt64.MaxValue)
| Returns list of the objects directly in the node.
virtual int | GetObjects (List< TObject > list, int startindex, UInt64 CollisionGroup=UInt64.MaxValue)
| Adds objects directly in the node with correct collision group to the list.
virtual int | GetObjectCount (UInt64 CollisionGroup=UInt64.MaxValue)
| Returns number of all objects in the node (and subnodes) with specified collision group.
virtual 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.
virtual 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)
virtual 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)
virtual bool | RemoveObject (TObject obj)
| Removes objects from indexer (including subnodes)
virtual 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.
virtual 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.
## Protected Attributes
ISpatialIndex | MyIndex
| Spatial index of the cell.
List< ISpatialPortal< TObject > > | Portals
| Portals in the cell.
List< TObject > | MyObjects
| Objects contained in the cell.
SpatialCell< TObject > | _Owner
| Parent of the cell.
## Properties
virtual ISpatialIndex | Index`[get]`
| Spatial index associated to this cell.
ISpatialCell< TObject > | Owner`[get]`
| Owner of the spatial cell for hiearchical indexing.
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>
class VisiMath::Collisions::SpatialCell< TObject >

Basic spatial cell.

Template Parameters:

  TObject |

Type Constraints

  TObject | : | ISpatialyIndexable |

## Member Function Documentation

template<TObject >

virtual void VisiMath.Collisions.SpatialCell< TObject >.AddObject | ( | TObject | obj,
|  | bool | force = `false`
| ) |  | `[virtual]`

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

Implements VisiMath.Collisions.ISpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.

template<TObject >

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

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

Implements VisiMath.Collisions.ISpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.

template<TObject >

virtual bool VisiMath.Collisions.SpatialCell< TObject >.Contains | ( | ref ISpatialIndex | index | ) | `[virtual]`

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

Parameters:

  index | Spatial index

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

virtual bool VisiMath.Collisions.SpatialCell< TObject >.ContainsFully | ( | ref ISpatialIndex | index | ) | `[virtual]`

Returns true if spatial portion contains spatial index fully.

Parameters:

  index | Spatial index

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

List<SpatialPair<TObject> > VisiMath.Collisions.SpatialCell< 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

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

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

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

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

virtual ISpatialCell<TObject> VisiMath.Collisions.SpatialCell< TObject >.GetNode | ( | ref Vector3 | position | ) | `[virtual]`

Returns spatial portion which contains position.

Parameters:

  position | Position vector

Returns:
  Spatial node containing object

Implements VisiMath.Collisions.ISpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >.

template<TObject >

virtual ISpatialCell<TObject> VisiMath.Collisions.SpatialCell< TObject >.GetNode | ( | ISpatialIndex | index | ) | `[virtual]`

Returns smallest spatial portion which fully contains spatial index.

Parameters:

  index | Spatial index

template<TObject >

virtual ISpatialCell<TObject> VisiMath.Collisions.SpatialCell< TObject >.GetNode | ( | ref Vector3 | center,
|  | float | radius
| ) |  | `[virtual]`

Returns smallest spatial portion which fully contains sphere.

Parameters:

  center | Sphere center
  radius | Radius of the sphere

Returns:
  Spatial node fully containing object

Implements VisiMath.Collisions.ISpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >.

template<TObject >

virtual ISpatialCell<TObject> VisiMath.Collisions.SpatialCell< TObject >.GetNode | ( | ref ISpatialIndex | index | ) | `[virtual]`

Returns smallest spatial portion which fully contains spatial index.

Parameters:

  index | Spatial index

Implements VisiMath.Collisions.ISpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >.

template<TObject >

virtual ISpatialCell<TObject> VisiMath.Collisions.SpatialCell< TObject >.GetNode | ( | ref Vector3 | minimum,
|  | ref Vector3 | maximum
| ) |  | `[virtual]`

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

Implements VisiMath.Collisions.ISpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >.

template<TObject >

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

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

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

virtual int VisiMath.Collisions.SpatialCell< TObject >.GetObjectCount | ( | UInt64 | CollisionGroup = `UInt64.MaxValue` | ) | `[virtual]`

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

Parameters:

  CollisionGroup | Collision group flags

Returns:
  Number of object

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

virtual IEnumerable<TObject> VisiMath.Collisions.SpatialCell< TObject >.GetObjects | ( | UInt64 | CollisionGroup = `UInt64.MaxValue` | ) | `[virtual]`

Returns list of the objects directly in the node.

Parameters:

  CollisionGroup | Collision group flags

Returns:
  List of objects in node with correct collision group

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

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

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

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

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

Returns spatial portal with specified index (0 to PortalCount)

Parameters:

  index |

Returns:

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

virtual ISpatialIndex VisiMath.Collisions.SpatialCell< TObject >.GetPrefferedIndex | ( | ref Vector3 | center,
|  | float | radius
| ) |  | `[virtual]`

Creates spatial index of prefered type.

Parameters:

  center | Center of the sphere
  radius | Radius of the sphere

Returns:
  Prefered type of spatial index

template<TObject >

virtual ISpatialIndex VisiMath.Collisions.SpatialCell< TObject >.GetPrefferedIndex | ( | ref Vector3 | position | ) | `[virtual]`

Creates spatial index of prefered type.

Parameters:

  position | position

Returns:
  Prefered type of spatial index

template<TObject >

virtual ISpatialIndex VisiMath.Collisions.SpatialCell< TObject >.GetPrefferedIndex | ( | ref Vector3 | min,
|  | ref Vector3 | max
| ) |  | `[virtual]`

Creates spatial index of prefered type.

Parameters:

  max | maximal corner
  min | minimal corner

Returns:
  Prefered type of spatial index

template<TObject >

virtual ISpatialCell<TObject> VisiMath.Collisions.SpatialCell< TObject >.MoveObject | ( | TObject | obj,
|  | ref ISpatialIndex | newindex
| ) |  | `[virtual]`

Moves object to new index.

Parameters:

  obj | Object to move
  newindex | New spatial index

Returns:
  New spatial portion where the object was moved

Implements VisiMath.Collisions.ISpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.

template<TObject >

virtual bool VisiMath.Collisions.SpatialCell< TObject >.RemoveObject | ( | TObject | obj | ) | `[virtual]`

Removes objects from indexer (including subnodes)

Parameters:

  obj | Object to remove

Returns:
  True if object removed

Implements VisiMath.Collisions.ISpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.

template<TObject >

VisiMath.Collisions.SpatialCell< TObject >.SpatialCell | ( | SpatialCell< TObject > | owner = `null` | ) |

## Member Data Documentation

template<TObject >

SpatialCell<TObject> VisiMath.Collisions.SpatialCell< TObject >._Owner`[protected]`

Parent of the cell.

template<TObject >

ISpatialIndex VisiMath.Collisions.SpatialCell< TObject >.MyIndex`[protected]`

Spatial index of the cell.

template<TObject >

List<TObject> VisiMath.Collisions.SpatialCell< TObject >.MyObjects`[protected]`

Objects contained in the cell.

template<TObject >

List<ISpatialPortal<TObject> > VisiMath.Collisions.SpatialCell< TObject >.Portals`[protected]`

Portals in the cell.

## Property Documentation

template<TObject >

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

Spatial index associated to this cell.

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

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

Number of the objects contained directly in the node.

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

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

Owner of the spatial cell for hiearchical indexing.

Implements VisiMath.Collisions.ISpatialCell< TObject >.

template<TObject >

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

Number of portals to adjacent spatialcells.

Implements VisiMath.Collisions.ISpatialCell< TObject >.

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

- SpatialCell.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events