sim.physics2D.physicalObject
Class PhysicalObject2D

java.lang.Object
  extended by SimplePortrayal2D
      extended by sim.physics2D.physicalObject.PhysicalObject2D
Direct Known Subclasses:
MobileObject2D, StationaryObject2D

public abstract class PhysicalObject2D
extends SimplePortrayal2D

PhysicalObject2D is an abstract class representing objects that can be operated on by PhysicsEngine2D


Field Summary
protected  double coefficientOfRestitution
           
 int index
           
protected  PhysicsState physicsState
           
protected  Shape shape
           
 
Constructor Summary
PhysicalObject2D()
           
 
Method Summary
 void draw(java.lang.Object object, java.awt.Graphics2D graphics, DrawInfo2D info)
          Display the object
abstract  double getAngularVelocity()
          How fast the object is rotating in radians per second.
 double getCoefficientOfRestitution()
          Represents the elasticity of an object 1 is perfectly elastic and 0 is perfectly inelastic.
 int getIndex()
          Returns the object's index, which uniquely identifies the object and determines where its state variables are kept in the state vectors and matrices.
abstract  double getMassInverse()
           
abstract  double getMassMomentOfInertiaInverse()
           
 Angle getOrientation()
          Returns an object's current orientation
 Double2D getPosition()
          Returns an object's current position
 Shape getShape()
          Returns an object's associated shape
abstract  Double2D getVelocity()
           
 int handleCollision(PhysicalObject2D other, Double2D colPoint)
          Provides a default implementation for the function used by the collision detection engine to notify an object when it has collided with another object.
abstract  void resetLastPose()
           
abstract  void restorePose()
           
 void setCoefficientOfRestitution(double coefficientOfRestitution)
          Represents the elasticity of an object 1 is perfectly elastic and 0 is perfectly inelastic.
 void setIndex(int index)
           
 void setPose(Double2D position, Angle orientation)
          Set the pose of the object
abstract  void updatePose(double percent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

public int index

shape

protected Shape shape

physicsState

protected PhysicsState physicsState

coefficientOfRestitution

protected double coefficientOfRestitution
Constructor Detail

PhysicalObject2D

public PhysicalObject2D()
Method Detail

getIndex

public int getIndex()
Returns the object's index, which uniquely identifies the object and determines where its state variables are kept in the state vectors and matrices.


setIndex

public void setIndex(int index)

getShape

public Shape getShape()
Returns an object's associated shape


getPosition

public Double2D getPosition()
Returns an object's current position


getOrientation

public Angle getOrientation()
Returns an object's current orientation


getCoefficientOfRestitution

public double getCoefficientOfRestitution()
Represents the elasticity of an object 1 is perfectly elastic and 0 is perfectly inelastic. Determines how much momentum is conserved when objects collide


setCoefficientOfRestitution

public void setCoefficientOfRestitution(double coefficientOfRestitution)
Represents the elasticity of an object 1 is perfectly elastic and 0 is perfectly inelastic. Determines how much momentum is conserved when objects collide


draw

public void draw(java.lang.Object object,
                 java.awt.Graphics2D graphics,
                 DrawInfo2D info)
Display the object


setPose

public void setPose(Double2D position,
                    Angle orientation)
Set the pose of the object


getVelocity

public abstract Double2D getVelocity()

getAngularVelocity

public abstract double getAngularVelocity()
How fast the object is rotating in radians per second. A positive angular velocity means the object is rotating counter clockwise


handleCollision

public int handleCollision(PhysicalObject2D other,
                           Double2D colPoint)
Provides a default implementation for the function used by the collision detection engine to notify an object when it has collided with another object.


resetLastPose

public abstract void resetLastPose()

updatePose

public abstract void updatePose(double percent)

restorePose

public abstract void restorePose()

getMassInverse

public abstract double getMassInverse()

getMassMomentOfInertiaInverse

public abstract double getMassMomentOfInertiaInverse()