Emini Physics Engine 1.3.5a API Documentation

at.emini.physics2D
Interface ExternalForce


public interface ExternalForce

Represents an external force applying to one or more bodies. The external force is applied at each step in the simulation.

Author:
Alexander Adensamer

Method Summary
 void applyForce(Body[] bodies, int bodyCount, float timestepFX)
          Method to apply the external force.
 ExternalForce copy(Body[] bodyMapping)
          Copy method for the force.
 

Method Detail

applyForce

void applyForce(Body[] bodies,
                int bodyCount,
                float timestepFX)
Method to apply the external force. The force is applied to all bodies that are affected by it. Force can be applied to a body using the Body#applyForce(at.emini.physics2D.util.FXVector, int) method.

Parameters:
bodies - the caller supplies an array containing all bodies in the world.
bodyCount - the number of bodies in the world (not necessarily equal to length of the array)
timestepFX - the current simulation timestep is passed

copy

ExternalForce copy(Body[] bodyMapping)
Copy method for the force. This is required when the world is copied or added to another world.

Parameters:
bodyMapping - a vector containing a mapping from bodies in the original world to the new world. This will only be used when the class depends on bodies. The reference to the copy of a body is found by bodyMapping[body.getId()].
Returns:
a deep copy of the force.

Emini Physics Engine 1.3.5a API Documentation

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