Module technology.sola.engine
Class ImpulseCollisionResolutionSystem
java.lang.Object
technology.sola.ecs.EcsSystem
technology.sola.engine.physics.system.ImpulseCollisionResolutionSystem
@NullMarked
public class ImpulseCollisionResolutionSystem
extends technology.sola.ecs.EcsSystem
ImpulseCollisionResolutionSystem is an
EcsSystem
that responds to CollisionEvent
s applying an
impulse to resolve collisions so that they will no longer overlap.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The order for this system which is one after theCollisionDetectionSystem.ORDER
. -
Constructor Summary
ConstructorsConstructorDescriptionImpulseCollisionResolutionSystem
(EventHub eventHub) Creates an instance with recommended settings.ImpulseCollisionResolutionSystem
(EventHub eventHub, int iterations) Creates an instance with custom iterations and recommended penetrationSlack and linearProjectionPercentage settings.ImpulseCollisionResolutionSystem
(EventHub eventHub, int iterations, float penetrationSlack, float linearProjectionPercentage) Creates an instance with custom settings. -
Method Summary
Methods inherited from class technology.sola.ecs.EcsSystem
isActive, setActive
-
Field Details
-
ORDER
public static final int ORDERThe order for this system which is one after theCollisionDetectionSystem.ORDER
.- See Also:
-
-
Constructor Details
-
ImpulseCollisionResolutionSystem
Creates an instance with recommended settings.- Parameters:
eventHub
- theEventHub
instance
-
ImpulseCollisionResolutionSystem
Creates an instance with custom iterations and recommended penetrationSlack and linearProjectionPercentage settings.- Parameters:
eventHub
- theEventHub
instanceiterations
- number of impulse resolution calculation iterations, larger is more accurate (1-20 is recommended)
-
ImpulseCollisionResolutionSystem
public ImpulseCollisionResolutionSystem(EventHub eventHub, int iterations, float penetrationSlack, float linearProjectionPercentage) Creates an instance with custom settings.- Parameters:
eventHub
- theEventHub
instanceiterations
- number of impulse resolution calculation iterations, larger is more accurate (1-20 is recommended)penetrationSlack
- smaller number is more accurate but causes more jittering (0.01-0.1 recommended)linearProjectionPercentage
- how much positional correction to apply, small value allows objects to penetrate more with less jittering (0.2-0.8 recommended)
-
-
Method Details
-
update
public void update(technology.sola.ecs.World world, float deltaTime) - Specified by:
update
in classtechnology.sola.ecs.EcsSystem
-
getOrder
public int getOrder()- Overrides:
getOrder
in classtechnology.sola.ecs.EcsSystem
-