private void integrateVertical( final float time) { final float r = this.input.takeRotationVertical(); final float s = this.speed_vertical + (r * (this.acceleration_vertical * time)); final float sc = Clamp.clamp( s, -this.maximum_speed_vertical, this.maximum_speed_vertical); this.camera.cameraRotateAroundVertical(sc); this.speed_vertical = JCameraFPSStyleAngularIntegrator .applyDrag(sc, this.drag_vertical, time); }
private void integrateVertical( final double time) { final double r = this.input.takeRotationVertical(); final double s = this.speed_vertical + (r * (this.acceleration_vertical * time)); final double sc = Clamp.clamp( s, -this.maximum_speed_vertical, this.maximum_speed_vertical); this.camera.cameraRotateAroundVertical(sc); this.speed_vertical = JCameraFPSStyleAngularIntegrator .applyDrag(sc, this.drag_vertical, time); }
private double integrateHorizontal( final double time) { final double r = this.input.takeRotationHorizontal(); final double s = this.speed_horizontal + (r * (this.acceleration_horizontal * time)); final double sc = Clamp.clamp( s, -this.maximum_speed_horizontal, this.maximum_speed_horizontal); /** * If applying the movement resulted in a value that was clamped, then * remove all speed in that direction by returning zero. Otherwise, the * user has to achieve a greater than or equal speed in the opposite * direction just to get the camera to appear to start moving. */ final boolean clamped = this.camera.cameraRotateAroundHorizontal(sc); if (clamped) { return 0.0f; } return JCameraFPSStyleAngularIntegrator.applyDrag( sc, this.drag_horizontal, time); }
private float integrateHorizontal( final float time) { final float r = this.input.takeRotationHorizontal(); final float s = this.speed_horizontal + (r * (this.acceleration_horizontal * time)); final float sc = Clamp.clamp( s, -this.maximum_speed_horizontal, this.maximum_speed_horizontal); /** * If applying the movement resulted in a value that was clamped, then * remove all speed in that direction by returning zero. Otherwise, the * user has to achieve a greater than or equal speed in the opposite * direction just to get the camera to appear to start moving. */ final boolean clamped = this.camera.cameraRotateAroundHorizontal(sc); if (clamped) { return 0.0f; } return JCameraFPSStyleAngularIntegrator.applyDrag( sc, this.drag_horizontal, time); }