-
- All Implemented Interfaces:
public final class ArbiterCreates 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 classArbiter.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Array<Vec2>contactsprivate Vec2contactNormalprivate IntegercontactCountprivate Doublerestitutionprivate final TranslatableBodyaprivate final TranslatableBodyb
-
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 Vec2getContactNormal()final UnitsetContactNormal(Vec2 contactNormal)final IntegergetContactCount()final UnitsetContactCount(Integer contactCount)final DoublegetRestitution()final UnitsetRestitution(Double restitution)final TranslatableBodygetA()Getter for Body A. final TranslatableBodygetB()Getter for Body B. final UnitnarrowPhase()Conducts a narrow phase detection and creates a contact manifold. final UnitpenetrationResolution()Resolves any penetrations that are left overlapping between shapes. final Unitsolve()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.
-
-
-
-