- Object
-
- Island<T>
-
- Type Parameters:
T
- thePhysicsBody
type
public final class Island<T extends PhysicsBody> extends Object
Used to solve the contact constraints and joints for a group of interconnected bodies.Island
s are used and setup by theConstraintGraph
during it's solving process.- Since:
- 1.0.0
- Version:
- 4.0.0
- Author:
- William Bittle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ContactConstraint<T> contactConstraint)
Adds the givenContactConstraint
to theContactConstraint
list.void
add(Joint<T> joint)
void
add(T body)
Adds the givenPhysicsBody
to thePhysicsBody
list.void
clear()
Clears the island.void
solve(ContactConstraintSolver<T> solver, Vector2 gravity, TimeStep step, Settings settings)
Integrates thePhysicsBody
s, solves allContactConstraint
s andJoint
s, and attempts to sleep motionlessPhysicsBody
s.
-
-
-
Method Detail
-
clear
public void clear()
Clears the island.
-
add
public void add(T body)
Adds the givenPhysicsBody
to thePhysicsBody
list.- Parameters:
body
- thePhysicsBody
-
add
public void add(ContactConstraint<T> contactConstraint)
Adds the givenContactConstraint
to theContactConstraint
list.- Parameters:
contactConstraint
- theContactConstraint
-
solve
public void solve(ContactConstraintSolver<T> solver, Vector2 gravity, TimeStep step, Settings settings)
Integrates thePhysicsBody
s, solves allContactConstraint
s andJoint
s, and attempts to sleep motionlessPhysicsBody
s.- Parameters:
solver
- the contact constraint solvergravity
- the gravity vectorstep
- the time step informationsettings
- the current world settings
-
-