com.threerings.opengl.model
Class CollisionMesh.Node

java.lang.Object
  extended by com.threerings.opengl.model.CollisionMesh.Node
All Implemented Interfaces:
Exportable
Direct Known Subclasses:
CollisionMesh.InternalNode, CollisionMesh.LeafNode
Enclosing class:
CollisionMesh

protected abstract static class CollisionMesh.Node
extends Object
implements Exportable

A node in the axis-aligned bounding box tree.


Field Summary
protected  Box _bounds
          The bounds of the node.
 
Constructor Summary
CollisionMesh.Node()
           
CollisionMesh.Node(Box bounds)
           
 
Method Summary
protected abstract  boolean computeIntersection(Ray3D ray, Vector3f result)
          Computes the actual intersection between the ray and this node's geometry, once it has been established that the ray intersects the node's bounding box.
 Box getBounds()
          Returns a reference to the bounds of the node.
 boolean getIntersection(Ray3D ray, Vector3f result)
          Finds the intersection of the given ray with this node and places it in the supplied result object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_bounds

protected Box _bounds
The bounds of the node.

Constructor Detail

CollisionMesh.Node

public CollisionMesh.Node(Box bounds)

CollisionMesh.Node

public CollisionMesh.Node()
Method Detail

getBounds

public Box getBounds()
Returns a reference to the bounds of the node.


getIntersection

public boolean getIntersection(Ray3D ray,
                               Vector3f result)
Finds the intersection of the given ray with this node and places it in the supplied result object.

Returns:
true if the ray hit a triangle within the node, in which case the result will be placed in the object supplied.

computeIntersection

protected abstract boolean computeIntersection(Ray3D ray,
                                               Vector3f result)
Computes the actual intersection between the ray and this node's geometry, once it has been established that the ray intersects the node's bounding box.

Returns:
true if the ray hit a triangle within the node, in which case the result will be placed in the object supplied.