|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.physics.PhysicalObject
public class PhysicalObject
Constructor Summary | |
---|---|
PhysicalObject()
|
Method Summary | |
---|---|
void |
accumulateForce(Vector force)
Applies a non-rotational force to this PhysicalObject. |
void |
accumulateForce(Vector force,
Vector p)
Applies a possibly rotational force to this PhysicalObject. |
Contact[] |
finalContacts()
Provides the final Contacts for this PhysicalObject, after all calculations for position have been completed by a Universe. |
Vector |
getDeltaPosition()
|
Vector |
getDeltaVelocity()
|
float |
getMass()
Returns the mass of this PhysicalObject. |
Vector |
getPosition()
Provides the position of the center of mass for this PhysicalObject. |
Tag |
getTag(java.lang.String name)
Gets the Tag associated with the given name. |
Vector |
getVelocity()
Provides the velocity of this PhysicalObject. |
boolean |
hasContact(Contact c)
|
Contact |
lastContact()
Provides the most recent (possibly incomplete) Contact still being used for calculating position on this PhysicalObject. |
float |
lastContactTime()
Provides the time value of the most recent (possibly incomplete) Contact still being used for calculating position on this PhysicalObject. |
Contact |
lastFinishedContact()
Provides the most recent complete Contact still being used for calculating position on this PhysicalObject. |
float |
lastFinishedContactTime()
Provides the time value of the most recent complete Contact still being used for calculating position on this PhysicalObject. |
Vector |
positionAt(float i,
float deltaTime)
|
void |
removeTag(java.lang.String name)
Removes the Tag with the given name. |
void |
removeTag(Tag tag)
Removes the Tag with the same name as Tag. |
void |
setDeltaPosition(Vector deltaPosition)
This is change in position over the time step used, not velocity! |
void |
setDeltaVelocity(Vector deltaVelocity)
This is change in velocity over the time step used, not plain acceleration! |
void |
setMass(float mass)
Sets the mass of this PhysicalObject. |
void |
setPosition(Vector position)
Sets the position of the center of mass for this PhysicalObject object. |
void |
setVelocity(Vector velocity)
Sets the velocity of this PhysicalObject. |
void |
tag(Tag tag)
Attaches a Tag to this PhysicalObject, replacing any existing Tag with the same name. |
Vector |
velocityAt(float i,
float deltaTime)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PhysicalObject()
Method Detail |
---|
public void setPosition(Vector position)
position
- the center of mass in world coordinates.public Vector getPosition()
public Vector positionAt(float i, float deltaTime)
public Vector velocityAt(float i, float deltaTime)
public void setDeltaPosition(Vector deltaPosition)
deltaPosition
- the change in position for the time step.public Vector getDeltaPosition()
public void setVelocity(Vector velocity)
velocity
- the new velocity.public void setDeltaVelocity(Vector deltaVelocity)
deltaVelocity
- the change in velocity for the time step.public Vector getDeltaVelocity()
public Vector getVelocity()
public void setMass(float mass)
mass
- the new mass for this PhysicalObject.public float getMass()
public void tag(Tag tag)
public Tag getTag(java.lang.String name)
name
- the name of the tag.
public void removeTag(java.lang.String name)
name
- the name of the Tag.public void removeTag(Tag tag)
tag
- the Tag.public void accumulateForce(Vector force)
force
- the force itself, in Newtons.public void accumulateForce(Vector force, Vector p)
force
- the force itself, in Newtons.p
- the point in the PhysicalObject's object space.public boolean hasContact(Contact c)
public Contact lastContact()
java.util.NoSuchElementException
- if there are no Contacts still
in use.public Contact lastFinishedContact()
java.util.NoSuchElementException
- if there are no Contacts still
in use.public float lastContactTime()
java.util.NoSuchElementException
- if there are no Contacts still
in use.public float lastFinishedContactTime()
java.util.NoSuchElementException
- if there are no Contacts still
in use.public Contact[] finalContacts()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |