vitro.plane
Class PhysicsActor

java.lang.Object
  extended by vitro.Actor
      extended by vitro.plane.PlaneActor
          extended by vitro.plane.PhysicsActor

public class PhysicsActor
extends PlaneActor

More realistic would be to keep tabs on momentum, so that changes in mass will be appropriately expressed. That change shouldn't be a large refactor though, so I'm keeping this simplistic approach for now.


Field Summary
 double mass
           
 Vector2 velocity
           
 
Fields inherited from class vitro.plane.PlaneActor
model
 
Constructor Summary
PhysicsActor(Plane model, double mass)
           
PhysicsActor(Plane model, double mass, Vector2 initial)
           
 
Method Summary
 Set<Action> actions()
          A collection of Actions that are possible for this Actor.
 
Methods inherited from class vitro.plane.PlaneActor
position
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mass

public final double mass

velocity

public Vector2 velocity
Constructor Detail

PhysicsActor

public PhysicsActor(Plane model,
                    double mass,
                    Vector2 initial)

PhysicsActor

public PhysicsActor(Plane model,
                    double mass)
Method Detail

actions

public Set<Action> actions()
Description copied from class: Actor
A collection of Actions that are possible for this Actor. In a simulation round, each Actor will have the opportunity to perform a single Action. If this method returns an empty set (the default), no action will be taken. If this method returns a single action, it will always be taken. Otherwise, it is the responsibility of the Controller to determine which action (if any) is taken. Controllers can associate Agents with Actors to act as decision-making 'filters'. In general, these Actions should be thought of as a collection of Actions that are 'physically possible' given the current state of the Model.

Overrides:
actions in class Actor
Returns:
a Set of Actions that this Actor can take.