edu.jhu.ece.iacl.jist.structures.geom
Class CollisionDetection

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.structures.geom.CollisionDetection

public class CollisionDetection
extends java.lang.Object

The Class CollisionDetection.


Nested Class Summary
static class CollisionDetection.Triangle
          The Class Triangle.
 
Field Summary
protected  double[] bounds
          The bounds.
protected  Vector3d center
          The center.
protected  double[] limits
          The limits.
protected  Vector3d scale
          The scale.
 
Constructor Summary
CollisionDetection(EmbeddedSurface mesh, int rows, int cols, int slices, int maxDepth)
          Instantiates a new collision detection.
 
Method Summary
 void computeBounds(EmbeddedSurface mesh)
          Compute bounds.
 void dispose()
          Dispose.
 void init(EmbeddedSurface mesh)
          Inits the.
 double intersectRayDistance(Point3d start, Vector3d dir)
          Intersect ray distance.
 Point3d intersectRayPoint(Point3d start, Vector3d dir)
          Intersect ray point.
 Point3f intersectRayPoint(Point3f start, Vector3f dir)
          Intersect ray point.
 double intersectSegmentDistance(Point3d start, Point3d end)
          Intersect segment distance.
 Point3d intersectSegmentPoint(Point3d start, Point3d end)
          Intersect segment point.
 Point3f intersectSegmentPoint(Point3f start, Point3f end)
          Intersect segment point.
 boolean isInside(Point3d start)
          Checks if is inside.
 Point3d projectToSurface(Point3d p)
          Project to surface.
 void setBounds(double[] limits)
          Sets the bounds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bounds

protected double[] bounds
The bounds.


limits

protected double[] limits
The limits.


center

protected Vector3d center
The center.


scale

protected Vector3d scale
The scale.

Constructor Detail

CollisionDetection

public CollisionDetection(EmbeddedSurface mesh,
                          int rows,
                          int cols,
                          int slices,
                          int maxDepth)
Instantiates a new collision detection.

Parameters:
mesh - the mesh
rows - the rows
cols - the cols
slices - the slices
maxDepth - the max depth
Method Detail

dispose

public void dispose()
Dispose.


init

public void init(EmbeddedSurface mesh)
Inits the.

Parameters:
mesh - the mesh

setBounds

public void setBounds(double[] limits)
Sets the bounds.

Parameters:
limits - the new bounds

computeBounds

public void computeBounds(EmbeddedSurface mesh)
Compute bounds.

Parameters:
mesh - the mesh

intersectSegmentPoint

public Point3d intersectSegmentPoint(Point3d start,
                                     Point3d end)
Intersect segment point.

Parameters:
start - the start
end - the end
Returns:
the point3d

intersectSegmentPoint

public Point3f intersectSegmentPoint(Point3f start,
                                     Point3f end)
Intersect segment point.

Parameters:
start - the start
end - the end
Returns:
the point3f

intersectRayPoint

public Point3d intersectRayPoint(Point3d start,
                                 Vector3d dir)
Intersect ray point.

Parameters:
start - the start
dir - the dir
Returns:
the point3d

intersectRayPoint

public Point3f intersectRayPoint(Point3f start,
                                 Vector3f dir)
Intersect ray point.

Parameters:
start - the start
dir - the dir
Returns:
the point3f

projectToSurface

public Point3d projectToSurface(Point3d p)
Project to surface.

Parameters:
p - the p
Returns:
the point3d

intersectSegmentDistance

public double intersectSegmentDistance(Point3d start,
                                       Point3d end)
Intersect segment distance.

Parameters:
start - the start
end - the end
Returns:
the double

intersectRayDistance

public double intersectRayDistance(Point3d start,
                                   Vector3d dir)
Intersect ray distance.

Parameters:
start - the start
dir - the dir
Returns:
the double

isInside

public boolean isInside(Point3d start)
Checks if is inside.

Parameters:
start - the start
Returns:
true, if is inside