Codota Logo
Rot.set
Code IndexAdd Codota 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)

  • Common ways to obtain Rot
private void myMethod () {
Rot r =
  • Codota IconIWorldPool pool;pool.popRot()
  • Codota Iconnew Rot()
  • Codota Iconnew OrderedStack<Rot>(argSize, argContainerSize){ protected Rot newInstance(){ return new Rot(); } }
  • Smart code suggestions by Codota
}
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

  • Reactive rest calls using spring rest template
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JOptionPane (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now