public DistanceProxy() { m_vertices = new Vec2[Settings.maxPolygonVertices]; for (int i = 0; i < m_vertices.length; i++) { m_vertices[i] = new Vec2(); } m_buffer = new Vec2[2]; m_count = 0; m_radius = 0f; }
protected FrictionJoint(IWorldPool argWorldPool, FrictionJointDef def) { super(argWorldPool, def); m_localAnchorA = new Vec2(def.localAnchorA); m_localAnchorB = new Vec2(def.localAnchorB); m_linearImpulse = new Vec2(); m_angularImpulse = 0.0f; m_maxForce = def.maxForce; m_maxTorque = def.maxTorque; }
public final static Vec2 mulTrans(final Transform T, final Vec2 v) { final float px = v.x - T.p.x; final float py = v.y - T.p.y; return new Vec2((T.q.c * px + T.q.s * py), (-T.q.s * px + T.q.c * py)); }
/** * Blank mass data */ public MassData() { mass = I = 0f; center = new Vec2(); }
/** * creates a manifold with 0 points, with it's points array full of instantiated ManifoldPoints. */ public Manifold() { points = new ManifoldPoint[Settings.maxManifoldPoints]; for (int i = 0; i < Settings.maxManifoldPoints; i++) { points[i] = new ManifoldPoint(); } localNormal = new Vec2(); localPoint = new Vec2(); pointCount = 0; }
/** Create a loop. This automatically adjusts connectivity. * @param vertices an array of vertices, these are copied */ public void createLoop (Vector2[] vertices) { Vec2[] v = new Vec2[vertices.length]; for (int i = 0; i < vertices.length; i++) { v[i] = new Vec2(vertices[i].x, vertices[i].y); } shape.createLoop(v, v.length); isLooped = true; }
/** * Get the world coordinates of a point given the local coordinates. * * @param localPoint a point on the body measured relative the the body's origin. * @return the same point expressed in world coordinates. */ public final Vec2 getWorldPoint(Vec2 localPoint) { Vec2 v = new Vec2(); getWorldPointToOut(localPoint, v); return v; }
/** * Gets a local point relative to the body's origin given a world point. * * @param a point in world coordinates. * @return the corresponding local point relative to the body's origin. */ public final Vec2 getLocalPoint(Vec2 worldPoint) { Vec2 out = new Vec2(); getLocalPointToOut(worldPoint, out); return out; }
/** The default constructor. */ public Transform() { p = new Vec2(); q = new Rot(); }
/** * takes the screen coordinates and returns the world coordinates. * * @param screenX * @param screenY */ public Vec2 getScreenToWorld(float screenX, float screenY) { Vec2 screen = new Vec2(screenX, screenY); viewportTransform.getScreenToWorld(screen, screen); return screen; } }
/** * Get the world velocity of a local point. * * @param a point in local coordinates. * @return the world velocity of a point. */ public final Vec2 getLinearVelocityFromLocalPoint(Vec2 localPoint) { Vec2 out = new Vec2(); getLinearVelocityFromLocalPointToOut(localPoint, out); return out; }
protected WeldJoint(IWorldPool argWorld, WeldJointDef def) { super(argWorld, def); m_localAnchorA = new Vec2(def.localAnchorA); m_localAnchorB = new Vec2(def.localAnchorB); m_referenceAngle = def.referenceAngle; m_frequencyHz = def.frequencyHz; m_dampingRatio = def.dampingRatio; m_impulse = new Vec3(); m_impulse.setZero(); }
/** * Solve A * x = b, where b is a column vector. This is more efficient than computing the inverse * in one-shot cases. * * @param b * @return */ public final Vec2 solve22(Vec2 b) { Vec2 x = new Vec2(); solve22ToOut(b, x); return x; }
public DynamicTreeFlatNodes() { m_root = NULL_NODE; m_nodeCount = 0; m_nodeCapacity = 16; expandBuffers(0, m_nodeCapacity); for (int i = 0; i < drawVecs.length; i++) { drawVecs[i] = new Vec2(); } }