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

How to use org.jbox2d.common

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

origin: libgdx/libgdx

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;
}
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

public final static Transform mul(final Transform A, final Transform B) {
 Transform C = new Transform();
 Rot.mulUnsafe(A.q, B.q, C.q);
 Rot.mulToOutUnsafe(A.q, B.p, C.p);
 C.p.addLocal(A.p);
 return C;
}
origin: libgdx/libgdx

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

public final static void mulTransToOutUnsafe(final Transform A, final Transform B,
  final Transform out) {
 assert (out != A);
 assert (out != B);
 Rot.mulTransUnsafe(A.q, B.q, out.q);
 pool.set(B.p).subLocal(A.p);
 Rot.mulTransUnsafe(A.q, pool, out.p);
}
origin: libgdx/libgdx

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

/**
 * takes the screen coordinates and puts the corresponding world coordinates in argWorld.
 * 
 * @param screenX
 * @param screenY
 * @param argWorld
 */
public void getScreenToWorldToOut(float screenX, float screenY, Vec2 argWorld) {
 argWorld.set(screenX, screenY);
 viewportTransform.getScreenToWorld(argWorld, argWorld);
}
origin: libgdx/libgdx

/**
 * takes the world coordinate (argWorld) and returns the screen coordinates.
 * 
 * @param argWorld
 */
public Vec2 getWorldToScreen(Vec2 argWorld) {
 Vec2 screen = new Vec2();
 viewportTransform.getWorldToScreen(argWorld, screen);
 return screen;
}
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

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

public final static Mat22 createRotationalTransform(float angle) {
 Mat22 mat = new Mat22();
 final float c = MathUtils.cos(angle);
 final float s = MathUtils.sin(angle);
 mat.ex.x = c;
 mat.ey.x = -s;
 mat.ex.y = s;
 mat.ey.y = c;
 return mat;
}
origin: libgdx/libgdx

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

/** The default constructor. */
public Transform() {
 p = new Vec2();
 q = new Rot();
}
origin: libgdx/libgdx

public void set(OBBViewportTransform vpt) {
 box.center.set(vpt.box.center);
 box.extents.set(vpt.box.extents);
 box.R.set(vpt.box.R);
 yFlip = vpt.yFlip;
}
origin: libgdx/libgdx

/** Set this to the identity transform. */
public final void setIdentity() {
 p.setZero();
 q.setIdentity();
}
origin: libgdx/libgdx

/**
 * 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 Vec3 solve33(Vec3 b) {
 Vec3 x = new Vec3();
 solve33ToOut(b, x);
 return x;
}
origin: libgdx/libgdx

/**
 * Return the matrix composed of the absolute values of all elements. djm: fixed double allocation
 * 
 * @return Absolute value matrix
 */
public final Mat22 abs() {
 return new Mat22(MathUtils.abs(ex.x), MathUtils.abs(ey.x), MathUtils.abs(ex.y),
   MathUtils.abs(ey.y));
}
origin: libgdx/libgdx

/** Initialize as a copy of another transform. */
public Transform(final Transform xf) {
 p = xf.p.clone();
 q = xf.q.clone();
}
origin: libgdx/libgdx

/**
 * takes the screen coordinates (argScreen) and returns the world coordinates
 * 
 * @param argScreen
 */
public Vec2 getScreenToWorld(Vec2 argScreen) {
 Vec2 world = new Vec2();
 viewportTransform.getScreenToWorld(argScreen, world);
 return world;
}
origin: libgdx/libgdx

/**
 * Takes the world coordinates and returns the screen coordinates.
 * 
 * @param worldX
 * @param worldY
 */
public Vec2 getWorldToScreen(float worldX, float worldY) {
 Vec2 argScreen = new Vec2(worldX, worldY);
 viewportTransform.getWorldToScreen(argScreen, argScreen);
 return argScreen;
}
org.jbox2d.common

Most used classes

  • Vec2
  • IViewportTransform
    This is the viewport transform used from drawing. Use yFlip if you are drawing from the top-left cor
  • Transform
    A transform contains translation and rotation. It is used to represent the position and orientation
  • Mat22
    A 2-by-2 matrix. Stored in column-major order.
  • MathUtils
    A few math methods that don't fit very well anywhere else.
  • BufferUtils,
  • Color3f,
  • Mat33,
  • Rot,
  • Sweep,
  • Timer,
  • OBBViewportTransform,
  • JBoxUtils,
  • Rotation
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