added isLocked() to lock the ground plane in hq

This commit is contained in:
ZappoMan 2014-05-18 20:31:55 -07:00
parent 0c4727d459
commit 31ae7ceaff

View file

@ -117,7 +117,11 @@ function controller(wichSide) {
this.grab = function (modelID, properties) {
if (this.isLocked(properties)) {
print("Model locked " + modelID.id);
} else {
print("Grabbing " + modelID.id);
this.grabbing = true;
this.modelID = modelID;
@ -125,6 +129,7 @@ function controller(wichSide) {
this.oldModelRotation = properties.modelRotation;
this.oldModelRadius = properties.radius;
}
}
this.release = function () {
this.grabbing = false;
@ -145,7 +150,23 @@ function controller(wichSide) {
}
}
this.isLocked = function (properties) {
// special case to lock the ground plane model in hq.
if (location.hostname == "hq.highfidelity.io" &&
properties.modelURL == "https://s3-us-west-1.amazonaws.com/highfidelity-public/ozan/Terrain_Reduce_forAlpha.fbx") {
return true;
}
return false;
}
this.checkModel = function (properties) {
// special case to lock the ground plane model in hq.
if (location.hostname == "hq.highfidelity.io" &&
properties.modelURL == "https://s3-us-west-1.amazonaws.com/highfidelity-public/ozan/Terrain_Reduce_forAlpha.fbx") {
return { valid: false };
}
// P P - Model
// /| A - Palm
// / | d B - unit vector toward tip
@ -285,8 +306,10 @@ function controller(wichSide) {
}
var properties = Models.getModelProperties(foundModels[i]);
if (this.isLocked(properties)) {
print("Model locked " + properties.id);
} else {
print("Checking properties: " + properties.id + " " + properties.isKnownID);
var check = this.checkModel(properties);
if (check.valid) {
this.grab(foundModels[i], properties);
@ -298,6 +321,7 @@ function controller(wichSide) {
}
}
}
}
this.cleanup = function () {
Overlays.deleteOverlay(this.laser);
@ -463,8 +487,10 @@ function mousePressEvent(event) {
}
var properties = Models.getModelProperties(foundModels[i]);
if (this.isLocked(properties)) {
print("Model locked " + properties.id);
} else {
print("Checking properties: " + properties.id + " " + properties.isKnownID);
// P P - Model
// /| A - Palm
// / | d B - unit vector toward tip
@ -505,12 +531,13 @@ function mousePressEvent(event) {
orientation = MyAvatar.orientation;
intersection = rayPlaneIntersection(pickRay, P, Quat.getFront(orientation));
print("Clicked on " + selectedModelID.id + " " + modelSelected);
print("Clicked on " + selectedModelID.id + " " + modelSelected);
return;
}
}
}
}
}
var oldModifier = 0;