Emini Physics Engine 1.3.5a API Documentation

at.emini.physics2D
Interface Constraint

All Known Implementing Classes:
Joint, Motor, Spring

public interface Constraint

Interface for additional constraints. The constraint has to be added to the world after creation. It is considered in the simulation by calling the following methods in the @link World.tick().

The constraint can apply to any number of bodies.

Author:
Alexander Adensamer

Field Summary
static int JOINT
          Type indicator for joints.
static int MOTOR
          Type indicator for motors.
static int SCRIPT
          Type indicator for scripts.
static int SPRING
          Type indicator for springs.
 
Method Summary
 boolean applyMomentum(float invTimestepFX)
          Applies the momentum to the body/bodies.
 boolean concernsBody(Body b)
          Checks whether the constraint applies to a body.
 Constraint copy(Body[] bodyMapping)
          Copies the constraint.
 boolean equals(Constraint other)
          Checks for equality of two constraints.
 float getImpulseFX()
          Gets the virtual work of the constraint.
 UserData getUserData()
           
 void postStep()
          Cleans up after constraint iteration.
 void precalculate(float invTimestepFX)
          Precomputes static values.
 

Field Detail

JOINT

static final int JOINT
Type indicator for joints. (used for loading/saving world)

See Also:
Constant Field Values

SPRING

static final int SPRING
Type indicator for springs. (used for loading/saving world)

See Also:
Constant Field Values

SCRIPT

static final int SCRIPT
Type indicator for scripts. (used for loading/saving world)

See Also:
Constant Field Values

MOTOR

static final int MOTOR
Type indicator for motors. (used for loading/saving world)

See Also:
Constant Field Values
Method Detail

precalculate

void precalculate(float invTimestepFX)
Precomputes static values. The method is called before the constraint iteration to pre-compute static values.

Parameters:
invTimestepFX - the inverse timestep of the simulation

applyMomentum

boolean applyMomentum(float invTimestepFX)
Applies the momentum to the body/bodies. This method is called for each constraint iteratively. It applies the constraint to the involved body (bodies).

Parameters:
invTimestepFX - the inverse timestep of the simulation

postStep

void postStep()
Cleans up after constraint iteration. Method is called after the iteration to clean up and perform post-iteration calculations.


getImpulseFX

float getImpulseFX()
Gets the virtual work of the constraint.

Returns:
the last acting impulse on the constraint

copy

Constraint copy(Body[] bodyMapping)
Copies the constraint. This includes update of body reference(s) of the new world.

Parameters:
bodyMapping - A mapping of the body indices from the old world to the new
Returns:
a deep copy of the constraint

concernsBody

boolean concernsBody(Body b)
Checks whether the constraint applies to a body.

Parameters:
b - the body to check
Returns:
true if the constraint applies to the body.

equals

boolean equals(Constraint other)
Checks for equality of two constraints.

Parameters:
other - the constraint to compare
Returns:
true if the constraints are equal.

getUserData

UserData getUserData()

Emini Physics Engine 1.3.5a API Documentation

Emini Physics Engine 1.3.5a API Documentation - Copyright 2014 Alexander Adensamer