Remove extra print statements and whitespace

This commit is contained in:
Ryan Huffman 2014-10-28 13:42:40 -07:00
parent 76c3e9f483
commit af103b22ff
2 changed files with 13 additions and 19 deletions

View file

@ -59,10 +59,8 @@ SelectionManager = (function() {
for (var i = 0; i < entityIDs.length; i++) { for (var i = 0; i < entityIDs.length; i++) {
var entityID = entityIDs[i]; var entityID = entityIDs[i];
if (entityID.isKnownID) { if (entityID.isKnownID) {
print('known!');
that.selections.push(entityID); that.selections.push(entityID);
} else { } else {
print('not known!');
that.pendingSelections.push(entityID); that.pendingSelections.push(entityID);
if (pendingSelectionTimer == null) { if (pendingSelectionTimer == null) {
pendingSelectionTimer = Script.setInterval(that._checkPendingSelections, PENDING_SELECTION_CHECK_INTERVAL); pendingSelectionTimer = Script.setInterval(that._checkPendingSelections, PENDING_SELECTION_CHECK_INTERVAL);
@ -74,12 +72,10 @@ SelectionManager = (function() {
}; };
that._checkPendingSelections = function() { that._checkPendingSelections = function() {
print("CHECKING PENDING SELCTIONS");
for (var i = 0; i < that.pendingSelections.length; i++) { for (var i = 0; i < that.pendingSelections.length; i++) {
var entityID = that.pendingSelections[i]; var entityID = that.pendingSelections[i];
var newEntityID = Entities.identifyEntity(entityID); var newEntityID = Entities.identifyEntity(entityID);
if (newEntityID.isKnownID) { if (newEntityID.isKnownID) {
print("is known!");
that.pendingSelections.splice(i, 1); that.pendingSelections.splice(i, 1);
that.addEntity(newEntityID); that.addEntity(newEntityID);
i--; i--;
@ -94,13 +90,11 @@ SelectionManager = (function() {
that.addEntity = function(entityID) { that.addEntity = function(entityID) {
if (entityID.isKnownID) { if (entityID.isKnownID) {
print('known: ' + entityID.id);
var idx = that.selections.indexOf(entityID); var idx = that.selections.indexOf(entityID);
if (idx == -1) { if (idx == -1) {
that.selections.push(entityID); that.selections.push(entityID);
} }
} else { } else {
print('not known!');
var idx = that.pendingSelections.indexOf(entityID); var idx = that.pendingSelections.indexOf(entityID);
if (idx == -1) { if (idx == -1) {
that.pendingSelections.push(entityID); that.pendingSelections.push(entityID);

View file

@ -1,4 +1,4 @@
//
// newEditEntities.js // newEditEntities.js
// examples // examples
// //
@ -272,7 +272,7 @@ var toolBar = (function () {
toggleNewModelButton(false); toggleNewModelButton(false);
file = Window.browse("Select your model file ...", file = Window.browse("Select your model file ...",
Settings.getValue("LastModelUploadLocation").path(), Settings.getValue("LastModelUploadLocation").path(),
"Model files (*.fst *.fbx)"); "Model files (*.fst *.fbx)");
//"Model files (*.fst *.fbx *.svo)"); //"Model files (*.fst *.fbx *.svo)");
if (file !== null) { if (file !== null) {
@ -295,7 +295,7 @@ var toolBar = (function () {
var position = Vec3.sum(MyAvatar.position, Vec3.multiply(Quat.getFront(MyAvatar.orientation), SPAWN_DISTANCE)); var position = Vec3.sum(MyAvatar.position, Vec3.multiply(Quat.getFront(MyAvatar.orientation), SPAWN_DISTANCE));
if (position.x > 0 && position.y > 0 && position.z > 0) { if (position.x > 0 && position.y > 0 && position.z > 0) {
Entities.addEntity({ Entities.addEntity({
type: "Box", type: "Box",
position: position, position: position,
dimensions: { x: DEFAULT_DIMENSION, y: DEFAULT_DIMENSION, z: DEFAULT_DIMENSION }, dimensions: { x: DEFAULT_DIMENSION, y: DEFAULT_DIMENSION, z: DEFAULT_DIMENSION },
@ -312,7 +312,7 @@ var toolBar = (function () {
var position = Vec3.sum(MyAvatar.position, Vec3.multiply(Quat.getFront(MyAvatar.orientation), SPAWN_DISTANCE)); var position = Vec3.sum(MyAvatar.position, Vec3.multiply(Quat.getFront(MyAvatar.orientation), SPAWN_DISTANCE));
if (position.x > 0 && position.y > 0 && position.z > 0) { if (position.x > 0 && position.y > 0 && position.z > 0) {
Entities.addEntity({ Entities.addEntity({
type: "Sphere", type: "Sphere",
position: position, position: position,
dimensions: { x: DEFAULT_DIMENSION, y: DEFAULT_DIMENSION, z: DEFAULT_DIMENSION }, dimensions: { x: DEFAULT_DIMENSION, y: DEFAULT_DIMENSION, z: DEFAULT_DIMENSION },
@ -433,7 +433,7 @@ function mousePressEvent(event) {
var angularSize = 2 * Math.atan(halfDiagonal / Vec3.distance(Camera.getPosition(), properties.position)) * 180 / 3.14; var angularSize = 2 * Math.atan(halfDiagonal / Vec3.distance(Camera.getPosition(), properties.position)) * 180 / 3.14;
var sizeOK = (allowLargeModels || angularSize < MAX_ANGULAR_SIZE) var sizeOK = (allowLargeModels || angularSize < MAX_ANGULAR_SIZE)
&& (allowSmallModels || angularSize > MIN_ANGULAR_SIZE); && (allowSmallModels || angularSize > MIN_ANGULAR_SIZE);
if (0 < x && sizeOK) { if (0 < x && sizeOK) {
@ -467,7 +467,7 @@ function mousePressEvent(event) {
w: selectedEntityProperties.rotation.w, w: selectedEntityProperties.rotation.w,
}; };
selectedEntityProperties.glowLevel = 0.0; selectedEntityProperties.glowLevel = 0.0;
print("Clicked on " + selectedEntityID.id + " " + entitySelected); print("Clicked on " + selectedEntityID.id + " " + entitySelected);
tooltip.updateText(selectedEntityProperties); tooltip.updateText(selectedEntityProperties);
tooltip.show(true); tooltip.show(true);
@ -481,7 +481,7 @@ function mouseMoveEvent(event) {
if (!isActive) { if (!isActive) {
return; return;
} }
// allow the selectionDisplay and cameraManager to handle the event first, if it doesn't handle it, then do our own thing // allow the selectionDisplay and cameraManager to handle the event first, if it doesn't handle it, then do our own thing
if (selectionDisplay.mouseMoveEvent(event) || cameraManager.mouseMoveEvent(event)) { if (selectionDisplay.mouseMoveEvent(event) || cameraManager.mouseMoveEvent(event)) {
return; return;
@ -496,11 +496,11 @@ function mouseMoveEvent(event) {
} }
var halfDiagonal = Vec3.length(entityIntersection.properties.dimensions) / 2.0; var halfDiagonal = Vec3.length(entityIntersection.properties.dimensions) / 2.0;
var angularSize = 2 * Math.atan(halfDiagonal / Vec3.distance(Camera.getPosition(), var angularSize = 2 * Math.atan(halfDiagonal / Vec3.distance(Camera.getPosition(),
entityIntersection.properties.position)) * 180 / 3.14; entityIntersection.properties.position)) * 180 / 3.14;
var sizeOK = (allowLargeModels || angularSize < MAX_ANGULAR_SIZE) var sizeOK = (allowLargeModels || angularSize < MAX_ANGULAR_SIZE)
&& (allowSmallModels || angularSize > MIN_ANGULAR_SIZE); && (allowSmallModels || angularSize > MIN_ANGULAR_SIZE);
if (entityIntersection.entityID.isKnownID && sizeOK) { if (entityIntersection.entityID.isKnownID && sizeOK) {
@ -510,7 +510,7 @@ function mouseMoveEvent(event) {
highlightedEntityID = entityIntersection.entityID; highlightedEntityID = entityIntersection.entityID;
selectionDisplay.highlightSelectable(entityIntersection.entityID); selectionDisplay.highlightSelectable(entityIntersection.entityID);
} }
} }
} }
@ -550,9 +550,9 @@ function setupModelMenus() {
} }
Menu.addMenuItem({ menuName: "Edit", menuItemName: "Paste Models", shortcutKey: "CTRL+META+V", afterItem: "Edit Properties..." }); Menu.addMenuItem({ menuName: "Edit", menuItemName: "Paste Models", shortcutKey: "CTRL+META+V", afterItem: "Edit Properties..." });
Menu.addMenuItem({ menuName: "Edit", menuItemName: "Allow Select Large Models", shortcutKey: "CTRL+META+L", Menu.addMenuItem({ menuName: "Edit", menuItemName: "Allow Select Large Models", shortcutKey: "CTRL+META+L",
afterItem: "Paste Models", isCheckable: true }); afterItem: "Paste Models", isCheckable: true });
Menu.addMenuItem({ menuName: "Edit", menuItemName: "Allow Select Small Models", shortcutKey: "CTRL+META+S", Menu.addMenuItem({ menuName: "Edit", menuItemName: "Allow Select Small Models", shortcutKey: "CTRL+META+S",
afterItem: "Allow Select Large Models", isCheckable: true }); afterItem: "Allow Select Large Models", isCheckable: true });
Menu.addMenuItem({ menuName: "File", menuItemName: "Models", isSeparator: true, beforeItem: "Settings" }); Menu.addMenuItem({ menuName: "File", menuItemName: "Models", isSeparator: true, beforeItem: "Settings" });