com.bulletphysics.collision.narrowphase
Class VoronoiSimplexSolver

java.lang.Object
  extended by com.bulletphysics.collision.narrowphase.VoronoiSimplexSolver
All Implemented Interfaces:
SimplexSolverInterface

public class VoronoiSimplexSolver
extends java.lang.Object
implements SimplexSolverInterface


Nested Class Summary
static class VoronoiSimplexSolver.SubSimplexClosestResult
           
static class VoronoiSimplexSolver.UsageBitfield
           
 
Field Summary
 VoronoiSimplexSolver.SubSimplexClosestResult cachedBC
           
 javax.vecmath.Vector3f cachedP1
           
 javax.vecmath.Vector3f cachedP2
           
 javax.vecmath.Vector3f cachedV
           
 boolean cachedValidClosest
           
 javax.vecmath.Vector3f lastW
           
 boolean needsUpdate
           
 int numVertices
           
 javax.vecmath.Vector3f[] simplexPointsP
           
 javax.vecmath.Vector3f[] simplexPointsQ
           
 javax.vecmath.Vector3f[] simplexVectorW
           
protected  ObjectPool<VoronoiSimplexSolver.SubSimplexClosestResult> subsimplexResultsPool
           
 
Constructor Summary
VoronoiSimplexSolver()
           
 
Method Summary
 void addVertex(javax.vecmath.Vector3f w, javax.vecmath.Vector3f p, javax.vecmath.Vector3f q)
           
 void backup_closest(javax.vecmath.Vector3f v)
           
 boolean closest(javax.vecmath.Vector3f v)
          Return/calculate the closest vertex.
 boolean closestPtPointTetrahedron(javax.vecmath.Vector3f p, javax.vecmath.Vector3f a, javax.vecmath.Vector3f b, javax.vecmath.Vector3f c, javax.vecmath.Vector3f d, VoronoiSimplexSolver.SubSimplexClosestResult finalResult)
           
 boolean closestPtPointTriangle(javax.vecmath.Vector3f p, javax.vecmath.Vector3f a, javax.vecmath.Vector3f b, javax.vecmath.Vector3f c, VoronoiSimplexSolver.SubSimplexClosestResult result)
           
 void compute_points(javax.vecmath.Vector3f p1, javax.vecmath.Vector3f p2)
           
 boolean emptySimplex()
           
 boolean fullSimplex()
           
 int getSimplex(javax.vecmath.Vector3f[] pBuf, javax.vecmath.Vector3f[] qBuf, javax.vecmath.Vector3f[] yBuf)
           
 boolean inSimplex(javax.vecmath.Vector3f w)
           
 float maxVertex()
           
 int numVertices()
           
static int pointOutsideOfPlane(javax.vecmath.Vector3f p, javax.vecmath.Vector3f a, javax.vecmath.Vector3f b, javax.vecmath.Vector3f c, javax.vecmath.Vector3f d)
           
 void reduceVertices(VoronoiSimplexSolver.UsageBitfield usedVerts)
           
 void removeVertex(int index)
           
 void reset()
          Clear the simplex, remove all the vertices.
 boolean updateClosestVectorAndPoints()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subsimplexResultsPool

protected final ObjectPool<VoronoiSimplexSolver.SubSimplexClosestResult> subsimplexResultsPool

numVertices

public int numVertices

simplexVectorW

public final javax.vecmath.Vector3f[] simplexVectorW

simplexPointsP

public final javax.vecmath.Vector3f[] simplexPointsP

simplexPointsQ

public final javax.vecmath.Vector3f[] simplexPointsQ

cachedP1

public final javax.vecmath.Vector3f cachedP1

cachedP2

public final javax.vecmath.Vector3f cachedP2

cachedV

public final javax.vecmath.Vector3f cachedV

lastW

public final javax.vecmath.Vector3f lastW

cachedValidClosest

public boolean cachedValidClosest

cachedBC

public final VoronoiSimplexSolver.SubSimplexClosestResult cachedBC

needsUpdate

public boolean needsUpdate
Constructor Detail

VoronoiSimplexSolver

public VoronoiSimplexSolver()
Method Detail

removeVertex

public void removeVertex(int index)

reduceVertices

public void reduceVertices(VoronoiSimplexSolver.UsageBitfield usedVerts)

updateClosestVectorAndPoints

public boolean updateClosestVectorAndPoints()

closestPtPointTriangle

public boolean closestPtPointTriangle(javax.vecmath.Vector3f p,
                                      javax.vecmath.Vector3f a,
                                      javax.vecmath.Vector3f b,
                                      javax.vecmath.Vector3f c,
                                      VoronoiSimplexSolver.SubSimplexClosestResult result)

pointOutsideOfPlane

public static int pointOutsideOfPlane(javax.vecmath.Vector3f p,
                                      javax.vecmath.Vector3f a,
                                      javax.vecmath.Vector3f b,
                                      javax.vecmath.Vector3f c,
                                      javax.vecmath.Vector3f d)

closestPtPointTetrahedron

public boolean closestPtPointTetrahedron(javax.vecmath.Vector3f p,
                                         javax.vecmath.Vector3f a,
                                         javax.vecmath.Vector3f b,
                                         javax.vecmath.Vector3f c,
                                         javax.vecmath.Vector3f d,
                                         VoronoiSimplexSolver.SubSimplexClosestResult finalResult)

reset

public void reset()
Clear the simplex, remove all the vertices.

Specified by:
reset in interface SimplexSolverInterface

addVertex

public void addVertex(javax.vecmath.Vector3f w,
                      javax.vecmath.Vector3f p,
                      javax.vecmath.Vector3f q)
Specified by:
addVertex in interface SimplexSolverInterface

closest

public boolean closest(javax.vecmath.Vector3f v)
Return/calculate the closest vertex.

Specified by:
closest in interface SimplexSolverInterface

maxVertex

public float maxVertex()
Specified by:
maxVertex in interface SimplexSolverInterface

fullSimplex

public boolean fullSimplex()
Specified by:
fullSimplex in interface SimplexSolverInterface

getSimplex

public int getSimplex(javax.vecmath.Vector3f[] pBuf,
                      javax.vecmath.Vector3f[] qBuf,
                      javax.vecmath.Vector3f[] yBuf)
Specified by:
getSimplex in interface SimplexSolverInterface

inSimplex

public boolean inSimplex(javax.vecmath.Vector3f w)
Specified by:
inSimplex in interface SimplexSolverInterface

backup_closest

public void backup_closest(javax.vecmath.Vector3f v)
Specified by:
backup_closest in interface SimplexSolverInterface

emptySimplex

public boolean emptySimplex()
Specified by:
emptySimplex in interface SimplexSolverInterface

compute_points

public void compute_points(javax.vecmath.Vector3f p1,
                           javax.vecmath.Vector3f p2)
Specified by:
compute_points in interface SimplexSolverInterface

numVertices

public int numVertices()
Specified by:
numVertices in interface SimplexSolverInterface