-
- All Implemented Interfaces:
-
de.chaffic.dynamics.bodies.PhysicalBodyInterface
,de.chaffic.geometry.bodies.TranslatableBody
public final class PhysicalBody extends AbstractPhysicalBody
-
-
Field Summary
Fields Modifier and Type Field Description private Vec2
position
private Vec2
velocity
private Vec2
force
private Double
angularVelocity
private Double
torque
private Double
restitution
private Double
density
private Double
mass
private Double
invMass
private Double
inertia
private Double
invInertia
private Double
angularDampening
private Double
linearDampening
private Boolean
affectedByGravity
private Boolean
particle
-
Constructor Summary
Constructors Constructor Description PhysicalBody(Double x, Double y)
-
Method Summary
Modifier and Type Method Description Vec2
getPosition()
Unit
setPosition(Vec2 position)
Vec2
getVelocity()
Unit
setVelocity(Vec2 velocity)
Vec2
getForce()
Unit
setForce(Vec2 force)
Double
getAngularVelocity()
Unit
setAngularVelocity(Double angularVelocity)
Double
getTorque()
Unit
setTorque(Double torque)
Double
getRestitution()
Unit
setRestitution(Double restitution)
Double
getDensity()
Unit
setDensity(Double density)
Sets the density and calculates the mass depending on it. Double
getMass()
Unit
setMass(Double mass)
Double
getInvMass()
Unit
setInvMass(Double invMass)
Double
getInertia()
Unit
setInertia(Double inertia)
Double
getInvInertia()
Unit
setInvInertia(Double invInertia)
Double
getAngularDampening()
Unit
setAngularDampening(Double angularDampening)
Double
getLinearDampening()
Unit
setLinearDampening(Double linearDampening)
Boolean
getAffectedByGravity()
Unit
setAffectedByGravity(Boolean affectedByGravity)
Boolean
getParticle()
Unit
setParticle(Boolean particle)
-
-
Method Detail
-
getPosition
Vec2 getPosition()
-
setPosition
Unit setPosition(Vec2 position)
-
getVelocity
Vec2 getVelocity()
-
setVelocity
Unit setVelocity(Vec2 velocity)
-
getAngularVelocity
Double getAngularVelocity()
-
setAngularVelocity
Unit setAngularVelocity(Double angularVelocity)
-
getRestitution
Double getRestitution()
-
setRestitution
Unit setRestitution(Double restitution)
-
getDensity
Double getDensity()
-
setDensity
Unit setDensity(Double density)
Sets the density and calculates the mass depending on it.
- Parameters:
density
- the new value for density.
-
getInvMass
Double getInvMass()
-
setInvMass
Unit setInvMass(Double invMass)
-
getInertia
Double getInertia()
-
setInertia
Unit setInertia(Double inertia)
-
getInvInertia
Double getInvInertia()
-
setInvInertia
Unit setInvInertia(Double invInertia)
-
getAngularDampening
Double getAngularDampening()
-
setAngularDampening
Unit setAngularDampening(Double angularDampening)
-
getLinearDampening
Double getLinearDampening()
-
setLinearDampening
Unit setLinearDampening(Double linearDampening)
-
getAffectedByGravity
Boolean getAffectedByGravity()
-
setAffectedByGravity
Unit setAffectedByGravity(Boolean affectedByGravity)
-
getParticle
Boolean getParticle()
-
setParticle
Unit setParticle(Boolean particle)
-
-
-
-