/** Returns the vertex at the given position. * @param index the index of the vertex 0 <= index < getVertexCount( ) * @param vertex vertex */ public void getVertex (int index, Vector2 vertex) { Vec2 v = shape.m_vertices[index]; vertex.set(v.x, v.y); }
/** Sets scale along both the x and y axis * * @param scaleX Scale on the x axis * @param scaleY Scale on the y axis */ public void setScale (float scaleX, float scaleY) { this.scale.set(scaleX, scaleY); updated = false; }
protected WorldManifold (org.jbox2d.collision.WorldManifold manifold) { normal.set(manifold.normal.x, manifold.normal.y); for (int i = 0; i < manifold.points.length; i++) { points[i].set(manifold.points[i].x, manifold.points[i].y); } numContactPoints = manifold.points.length; separations[0] = manifold.separations[0]; separations[1] = manifold.separations[1]; }
/** Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis. */ public void initialize (Body bodyA, Body bodyB, Vector2 anchor) { this.bodyA = bodyA; this.bodyB = bodyB; localAnchorA.set(bodyA.getLocalPoint(anchor)); localAnchorB.set(bodyB.getLocalPoint(anchor)); }
public Vector2 getLocalAnchorA () { Vec2 localAnchor = joint.getLocalAnchorA(); localAnchorA.set(localAnchor.x, localAnchor.y); return localAnchorA; }
public Vector2 getLocalAnchorA () { Vec2 localAnchor = joint.getLocalAnchorA(); localAnchorA.set(localAnchor.x, localAnchor.y); return localAnchorA; }
public Vector2 getLocalAxisA(){ jniGetLocalAxisA(addr, tmp); localAxisA.set(tmp[0], tmp[1]); return localAxisA; }
public Vector2 getLinearOffset () { jniGetLinearOffset(addr, tmp); linearOffset.set(tmp[0], tmp[1]); return linearOffset; }
public ManifoldPoint[] getPoints () { for (int i = 0; i < manifold.points.length; i++) { points[i].contactID = manifold.points[i].id.getKey(); points[i].localPoint.set(manifold.points[i].localPoint.x, manifold.points[i].localPoint.y); points[i].normalImpulse = manifold.points[i].normalImpulse; points[i].tangentImpulse = manifold.points[i].tangentImpulse; } return points; }
public Vector2 getLocalAnchorA () { jniGetLocalAnchorA(addr, tmp); localAnchorA.set(tmp[0], tmp[1]); return localAnchorA; }
public Vector2 getLocalAnchorB () { jniGetLocalAnchorB(addr, tmp); localAnchorB.set(tmp[0], tmp[1]); return localAnchorB; }
public Vector2 getLocalAnchorB () { Vec2 localAnchor = joint.getLocalAnchorB(); localAnchorB.set(localAnchor.x, localAnchor.y); return localAnchorB; }
/** Initialize the bodies, anchors, and length using the world anchors. */ public void initialize (Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB) { this.bodyA = bodyA; this.bodyB = bodyB; this.localAnchorA.set(bodyA.getLocalPoint(anchorA)); this.localAnchorB.set(bodyB.getLocalPoint(anchorB)); this.length = anchorA.dst(anchorB); }
/** Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis. */ public void initialize (Body bodyA, Body bodyB, Vector2 anchor, Vector2 axis) { this.bodyA = bodyA; this.bodyB = bodyB; localAnchorA.set(bodyA.getLocalPoint(anchor)); localAnchorB.set(bodyB.getLocalPoint(anchor)); localAxisA.set(bodyA.getLocalVector(axis)); referenceAngle = bodyB.getAngle() - bodyA.getAngle(); }
/** Initialize the bodies, anchors, and reference angle using a world anchor point. */ public void initialize (Body bodyA, Body bodyB, Vector2 anchor) { this.bodyA = bodyA; this.bodyB = bodyB; localAnchorA.set(bodyA.getLocalPoint(anchor)); localAnchorB.set(bodyB.getLocalPoint(anchor)); referenceAngle = bodyB.getAngle() - bodyA.getAngle(); }
public boolean fling (float velocityX, float velocityY, int button) { stageToLocalAmount(tmpCoords.set(velocityX, velocityY)); ActorGestureListener.this.fling(event, tmpCoords.x, tmpCoords.y, button); return true; }
public void draw (Batch batch, float parentAlpha) { selectBox.localToStageCoordinates(temp.set(0, 0)); if (!temp.equals(screenPosition)) hide(); super.draw(batch, parentAlpha); }