public class PhysicsChain extends Object implements DrawableObject
DemoChainPhysics to see how to use it.| Modifier and Type | Class and Description |
|---|---|
static class |
PhysicsChain.chain_type |
| Modifier and Type | Field and Description |
|---|---|
protected Body |
b |
protected ChainShape |
s |
protected Vector2 |
start |
protected Vector2 |
stop |
protected ArrayList<Vector2> |
vertices |
| Constructor and Description |
|---|
PhysicsChain(Vector2 start,
Vector2 stop,
int nPoints,
PhysicsChain.chain_type t) |
| Modifier and Type | Method and Description |
|---|---|
void |
catmull_chain(int nPoints)
|
void |
draw(GdxGraphics g)
A sample implementation for the rendering of a physics chain.
|
void |
random_chain(int nPoints)
|
protected Body b
protected ChainShape s
protected Vector2 start
protected Vector2 stop
public PhysicsChain(Vector2 start, Vector2 stop, int nPoints, PhysicsChain.chain_type t)
public void random_chain(int nPoints)
nPoints - The number of points from the start to the stop positionpublic void catmull_chain(int nPoints)
nPoints - The number of points from the start to the stop positionpublic void draw(GdxGraphics g)
PhysicsChain(com.badlogic.gdx.math.Vector2, com.badlogic.gdx.math.Vector2, int, ch.hevs.gdx2d.components.physics.PhysicsChain.chain_type).draw in interface DrawableObjectCopyright © 2014-2016 gdx2d - https://github.com/hevs-isi/gdx2d