private float integrateIncline( final float time) { float s = this.speed_incline; final boolean positive = this.input.isOrbitingInclinePositive(); if (positive) { s += this.acceleration_incline * time; } final boolean negative = this.input.isOrbitingInclineNegative(); if (negative) { s -= this.acceleration_incline * time; } s = Clamp.clamp(s, -this.maximum_speed_incline, this.maximum_speed_incline); /** * 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.cameraOrbitIncline(s * time); if (clamped) { return 0.0f; } return JCameraSphericalAngularIntegrator.applyDrag( s, this.drag_incline, time); }
private double integrateIncline( final double time) { double s = this.speed_incline; final boolean positive = this.input.isOrbitingInclinePositive(); if (positive) { s += this.acceleration_incline * time; } final boolean negative = this.input.isOrbitingInclineNegative(); if (negative) { s -= this.acceleration_incline * time; } s = Clamp.clamp(s, -this.maximum_speed_incline, this.maximum_speed_incline); /* * 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.cameraOrbitIncline(s * time); if (clamped) { return 0.0; } return JCameraSphericalAngularIntegrator.applyDrag( s, this.drag_incline, time); }