public class Breakable
extends java.lang.Object
Breakable.Manager as ContactListener.Breakable.Manager.destroy() after every world time step.Breakable.Manager.destroy(Fixture) and Breakable.Manager.destroy(Body) methods.| Modifier and Type | Class and Description |
|---|---|
static interface |
Breakable.Callback
a callback for a
Breakable if its container (body or fixture) was destroyed (for example to play a sound) |
static class |
Breakable.Manager
Manages the
Breakables of the Contacts it receives. |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
breakBody
if the fixture's body (in case the Breakable is used for a fixture) should be destroyed if the fixture is destroyed (false by default)
|
private boolean |
breakBodyWithoutFixtures
if the fixture's body (in case the Breakable is used for a fixture) should be destroyed if the fixture is destroyed and it was the body's last one (true by default)
|
private Breakable.Callback |
callback
the
Breakable.Callback called when the Breakable's container is destroyed |
private float |
normalResistance
how much force the Breakable can bear
|
private float |
reactionForceLength2Resistance
the max
squared length of the reaction force |
private com.badlogic.gdx.math.Vector2 |
reactionForceResistance
how much
reaction force the Breakable can bear |
private float |
reactionTorqueResistance
how much
reaction torque the Breakable can bear |
private float |
tangentResistance
how much friction the Breakable can bear
|
| Constructor and Description |
|---|
Breakable(Breakable other)
constructs a new Breakable exactly like the given other one
|
Breakable(float normalResistance,
float tangentResistance) |
Breakable(float normalResistance,
float tangentResistance,
boolean breakBody) |
Breakable(float normalResistance,
float tangentResistance,
boolean breakBody,
boolean breakBodyWithoutFixtures) |
Breakable(float normalResistance,
float tangentResistance,
boolean breakBody,
Breakable.Callback callback) |
Breakable(float normalResistance,
float tangentResistance,
Breakable.Callback callback) |
Breakable(float normalResistance,
float tangentResistance,
com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance,
boolean breakBody,
boolean breakBodyWithoutFixtures,
Breakable.Callback callback) |
Breakable(com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance) |
Breakable(com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance,
boolean breakBody) |
Breakable(com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance,
boolean breakBody,
boolean breakBodyWithoutFixtures) |
Breakable(com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance,
boolean breakBody,
Breakable.Callback callback) |
Breakable(com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance,
Breakable.Callback callback) |
| Modifier and Type | Method and Description |
|---|---|
Breakable.Callback |
getCallback() |
float |
getNormalResistance() |
float |
getReactionForceLength2Resistance() |
com.badlogic.gdx.math.Vector2 |
getReactionForceResistance() |
float |
getReactionTorqueResistance() |
float |
getTangentResistance() |
boolean |
isBreakBody() |
boolean |
isBreakBodyWithoutFixtures() |
void |
setBreakBody(boolean breakBody) |
void |
setBreakBodyWithoutFixtures(boolean breakBodyWithoutFixtures) |
void |
setCallback(Breakable.Callback callback) |
void |
setNormalResistance(float normalResistance) |
void |
setReactionForceLength2Resistance(float reactionForceLength2Resistance) |
void |
setReactionForceResistance(com.badlogic.gdx.math.Vector2 reactionForceResistance) |
void |
setReactionTorqueResistance(float reactionTorqueResistance) |
void |
setTangentResistance(float tangentResistance) |
private float normalResistance
private float tangentResistance
private final com.badlogic.gdx.math.Vector2 reactionForceResistance
reaction force the Breakable can bearprivate float reactionForceLength2Resistance
squared length of the reaction forceprivate float reactionTorqueResistance
reaction torque the Breakable can bearprivate boolean breakBody
private boolean breakBodyWithoutFixtures
private Breakable.Callback callback
Breakable.Callback called when the Breakable's container is destroyedpublic Breakable(float normalResistance,
float tangentResistance)
Breakable(float, float, boolean)public Breakable(float normalResistance,
float tangentResistance,
boolean breakBody)
public Breakable(float normalResistance,
float tangentResistance,
boolean breakBody,
boolean breakBodyWithoutFixtures)
public Breakable(float normalResistance,
float tangentResistance,
Breakable.Callback callback)
public Breakable(float normalResistance,
float tangentResistance,
boolean breakBody,
Breakable.Callback callback)
public Breakable(com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance)
public Breakable(com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance,
boolean breakBody)
public Breakable(com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance,
boolean breakBody,
boolean breakBodyWithoutFixtures)
public Breakable(com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance,
Breakable.Callback callback)
public Breakable(com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance,
boolean breakBody,
Breakable.Callback callback)
public Breakable(float normalResistance,
float tangentResistance,
com.badlogic.gdx.math.Vector2 reactionForceResistance,
float reactionForceLength2Resistance,
float reactionTorqueResistance,
boolean breakBody,
boolean breakBodyWithoutFixtures,
Breakable.Callback callback)
normalResistance - the normalResistancetangentResistance - the tangentResistancereactionForceResistance - the reactionForceResistancereactionForceLength2Resistance - the reactionForceLength2ResistancereactionTorqueResistance - the reactionTorqueResistancebreakBody - the breakBodybreakBodyWithoutFixtures - the breakBodyWithoutFixturescallback - the callbackpublic Breakable(Breakable other)
public float getNormalResistance()
normalResistancepublic void setNormalResistance(float normalResistance)
normalResistance - the normalResistance to setpublic float getTangentResistance()
tangentResistancepublic void setTangentResistance(float tangentResistance)
tangentResistance - the tangentResistance to setpublic com.badlogic.gdx.math.Vector2 getReactionForceResistance()
reactionForceResistancepublic void setReactionForceResistance(com.badlogic.gdx.math.Vector2 reactionForceResistance)
reactionForceResistance - the reactionForceResistance to setpublic float getReactionForceLength2Resistance()
reactionForceLength2Resistancepublic void setReactionForceLength2Resistance(float reactionForceLength2Resistance)
reactionForceLength2Resistance - the reactionForceLength2Resistance to setpublic float getReactionTorqueResistance()
reactionTorqueResistancepublic void setReactionTorqueResistance(float reactionTorqueResistance)
reactionTorqueResistance - the reactionTorqueResistance to setpublic boolean isBreakBody()
breakBodypublic void setBreakBody(boolean breakBody)
breakBody - the breakBody to setpublic boolean isBreakBodyWithoutFixtures()
breakBodyWithoutFixturespublic void setBreakBodyWithoutFixtures(boolean breakBodyWithoutFixtures)
breakBodyWithoutFixtures - the breakBodyWithoutFixtures to setpublic Breakable.Callback getCallback()
callbackpublic void setCallback(Breakable.Callback callback)
callback - the callback to set