congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Rot.set
Code IndexAdd Tabnine to your IDE (free)

How to use
set
method
in
org.jbox2d.common.Rot

Best Java code snippets using org.jbox2d.common.Rot.set (Showing top 20 results out of 315)

origin: libgdx/libgdx

public Rot(float angle) {
 set(angle);
}
origin: libgdx/libgdx

/**
 * Get the interpolated transform at a specific time.
 * 
 * @param xf the result is placed here - must not be null
 * @param t the normalized time in [0,1].
 */
public final void getTransform(final Transform xf, final float beta) {
 assert (xf != null);
 // xf->p = (1.0f - beta) * c0 + beta * c;
 // float32 angle = (1.0f - beta) * a0 + beta * a;
 // xf->q.Set(angle);
 xf.p.x = (1.0f - beta) * c0.x + beta * c.x;
 xf.p.y = (1.0f - beta) * c0.y + beta * c.y;
 float angle = (1.0f - beta) * a0 + beta * a;
 xf.q.set(angle);
 // Shift to origin
 // xf->p -= b2Mul(xf->q, localCenter);
 final Rot q = xf.q;
 xf.p.x -= q.c * localCenter.x - q.s * localCenter.y;
 xf.p.y -= q.s * localCenter.x + q.c * localCenter.y;
}
origin: libgdx/libgdx

/**
 * 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);
}
origin: libgdx/libgdx

/** Set this to equal another transform. */
public final Transform set(final Transform xf) {
 p.set(xf.p);
 q.set(xf.q);
 return this;
}
origin: libgdx/libgdx

 protected final void advance(float t) {
  // Advance to the new safe time. This doesn't sync the broad-phase.
  m_sweep.advance(t);
  m_sweep.c.set(m_sweep.c0);
  m_sweep.a = m_sweep.a0;
  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);
 }
}
origin: libgdx/libgdx

void solveRigid(final TimeStep step) {
 for (ParticleGroup group = m_groupList; group != null; group = group.getNext()) {
  if ((group.m_groupFlags & ParticleGroupType.b2_rigidParticleGroup) != 0) {
   group.updateStatistics();
   Vec2 temp = tempVec;
   Vec2 cross = tempVec2;
   Rot rotation = tempRot;
   rotation.set(step.dt * group.m_angularVelocity);
   Rot.mulToOutUnsafe(rotation, group.m_center, cross);
   temp.set(group.m_linearVelocity).mulLocal(step.dt).addLocal(group.m_center).subLocal(cross);
   tempXf.p.set(temp);
   tempXf.q.set(rotation);
   Transform.mulToOut(tempXf, group.m_transform, group.m_transform);
   final Transform velocityTransform = tempXf2;
   velocityTransform.p.x = step.inv_dt * tempXf.p.x;
   velocityTransform.p.y = step.inv_dt * tempXf.p.y;
   velocityTransform.q.s = step.inv_dt * tempXf.q.s;
   velocityTransform.q.c = step.inv_dt * (tempXf.q.c - 1);
   for (int i = group.m_firstIndex; i < group.m_lastIndex; i++) {
    Transform.mulToOutUnsafe(velocityTransform, m_positionBuffer.data[i],
      m_velocityBuffer.data[i]);
   }
  }
 }
}
origin: libgdx/libgdx

/**
 * Set the position of the body's origin and rotation. This breaks any contacts and wakes the
 * other bodies. Manipulating a body's transform may cause non-physical behavior. Note: contacts
 * are updated on the next call to World.step().
 * 
 * @param position the world position of the body's local origin.
 * @param angle the world rotation in radians.
 */
public final void setTransform(Vec2 position, float angle) {
 assert (m_world.isLocked() == false);
 if (m_world.isLocked() == true) {
  return;
 }
 m_xf.q.set(angle);
 m_xf.p.set(position);
 // m_sweep.c0 = m_sweep.c = Mul(m_xf, m_sweep.localCenter);
 Transform.mulToOutUnsafe(m_xf, m_sweep.localCenter, m_sweep.c);
 m_sweep.a = angle;
 m_sweep.c0.set(m_sweep.c);
 m_sweep.a0 = m_sweep.a;
 BroadPhase broadPhase = m_world.m_contactManager.m_broadPhase;
 for (Fixture f = m_fixtureList; f != null; f = f.m_next) {
  f.synchronize(broadPhase, m_xf, m_xf);
 }
}
origin: libgdx/libgdx

float aB = data.positions[m_indexB].a;
qA.set(aA);
qB.set(aB);
 qA.set(aA);
 qB.set(aB);
origin: libgdx/libgdx

m_xf.q.set(bd.angle);
origin: libgdx/libgdx

final Vec2 temp = pool.popVec2();
qA.set(aA);
qB.set(aB);
origin: libgdx/libgdx

float aB = data.positions[m_indexB].a;
qA.set(aA);
qB.set(aB);
origin: libgdx/libgdx

/**
 * Build vertices to represent an oriented box.
 * 
 * @param hx the half-width.
 * @param hy the half-height.
 * @param center the center of the box in local coordinates.
 * @param angle the rotation of the box in local coordinates.
 */
public final void setAsBox(final float hx, final float hy, final Vec2 center, final float angle) {
 m_count = 4;
 m_vertices[0].set(-hx, -hy);
 m_vertices[1].set(hx, -hy);
 m_vertices[2].set(hx, hy);
 m_vertices[3].set(-hx, hy);
 m_normals[0].set(0.0f, -1.0f);
 m_normals[1].set(1.0f, 0.0f);
 m_normals[2].set(0.0f, 1.0f);
 m_normals[3].set(-1.0f, 0.0f);
 m_centroid.set(center);
 final Transform xf = poolt1;
 xf.p.set(center);
 xf.q.set(angle);
 // Transform vertices and normals.
 for (int i = 0; i < m_count; ++i) {
  Transform.mulToOut(xf, m_vertices[i], m_vertices[i]);
  Rot.mulToOut(xf.q, m_normals[i], m_normals[i]);
 }
}
origin: libgdx/libgdx

final Vec2 temp = pool.popVec2();
qA.set(aA);
qB.set(aB);
origin: libgdx/libgdx

final Vec2 temp = pool.popVec2();
qA.set(aA);
qB.set(aB);
origin: libgdx/libgdx

final Rot qB = pool.popRot();
qA.set(aA);
qB.set(aB);
origin: libgdx/libgdx

final Rot qB = pool.popRot();
qA.set(aA);
qB.set(aB);
origin: libgdx/libgdx

final Vec2 temp = pool.popVec2();
qA.set(aA);
qB.set(aB);
origin: libgdx/libgdx

float aB = data.positions[m_indexB].a;
qA.set(aA);
qB.set(aB);
origin: libgdx/libgdx

qB.set(aB);
origin: libgdx/libgdx

final Vec2 rB = pool.popVec2();
qA.set(aA);
qB.set(aB);
org.jbox2d.commonRotset

Popular methods of Rot

  • mulToOut
  • mulToOutUnsafe
  • <init>
  • clone
  • getAngle
  • getXAxis
  • mul
  • mulTrans
  • mulTransUnsafe
  • mulUnsafe
  • setIdentity
  • setIdentity

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JLabel (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now