mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 04:08:13 +02:00
don't use globals and remove double definitions
This commit is contained in:
parent
6f6a7bcc44
commit
fefe5e30ec
2 changed files with 5 additions and 18 deletions
|
@ -15,8 +15,7 @@
|
||||||
(function() { // BEGIN LOCAL_SCOPE
|
(function() { // BEGIN LOCAL_SCOPE
|
||||||
|
|
||||||
Script.include("../libraries/utils.js");
|
Script.include("../libraries/utils.js");
|
||||||
// objects that appear smaller than this can't be grabbed
|
var MAX_SOLID_ANGLE = 0.01; // objects that appear smaller than this can't be grabbed
|
||||||
var MAX_SOLID_ANGLE = 0.01;
|
|
||||||
|
|
||||||
var ZERO_VEC3 = {
|
var ZERO_VEC3 = {
|
||||||
x: 0,
|
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 ACTION_TTL = 10; // seconds
|
||||||
|
|
||||||
var enabled = true;
|
var enabled = true;
|
||||||
|
@ -124,7 +111,7 @@ function mouseIntersectionWithPlane(pointOnPlane, planeNormal, event, maxDistanc
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mouse class stores mouse click and drag info
|
// Mouse class stores mouse click and drag info
|
||||||
Mouse = function() {
|
function Mouse() {
|
||||||
this.current = {
|
this.current = {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 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 class stores info for drawing a line at object's target position
|
||||||
Beacon = function() {
|
function Beacon() {
|
||||||
this.height = 0.10;
|
this.height = 0.10;
|
||||||
this.overlayID = Overlays.addOverlay("line3d", {
|
this.overlayID = Overlays.addOverlay("line3d", {
|
||||||
color: {
|
color: {
|
||||||
|
@ -246,7 +233,7 @@ var beacon = new Beacon();
|
||||||
|
|
||||||
|
|
||||||
// Grabber class stores and computes info for grab behavior
|
// Grabber class stores and computes info for grab behavior
|
||||||
Grabber = function() {
|
function Grabber() {
|
||||||
this.isGrabbing = false;
|
this.isGrabbing = false;
|
||||||
this.entityID = null;
|
this.entityID = null;
|
||||||
this.actionID = null;
|
this.actionID = null;
|
||||||
|
|
|
@ -245,7 +245,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateProgressBarLocation() {
|
function updateProgressBarLocation() {
|
||||||
viewport = Controller.getViewportDimensions();
|
var viewport = Controller.getViewportDimensions();
|
||||||
windowWidth = viewport.x;
|
windowWidth = viewport.x;
|
||||||
windowHeight = viewport.y;
|
windowHeight = viewport.y;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue