private void updateDirection() { float x; float y = 0.0f; float z; x = -(float) Math.sin(Math.toRadians(this.heading)); y = (float) Math.sin(Math.toRadians(this.pitch)); z = (float) Math.cos(Math.toRadians(this.heading)); this.ori = new Vector(x, y, z); }
public void strafeLeft() { float mov = ((System.nanoTime() - UHPT.lastFrame) / 10000000.0f); Vector slide = new Vector(0.0f, 0.0f, 0.0f); float x; float z; x = (float) Math.sin((90.0f + this.heading) * Math.PI / 180); z = -(float) Math.cos((90.0f + this.heading) * Math.PI / 180); slide.x = x; slide.z = z; slide.normalize(); slide.mult(mov); this.loc.sub(slide); }