-
- 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 Vec2positionprivate Vec2velocityprivate Vec2forceprivate DoubleangularVelocityprivate Doubletorqueprivate Doublerestitutionprivate Doubledensityprivate Doublemassprivate DoubleinvMassprivate Doubleinertiaprivate DoubleinvInertiaprivate DoubleangularDampeningprivate DoublelinearDampeningprivate BooleanaffectedByGravityprivate Booleanparticle
-
Constructor Summary
Constructors Constructor Description PhysicalBody(Double x, Double y)
-
Method Summary
Modifier and Type Method Description Vec2getPosition()UnitsetPosition(Vec2 position)Vec2getVelocity()UnitsetVelocity(Vec2 velocity)Vec2getForce()UnitsetForce(Vec2 force)DoublegetAngularVelocity()UnitsetAngularVelocity(Double angularVelocity)DoublegetTorque()UnitsetTorque(Double torque)DoublegetRestitution()UnitsetRestitution(Double restitution)DoublegetDensity()UnitsetDensity(Double density)Sets the density and calculates the mass depending on it. DoublegetMass()UnitsetMass(Double mass)DoublegetInvMass()UnitsetInvMass(Double invMass)DoublegetInertia()UnitsetInertia(Double inertia)DoublegetInvInertia()UnitsetInvInertia(Double invInertia)DoublegetAngularDampening()UnitsetAngularDampening(Double angularDampening)DoublegetLinearDampening()UnitsetLinearDampening(Double linearDampening)BooleangetAffectedByGravity()UnitsetAffectedByGravity(Boolean affectedByGravity)BooleangetParticle()UnitsetParticle(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)
-
-
-
-