component.movementconstraintcomponent

Component that constraints an entity's movement, e.g. to another entity or an area.

struct MovementConstraintComponent;

Component that constraints an entity's movement, e.g. to another entity or an area.

This is used e.g. to limit player ship movement.

bool constrainedToOwner;

If true, we're constrained to an owner determined by OwnerComponent.

Otherwise, the constraint is in world space.

enum Type;

Constraint types.

Uninitialized

Used when uninitialized to detect errors.

AABBox

Axis-aligned bounding box.

Vector2f position;

Position we're constrained to.

If we're constrained to an owner, this is changed each update.

this(ref Node yaml);

Load from a YAML node.

Throws YAMLException on error.

inout pure nothrow @property ref inout(Rectf) aabbox();

Get the constraint as an AABBox

const pure nothrow @property Type type();

Get constraint type.