Пример #1
0
  @Override
  public void interpolate(float f) {
    interpolatedPositionA.x = lastPhysicsPosA.x * f;
    interpolatedPositionA.x += joint.getAnchorA().x * (1 - f);

    interpolatedPositionA.y = lastPhysicsPosA.y * f;
    interpolatedPositionA.y += joint.getAnchorA().y * (1 - f);

    interpolatedPositionB.x = lastPhysicsPosB.x * f;
    interpolatedPositionB.x += joint.getAnchorB().x * (1 - f);

    interpolatedPositionB.y = lastPhysicsPosB.y * f;
    interpolatedPositionB.y += joint.getAnchorB().y * (1 - f);
  }
Пример #2
0
  @Override
  public void storeCurrentState() {

    lastPhysicsPosA.set(joint.getAnchorA());
    lastPhysicsPosB.set(joint.getAnchorB());
  }
Пример #3
0
 @Override
 public Vector2 getAnchorB() {
   return joint.getAnchorB();
 }