Package net.sf.fysix.math

Examples of net.sf.fysix.math.Vector2d.rotate()


  private double throttle(double speedW, double strafeW, double rotateW) {
    double targetSpeed = getTargetSpeed();
    double targetStrafe = getTargetStrafe();
    double targetAV = getTargetAngularVelocity();
    Vector2d v = getVelocity();
    v.rotate(-getRotation());    // Make velocity relative to the ships orientation (x=forward, y=starboard)
    double speed = v.getX();
    double strafe = v.getY();
    double tots = v.length();
    double av = getAngularVelocity();
    if (Math.signum(speed * speedW) > 0) {  // Are we moving in the direction of this engines thrust?
View Full Code Here


  private double throttle(double speedW, double strafeW, double rotateW) {
    double targetSpeed = getTargetSpeed();
    double targetStrafe = 0.0;
    double targetAV = 0.0;
    Vector2d v = getVelocity();
    v.rotate(-getRotation());    // Make velocity relative to the ships orientation (x=forward, y=starboard)
    double speed = v.getX();
    double strafe = v.getY();
    double tots = v.length();
    double av = getAngularVelocity();
    if (Math.signum(speed * speedW) > 0) {  // Are we moving in the direction of this engines thrust?
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.