public class Box2DUtils
extends java.lang.Object
Bodies, Fixtures and Shapes| Modifier and Type | Class and Description |
|---|---|
static class |
Box2DUtils.PreconditionCheck
checks if Box2D's preconditions are met to avoid native crashes
|
static class |
Box2DUtils.Settings
b2Settings.h
|
static class |
Box2DUtils.ShapeCache
cached method results
|
| Modifier and Type | Field and Description |
|---|---|
static boolean |
autoCache
if shapes should automatically be cached when they are inspected for the first time
|
static com.badlogic.gdx.utils.ObjectMap<com.badlogic.gdx.physics.box2d.Shape,Box2DUtils.ShapeCache> |
cache
Cached
Shapes and their Box2DUtils.ShapeCache. |
static Box2DUtils.PreconditionCheck |
check
the PreconditionCheck to use
|
private static com.badlogic.gdx.math.Polygon |
polygon
for internal, temporary usage
|
private static com.badlogic.gdx.math.Vector2 |
vec2_0
for internal, temporary usage
|
private static com.badlogic.gdx.math.Vector2 |
vec2_1
for internal, temporary usage
|
| Constructor and Description |
|---|
Box2DUtils() |
| Modifier and Type | Method and Description |
|---|---|
static com.badlogic.gdx.math.Rectangle |
aabb(com.badlogic.gdx.physics.box2d.Body body) |
static com.badlogic.gdx.math.Rectangle |
aabb(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.math.Rectangle aabb) |
static com.badlogic.gdx.math.Rectangle |
aabb(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static com.badlogic.gdx.math.Rectangle |
aabb(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Rectangle aabb) |
static com.badlogic.gdx.math.Rectangle |
aabb(com.badlogic.gdx.physics.box2d.Shape shape,
float rotation) |
static com.badlogic.gdx.math.Rectangle |
aabb(com.badlogic.gdx.physics.box2d.Shape shape,
float rotation,
com.badlogic.gdx.math.Rectangle aabb) |
static com.badlogic.gdx.math.Polyline |
as(com.badlogic.gdx.physics.box2d.ChainShape shape,
com.badlogic.gdx.math.Polyline polyline) |
static com.badlogic.gdx.math.Circle |
as(com.badlogic.gdx.physics.box2d.CircleShape shape,
com.badlogic.gdx.math.Circle circle) |
static com.badlogic.gdx.math.Polyline |
as(com.badlogic.gdx.physics.box2d.EdgeShape shape,
com.badlogic.gdx.math.Polyline polyline) |
static com.badlogic.gdx.math.Circle |
as(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Circle circle)
sets the given Circle to the Fixture's CircleShape, in world coordinates
|
static com.badlogic.gdx.math.Polygon |
as(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Polygon polygon)
sets the given Polygon to the Fixture's PolygonShape, in world coordinates
|
static com.badlogic.gdx.math.Polyline |
as(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Polyline polyline)
sets the given Polyline to the given Fixture's EdgeShape or ChainShape, in world coordinates
|
static com.badlogic.gdx.math.Polygon |
as(com.badlogic.gdx.physics.box2d.PolygonShape shape,
com.badlogic.gdx.math.Polygon polygon) |
static Box2DUtils.ShapeCache |
cache(com.badlogic.gdx.physics.box2d.Shape shape) |
static com.badlogic.gdx.physics.box2d.Body |
clone(com.badlogic.gdx.physics.box2d.Body body)
clones a Body (without deep copying the Shapes of its Fixtures)
|
static com.badlogic.gdx.physics.box2d.Body |
clone(com.badlogic.gdx.physics.box2d.Body body,
boolean shapes)
clones a Body
|
static com.badlogic.gdx.physics.box2d.Fixture |
clone(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.physics.box2d.Body body)
clones a Fixture (without deep copying its Shape)
|
static com.badlogic.gdx.physics.box2d.Fixture |
clone(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.physics.box2d.Body body,
boolean shape)
clones a Fixture
|
static <T extends com.badlogic.gdx.physics.box2d.Joint> |
clone(T joint) |
static <T extends com.badlogic.gdx.physics.box2d.Shape> |
clone(T shape)
creates a deep copy of a Shape
|
static com.badlogic.gdx.physics.box2d.BodyDef |
createDef(com.badlogic.gdx.physics.box2d.Body body) |
static com.badlogic.gdx.physics.box2d.joints.DistanceJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.DistanceJoint joint) |
static com.badlogic.gdx.physics.box2d.FixtureDef |
createDef(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static com.badlogic.gdx.physics.box2d.joints.FrictionJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.FrictionJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.GearJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.GearJoint joint) |
static com.badlogic.gdx.physics.box2d.JointDef |
createDef(com.badlogic.gdx.physics.box2d.Joint joint) |
static com.badlogic.gdx.physics.box2d.joints.MotorJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.MotorJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.MouseJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.MouseJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.PrismaticJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.PrismaticJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.PulleyJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.PulleyJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.RevoluteJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.RevoluteJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.RopeJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.RopeJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.WeldJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.WeldJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.WheelJointDef |
createDef(com.badlogic.gdx.physics.box2d.joints.WheelJoint joint) |
static void |
destroyFixtures(com.badlogic.gdx.physics.box2d.Body body)
destroys all fixtures of the given body |
static void |
destroyFixtures(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.utils.Array<com.badlogic.gdx.physics.box2d.Fixture> exclude)
destroys all fixtures of the given body except the given ones |
static void |
destroyFixtures(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.physics.box2d.Fixture... exclude) |
static void |
destroyFixtures(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.physics.box2d.Fixture exclude) |
static boolean |
equals(com.badlogic.gdx.physics.box2d.Filter a,
com.badlogic.gdx.physics.box2d.Filter b) |
static boolean |
equals(com.badlogic.gdx.physics.box2d.MassData a,
com.badlogic.gdx.physics.box2d.MassData b) |
static boolean |
equals(com.badlogic.gdx.physics.box2d.Transform a,
com.badlogic.gdx.physics.box2d.Transform b) |
static float[][] |
fixtureVertices(com.badlogic.gdx.physics.box2d.Body body) |
static float |
height(com.badlogic.gdx.physics.box2d.Body body) |
static float |
height(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static float |
height(com.badlogic.gdx.physics.box2d.Shape shape) |
private static float |
height0(com.badlogic.gdx.physics.box2d.Shape shape) |
static float |
maxX(com.badlogic.gdx.physics.box2d.Body body) |
static float |
maxX(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static float |
maxX(com.badlogic.gdx.physics.box2d.Shape shape) |
private static float |
maxX0(com.badlogic.gdx.physics.box2d.Shape shape) |
static float |
maxXWorld(com.badlogic.gdx.physics.box2d.Body body) |
static float |
maxXWorld(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static float |
maxY(com.badlogic.gdx.physics.box2d.Body body) |
static float |
maxY(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static float |
maxY(com.badlogic.gdx.physics.box2d.Shape shape) |
private static float |
maxY0(com.badlogic.gdx.physics.box2d.Shape shape) |
static float |
maxYWorld(com.badlogic.gdx.physics.box2d.Body body) |
static float |
maxYWorld(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static float |
minX(com.badlogic.gdx.physics.box2d.Body body) |
static float |
minX(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static float |
minX(com.badlogic.gdx.physics.box2d.Shape shape) |
private static float |
minX0(com.badlogic.gdx.physics.box2d.Shape shape) |
static float |
minXWorld(com.badlogic.gdx.physics.box2d.Body body) |
static float |
minXWorld(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static float |
minY(com.badlogic.gdx.physics.box2d.Body body) |
static float |
minY(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static float |
minY(com.badlogic.gdx.physics.box2d.Shape shape) |
private static float |
minY0(com.badlogic.gdx.physics.box2d.Shape shape) |
static float |
minYWorld(com.badlogic.gdx.physics.box2d.Body body) |
static float |
minYWorld(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static com.badlogic.gdx.math.Vector2 |
position(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static com.badlogic.gdx.math.Vector2 |
position(com.badlogic.gdx.physics.box2d.Shape shape,
com.badlogic.gdx.physics.box2d.Body body) |
static com.badlogic.gdx.math.Vector2 |
positionRelative(com.badlogic.gdx.physics.box2d.CircleShape shape) |
static com.badlogic.gdx.math.Vector2 |
positionRelative(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static com.badlogic.gdx.math.Vector2 |
positionRelative(com.badlogic.gdx.physics.box2d.Shape shape,
float rotation) |
static com.badlogic.gdx.physics.box2d.BodyDef |
reset(com.badlogic.gdx.physics.box2d.BodyDef bodyDef) |
static com.badlogic.gdx.physics.box2d.FixtureDef |
reset(com.badlogic.gdx.physics.box2d.FixtureDef fixtureDef) |
static com.badlogic.gdx.physics.box2d.BodyDef |
set(com.badlogic.gdx.physics.box2d.BodyDef bodyDef,
com.badlogic.gdx.physics.box2d.Body body) |
static com.badlogic.gdx.physics.box2d.joints.DistanceJointDef |
set(com.badlogic.gdx.physics.box2d.joints.DistanceJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.DistanceJoint joint) |
static com.badlogic.gdx.physics.box2d.FixtureDef |
set(com.badlogic.gdx.physics.box2d.FixtureDef fixtureDef,
com.badlogic.gdx.physics.box2d.Fixture fixture) |
static com.badlogic.gdx.physics.box2d.joints.FrictionJointDef |
set(com.badlogic.gdx.physics.box2d.joints.FrictionJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.FrictionJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.GearJointDef |
set(com.badlogic.gdx.physics.box2d.joints.GearJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.GearJoint joint) |
static com.badlogic.gdx.physics.box2d.JointDef |
set(com.badlogic.gdx.physics.box2d.JointDef jointDef,
com.badlogic.gdx.physics.box2d.Joint joint) |
static com.badlogic.gdx.physics.box2d.joints.MotorJointDef |
set(com.badlogic.gdx.physics.box2d.joints.MotorJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.MotorJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.MouseJointDef |
set(com.badlogic.gdx.physics.box2d.joints.MouseJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.MouseJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.PrismaticJointDef |
set(com.badlogic.gdx.physics.box2d.joints.PrismaticJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.PrismaticJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.PulleyJointDef |
set(com.badlogic.gdx.physics.box2d.joints.PulleyJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.PulleyJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.RevoluteJointDef |
set(com.badlogic.gdx.physics.box2d.joints.RevoluteJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.RevoluteJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.RopeJointDef |
set(com.badlogic.gdx.physics.box2d.joints.RopeJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.RopeJoint joint) |
static com.badlogic.gdx.physics.box2d.joints.WeldJointDef |
set(com.badlogic.gdx.physics.box2d.joints.WeldJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.WeldJoint joint)
Note: The reference angle cannot be set due to the Box2D API not providing it.
|
static com.badlogic.gdx.physics.box2d.joints.WheelJointDef |
set(com.badlogic.gdx.physics.box2d.joints.WheelJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.WheelJoint joint) |
static void |
setSensor(com.badlogic.gdx.physics.box2d.Body body,
boolean sensor)
sets the
sensor flags of all of the given Body's Fixtures |
static com.badlogic.gdx.math.Vector2 |
size(com.badlogic.gdx.physics.box2d.Body body) |
static com.badlogic.gdx.math.Vector2 |
size(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static com.badlogic.gdx.math.Vector2 |
size(com.badlogic.gdx.physics.box2d.Shape shape) |
private static com.badlogic.gdx.math.Vector2 |
size0(com.badlogic.gdx.physics.box2d.Shape shape) |
static boolean |
split(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.math.Vector2 a,
com.badlogic.gdx.math.Vector2 b,
net.dermetfan.utils.Pair<com.badlogic.gdx.physics.box2d.Body,com.badlogic.gdx.physics.box2d.Body> store) |
static boolean |
split(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Vector2 a,
com.badlogic.gdx.math.Vector2 b,
com.badlogic.gdx.physics.box2d.Body aBody,
com.badlogic.gdx.physics.box2d.Body bBody,
net.dermetfan.utils.Pair<com.badlogic.gdx.physics.box2d.Fixture,com.badlogic.gdx.physics.box2d.Fixture> store) |
static boolean |
split(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Vector2 a,
com.badlogic.gdx.math.Vector2 b,
net.dermetfan.utils.Pair<com.badlogic.gdx.physics.box2d.FixtureDef,com.badlogic.gdx.physics.box2d.FixtureDef> store) |
static <T extends com.badlogic.gdx.physics.box2d.Shape> |
split(T shape,
com.badlogic.gdx.math.Vector2 a,
com.badlogic.gdx.math.Vector2 b,
net.dermetfan.utils.Pair<T,T> store)
splits the given Shape using the segment described by the two given Vector2s
|
static float[] |
toLocalVertices(float[] vertices,
com.badlogic.gdx.physics.box2d.Body body) |
static float[] |
toLocalVertices(float[] vertices,
int offset,
int length,
com.badlogic.gdx.physics.box2d.Body body) |
static float[] |
toWorldVertices(float[] vertices,
com.badlogic.gdx.physics.box2d.Body body) |
static float[] |
toWorldVertices(float[] vertices,
int offset,
int length,
com.badlogic.gdx.physics.box2d.Body body) |
static float[] |
vertices(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static float[] |
vertices(com.badlogic.gdx.physics.box2d.Shape shape) |
private static float[] |
vertices0(com.badlogic.gdx.physics.box2d.Shape shape) |
static int |
weld(float[] vertices) |
static int |
weld(float[] vertices,
int offset,
int length)
welds the given vertices together the way
PolygonShape.set(float[]) does |
static int |
weld(com.badlogic.gdx.utils.FloatArray vertices) |
static float |
width(com.badlogic.gdx.physics.box2d.Body body) |
static float |
width(com.badlogic.gdx.physics.box2d.Fixture fixture) |
static float |
width(com.badlogic.gdx.physics.box2d.Shape shape) |
private static float |
width0(com.badlogic.gdx.physics.box2d.Shape shape) |
public static final com.badlogic.gdx.utils.ObjectMap<com.badlogic.gdx.physics.box2d.Shape,Box2DUtils.ShapeCache> cache
Shapes and their Box2DUtils.ShapeCache. You should clear this when you don't use the shapes anymore.public static boolean autoCache
public static Box2DUtils.PreconditionCheck check
private static final com.badlogic.gdx.math.Vector2 vec2_0
private static final com.badlogic.gdx.math.Vector2 vec2_1
private static final com.badlogic.gdx.math.Polygon polygon
public static Box2DUtils.ShapeCache cache(com.badlogic.gdx.physics.box2d.Shape shape)
shape - the Shape to create a new Box2DUtils.ShapeCache for that will be added to cacheprivate static float[] vertices0(com.badlogic.gdx.physics.box2d.Shape shape)
shape - the Shape which vertices to get (for circles, the bounding box vertices will be returned)private static float minX0(com.badlogic.gdx.physics.box2d.Shape shape)
private static float minY0(com.badlogic.gdx.physics.box2d.Shape shape)
private static float maxX0(com.badlogic.gdx.physics.box2d.Shape shape)
private static float maxY0(com.badlogic.gdx.physics.box2d.Shape shape)
private static float width0(com.badlogic.gdx.physics.box2d.Shape shape)
private static float height0(com.badlogic.gdx.physics.box2d.Shape shape)
private static com.badlogic.gdx.math.Vector2 size0(com.badlogic.gdx.physics.box2d.Shape shape)
public static float[] vertices(com.badlogic.gdx.physics.box2d.Shape shape)
public static float minX(com.badlogic.gdx.physics.box2d.Shape shape)
public static float minY(com.badlogic.gdx.physics.box2d.Shape shape)
public static float maxX(com.badlogic.gdx.physics.box2d.Shape shape)
public static float maxY(com.badlogic.gdx.physics.box2d.Shape shape)
public static float width(com.badlogic.gdx.physics.box2d.Shape shape)
public static float height(com.badlogic.gdx.physics.box2d.Shape shape)
public static com.badlogic.gdx.math.Vector2 size(com.badlogic.gdx.physics.box2d.Shape shape)
Vector2 representing the size of the given Shapepublic static float[] vertices(com.badlogic.gdx.physics.box2d.Fixture fixture)
vertices(Shape)public static float minX(com.badlogic.gdx.physics.box2d.Fixture fixture)
minX(Shape)public static float minY(com.badlogic.gdx.physics.box2d.Fixture fixture)
minY(Shape)public static float maxX(com.badlogic.gdx.physics.box2d.Fixture fixture)
maxX(Shape)public static float maxY(com.badlogic.gdx.physics.box2d.Fixture fixture)
maxY(Shape)public static float minXWorld(com.badlogic.gdx.physics.box2d.Fixture fixture)
public static float minYWorld(com.badlogic.gdx.physics.box2d.Fixture fixture)
public static float maxXWorld(com.badlogic.gdx.physics.box2d.Fixture fixture)
public static float maxYWorld(com.badlogic.gdx.physics.box2d.Fixture fixture)
public static float width(com.badlogic.gdx.physics.box2d.Fixture fixture)
width(Shape)public static float height(com.badlogic.gdx.physics.box2d.Fixture fixture)
height(Shape)public static com.badlogic.gdx.math.Vector2 size(com.badlogic.gdx.physics.box2d.Fixture fixture)
size(Shape)public static float[][] fixtureVertices(com.badlogic.gdx.physics.box2d.Body body)
public static float minX(com.badlogic.gdx.physics.box2d.Body body)
public static float minY(com.badlogic.gdx.physics.box2d.Body body)
public static float maxX(com.badlogic.gdx.physics.box2d.Body body)
public static float maxY(com.badlogic.gdx.physics.box2d.Body body)
public static float minXWorld(com.badlogic.gdx.physics.box2d.Body body)
public static float minYWorld(com.badlogic.gdx.physics.box2d.Body body)
public static float maxXWorld(com.badlogic.gdx.physics.box2d.Body body)
public static float maxYWorld(com.badlogic.gdx.physics.box2d.Body body)
public static float width(com.badlogic.gdx.physics.box2d.Body body)
public static float height(com.badlogic.gdx.physics.box2d.Body body)
public static com.badlogic.gdx.math.Vector2 size(com.badlogic.gdx.physics.box2d.Body body)
public static com.badlogic.gdx.math.Vector2 positionRelative(com.badlogic.gdx.physics.box2d.CircleShape shape)
positionRelative(Shape, float),
CircleShape.getPosition()public static com.badlogic.gdx.math.Vector2 positionRelative(com.badlogic.gdx.physics.box2d.Shape shape,
float rotation)
public static com.badlogic.gdx.math.Vector2 position(com.badlogic.gdx.physics.box2d.Shape shape,
com.badlogic.gdx.physics.box2d.Body body)
shape - the Shape which position to getbody - the Body the given Shape is attached topublic static com.badlogic.gdx.math.Vector2 positionRelative(com.badlogic.gdx.physics.box2d.Fixture fixture)
positionRelative(Shape, float)public static com.badlogic.gdx.math.Vector2 position(com.badlogic.gdx.physics.box2d.Fixture fixture)
position(Shape, Body)public static com.badlogic.gdx.math.Rectangle aabb(com.badlogic.gdx.physics.box2d.Shape shape,
float rotation,
com.badlogic.gdx.math.Rectangle aabb)
shape - the Shape which AABB to getaabb - the Rectangle to set to the given Shape's AABBpublic static com.badlogic.gdx.math.Rectangle aabb(com.badlogic.gdx.physics.box2d.Shape shape,
float rotation)
aabb(Shape, float, Rectangle)public static com.badlogic.gdx.math.Rectangle aabb(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Rectangle aabb)
aabb(Shape, float, Rectangle)public static com.badlogic.gdx.math.Rectangle aabb(com.badlogic.gdx.physics.box2d.Fixture fixture)
aabb(Fixture, Rectangle)public static com.badlogic.gdx.math.Rectangle aabb(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.math.Rectangle aabb)
public static com.badlogic.gdx.math.Rectangle aabb(com.badlogic.gdx.physics.box2d.Body body)
aabb(Body, Rectangle)public static com.badlogic.gdx.physics.box2d.Body clone(com.badlogic.gdx.physics.box2d.Body body)
copy(body, false)clone(Body, boolean)public static com.badlogic.gdx.physics.box2d.Body clone(com.badlogic.gdx.physics.box2d.Body body,
boolean shapes)
body - the Body to copyshapes - if the Shapes of the Fixtures of the given Body should be copied as wellpublic static com.badlogic.gdx.physics.box2d.Fixture clone(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.physics.box2d.Body body)
copy(fixture, body, false)clone(Fixture, Body, boolean)public static com.badlogic.gdx.physics.box2d.Fixture clone(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.physics.box2d.Body body,
boolean shape)
fixture - the Fixture to copybody - the Body to create a copy of the given fixture onshape - if the shape of the given Fixture should be deep copied as wellpublic static <T extends com.badlogic.gdx.physics.box2d.Shape> T clone(T shape)
shape - the Shape to clonepublic static <T extends com.badlogic.gdx.physics.box2d.Joint> T clone(T joint)
joint - the joint to clonepublic static com.badlogic.gdx.physics.box2d.BodyDef set(com.badlogic.gdx.physics.box2d.BodyDef bodyDef,
com.badlogic.gdx.physics.box2d.Body body)
bodyDef - the BodyDef to set according to the given Bodybody - the Body to set the given BodyDef accordingly topublic static com.badlogic.gdx.physics.box2d.FixtureDef set(com.badlogic.gdx.physics.box2d.FixtureDef fixtureDef,
com.badlogic.gdx.physics.box2d.Fixture fixture)
fixtureDef - the FixtureDef to set according to the given Fixturefixture - the Fixture to set the given FixtureDef accordingly topublic static com.badlogic.gdx.physics.box2d.JointDef set(com.badlogic.gdx.physics.box2d.JointDef jointDef,
com.badlogic.gdx.physics.box2d.Joint joint)
jointDef - the JointDef to set according to the given Jointjoint - the Joint to set the given JointDef accordingly topublic static com.badlogic.gdx.physics.box2d.joints.DistanceJointDef set(com.badlogic.gdx.physics.box2d.joints.DistanceJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.DistanceJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.joints.FrictionJointDef set(com.badlogic.gdx.physics.box2d.joints.FrictionJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.FrictionJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.joints.GearJointDef set(com.badlogic.gdx.physics.box2d.joints.GearJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.GearJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.joints.MotorJointDef set(com.badlogic.gdx.physics.box2d.joints.MotorJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.MotorJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.joints.MouseJointDef set(com.badlogic.gdx.physics.box2d.joints.MouseJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.MouseJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.joints.RevoluteJointDef set(com.badlogic.gdx.physics.box2d.joints.RevoluteJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.RevoluteJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.joints.PrismaticJointDef set(com.badlogic.gdx.physics.box2d.joints.PrismaticJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.PrismaticJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.joints.PulleyJointDef set(com.badlogic.gdx.physics.box2d.joints.PulleyJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.PulleyJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.joints.WheelJointDef set(com.badlogic.gdx.physics.box2d.joints.WheelJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.WheelJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.joints.WeldJointDef set(com.badlogic.gdx.physics.box2d.joints.WeldJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.WeldJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.joints.RopeJointDef set(com.badlogic.gdx.physics.box2d.joints.RopeJointDef jointDef,
com.badlogic.gdx.physics.box2d.joints.RopeJoint joint)
set(JointDef, Joint)public static com.badlogic.gdx.physics.box2d.BodyDef createDef(com.badlogic.gdx.physics.box2d.Body body)
body - the body for which to setup a new BodyDefBodyDef instance that can be used to clone the given bodypublic static com.badlogic.gdx.physics.box2d.FixtureDef createDef(com.badlogic.gdx.physics.box2d.Fixture fixture)
fixture - the fixture for which to setup a new FixtureDefFixtureDef instance that can be used to clone the given fixturepublic static com.badlogic.gdx.physics.box2d.JointDef createDef(com.badlogic.gdx.physics.box2d.Joint joint)
joint - the joint for which to create a new JointDefpublic static com.badlogic.gdx.physics.box2d.joints.DistanceJointDef createDef(com.badlogic.gdx.physics.box2d.joints.DistanceJoint joint)
createDef(Joint)public static com.badlogic.gdx.physics.box2d.joints.FrictionJointDef createDef(com.badlogic.gdx.physics.box2d.joints.FrictionJoint joint)
createDef(Joint)public static com.badlogic.gdx.physics.box2d.joints.GearJointDef createDef(com.badlogic.gdx.physics.box2d.joints.GearJoint joint)
createDef(Joint)public static com.badlogic.gdx.physics.box2d.joints.MotorJointDef createDef(com.badlogic.gdx.physics.box2d.joints.MotorJoint joint)
createDef(Joint)public static com.badlogic.gdx.physics.box2d.joints.MouseJointDef createDef(com.badlogic.gdx.physics.box2d.joints.MouseJoint joint)
createDef(Joint)public static com.badlogic.gdx.physics.box2d.joints.RevoluteJointDef createDef(com.badlogic.gdx.physics.box2d.joints.RevoluteJoint joint)
createDef(Joint)public static com.badlogic.gdx.physics.box2d.joints.PrismaticJointDef createDef(com.badlogic.gdx.physics.box2d.joints.PrismaticJoint joint)
createDef(Joint)public static com.badlogic.gdx.physics.box2d.joints.PulleyJointDef createDef(com.badlogic.gdx.physics.box2d.joints.PulleyJoint joint)
createDef(Joint)public static com.badlogic.gdx.physics.box2d.joints.WheelJointDef createDef(com.badlogic.gdx.physics.box2d.joints.WheelJoint joint)
createDef(Joint)public static com.badlogic.gdx.physics.box2d.joints.WeldJointDef createDef(com.badlogic.gdx.physics.box2d.joints.WeldJoint joint)
createDef(Joint)public static com.badlogic.gdx.physics.box2d.joints.RopeJointDef createDef(com.badlogic.gdx.physics.box2d.joints.RopeJoint joint)
createDef(Joint)public static boolean split(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.math.Vector2 a,
com.badlogic.gdx.math.Vector2 b,
net.dermetfan.utils.Pair<com.badlogic.gdx.physics.box2d.Body,com.badlogic.gdx.physics.box2d.Body> store)
body - the Body to splita - the first point of the segmentb - the second point of the segmentstore - The Pair to store the resulting bodies in. May be null.public static boolean split(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Vector2 a,
com.badlogic.gdx.math.Vector2 b,
com.badlogic.gdx.physics.box2d.Body aBody,
com.badlogic.gdx.physics.box2d.Body bBody,
net.dermetfan.utils.Pair<com.badlogic.gdx.physics.box2d.Fixture,com.badlogic.gdx.physics.box2d.Fixture> store)
fixture - the fixture to splita - the first point of the segmentb - the second point of the segmentaBody - The body the first resulting fixture will be created on. No fixture will be created if this is null.bBody - The body the second resulting fixture will be created on. No fixture will be created if this is null.store - The Pair to store the resulting fixtures in. May be null.split(Shape, Vector2, Vector2, Pair)public static boolean split(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Vector2 a,
com.badlogic.gdx.math.Vector2 b,
net.dermetfan.utils.Pair<com.badlogic.gdx.physics.box2d.FixtureDef,com.badlogic.gdx.physics.box2d.FixtureDef> store)
fixture - the fixture to splita - the first point of the segmentb - the second point of the segmentstore - the Pair to store the resulting FixtureDefs insplit(Shape, Vector2, Vector2, Pair)public static <T extends com.badlogic.gdx.physics.box2d.Shape> boolean split(T shape,
com.badlogic.gdx.math.Vector2 a,
com.badlogic.gdx.math.Vector2 b,
net.dermetfan.utils.Pair<T,T> store)
shape - the Shape to splita - The first point of the segment. Will be set to the first intersection with the given shape.b - The second point of the segment. Will be set to the second intersection with the given shape.store - the Pair to store the split Shapes inpublic static int weld(com.badlogic.gdx.utils.FloatArray vertices)
weld(float[], int, int)public static int weld(float[] vertices)
weld(float[], int, int)public static int weld(float[] vertices,
int offset,
int length)
PolygonShape.set(float[]) doespublic static com.badlogic.gdx.math.Circle as(com.badlogic.gdx.physics.box2d.CircleShape shape,
com.badlogic.gdx.math.Circle circle)
circle - the Circle to set according to the given shapepublic static com.badlogic.gdx.math.Polygon as(com.badlogic.gdx.physics.box2d.PolygonShape shape,
com.badlogic.gdx.math.Polygon polygon)
polygon - the Polygon which vertices to set according to the given shapepublic static com.badlogic.gdx.math.Polyline as(com.badlogic.gdx.physics.box2d.EdgeShape shape,
com.badlogic.gdx.math.Polyline polyline)
polyline - the Polyline which vertices to set according to the given shapepublic static com.badlogic.gdx.math.Polyline as(com.badlogic.gdx.physics.box2d.ChainShape shape,
com.badlogic.gdx.math.Polyline polyline)
polyline - the Polyline which vertices to set according to the given shapepublic static com.badlogic.gdx.math.Circle as(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Circle circle)
java.lang.IllegalArgumentException - if the Fixture's Shape is not of Shape.Type.Circleas(CircleShape, Circle)public static com.badlogic.gdx.math.Polygon as(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Polygon polygon)
java.lang.IllegalArgumentException - if the Fixture's Shape is not of Shape.Type.Polygonas(PolygonShape, Polygon)public static com.badlogic.gdx.math.Polyline as(com.badlogic.gdx.physics.box2d.Fixture fixture,
com.badlogic.gdx.math.Polyline polyline)
java.lang.IllegalArgumentException - if the Fixture's Shape is neither of Shape.Type.Edge nor Shape.Type.Chainas(EdgeShape, Polyline),
as(ChainShape, Polyline)public static float[] toWorldVertices(float[] vertices,
int offset,
int length,
com.badlogic.gdx.physics.box2d.Body body)
vertices - the local vertices to convert to world verticesbody - the Body relative to which the given vertices are localpublic static float[] toWorldVertices(float[] vertices,
com.badlogic.gdx.physics.box2d.Body body)
toWorldVertices(float[], int, int, Body)public static float[] toLocalVertices(float[] vertices,
int offset,
int length,
com.badlogic.gdx.physics.box2d.Body body)
vertices - the world vertices to convert to local verticesbody - the Body in which local coordinate system to convert the verticespublic static float[] toLocalVertices(float[] vertices,
com.badlogic.gdx.physics.box2d.Body body)
toLocalVertices(float[], int, int, Body)public static boolean equals(com.badlogic.gdx.physics.box2d.Transform a,
com.badlogic.gdx.physics.box2d.Transform b)
values equalpublic static boolean equals(com.badlogic.gdx.physics.box2d.MassData a,
com.badlogic.gdx.physics.box2d.MassData b)
public static boolean equals(com.badlogic.gdx.physics.box2d.Filter a,
com.badlogic.gdx.physics.box2d.Filter b)
public static void setSensor(com.badlogic.gdx.physics.box2d.Body body,
boolean sensor)
sensor flags of all of the given Body's Fixturesbody - the Body which Fixtures' sensor flags to setsensor - the parameter to pass to Fixture.setSensor(boolean)Fixture.setSensor(boolean)public static void destroyFixtures(com.badlogic.gdx.physics.box2d.Body body)
destroys all fixtures of the given bodybody - the body which fixtures to destroypublic static void destroyFixtures(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.utils.Array<com.badlogic.gdx.physics.box2d.Fixture> exclude)
destroys all fixtures of the given body except the given onesexclude - the fixtures not to destroybody - the body which fixtures to destroypublic static void destroyFixtures(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.physics.box2d.Fixture... exclude)
destroyFixtures(Body, Array)public static void destroyFixtures(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.physics.box2d.Fixture exclude)
destroyFixtures(Body, Array)public static com.badlogic.gdx.physics.box2d.BodyDef reset(com.badlogic.gdx.physics.box2d.BodyDef bodyDef)
bodyDef - the BodyDef to reset to default valuespublic static com.badlogic.gdx.physics.box2d.FixtureDef reset(com.badlogic.gdx.physics.box2d.FixtureDef fixtureDef)
fixtureDef - the FixtureDef to reset to default values