com.bulletphysics.dynamics.constraintsolver
Class SequentialImpulseConstraintSolver

java.lang.Object
  extended by com.bulletphysics.dynamics.constraintsolver.ConstraintSolver
      extended by com.bulletphysics.dynamics.constraintsolver.SequentialImpulseConstraintSolver

public class SequentialImpulseConstraintSolver
extends ConstraintSolver

SequentialImpulseConstraintSolver uses a Propagation Method and Sequentially applies impulses. The approach is the 3D version of Erin Catto's GDC 2006 tutorial. See http://www.gphysics.com

Although Sequential Impulse is more intuitive, it is mathematically equivalent to Projected Successive Overrelaxation (iterative LCP).

Applies impulses for combined restitution and penetration recovery and to simulate friction.


Constructor Summary
SequentialImpulseConstraintSolver()
           
 
Method Summary
 long getRandSeed()
           
 long rand2()
           
 int randInt2(int n)
           
 void reset()
          Clear internal cached data and reset random seed.
 void setContactSolverFunc(ContactSolverFunc func, int type0, int type1)
          Advanced: Override the default contact solving function for contacts, for certain types of rigidbody
See RigidBody.contactSolverType and RigidBody.frictionSolverType
 void setFrictionSolverFunc(ContactSolverFunc func, int type0, int type1)
          Advanced: Override the default friction solving function for contacts, for certain types of rigidbody
See RigidBody.contactSolverType and RigidBody.frictionSolverType
 void setRandSeed(long seed)
           
 float solveCombinedContactFriction(RigidBody body0, RigidBody body1, ManifoldPoint cp, ContactSolverInfo info, int iter, IDebugDraw debugDrawer)
           
 float solveGroup(ObjectArrayList<CollisionObject> bodies, int numBodies, ObjectArrayList<PersistentManifold> manifoldPtr, int manifold_offset, int numManifolds, ObjectArrayList<TypedConstraint> constraints, int constraints_offset, int numConstraints, ContactSolverInfo infoGlobal, IDebugDraw debugDrawer, Dispatcher dispatcher)
          Sequentially applies impulses.
 float solveGroupCacheFriendly(ObjectArrayList<CollisionObject> bodies, int numBodies, ObjectArrayList<PersistentManifold> manifoldPtr, int manifold_offset, int numManifolds, ObjectArrayList<TypedConstraint> constraints, int constraints_offset, int numConstraints, ContactSolverInfo infoGlobal, IDebugDraw debugDrawer)
           
 float solveGroupCacheFriendlyIterations(ObjectArrayList<CollisionObject> bodies, int numBodies, ObjectArrayList<PersistentManifold> manifoldPtr, int manifold_offset, int numManifolds, ObjectArrayList<TypedConstraint> constraints, int constraints_offset, int numConstraints, ContactSolverInfo infoGlobal, IDebugDraw debugDrawer)
           
 float solveGroupCacheFriendlySetup(ObjectArrayList<CollisionObject> bodies, int numBodies, ObjectArrayList<PersistentManifold> manifoldPtr, int manifold_offset, int numManifolds, ObjectArrayList<TypedConstraint> constraints, int constraints_offset, int numConstraints, ContactSolverInfo infoGlobal, IDebugDraw debugDrawer)
           
 
Methods inherited from class com.bulletphysics.dynamics.constraintsolver.ConstraintSolver
allSolved, prepareSolve
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequentialImpulseConstraintSolver

public SequentialImpulseConstraintSolver()
Method Detail

rand2

public long rand2()

randInt2

public int randInt2(int n)

solveGroupCacheFriendlySetup

public float solveGroupCacheFriendlySetup(ObjectArrayList<CollisionObject> bodies,
                                          int numBodies,
                                          ObjectArrayList<PersistentManifold> manifoldPtr,
                                          int manifold_offset,
                                          int numManifolds,
                                          ObjectArrayList<TypedConstraint> constraints,
                                          int constraints_offset,
                                          int numConstraints,
                                          ContactSolverInfo infoGlobal,
                                          IDebugDraw debugDrawer)

solveGroupCacheFriendlyIterations

public float solveGroupCacheFriendlyIterations(ObjectArrayList<CollisionObject> bodies,
                                               int numBodies,
                                               ObjectArrayList<PersistentManifold> manifoldPtr,
                                               int manifold_offset,
                                               int numManifolds,
                                               ObjectArrayList<TypedConstraint> constraints,
                                               int constraints_offset,
                                               int numConstraints,
                                               ContactSolverInfo infoGlobal,
                                               IDebugDraw debugDrawer)

solveGroupCacheFriendly

public float solveGroupCacheFriendly(ObjectArrayList<CollisionObject> bodies,
                                     int numBodies,
                                     ObjectArrayList<PersistentManifold> manifoldPtr,
                                     int manifold_offset,
                                     int numManifolds,
                                     ObjectArrayList<TypedConstraint> constraints,
                                     int constraints_offset,
                                     int numConstraints,
                                     ContactSolverInfo infoGlobal,
                                     IDebugDraw debugDrawer)

solveGroup

public float solveGroup(ObjectArrayList<CollisionObject> bodies,
                        int numBodies,
                        ObjectArrayList<PersistentManifold> manifoldPtr,
                        int manifold_offset,
                        int numManifolds,
                        ObjectArrayList<TypedConstraint> constraints,
                        int constraints_offset,
                        int numConstraints,
                        ContactSolverInfo infoGlobal,
                        IDebugDraw debugDrawer,
                        Dispatcher dispatcher)
Sequentially applies impulses.

Specified by:
solveGroup in class ConstraintSolver

solveCombinedContactFriction

public float solveCombinedContactFriction(RigidBody body0,
                                          RigidBody body1,
                                          ManifoldPoint cp,
                                          ContactSolverInfo info,
                                          int iter,
                                          IDebugDraw debugDrawer)

reset

public void reset()
Description copied from class: ConstraintSolver
Clear internal cached data and reset random seed.

Specified by:
reset in class ConstraintSolver

setContactSolverFunc

public void setContactSolverFunc(ContactSolverFunc func,
                                 int type0,
                                 int type1)
Advanced: Override the default contact solving function for contacts, for certain types of rigidbody
See RigidBody.contactSolverType and RigidBody.frictionSolverType


setFrictionSolverFunc

public void setFrictionSolverFunc(ContactSolverFunc func,
                                  int type0,
                                  int type1)
Advanced: Override the default friction solving function for contacts, for certain types of rigidbody
See RigidBody.contactSolverType and RigidBody.frictionSolverType


setRandSeed

public void setRandSeed(long seed)

getRandSeed

public long getRandSeed()