/** * Set as a matrix representing a rotation. * * @param angle Rotation (in radians) that matrix represents. */ public final void set(final float angle) { final float c = JBoxUtils.cos(angle), s = JBoxUtils.sin(angle); ex.x = c; ey.x = -s; ex.y = s; ey.y = c; }
public Rotation set(float angle) { s = JBoxUtils.sin(angle); c = JBoxUtils.cos(angle); return this; }
public final static void createRotationalTransform(float angle, Mat22 out) { final float c = JBoxUtils.cos(angle); final float s = JBoxUtils.sin(angle); out.ex.x = c; out.ey.x = -s; out.ex.y = s; out.ey.y = c; }
public final void synchronizeTransform() { // m_xf.q.set(m_sweep.a); // // // m_xf.position = m_sweep.c - Mul(m_xf.R, m_sweep.localCenter); // Rot.mulToOutUnsafe(m_xf.q, m_sweep.localCenter, m_xf.p); // m_xf.p.mulLocal(-1).addLocal(m_sweep.c); // m_xf.q.s = JBoxUtils.sin(m_sweep.a); m_xf.q.c = JBoxUtils.cos(m_sweep.a); Rotation q = m_xf.q; Vec2 v = m_sweep.localCenter; m_xf.p.x = m_sweep.c.x - q.c * v.x + q.s * v.y; m_xf.p.y = m_sweep.c.y - q.s * v.x - q.c * v.y; }
public final static Mat22 createRotationalTransform(float angle) { Mat22 mat = new Mat22(); final float c = JBoxUtils.cos(angle); final float s = JBoxUtils.sin(angle); mat.ex.x = c; mat.ey.x = -s; mat.ex.y = s; mat.ey.y = c; return mat; }
protected final void synchronizeFixtures() { final Transform xf1 = pxf; // xf1.position = m_sweep.c0 - Mul(xf1.R, m_sweep.localCenter); // xf1.q.set(m_sweep.a0); // Rot.mulToOutUnsafe(xf1.q, m_sweep.localCenter, xf1.p); // xf1.p.mulLocal(-1).addLocal(m_sweep.c0); // inlined: xf1.q.s = JBoxUtils.sin(m_sweep.a0); xf1.q.c = JBoxUtils.cos(m_sweep.a0); xf1.p.x = m_sweep.c0.x - xf1.q.c * m_sweep.localCenter.x + xf1.q.s * m_sweep.localCenter.y; xf1.p.y = m_sweep.c0.y - xf1.q.s * m_sweep.localCenter.x - xf1.q.c * m_sweep.localCenter.y; // end inline for (Fixture f : fixtures) { f.synchronize(world.m_contactManager.m_broadPhase, xf1, m_xf); } }