Package net.dermetfan.gdx.physics.box2d
Class Chain.DefBuilder
java.lang.Object
net.dermetfan.gdx.physics.box2d.Chain.DefBuilder
- All Implemented Interfaces:
Chain.Builder
- Enclosing class:
- Chain
public static class Chain.DefBuilder extends java.lang.Object implements Chain.Builder
-
Field Summary
Fields Modifier and Type Field Description protected com.badlogic.gdx.physics.box2d.BodyDef
bodyDef
theBodyDef
to use increateSegment(int, int, Chain)
protected com.badlogic.gdx.physics.box2d.FixtureDef
fixtureDef
theFixtureDef
to use increateSegment(int, int, Chain)
protected com.badlogic.gdx.physics.box2d.JointDef
jointDef
theJointDef
to use increateConnection(Body, int, Body, int)
protected com.badlogic.gdx.physics.box2d.World
world
theWorld
in which to create segments and joints -
Constructor Summary
Constructors Constructor Description DefBuilder(com.badlogic.gdx.physics.box2d.World world, com.badlogic.gdx.physics.box2d.BodyDef bodyDef, com.badlogic.gdx.physics.box2d.FixtureDef fixtureDef, com.badlogic.gdx.physics.box2d.JointDef jointDef)
-
Method Summary
Modifier and Type Method 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 aChain.Connection
com.badlogic.gdx.physics.box2d.Body
createSegment(int index, int length, Chain chain)
creates a segment that is going to be added toChain.segments
com.badlogic.gdx.physics.box2d.BodyDef
getBodyDef()
com.badlogic.gdx.physics.box2d.FixtureDef
getFixtureDef()
com.badlogic.gdx.physics.box2d.JointDef
getJointDef()
com.badlogic.gdx.physics.box2d.World
getWorld()
void
setBodyDef(com.badlogic.gdx.physics.box2d.BodyDef bodyDef)
void
setFixtureDef(com.badlogic.gdx.physics.box2d.FixtureDef fixtureDef)
void
setJointDef(com.badlogic.gdx.physics.box2d.JointDef jointDef)
void
setWorld(com.badlogic.gdx.physics.box2d.World world)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
world
protected com.badlogic.gdx.physics.box2d.World worldtheWorld
in which to create segments and joints -
bodyDef
protected com.badlogic.gdx.physics.box2d.BodyDef bodyDeftheBodyDef
to use increateSegment(int, int, Chain)
-
fixtureDef
protected com.badlogic.gdx.physics.box2d.FixtureDef fixtureDeftheFixtureDef
to use increateSegment(int, int, Chain)
-
jointDef
protected com.badlogic.gdx.physics.box2d.JointDef jointDeftheJointDef
to use increateConnection(Body, int, Body, int)
-
-
Constructor Details
-
DefBuilder
public DefBuilder(com.badlogic.gdx.physics.box2d.World world, com.badlogic.gdx.physics.box2d.BodyDef bodyDef, com.badlogic.gdx.physics.box2d.FixtureDef fixtureDef, com.badlogic.gdx.physics.box2d.JointDef jointDef)- Parameters:
world
- theworld
bodyDef
- thebodyDef
fixtureDef
- thefixtureDef
jointDef
- thejointDef
-
-
Method Details
-
createSegment
Description copied from interface:Chain.Builder
creates a segment that is going to be added toChain.segments
- Specified by:
createSegment
in interfaceChain.Builder
- Parameters:
index
- the index of the segment to createlength
- the desired length of theChain
that is being buildchain
- theChain
this segment will be added to- Returns:
- a new
segment
created withbodyDef
andfixtureDef
-
createConnection
public Chain.Connection createConnection(com.badlogic.gdx.physics.box2d.Body seg1, int seg1index, com.badlogic.gdx.physics.box2d.Body seg2, int seg2index)Description copied from interface:Chain.Builder
connects two segments with each other using aChain.Connection
- Specified by:
createConnection
in interfaceChain.Builder
- Parameters:
seg1
- the first segmentseg1index
- the index of the first segmentseg2
- the second segmentseg2index
- the index of the second segment- Returns:
- a new
JointDef
created withjointDef
-
getWorld
public com.badlogic.gdx.physics.box2d.World getWorld()- Returns:
- the
world
-
setWorld
public void setWorld(com.badlogic.gdx.physics.box2d.World world)- Parameters:
world
- theworld
to set
-
getBodyDef
public com.badlogic.gdx.physics.box2d.BodyDef getBodyDef()- Returns:
- the
bodyDef
-
setBodyDef
public void setBodyDef(com.badlogic.gdx.physics.box2d.BodyDef bodyDef)- Parameters:
bodyDef
- thebodyDef
to set
-
getFixtureDef
public com.badlogic.gdx.physics.box2d.FixtureDef getFixtureDef()- Returns:
- the
fixtureDef
-
setFixtureDef
public void setFixtureDef(com.badlogic.gdx.physics.box2d.FixtureDef fixtureDef)- Parameters:
fixtureDef
- thefixtureDef
to set
-
getJointDef
public com.badlogic.gdx.physics.box2d.JointDef getJointDef()- Returns:
- the
jointDef
-
setJointDef
public void setJointDef(com.badlogic.gdx.physics.box2d.JointDef jointDef)- Parameters:
jointDef
- thejointDef
to set
-