public static class Chain.DefShapeBuilder extends java.lang.Object implements Chain.Builder, com.badlogic.gdx.utils.Disposable
Chain.Builder that builds using a BodyDef, JointDef and Shape. Should be dispose if no longer used.| Modifier and Type | Field and Description |
|---|---|
protected com.badlogic.gdx.physics.box2d.BodyDef |
bodyDef
the
BodyDef to use in createSegment(int, int, Chain) |
protected float |
density
the density to use in
Body.createFixture(Shape, float) |
protected com.badlogic.gdx.physics.box2d.JointDef |
jointDef
the
JointDef to use in createSegment(int, int, Chain) |
protected com.badlogic.gdx.physics.box2d.Shape |
shape
the
Shape to use in createSegment(int, int, Chain) |
protected com.badlogic.gdx.physics.box2d.World |
world
the
World to create things in |
| Constructor and Description |
|---|
DefShapeBuilder(com.badlogic.gdx.physics.box2d.World world,
com.badlogic.gdx.physics.box2d.BodyDef bodyDef,
com.badlogic.gdx.physics.box2d.Shape shape,
float density,
com.badlogic.gdx.physics.box2d.JointDef jointDef) |
| Modifier and Type | Method and Description |
|---|---|
Chain.Connection |
createConnection(com.badlogic.gdx.physics.box2d.Body seg1,
int seg1index,
com.badlogic.gdx.physics.box2d.Body seg2,
int seg2index)
connects two segments with each other using a
Chain.Connection |
com.badlogic.gdx.physics.box2d.Body |
createSegment(int index,
int length,
Chain chain)
|
void |
dispose()
disposes the shape |
com.badlogic.gdx.physics.box2d.BodyDef |
getBodyDef() |
float |
getDensity() |
com.badlogic.gdx.physics.box2d.JointDef |
getJointDef() |
com.badlogic.gdx.physics.box2d.Shape |
getShape() |
com.badlogic.gdx.physics.box2d.World |
getWorld() |
void |
setBodyDef(com.badlogic.gdx.physics.box2d.BodyDef bodyDef) |
void |
setDensity(float density) |
void |
setJointDef(com.badlogic.gdx.physics.box2d.JointDef jointDef) |
void |
setWorld(com.badlogic.gdx.physics.box2d.World world) |
protected com.badlogic.gdx.physics.box2d.World world
World to create things inprotected com.badlogic.gdx.physics.box2d.BodyDef bodyDef
BodyDef to use in createSegment(int, int, Chain)protected com.badlogic.gdx.physics.box2d.Shape shape
Shape to use in createSegment(int, int, Chain)protected float density
Body.createFixture(Shape, float)protected com.badlogic.gdx.physics.box2d.JointDef jointDef
JointDef to use in createSegment(int, int, Chain)public DefShapeBuilder(com.badlogic.gdx.physics.box2d.World world,
com.badlogic.gdx.physics.box2d.BodyDef bodyDef,
com.badlogic.gdx.physics.box2d.Shape shape,
float density,
com.badlogic.gdx.physics.box2d.JointDef jointDef)
public com.badlogic.gdx.physics.box2d.Body createSegment(int index,
int length,
Chain chain)
createSegment in interface Chain.Builderindex - the index of the segment to createlength - the desired length of the Chain that is being buildchain - the Chain this segment will be added toBody.createFixture(Shape, float)public Chain.Connection createConnection(com.badlogic.gdx.physics.box2d.Body seg1, int seg1index, com.badlogic.gdx.physics.box2d.Body seg2, int seg2index)
Chain.BuilderChain.ConnectioncreateConnection in interface Chain.Builderseg1 - the first segmentseg1index - the index of the first segmentseg2 - the second segmentseg2index - the index of the second segmentJoint created with jointDefpublic void dispose()
disposes the shapedispose in interface com.badlogic.gdx.utils.Disposablepublic com.badlogic.gdx.physics.box2d.World getWorld()
worldpublic void setWorld(com.badlogic.gdx.physics.box2d.World world)
world - the world to setpublic com.badlogic.gdx.physics.box2d.BodyDef getBodyDef()
bodyDefpublic void setBodyDef(com.badlogic.gdx.physics.box2d.BodyDef bodyDef)
bodyDef - the bodyDef to setpublic float getDensity()
densitypublic void setDensity(float density)
density - the density to setpublic com.badlogic.gdx.physics.box2d.JointDef getJointDef()
jointDefpublic void setJointDef(com.badlogic.gdx.physics.box2d.JointDef jointDef)
jointDef - the jointDef to setpublic com.badlogic.gdx.physics.box2d.Shape getShape()
shape