org.openmali.spatial.octree
Class OcNode<T>

java.lang.Object
  extended by org.openmali.spatial.bodies.Sphere
      extended by org.openmali.spatial.bounds.BoundingSphere
          extended by org.openmali.spatial.octree.OcNode<T>
All Implemented Interfaces:
java.io.Serializable, Body, Bounds, SpatialHandle<T>

public class OcNode<T>
extends BoundingSphere
implements SpatialHandle<T>

A node used to define an object stored in the octree. This is not optimized for triangle level octrees, as the overhead per node is substantial.

Copyright: Copyright (c) 2000,2001

Company: Teseract Software, LLP

Author:
David Yazel, Marvin Froehlich (aka Qudus) [code cleaning]
See Also:
Serialized Form

Field Summary
protected  OcNode<T> next
           
 
Constructor Summary
OcNode()
           
OcNode(float x, float y, float z, float r, T o)
           
OcNode(Point3f c, float r, T o)
          Builds an OcNode with the specified center, radius and object.
OcNode(T o, VertexContainer source)
          Builds an OcNode for the specified object.
 
Method Summary
 T getObject()
           
 OcCell<T> getParent()
           
 void recompute()
          Recompute the bounds for the object and place it in the spatial container in the correct place.
 void remove()
          Removes the node from its spatial container.
 
Methods inherited from class org.openmali.spatial.bounds.BoundingSphere
closestIntersection, compute, compute, compute, getMaxDistance, getMaxSquaredDistance, getType, intersects, intersects, intersects, intersects, intersects, intersects, newBoundingSphere, newBoundingSphere, newBoundingSphere, set, set, toString, transform, transform
 
Methods inherited from class org.openmali.spatial.bodies.Sphere
combine, combine, combine, combine, combine, contains, contains, containsPlus, containsXYPlus, getCenter, getCenter, getCenterX, getCenterY, getCenterZ, getRadius, getRadiusSquared, setCenter, setCenter, setRadius
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openmali.spatial.bounds.Bounds
combine, combine, combine, contains, contains, getCenter
 
Methods inherited from interface org.openmali.spatial.bodies.Body
combine, combine
 

Field Detail

next

protected OcNode<T> next
Constructor Detail

OcNode

public OcNode()

OcNode

public OcNode(float x,
              float y,
              float z,
              float r,
              T o)

OcNode

public OcNode(Point3f c,
              float r,
              T o)
Builds an OcNode with the specified center, radius and object.

Parameters:
c -
r -
o -

OcNode

public OcNode(T o,
              VertexContainer source)
Builds an OcNode for the specified object. The bounds are determined using the source interface which allows an optimal sphere to be constructed.

Parameters:
o -
source -
Method Detail

getParent

public OcCell<T> getParent()

getObject

public T getObject()
Specified by:
getObject in interface SpatialHandle<T>

remove

public void remove()
Removes the node from its spatial container.

Specified by:
remove in interface SpatialHandle<T>

recompute

public void recompute()
Recompute the bounds for the object and place it in the spatial container in the correct place. This generally causes a removal and reintegration.

Specified by:
recompute in interface SpatialHandle<T>