com.threerings.opengl.model
Class CollisionMesh

java.lang.Object
  extended by com.threerings.opengl.model.CollisionMesh
All Implemented Interfaces:
Exportable

public class CollisionMesh
extends Object
implements Exportable

A mesh used for collision detection.


Constructor Summary
CollisionMesh()
          No-arg constructor for deserialization.
CollisionMesh(Vector3f... vertices)
          Creates the mesh from an array of vertices, where each set of three vertices represents a triangle.
 
Method Summary
 Box getBounds()
          Returns a reference to the bounds of the mesh.
 boolean getIntersection(Ray3D ray, Vector3f result)
          Finds the intersection of the given ray with this mesh and places it in the supplied result object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollisionMesh

public CollisionMesh(Vector3f... vertices)
Creates the mesh from an array of vertices, where each set of three vertices represents a triangle.


CollisionMesh

public CollisionMesh()
No-arg constructor for deserialization.

Method Detail

getBounds

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


getIntersection

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

Returns:
true if the ray hit the mesh, in which case the result will be placed in the object supplied.


Copyright © 2011. All Rights Reserved.