Class PhysicsSystem
java.lang.Object
com.badlogic.ashley.core.EntitySystem
com.badlogic.ashley.systems.IteratingSystem
com.devcharles.piazzapanic.componentsystems.PhysicsSystem
public class PhysicsSystem
extends com.badlogic.ashley.systems.IteratingSystem
Steps the Box2D world and maps the body positions to their
TransformComponents to link physics and rendering.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static floatprivate com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity>private static final floatprivate com.badlogic.gdx.physics.box2d.WorldFields inherited from class com.badlogic.ashley.core.EntitySystem
priority -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprocessEntity(com.badlogic.ashley.core.Entity entity, float deltaTime) This method is called on every entity on every update call of the EntitySystem.voidupdate(float deltaTime) The update method called every tick.Methods inherited from class com.badlogic.ashley.systems.IteratingSystem
addedToEngine, getEntities, getFamily, removedFromEngineMethods inherited from class com.badlogic.ashley.core.EntitySystem
checkProcessing, getEngine, setProcessing
-
Field Details
-
world
private com.badlogic.gdx.physics.box2d.World world -
bodies
private com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> bodies -
MAX_FRAMETIME
private static final float MAX_FRAMETIME- See Also:
-
accumulator
private static float accumulator
-
-
Constructor Details
-
PhysicsSystem
public PhysicsSystem(com.badlogic.gdx.physics.box2d.World world)
-
-
Method Details
-
processEntity
protected void processEntity(com.badlogic.ashley.core.Entity entity, float deltaTime) Description copied from class:com.badlogic.ashley.systems.IteratingSystemThis method is called on every entity on every update call of the EntitySystem. Override this to implement your system's specific processing.- Specified by:
processEntityin classcom.badlogic.ashley.systems.IteratingSystem- Parameters:
entity- The current Entity being processeddeltaTime- The delta time between the last and current frame
-
update
public void update(float deltaTime) Description copied from class:com.badlogic.ashley.core.EntitySystemThe update method called every tick.- Overrides:
updatein classcom.badlogic.ashley.systems.IteratingSystem- Parameters:
deltaTime- The time passed since last frame in seconds.
-