don't use globals and remove double definitions

This commit is contained in:
Andrew Meadows 2016-08-23 12:54:09 -07:00
parent 6f6a7bcc44
commit fefe5e30ec
2 changed files with 5 additions and 18 deletions

View file

@ -15,8 +15,7 @@
(function() { // BEGIN LOCAL_SCOPE
Script.include("../libraries/utils.js");
// objects that appear smaller than this can't be grabbed
var MAX_SOLID_ANGLE = 0.01;
var MAX_SOLID_ANGLE = 0.01; // objects that appear smaller than this can't be grabbed
var ZERO_VEC3 = {
x: 0,
@ -42,18 +41,6 @@ var DEFAULT_GRABBABLE_DATA = {
};
var MAX_SOLID_ANGLE = 0.01; // objects that appear smaller than this can't be grabbed
var ZERO_VEC3 = {
x: 0,
y: 0,
z: 0
};
var IDENTITY_QUAT = {
x: 0,
y: 0,
z: 0,
w: 0
};
var ACTION_TTL = 10; // seconds
var enabled = true;
@ -124,7 +111,7 @@ function mouseIntersectionWithPlane(pointOnPlane, planeNormal, event, maxDistanc
}
// Mouse class stores mouse click and drag info
Mouse = function() {
function Mouse() {
this.current = {
x: 0,
y: 0
@ -194,7 +181,7 @@ var mouse = new Mouse();
// Beacon class stores info for drawing a line at object's target position
Beacon = function() {
function Beacon() {
this.height = 0.10;
this.overlayID = Overlays.addOverlay("line3d", {
color: {
@ -246,7 +233,7 @@ var beacon = new Beacon();
// Grabber class stores and computes info for grab behavior
Grabber = function() {
function Grabber() {
this.isGrabbing = false;
this.entityID = null;
this.actionID = null;

View file

@ -245,7 +245,7 @@
}
function updateProgressBarLocation() {
viewport = Controller.getViewportDimensions();
var viewport = Controller.getViewportDimensions();
windowWidth = viewport.x;
windowHeight = viewport.y;