|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSimplePortrayal2D
sim.physics2D.physicalObject.PhysicalObject2D
sim.physics2D.physicalObject.MobileObject2D
public abstract class MobileObject2D
MobileObject2D represents a physical object that can move.
| Field Summary | |
|---|---|
protected double |
coefficientOfFriction
|
protected double |
coefficientOfStaticFriction
|
protected double |
mass
|
protected double |
massMomentOfInertia
|
| Fields inherited from class sim.physics2D.physicalObject.PhysicalObject2D |
|---|
coefficientOfRestitution, index, physicsState, shape |
| Constructor Summary | |
|---|---|
MobileObject2D()
|
|
| Method Summary | |
|---|---|
void |
addForce(Double2D force)
Apply a force to the MobileObject |
void |
addFrictionForce()
Calculates and adds the static and dynamic friction forces on the object based on the coefficients of friction. |
void |
addTorque(double torque)
Apply a torque to the MobileObject |
double |
getAngularVelocity()
How fast the object is rotating in radians per second. |
double |
getCoefficientOfFriction()
Positive value representing the coefficient of friction of the object with the background surface. |
double |
getCoefficientOfStaticFriction()
Positive value representing the coefficient of static friction of the object with the background surface. |
Double2D |
getForceAccumulator()
Returns a vector that represents a combination of all the forces applied to it |
double |
getMass()
Returns the object's mass |
double |
getMassInverse()
1 / mass. |
double |
getMassMomentOfInertiaInverse()
1 / massMomentOfInertia. |
double |
getTorqueAccumulator()
Returns a number that represents a combination of all the torques applied to it |
Double2D |
getVelocity()
Returns the object's velocity |
void |
resetLastPose()
Move the object back to its previous location |
void |
restorePose()
Restores an object to its current location |
void |
setAngularVelocity(double angularVelocity)
How fast the object is rotating in radians per second. |
void |
setCoefficientOfFriction(double coefficientOfFriction)
Positive value representing the coefficient of friction of the object with the background surface. |
void |
setCoefficientOfStaticFriction(double coefficientOfStaticFriction)
Positive value representing the coefficient of static friction of the object with the background surface. |
void |
setMass(double mass)
Sets an object's mass. |
void |
setShape(Shape shape,
double mass)
Set the shape of the object which determines how it is displayed, when it is colliding with another object, and how its mass moment of inertia is calculated |
void |
setVelocity(Double2D velocity)
Updates the object's velocity |
void |
updatePose(double percent)
Updates the pose to where the object would be in only a percentage of a time step. |
| Methods inherited from class sim.physics2D.physicalObject.PhysicalObject2D |
|---|
draw, getCoefficientOfRestitution, getIndex, getOrientation, getPosition, getShape, handleCollision, setCoefficientOfRestitution, setIndex, setPose |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected double coefficientOfFriction
protected double coefficientOfStaticFriction
protected double mass
protected double massMomentOfInertia
| Constructor Detail |
|---|
public MobileObject2D()
| Method Detail |
|---|
public double getMass()
public void setMass(double mass)
public void addForce(Double2D force)
public void addTorque(double torque)
public double getCoefficientOfFriction()
public void setCoefficientOfFriction(double coefficientOfFriction)
public double getCoefficientOfStaticFriction()
public void setCoefficientOfStaticFriction(double coefficientOfStaticFriction)
public void setShape(Shape shape,
double mass)
public void updatePose(double percent)
updatePose in class PhysicalObject2Dpublic void resetLastPose()
resetLastPose in class PhysicalObject2Dpublic void restorePose()
restorePose in class PhysicalObject2Dpublic Double2D getVelocity()
getVelocity in class PhysicalObject2Dpublic void setVelocity(Double2D velocity)
public double getAngularVelocity()
getAngularVelocity in class PhysicalObject2Dpublic void setAngularVelocity(double angularVelocity)
public Double2D getForceAccumulator()
public double getTorqueAccumulator()
public double getMassInverse()
getMassInverse in class PhysicalObject2Dpublic double getMassMomentOfInertiaInverse()
getMassMomentOfInertiaInverse in class PhysicalObject2Dpublic void addFrictionForce()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||