public class RigidBody2D extends ClassicalParticle2D
| Modifier and Type | Field and Description |
|---|---|
protected double |
ang
Angle (orientation).
|
protected double |
angMass
Moment of inertia.
|
protected double |
angVel
Angular velocity.
|
| Constructor and Description |
|---|
RigidBody2D()
Constructs a rigid body.
|
| Modifier and Type | Method and Description |
|---|---|
RigidBody2D |
angularAccelerate(double a,
double dt) |
RigidBody2D |
angularCollide(RigidBody2D p,
double e)
Collides this particle with another.
|
ClassicalParticle2D |
applyForce(Force2D F,
double dt) |
RigidBody2D |
applyTorque(double T,
double dt) |
RigidBody2D |
collide(RigidBody2D p,
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() |
double |
getMomentOfInertia() |
ClassicalParticle2D |
move(double dt)
Evolves the particle forward according to its kinematics.
|
RigidBody2D |
rotate(double dt) |
void |
setAngle(double angle)
Sets the angle (orientation) of this body.
|
void |
setAngularMomentum(double angleMom) |
void |
setAngularVelocity(double angleVel) |
void |
setMomentOfInertia(double MoI) |
accelerate, applyForce, collide, getMass, getXMomentum, getXPosition, getXVelocity, getYMomentum, getYPosition, getYVelocity, gravitate, setMass, setMomentum, setPosition, setVelocity, setXPosition, setYPosition, speed, translateprotected double angMass
protected double ang
protected double angVel
public void setMomentOfInertia(double MoI)
public double getMomentOfInertia()
public void setAngle(double angle)
angle - an angle in radianspublic double getAngle()
public void setAngularVelocity(double angleVel)
public double getAngularVelocity()
public void setAngularMomentum(double angleMom)
public double getAngularMomentum()
public double energy()
energy in class ClassicalParticle2Dpublic ClassicalParticle2D move(double dt)
move in class ClassicalParticle2Dpublic RigidBody2D rotate(double dt)
public RigidBody2D angularAccelerate(double a, double dt)
public RigidBody2D applyTorque(double T, double dt)
public ClassicalParticle2D applyForce(Force2D F, double dt)
applyForce in class ClassicalParticle2Dpublic RigidBody2D collide(RigidBody2D p, double e)
e - coefficient of restitutionpublic RigidBody2D angularCollide(RigidBody2D p, double e)
e - coefficient of restitution