Dynamics2DEnvironment
Any implementing Environment should take care of physical dynamics, in particular collision detection and response. This interface provides some hooks in order to be able to manage some of the node's physical state.
Properties
Functions
Computes the farthest position reachable by a node towards a desiredPosition, avoiding node overlapping. If no node is located in between, desiredPosition is returned. Otherwise, the first position where the node collides with someone else is returned. For collision purposes, hitboxes are used: each node is given a circular hitbox of radius equal to its shape's radius (shapeless nodes can't cause overlapping). The client can specify a different radius for the hitbox of the moving node.
Gets the heading of a node as a direction vector.
Gets all nodes whose shape.intersect is true for the given shape.
Gets the shape of a node relatively to its position and heading in the environment.
Get node's current linear velocity.
Sets the heading of a node.
Set node's current linear velocity.
Compute any collision response and update node positions.