org.openmali.spatial
Interface SpatialContainerInterface<T>


public interface SpatialContainerInterface<T>

A spatial container holds objects which implement the SpatialObjectInterface. Different implementations of spatial containers will have different capabilities and will implement different interfaces to satisfy those capaibilies. FrustumCulledInterface and OcclusionCulledInterface are such implmentations

Note: Some spatial containers might themselves be spatial objects. This allows for an octree being used for the entire world, but a bsp tree being used for a model or even a whole subscene. This then allows for large sub-scenes to be used as occluders. Another example is to put the terrain cells into the oct-tree so that occlusion checks and raycasting checks can be used.


Method Summary
 void changed(SpatialHandle<T> handle)
          Notifies the container that the size or location of the object has been changed.
 void empty()
          Empties all the entries from the container
 SpatialHandle<T> inject(Tuple3f center, float radius, java.lang.Object object)
          Inject the specified object into the container.
 SpatialHandle<T> inject(VertexContainer object)
           
 void remove(SpatialHandle<T> handle)
          Remove the object from the spatial container.
 

Method Detail

inject

SpatialHandle<T> inject(Tuple3f center,
                        float radius,
                        java.lang.Object object)
Inject the specified object into the container. The handle returned is necessary to update or remove the object.

Parameters:
object - Object to be inserted
Returns:
Spatial handle for the injected object

inject

SpatialHandle<T> inject(VertexContainer object)

changed

void changed(SpatialHandle<T> handle)
Notifies the container that the size or location of the object has been changed. For some implementations this will be extremly slow and costly, while others, like SphereTrees this is extremely fast and efficient.

Parameters:
handle -

remove

void remove(SpatialHandle<T> handle)
Remove the object from the spatial container.

Parameters:
handle -

empty

void empty()
Empties all the entries from the container