Package net.dermetfan.gdx.physics.box2d
Interface Breakable.Callback
- All Known Implementing Classes:
Breakable.Callback.Adapter
- Enclosing class:
- Breakable
public static interface Breakable.Callback
a callback for a
Breakable
if its container (body or fixture) was destroyed (for example to play a sound)-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Breakable.Callback.Adapter
Returns false in all methods implemented fromBreakable.Callback
. -
Method Summary
Modifier and Type Method Description boolean
destroyed(com.badlogic.gdx.physics.box2d.Body body, Breakable breakable)
called byBreakable.Manager.destroy(Body)
boolean
destroyed(com.badlogic.gdx.physics.box2d.Fixture fixture, Breakable breakable)
called byBreakable.Manager.destroy(Fixture)
boolean
destroyed(com.badlogic.gdx.physics.box2d.Joint joint, Breakable breakable)
called byBreakable.Manager.destroy(Joint)
boolean
strained(com.badlogic.gdx.physics.box2d.Fixture fixture, Breakable breakable, com.badlogic.gdx.physics.box2d.Contact contact, com.badlogic.gdx.physics.box2d.ContactImpulse impulse, float normalImpulse, float tangentImpulse)
boolean
strained(com.badlogic.gdx.physics.box2d.Joint joint, Breakable breakable, com.badlogic.gdx.math.Vector2 reactionForce, float reactionTorque)
called byBreakable.Manager.strain(Joint, float)
-
Method Details
-
strained
boolean strained(com.badlogic.gdx.physics.box2d.Fixture fixture, Breakable breakable, com.badlogic.gdx.physics.box2d.Contact contact, com.badlogic.gdx.physics.box2d.ContactImpulse impulse, float normalImpulse, float tangentImpulse)- Parameters:
fixture
- the strained fixturebreakable
- the Breakable instance causing this callback to be calledcontact
- the straining contactimpulse
- the straining ContactImpulsenormalImpulse
- the sum of the normal impulses of impulsetangentImpulse
- the sum of the tangent impulses of impulse- Returns:
- true to cancel the destruction if one was going to occur
-
strained
boolean strained(com.badlogic.gdx.physics.box2d.Joint joint, Breakable breakable, com.badlogic.gdx.math.Vector2 reactionForce, float reactionTorque)called byBreakable.Manager.strain(Joint, float)
- Parameters:
joint
- the strainedJoint
breakable
- theBreakable
instance causing this callback to be calledreactionForce
- thereaction force
- Returns:
- true to cancel the destruction if one was going to occur
-
destroyed
called byBreakable.Manager.destroy(Body)
- Returns:
- true to cancel the destruction
-
destroyed
called byBreakable.Manager.destroy(Fixture)
- Returns:
- true to cancel the destruction
-
destroyed
called byBreakable.Manager.destroy(Joint)
- Returns:
- true to cancel the destruction
-