|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.eside.flingbox.physics.PhysicBody
public abstract class PhysicBody
Abstract class with handles all properties that any physical body should have.
Nested Class Summary | |
---|---|
static interface |
PhysicBody.OnMovementListener
Implements on move callback. |
Field Summary | |
---|---|
static float |
INFINITE_ANGULAR_MASS
Objects with INFINITE_ANGULAR_MASS should be imposible to rotate |
static float |
INFINITE_MASS
Objects with INFINITE_MASS should be impossible to move |
Method Summary | |
---|---|
void |
applyImpulse(Vector2D impulse)
Applies force to the object |
void |
applyImpulse(Vector2D impulse,
Vector2D applicationPoint)
Applies force to the object |
boolean |
contains(Vector2D p)
Check if point is contained by the polygon |
float |
getAngle()
|
float |
getAngularMass()
|
float |
getAngularVelocity()
|
float |
getBodyMass()
|
Collider |
getCollider()
|
float |
getDensity()
|
float |
getDynamicFrictionCoeficient()
|
float |
getEnergy()
Computes current object's energy |
Vector2D |
getImpulse()
|
Vector2D |
getPosition()
|
float |
getRestitutionCoeficient()
|
float |
getStaticFrictionCoeficient()
|
Vector2D |
getVelocity()
|
boolean |
isEnabled()
|
boolean |
isFixed()
|
void |
onUpdateBody(float time)
Called to refresh object's position |
void |
setAngle(float angle)
|
void |
setBodyFixed(boolean fixed)
Fixs body, making impossible to move |
void |
setDensity(float density)
|
void |
setDynamicFrictionCoeficient(float f)
|
void |
setEnabled(boolean doEnable)
Sets if object is enabled or not |
void |
setPosition(float x,
float y)
|
void |
setPosition(Vector2D v)
|
void |
setRestitutionCoeficient(float restCoef)
Sets body's Restitution Coeficient |
void |
setStaticFrictionCoeficient(float f)
|
void |
setVelocity(float vx,
float vy)
Sets velocity components |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float INFINITE_ANGULAR_MASS
public static final float INFINITE_MASS
Method Detail |
---|
public void onUpdateBody(float time)
time
- in seconds since last updatepublic void applyImpulse(Vector2D impulse, Vector2D applicationPoint)
force
- ForceapplicationPoint
- relative point in wich force is applieddt
- time period while force is appliedpublic void setBodyFixed(boolean fixed)
public boolean isFixed()
public float getAngularMass()
public float getDensity()
public void setDensity(float density)
public Vector2D getVelocity()
public void setVelocity(float vx, float vy)
vx
- vy
- public float getAngularVelocity()
public float getAngle()
public void setAngle(float angle)
angle
- new object's anglepublic float getEnergy()
public Collider getCollider()
public void applyImpulse(Vector2D impulse)
force
- Forcedt
- time period while force is appliedpublic boolean contains(Vector2D p)
p
- point to check
public Vector2D getImpulse()
public boolean isEnabled()
public void setEnabled(boolean doEnable)
public Vector2D getPosition()
getPosition
in interface PositionComparator.Positionable
public void setPosition(float x, float y)
position
- new postion of the objectpublic void setPosition(Vector2D v)
position
- new postion of the objectpublic float getBodyMass()
public float getDynamicFrictionCoeficient()
public void setDynamicFrictionCoeficient(float f)
public float getStaticFrictionCoeficient()
public void setStaticFrictionCoeficient(float f)
public float getRestitutionCoeficient()
public void setRestitutionCoeficient(float restCoef)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |