|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.math.DynamicState
public final class DynamicState
Provides dynamic state of an object. The orientation and position relate
object coordinates to world coordinates. Units should be consistent: mass,
length, time. Typically acelerations are the only inputs, both for position
and orientation, using the addXAcceleration()
methods.
Constructor Summary | |
---|---|
DynamicState()
|
Method Summary | |
---|---|
void |
addAcceleration(Vector acceleration)
Add a positional acceleration. |
void |
addAngularAcceleration(Quaternion acceleration)
Add an angular acceleration. |
void |
addMassAcceleration(double massAcceleration)
Add a mass velocity rate of change. |
void |
applyForce(Vector force)
Apply the given force through the center of mass to this object. |
void |
applyForce(Vector force,
Vector position)
Apply the given force at the given position to this object. |
void |
applyForceLocal(Vector force,
Vector position)
Apply the given force at the given position to this object where these vectors are expressed in local coordinates. |
protected void |
applyTorque(Vector force,
Vector position)
Apply the given torque to this object where these vectors are expressed in local coordinates. |
Object |
clone()
Return a clone of this instance. |
Vector |
convertLocalToWorld(Vector v)
Convert the given vector from local coordinates to world coordinates. |
Vector |
convertWorldToLocal(Vector v)
Convert the given vector from world coordinates to local coordinates. |
Vector |
getAcceleration()
Return the acceleration in length time^-2 units. |
Quaternion |
getAngularAcceleration()
Return the angular acceleration in radians time^-2 units. |
Quaternion |
getAngularVelocity()
Return the angular velocity in radians time^-1 units. |
double |
getMass()
Return the mass in mass units. |
double |
getMassAcceleration()
Return the mass velocity rate of change in mass time^-2 units. |
double |
getMassVelocity()
Return the mass rate of change in mass time^-1 units. |
double[] |
getMomentOfInertia()
Return the moment of inertia in mass length^2 units. |
Quaternion |
getOrientation()
Return the orientation quaternion. |
Vector |
getPosition()
Return the position vector. |
Vector |
getPreviousPosition()
Return the previous position vector. |
Vector |
getVelocity()
Return the velocity in length time^-1 units. |
void |
move(Vector movement)
Move using the given vector. |
Vector |
orientLocalToWorld(Vector v)
Orient the given vector from local coordinates to world coordinates. |
Vector |
orientWorldToLocal(Vector v)
Orient the given vector from world coordinates to local coordinates. |
void |
rotate(Quaternion rotation)
Rotate using the given quaternion. |
void |
setAcceleration(Vector acceleration)
Set the acceleration. |
void |
setAngularAcceleration(Quaternion angularAcceleration)
Set the angular acceleration. |
void |
setAngularVelocity(Quaternion angularVelocity)
Set the angular velocity. |
void |
setMass(double mass)
Set the mass. |
void |
setMassAcceleration(double massAcceleration)
Set the mass velocity rate of change. |
void |
setMassVelocity(double massVelocity)
Set the mass rate of change. |
void |
setMomentOfInertia(double[] momentOfInertia)
Set the moment of inertia. |
void |
setOrientation(Quaternion orientation)
Set the orientation. |
void |
setPosition(Vector position)
Set the position. |
void |
setVelocity(Vector velocity)
Set the velocity. |
String |
toString()
Return a string representation of this object. |
void |
zeroAcceleration()
Zero the acceleration. |
void |
zeroAngularAcceleration()
Zero the angular acceleration. |
void |
zeroAngularMotion()
Zero all angular motion. |
void |
zeroMassAcceleration()
Zero the mass acceleration. |
void |
zeroMotion()
Zero all motion. |
void |
zeroTranslationalMotion()
Zero all translational motion. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DynamicState()
Method Detail |
---|
public void addAcceleration(Vector acceleration)
addAcceleration
in interface IDynamicState
acceleration
- Acceleration vector in length time^-2 units.public void addAngularAcceleration(Quaternion acceleration)
addAngularAcceleration
in interface IDynamicState
acceleration
- Angular acceleration in radians time^-2 units.public void addMassAcceleration(double massAcceleration)
addMassAcceleration
in interface IDynamicState
massAcceleration
- in mass time^-2 units.public void applyForce(Vector force)
applyForce
in interface IDynamicState
force
- Force vector in world coordinates in mass length time^-2
units.public void applyForce(Vector force, Vector position)
applyForce
in interface IDynamicState
force
- Force vector in world coordinates in mass length
time^-2 units.position
- Position of applied force relative to the center of
mass in world coordinates in length units.public void applyForceLocal(Vector force, Vector position)
applyForceLocal
in interface IDynamicState
force
- Force vector in local coordinates in mass length
time^-2 units.position
- Position of applied force relative to the center of
mass in local coordinates in length units.public Object clone()
clone
in interface IState
clone
in class Object
public Vector convertLocalToWorld(Vector v)
convertLocalToWorld
in interface IState
v
- Vector in local coordinates.public Vector convertWorldToLocal(Vector v)
convertWorldToLocal
in interface IState
v
- Vector in local coordinates.public Vector getAcceleration()
getAcceleration
in interface IDynamicState
public Quaternion getAngularAcceleration()
getAngularAcceleration
in interface IDynamicState
public Quaternion getAngularVelocity()
getAngularVelocity
in interface IDynamicState
public double getMass()
getMass
in interface IDynamicState
public double getMassAcceleration()
getMassAcceleration
in interface IDynamicState
public double getMassVelocity()
getMassVelocity
in interface IDynamicState
public double[] getMomentOfInertia()
getMomentOfInertia
in interface IDynamicState
public Quaternion getOrientation()
getOrientation
in interface IState
public Vector getPosition()
getPosition
in interface IState
public Vector getPreviousPosition()
getPreviousPosition
in interface IState
public Vector getVelocity()
getVelocity
in interface IDynamicState
public void move(Vector movement)
move
in interface IState
public Vector orientLocalToWorld(Vector v)
orientLocalToWorld
in interface IState
v
- Vector in local coordinates.public Vector orientWorldToLocal(Vector v)
orientWorldToLocal
in interface IState
v
- Vector in world coordinates.public void rotate(Quaternion rotation)
rotate
in interface IState
public void setAcceleration(Vector acceleration)
setAcceleration
in interface IDynamicState
acceleration
- Acceleration vector in length time^-2 units.public void setAngularAcceleration(Quaternion angularAcceleration)
setAngularAcceleration
in interface IDynamicState
angularAcceleration
- Angular acceleration in radians time^-2
units.public void setAngularVelocity(Quaternion angularVelocity)
setAngularVelocity
in interface IDynamicState
angularVelocity
- Angular velocity in radians time^-1 units.public void setMass(double mass)
setMass
in interface IDynamicState
mass
- Mass in mass units.public void setMassAcceleration(double massAcceleration)
setMassAcceleration
in interface IDynamicState
massAcceleration
- Mass velocity rate of change in mass time^-2
units.public void setMassVelocity(double massVelocity)
setMassVelocity
in interface IDynamicState
massVelocity
- Mass rate of change in mass time^-1 units.public void setMomentOfInertia(double[] momentOfInertia)
setMomentOfInertia
in interface IDynamicState
momentOfInertia
- Moment of intertia in mass length^2 units.public void setOrientation(Quaternion orientation)
setOrientation
in interface IState
public void setPosition(Vector position)
setPosition
in interface IState
public void setVelocity(Vector velocity)
setVelocity
in interface IDynamicState
velocity
- Velocity vector in length time^-1 units.public String toString()
toString
in interface IDynamicState
toString
in class Object
public void zeroAcceleration()
zeroAcceleration
in interface IDynamicState
public void zeroAngularAcceleration()
zeroAngularAcceleration
in interface IDynamicState
public void zeroAngularMotion()
zeroAngularMotion
in interface IDynamicState
public void zeroMassAcceleration()
zeroMassAcceleration
in interface IDynamicState
public void zeroMotion()
zeroMotion
in interface IDynamicState
public void zeroTranslationalMotion()
zeroTranslationalMotion
in interface IDynamicState
protected void applyTorque(Vector force, Vector position)
force
- Force vector in local coordinates in mass length
time^-2 units.position
- Position of applied force relative to the center of
mass in local coordinates in length units.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |