|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.eside.flingbox.physics.PhysicBody
edu.eside.flingbox.physics.PhysicPolygon
public class PhysicPolygon
Implements physics properties for polygols.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class edu.eside.flingbox.physics.PhysicBody |
---|
PhysicBody.OnMovementListener |
Field Summary | |
---|---|
static float |
INFINITE_MASS
Objects with INFINITE_MASS should be impossible to move |
Fields inherited from class edu.eside.flingbox.physics.PhysicBody |
---|
INFINITE_ANGULAR_MASS |
Constructor Summary | |
---|---|
PhysicPolygon(Vector2D[] points,
float bodyMass,
Vector2D position,
PhysicBody.OnMovementListener listener)
Constructor physics for default polygon. |
Method Summary | |
---|---|
void |
applyImpulse(Vector2D impulse)
Applies force to the object |
boolean |
contains(Vector2D p)
Check if point is contained by the polygon |
float |
getBodyMass()
|
float |
getDynamicFrictionCoeficient()
|
Vector2D |
getImpulse()
|
Vector2D |
getPosition()
|
float |
getRestitutionCoeficient()
|
float |
getStaticFrictionCoeficient()
|
boolean |
isEnabled()
|
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)
|
Methods inherited from class edu.eside.flingbox.physics.PhysicBody |
---|
applyImpulse, getAngle, getAngularMass, getAngularVelocity, getCollider, getDensity, getEnergy, getVelocity, isFixed, onUpdateBody, setAngle, setBodyFixed, setVelocity |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float INFINITE_MASS
Constructor Detail |
---|
public PhysicPolygon(Vector2D[] points, float bodyMass, Vector2D position, PhysicBody.OnMovementListener listener)
points
- polygon's pointsbodyMass
- polygon's massposition
- Polygon's start positionlistener
- Lister to be called when movement occursMethod Detail |
---|
public boolean contains(Vector2D p)
p
- point to check
public void setDensity(float density)
setDensity
in class PhysicBody
public void applyImpulse(Vector2D impulse)
force
- Forcedt
- time period while force is appliedpublic 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 |