Package org.spout.math.vector

Examples of org.spout.math.vector.Vector3f.sub()


    PhysicsComponent sc = player.getPhysics();

    Vector3f offset = Vector3f.ZERO;
    float speed = 50;
    if (inputState.getForward()) {
      offset = offset.sub(ts.forwardVector().mul(speed * dt));
    }
    if (inputState.getBackward()) {
      offset = offset.add(ts.forwardVector().mul(speed * dt));
    }
    if (inputState.getLeft()) {
View Full Code Here


    }
    if (inputState.getBackward()) {
      offset = offset.add(ts.forwardVector().mul(speed * dt));
    }
    if (inputState.getLeft()) {
      offset = offset.sub(ts.rightVector().mul(speed * dt));
    }
    if (inputState.getRight()) {
      offset = offset.add(ts.rightVector().mul(speed * dt));
    }
    if (inputState.getJump()) {
View Full Code Here

    }
    if (inputState.getJump()) {
      offset = offset.add(ts.upVector().mul(speed * dt));
    }
    if (inputState.getCrouch()) {
      offset = offset.sub(ts.upVector().mul(speed * dt));
    }

    player.get(EntityHead.class).setOrientation(Quaternionf.fromAxesAnglesDeg(inputState.pitch(), inputState.yaw(), ts.getRotation().getAxesAngleDeg().getZ()));
    player.getPhysics().translate(offset);
    player.getPhysics().setRotation(Quaternionf.fromAxesAnglesDeg(inputState.pitch(), inputState.yaw(), ts.getRotation().getAxesAngleDeg().getZ()));
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.