public void set(final RayCastOutput rco){ normal.set(rco.normal); fraction = rco.fraction; } };
/** * Establish connectivity to a vertex that follows the last vertex. Don't call this for loops. * * @param nextVertex */ public void setNextVertex(final Vec2 nextVertex) { m_nextVertex.set(nextVertex); m_hasNextVertex = true; } }
/** * Get the target linear offset, in frame A, in meters. */ public void getLinearOffset(Vec2 out) { out.set(m_linearOffset); }
/** * Establish connectivity to a vertex that precedes the first vertex. Don't call this for loops. * * @param prevVertex */ public void setPrevVertex(final Vec2 prevVertex) { m_prevVertex.set(prevVertex); m_hasPrevVertex = true; }
public MouseJointDef() { super(JointType.MOUSE); target.set(0, 0); maxForce = 0; frequencyHz = 5; dampingRatio = .7f; } }
public void QueryAABB (final QueryCallback callback, float lowerX, float lowerY, float upperX, float upperY) { // FIXME pool QueryCallback? aabb.lowerBound.set(lowerX, lowerY); aabb.upperBound.set(upperX, upperY); world.queryAABB(new org.jbox2d.callbacks.QueryCallback() { @Override public boolean reportFixture (org.jbox2d.dynamics.Fixture f) { Fixture fixture = fixtures.get(f); return callback.reportFixture(fixture); } }, aabb); }
public void rayCast (final RayCastCallback callback, float point1X, float point1Y, float point2X, float point2Y) { // FIXME pool RayCastCallback? world.raycast(new org.jbox2d.callbacks.RayCastCallback() { @Override public float reportFixture (org.jbox2d.dynamics.Fixture f, Vec2 p, Vec2 n, float fraction) { return callback.reportRayFixture(fixtures.get(f), point.set(p.x, p.y), normal.set(n.x, n.y), fraction); } }, this.point1.set(point1X, point1Y), this.point2.set(point2X, point2Y)); } }
/** Apply a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the * angular velocity. This wakes up the body. * @param forceX the world force vector on x, usually in Newtons (N). * @param forceY the world force vector on y, usually in Newtons (N). * @param pointX the world position of the point of application on x. * @param pointY the world position of the point of application on y. */ public void applyForce (float forceX, float forceY, float pointX, float pointY, boolean wake) { tmp.set(forceX, forceY); tmp2.set(pointX, pointY); body.applyForce(tmp, tmp2); }
/** * Set this based on the position and angle. * * @param p * @param angle */ public final void set(Vec2 p, float angle) { this.p.set(p); q.set(angle); }
/** * Takes the world coordinates and puts the corresponding screen coordinates in argScreen. * * @param worldX * @param worldY * @param argScreen */ public void getWorldToScreenToOut(float worldX, float worldY, Vec2 argScreen) { argScreen.set(worldX, worldY); viewportTransform.getWorldToScreen(argScreen, argScreen); }
/** Test a point for containment in this fixture. * @param p a point in world coordinates. */ public boolean testPoint (Vector2 p) { tmp.set(p.x, p.y); return fixture.testPoint(tmp); }
/** * Sets this manifold point form the given one * @param cp the point to copy from */ public void set(final ManifoldPoint cp){ localPoint.set(cp.localPoint); normalImpulse = cp.normalImpulse; tangentImpulse = cp.tangentImpulse; id.set(cp.id); } }
/** * Set the target linear offset, in frame A, in meters. */ public void setLinearOffset(Vec2 linearOffset) { if (linearOffset.x != m_linearOffset.x || linearOffset.y != m_linearOffset.y) { m_bodyA.setAwake(true); m_bodyB.setAwake(true); m_linearOffset.set(linearOffset); } }
public void setTarget(Vec2 target) { if (m_bodyB.isAwake() == false) { m_bodyB.setAwake(true); } m_targetA.set(target); }
/** Get the world linear velocity of a world point attached to this body. * @param worldPoint a point in world coordinates. * @return the world velocity of a point. */ public Vector2 getLinearVelocityFromWorldPoint (Vector2 worldPoint) { tmp.set(worldPoint.x, worldPoint.y); Vec2 lv = body.getLinearVelocityFromWorldPoint(tmp); return linVelWorld.set(lv.x, lv.y); }
public final static void mulTransToOut(final Transform A, final Transform B, final Transform out) { assert (out != A); Rot.mulTrans(A.q, B.q, out.q); pool.set(B.p).subLocal(A.p); Rot.mulTrans(A.q, pool, out.p); }
public final static Transform mulTrans(final Transform A, final Transform B) { Transform C = new Transform(); Rot.mulTransUnsafe(A.q, B.q, C.q); pool.set(B.p).subLocal(A.p); Rot.mulTransUnsafe(A.q, pool, C.p); return C; }