Name | Type | Description |
---|---|---|
entities |
Container | container of entities (usually dictionary) |
Members
-
gravity Utils.Vector2d
-
gravity acceleration in px/s^2 (default: (0, 9.8 * pixelMeterRatio) )
-
number of iterations/ticks per update (default: 7)
-
pixels/meter ratio (default: 50)
-
simulation speed multiplier
-
tick duration in seconds. Should be linear to 1/numIterations! (default: Scene.tick_duration/numIterations)
Methods
-
resolve a collision described by a manifold
Name Type Description manifold
Physics.Manifold collision manifold of two entities. -
applys natural forces to a rigidbody component
Name Type Description rigidbody
Components.Rigidbody rigidbody component -
detects collisions
Returns:
Type Description Array array of collision manifolds -
fixes penetration/energy loss
Name Type Description manifold
Physics.Manifold collision manifold -
resolve collision manifolds
Name Type Description manifolds
Array array of collision manifolds -
resolve natural forces on engine's tracked entities.
-
updates physics engine (tick)
Name Type Description tick_duration
Number the time (in seconds) of a tick (usually dt)