tidy inspect.js

This commit is contained in:
Triplelexx 2018-03-16 20:13:02 +00:00
parent 59a088f226
commit 563be9ab91

View file

@ -83,7 +83,6 @@ var rotatingTowardsTarget = false;
var targetCamOrientation;
var oldPosition, oldOrientation;
function orientationOf(vector) {
var direction,
yaw,
@ -95,7 +94,6 @@ function orientationOf(vector) {
return Quat.multiply(yaw, pitch);
}
function handleRadialMode(dx, dy) {
azimuth += dx / AZIMUTH_RATE;
radius += radius * dy * RADIUS_RATE;
@ -133,7 +131,6 @@ function handleOrbitMode(dx, dy) {
Camera.setOrientation(orientationOf(vector));
}
function handlePanMode(dx, dy) {
var up = Quat.getUp(Camera.getOrientation());
var right = Quat.getRight(Camera.getOrientation());
@ -254,8 +251,6 @@ function keyReleaseEvent(event) {
}
}
function mousePressEvent(event) {
if (alt && !isActive) {
mouseLastX = event.x;
@ -267,20 +262,17 @@ function mousePressEvent(event) {
position = Camera.getPosition();
var avatarTarget = MyAvatar.getTargetAvatarPosition();
var distance = -1;
var string;
var string = "";
if (modelIntersection.intersects && modelIntersection.accurate) {
distance = modelIntersection.distance;
center = modelIntersection.intersection;
string = "Inspecting model";
//We've selected our target, now orbit towards it automatically
// We've selected our target, now orbit towards it automatically
rotatingTowardsTarget = true;
//calculate our target cam rotation
Script.setTimeout(function() {
// calculate our target cam rotation
Script.setTimeout(function () {
rotatingTowardsTarget = false;
}, LOOK_AT_TIME);
@ -313,7 +305,6 @@ function mouseMoveEvent(event) {
if (mode == panningMode) {
handlePanMode(event.x - mouseLastX, event.y - mouseLastY);
}
}
mouseLastX = event.x;
mouseLastY = event.y;
@ -327,7 +318,7 @@ function update() {
}
function rotateTowardsTarget() {
var newOrientation = Quat.mix(Camera.getOrientation(), targetCamOrientation, .1);
var newOrientation = Quat.mix(Camera.getOrientation(), targetCamOrientation, 0.1);
Camera.setOrientation(newOrientation);
}