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.BodyDefbodyDeftheBodyDefto use increateSegment(int, int, Chain)protected com.badlogic.gdx.physics.box2d.FixtureDeffixtureDeftheFixtureDefto use increateSegment(int, int, Chain)protected com.badlogic.gdx.physics.box2d.JointDefjointDeftheJointDefto use increateConnection(Body, int, Body, int)protected com.badlogic.gdx.physics.box2d.WorldworldtheWorldin 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.ConnectioncreateConnection(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.Connectioncom.badlogic.gdx.physics.box2d.BodycreateSegment(int index, int length, Chain chain)creates a segment that is going to be added toChain.segmentscom.badlogic.gdx.physics.box2d.BodyDefgetBodyDef()com.badlogic.gdx.physics.box2d.FixtureDefgetFixtureDef()com.badlogic.gdx.physics.box2d.JointDefgetJointDef()com.badlogic.gdx.physics.box2d.WorldgetWorld()voidsetBodyDef(com.badlogic.gdx.physics.box2d.BodyDef bodyDef)voidsetFixtureDef(com.badlogic.gdx.physics.box2d.FixtureDef fixtureDef)voidsetJointDef(com.badlogic.gdx.physics.box2d.JointDef jointDef)voidsetWorld(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 worldtheWorldin which to create segments and joints -
bodyDef
protected com.badlogic.gdx.physics.box2d.BodyDef bodyDeftheBodyDefto use increateSegment(int, int, Chain) -
fixtureDef
protected com.badlogic.gdx.physics.box2d.FixtureDef fixtureDeftheFixtureDefto use increateSegment(int, int, Chain) -
jointDef
protected com.badlogic.gdx.physics.box2d.JointDef jointDeftheJointDefto 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- theworldbodyDef- thebodyDeffixtureDef- thefixtureDefjointDef- thejointDef
-
-
Method Details
-
createSegment
Description copied from interface:Chain.Buildercreates a segment that is going to be added toChain.segments- Specified by:
createSegmentin interfaceChain.Builder- Parameters:
index- the index of the segment to createlength- the desired length of theChainthat is being buildchain- theChainthis segment will be added to- Returns:
- a new
segmentcreated withbodyDefandfixtureDef
-
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.Builderconnects two segments with each other using aChain.Connection- Specified by:
createConnectionin 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
JointDefcreated 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- theworldto 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- thebodyDefto 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- thefixtureDefto 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- thejointDefto set
-