org.jbox2d.dynamics.Body.getLocalPointToOut()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.jbox2d.dynamics.Body.getLocalPointToOut()方法的一些代码示例,展示了Body.getLocalPointToOut()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.getLocalPointToOut()方法的具体详情如下:
包路径:org.jbox2d.dynamics.Body
类名称:Body
方法名:getLocalPointToOut

Body.getLocalPointToOut介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

/**
  * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world
  * axis.
  */
 public void initialize(Body bA, Body bB, Vec2 anchor) {
  bodyA = bA;
  bodyB = bB;
  bA.getLocalPointToOut(anchor, localAnchorA);
  bB.getLocalPointToOut(anchor, localAnchorB);
 }
}

代码示例来源:origin: libgdx/libgdx

public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) {
  bodyA = b1;
  bodyB = b2;
  b1.getLocalPointToOut(anchor, localAnchorA);
  b2.getLocalPointToOut(anchor, localAnchorB);
  bodyA.getLocalVectorToOut(axis, localAxisA);
 }
}

代码示例来源:origin: libgdx/libgdx

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

代码示例来源:origin: libgdx/libgdx

/**
  * Initialize the bodies, anchors, and reference angle using the world anchor.
  * 
  * @param b1
  * @param b2
  * @param anchor
  */
 public void initialize(final Body b1, final Body b2, final Vec2 anchor) {
  bodyA = b1;
  bodyB = b2;
  bodyA.getLocalPointToOut(anchor, localAnchorA);
  bodyB.getLocalPointToOut(anchor, localAnchorB);
  referenceAngle = bodyB.getAngle() - bodyA.getAngle();
 }
}

代码示例来源:origin: libgdx/libgdx

/**
  * Initialize the bodies, anchors, and reference angle using a world anchor point.
  * 
  * @param bA
  * @param bB
  * @param anchor
  */
 public void initialize(Body bA, Body bB, Vec2 anchor) {
  bodyA = bA;
  bodyB = bB;
  bodyA.getLocalPointToOut(anchor, localAnchorA);
  bodyB.getLocalPointToOut(anchor, localAnchorB);
  referenceAngle = bodyB.getAngle() - bodyA.getAngle();
 }
}

代码示例来源:origin: libgdx/libgdx

/**
  * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world
  * axis.
  */
 public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) {
  bodyA = b1;
  bodyB = b2;
  bodyA.getLocalPointToOut(anchor, localAnchorA);
  bodyB.getLocalPointToOut(anchor, localAnchorB);
  bodyA.getLocalVectorToOut(axis, localAxisA);
  referenceAngle = bodyB.getAngle() - bodyA.getAngle();
 }
}

代码示例来源:origin: libgdx/libgdx

public void initialize(Body bA, Body bB) {
  bodyA = bA;
  bodyB = bB;
  Vec2 xB = bodyB.getPosition();
  bodyA.getLocalPointToOut(xB, linearOffset);

  float angleA = bodyA.getAngle();
  float angleB = bodyB.getAngle();
  angularOffset = angleB - angleA;
 }
}

代码示例来源:origin: jbox2d/jbox2d

/**
  * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world
  * axis.
  */
 public void initialize(Body bA, Body bB, Vec2 anchor) {
  bodyA = bA;
  bodyB = bB;
  bA.getLocalPointToOut(anchor, localAnchorA);
  bB.getLocalPointToOut(anchor, localAnchorB);
 }
}

代码示例来源:origin: jbox2d/jbox2d

public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) {
  bodyA = b1;
  bodyB = b2;
  b1.getLocalPointToOut(anchor, localAnchorA);
  b2.getLocalPointToOut(anchor, localAnchorB);
  bodyA.getLocalVectorToOut(axis, localAxisA);
 }
}

代码示例来源:origin: jbox2d/jbox2d

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

代码示例来源:origin: jbox2d/jbox2d

