List of usage examples for com.badlogic.gdx.physics.box2d Body getWorldVector
public Vector2 getWorldVector(Vector2 localVector)
From source file:com.agateau.pixelwheels.utils.Box2DUtils.java
License:Open Source License
@SuppressWarnings("unused") public static Vector2 getForwardVelocity(Body body) { Vector2 currentRightNormal = body.getWorldVector(FORWARD_VECTOR); float v = currentRightNormal.dot(body.getLinearVelocity()); return currentRightNormal.scl(v); }
From source file:com.agateau.pixelwheels.utils.Box2DUtils.java
License:Open Source License
public static Vector2 getLateralVelocity(Body body) { Vector2 currentRightNormal = body.getWorldVector(LATERAL_VECTOR); float v = currentRightNormal.dot(body.getLinearVelocity()); return currentRightNormal.scl(v); }