|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.physics.Particle JSci.physics.AbstractClassicalParticle JSci.physics.ClassicalParticle2D JSci.physics.RigidBody2D
public class RigidBody2D
The RigidBody2D class provides an object for encapsulating rigid bodies that live in 2D.
Field Summary | |
---|---|
protected double |
ang
Angle (orientation). |
protected double |
angMass
Moment of inertia. |
protected double |
angVel
Angular velocity. |
Fields inherited from class JSci.physics.ClassicalParticle2D |
---|
mass, vx, vy, x, y |
Constructor Summary | |
---|---|
RigidBody2D()
Constructs a rigid body. |
Method Summary | |
---|---|
RigidBody2D |
angularAccelerate(double a,
double dt)
Accelerates this particle. |
RigidBody2D |
angularCollide(RigidBody2D p,
double e)
Collides this particle with another. |
RigidBody2D |
applyForce(double fx,
double fy,
double x,
double y,
double dt)
Applies a force acting at a point away from the centre of mass. |
RigidBody2D |
applyTorque(double T,
double dt)
Applies a torque to this particle. |
RigidBody2D |
collide(RigidBody2D p,
double theta,
double e)
Collides this particle with another. |
double |
energy()
Returns the kinetic and rotational energy. |
double |
getAngle()
Returns the angle (orientation) of this body. |
double |
getAngularMomentum()
|
double |
getAngularVelocity()
Returns the angular velocity. |
double |
getMomentOfInertia()
Returns the moment of inertia. |
ClassicalParticle2D |
move(double dt)
Evolves this particle forward according to its kinematics. |
RigidBody2D |
rotate(double dt)
Evolves this particle forward according to its rotational kinematics. |
void |
setAngle(double angle)
Sets the angle (orientation) of this body. |
void |
setAngularMomentum(double angleMom)
|
void |
setAngularVelocity(double angleVel)
Sets the angular velocity. |
void |
setMomentOfInertia(double MoI)
Sets the moment of inertia. |
Methods inherited from class JSci.physics.ClassicalParticle2D |
---|
accelerate, applyForce, collide, getMass, getMomentum, getPosition, getVelocity, getXMomentum, getXPosition, getXVelocity, getYMomentum, getYPosition, getYVelocity, gravitate, setMass, setMomentum, setPosition, setVelocity, setXPosition, setYPosition, speed, translate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double angMass
protected double ang
protected double angVel
Constructor Detail |
---|
public RigidBody2D()
Method Detail |
---|
public void setMomentOfInertia(double MoI)
public double getMomentOfInertia()
public void setAngle(double angle)
angle
- an angle in radians.public double getAngle()
public void setAngularVelocity(double angleVel)
public double getAngularVelocity()
public void setAngularMomentum(double angleMom)
public double getAngularMomentum()
public double energy()
energy
in class ClassicalParticle2D
public ClassicalParticle2D move(double dt)
move
in class ClassicalParticle2D
public RigidBody2D rotate(double dt)
public RigidBody2D angularAccelerate(double a, double dt)
angularAccelerate(a1, dt).angularAccelerate(a2, dt)
is equivalent to angularAccelerate(a1+a2, dt)
.
public RigidBody2D applyTorque(double T, double dt)
applyTorque(T1, dt).applyTorque(T2, dt)
is equivalent to applyTorque(T1+T2, dt)
.
public RigidBody2D applyForce(double fx, double fy, double x, double y, double dt)
x
- x-coordinate from centre of mass.y
- y-coordinate from centre of mass.
public RigidBody2D collide(RigidBody2D p, double theta, double e)
theta
- centre of mass deflection angle.e
- coefficient of restitution.
public RigidBody2D angularCollide(RigidBody2D p, double e)
e
- coefficient of restitution.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |