-
- All Implemented Interfaces:
public final class Arbiter
Creates manifolds to detect collisions and apply forces to them. Discrete in nature and only evaluates pairs of bodies in a single manifold.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
Arbiter.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Array<Vec2>
contacts
private Vec2
contactNormal
private Integer
contactCount
private Double
restitution
private final TranslatableBody
a
private final TranslatableBody
b
-
Constructor Summary
Constructors Constructor Description Arbiter(TranslatableBody a, TranslatableBody b)
-
Method Summary
Modifier and Type Method Description final Array<Vec2>
getContacts()
Array to save the contact points of the objects body's in world space. final Vec2
getContactNormal()
final Unit
setContactNormal(Vec2 contactNormal)
final Integer
getContactCount()
final Unit
setContactCount(Integer contactCount)
final Double
getRestitution()
final Unit
setRestitution(Double restitution)
final TranslatableBody
getA()
Getter for Body A. final TranslatableBody
getB()
Getter for Body B. final Unit
narrowPhase()
Conducts a narrow phase detection and creates a contact manifold. final Unit
penetrationResolution()
Resolves any penetrations that are left overlapping between shapes. final Unit
solve()
Solves the current contact manifold and applies impulses based on any contacts found. -
-
Constructor Detail
-
Arbiter
Arbiter(TranslatableBody a, TranslatableBody b)
-
-
Method Detail
-
getContacts
final Array<Vec2> getContacts()
Array to save the contact points of the objects body's in world space.
-
getContactNormal
final Vec2 getContactNormal()
-
setContactNormal
final Unit setContactNormal(Vec2 contactNormal)
-
getContactCount
final Integer getContactCount()
-
setContactCount
final Unit setContactCount(Integer contactCount)
-
getRestitution
final Double getRestitution()
-
setRestitution
final Unit setRestitution(Double restitution)
-
getA
final TranslatableBody getA()
Getter for Body A.
-
getB
final TranslatableBody getB()
Getter for Body B.
-
narrowPhase
final Unit narrowPhase()
Conducts a narrow phase detection and creates a contact manifold.
-
penetrationResolution
final Unit penetrationResolution()
Resolves any penetrations that are left overlapping between shapes. This can be cause due to integration errors of the solvers integration method. Based on linear projection to move the shapes away from each other based on a correction constant and scaled relative to the inverse mass of the objects.
-
-
-
-