Package io.github.espressoengine.physics
Class PhysicsEngine
java.lang.Object
io.github.espressoengine.physics.PhysicsEngine
A simple 2D physics engine for JyGame.
- Version:
- $Id: $Id
- Author:
- pastthepixels
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
bodies
-
bounds
-
gravity
public double gravity
-
-
Constructor Details
-
PhysicsEngine
public PhysicsEngine()
-
-
Method Details
-
nextFrame
public void nextFrame()Updates the physics engine to the "next frame". Needs to be called manually every loop. -
add
Adds a
RigidBody
to the list of total bodies.- Parameters:
object
- aRigidBody
object
-
remove
Removes a
RigidBody
from the list of total bodies.- Parameters:
object
- aRigidBody
object
-