/**
  * Initialize the bodies, anchors, and reference angle using a world anchor point.
  * 
  * @param bA
  * @param bB
  * @param anchor
  */
 public void initialize(Body bA, Body bB, Vec2 anchor) {
  bodyA = bA;
  bodyB = bB;
  bodyA.getLocalPointToOut(anchor, localAnchorA);
  bodyB.getLocalPointToOut(anchor, localAnchorB);
  referenceAngle = bodyB.getAngle() - bodyA.getAngle();
 }
}

代码示例来源:origin: jbox2d/jbox2d

/**
  * Initialize the bodies, anchors, and reference angle using the world anchor.
  * 
  * @param b1
  * @param b2
  * @param anchor
  */
 public void initialize(final Body b1, final Body b2, final Vec2 anchor) {
  bodyA = b1;
  bodyB = b2;
  bodyA.getLocalPointToOut(anchor, localAnchorA);
  bodyB.getLocalPointToOut(anchor, localAnchorB);
  referenceAngle = bodyB.getAngle() - bodyA.getAngle();
 }
}

代码示例来源:origin: jbox2d/jbox2d

/**
  * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world
  * axis.
  */
 public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) {
  bodyA = b1;
  bodyB = b2;
  bodyA.getLocalPointToOut(anchor, localAnchorA);
  bodyB.getLocalPointToOut(anchor, localAnchorB);
  bodyA.getLocalVectorToOut(axis, localAxisA);
  referenceAngle = bodyB.getAngle() - bodyA.getAngle();
 }
}

代码示例来源:origin: jbox2d/jbox2d

public void initialize(Body bA, Body bB) {
  bodyA = bA;
  bodyB = bB;
  Vec2 xB = bodyB.getPosition();
  bodyA.getLocalPointToOut(xB, linearOffset);

  float angleA = bodyA.getAngle();
  float angleB = bodyB.getAngle();
  angularOffset = angleB - angleA;
 }
}

代码示例来源:origin: andmizi/MobikeTags

/**
  * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world
  * axis.
  */
 public void initialize(Body bA, Body bB, Vec2 anchor) {
  bodyA = bA;
  bodyB = bB;
  bA.getLocalPointToOut(anchor, localAnchorA);
  bB.getLocalPointToOut(anchor, localAnchorB);
 }
}

代码示例来源:origin: org.jbox2d/jbox2d-library

/**
   * Initialize the bodies, anchors, axis, and reference angle using the world
   * anchor and world axis.
   */
  public void initialize(Body bA, Body bB, Vec2 anchor){
    bodyA = bA;
    bodyB = bB;
    bA.getLocalPointToOut(anchor, localAnchorA);
    bB.getLocalPointToOut(anchor, localAnchorB);
  }
}

代码示例来源:origin: com.github.almasb/fxgl-physics

public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) {
    bodyA = b1;
    bodyB = b2;
    b1.getLocalPointToOut(anchor, localAnchorA);
    b2.getLocalPointToOut(anchor, localAnchorB);
    bodyA.getLocalVectorToOut(axis, localAxisA);
  }
}

代码示例来源:origin: andmizi/MobikeTags

public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) {
  bodyA = b1;
  bodyB = b2;
  b1.getLocalPointToOut(anchor, localAnchorA);
  b2.getLocalPointToOut(anchor, localAnchorB);
  bodyA.getLocalVectorToOut(axis, localAxisA);
 }
}

代码示例来源:origin: com.github.almasb/fxgl-physics

/**
 * Gets a local point relative to the body's origin given a world point.
 *
 * @param worldPoint 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;
}

代码示例来源:origin: jbox2d/jbox2d

jd1.bodyA = ground;
jd1.bodyB = body1;
ground.getLocalPointToOut(bd1.position, jd1.localAnchorA);
body1.getLocalPointToOut(bd1.position, jd1.localAnchorB);
jd1.referenceAngle = body1.getAngle() - ground.getAngle();
m_joint1 = (RevoluteJoint) m_world.createJoint(jd1);

相关文章