mirror of
https://github.com/lubosz/overte.git
synced 2025-04-25 01:03:59 +02:00
+= 1 ==> ++
This commit is contained in:
parent
03e0e21ce0
commit
680235a7b1
9 changed files with 78 additions and 78 deletions
|
@ -351,12 +351,12 @@ CreatePalette = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
var i,
|
||||
length;
|
||||
|
||||
for (i = 0, length = staticOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = staticOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(staticOverlays[i], { visible: visible });
|
||||
}
|
||||
|
||||
if (!visible) {
|
||||
for (i = 0, length = paletteItemHoverOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = paletteItemHoverOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(paletteItemHoverOverlays[i], { visible: false });
|
||||
}
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ CreatePalette = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
palettePanelOverlay = Overlays.addOverlay("cube", properties);
|
||||
|
||||
// Palette items.
|
||||
for (i = 0, length = PALETTE_ITEMS.length; i < length; i += 1) {
|
||||
for (i = 0, length = PALETTE_ITEMS.length; i < length; i++) {
|
||||
// Collision overlay.
|
||||
properties = Object.clone(PALETTE_ITEM.properties);
|
||||
properties.parentID = palettePanelOverlay;
|
||||
|
|
|
@ -56,9 +56,9 @@ Groups = function () {
|
|||
j,
|
||||
lengthJ;
|
||||
|
||||
for (i = 0, lengthI = rootEntityIDs.length; i < lengthI; i += 1) {
|
||||
for (i = 0, lengthI = rootEntityIDs.length; i < lengthI; i++) {
|
||||
if (excludes.indexOf(rootEntityIDs[i]) === -1) {
|
||||
for (j = 0, lengthJ = selections[i].length; j < lengthJ; j += 1) {
|
||||
for (j = 0, lengthJ = selections[i].length; j < lengthJ; j++) {
|
||||
result.push(selections[i][j]);
|
||||
}
|
||||
}
|
||||
|
@ -98,8 +98,8 @@ Groups = function () {
|
|||
// collisionless. (Don't need to worry about other groups physics properties because only those of the first entity in
|
||||
// the linkset are used by High Fidelity.) See Selection.applyPhysics().
|
||||
if (selections[0][0].dynamic) {
|
||||
for (i = 1, lengthI = selections.length; i < lengthI; i += 1) {
|
||||
for (j = 0, lengthJ = selections[i].length; j < lengthJ; j += 1) {
|
||||
for (i = 1, lengthI = selections.length; i < lengthI; i++) {
|
||||
for (j = 0, lengthJ = selections[i].length; j < lengthJ; j++) {
|
||||
undoData.push({
|
||||
entityID: selections[i][j].id,
|
||||
properties: {
|
||||
|
@ -120,7 +120,7 @@ Groups = function () {
|
|||
|
||||
// Make the first entity in the first group the root and link the first entities of all other groups to it.
|
||||
rootID = rootEntityIDs[0];
|
||||
for (i = 1, lengthI = rootEntityIDs.length; i < lengthI; i += 1) {
|
||||
for (i = 1, lengthI = rootEntityIDs.length; i < lengthI; i++) {
|
||||
undoData.push({
|
||||
entityID: rootEntityIDs[i],
|
||||
properties: { parentID: Uuid.NULL }
|
||||
|
@ -136,7 +136,7 @@ Groups = function () {
|
|||
|
||||
// Update selection.
|
||||
rootEntityIDs.splice(1, rootEntityIDs.length - 1);
|
||||
for (i = 1, lengthI = selections.length; i < lengthI; i += 1) {
|
||||
for (i = 1, lengthI = selections.length; i < lengthI; i++) {
|
||||
selections[i][0].parentID = rootID;
|
||||
selections[0] = selections[0].concat(selections[i]);
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ Groups = function () {
|
|||
|
||||
// Compile information on immediate children.
|
||||
rootID = rootEntityIDs[0];
|
||||
for (i = 1, lengthI = selections[0].length; i < lengthI; i += 1) {
|
||||
for (i = 1, lengthI = selections[0].length; i < lengthI; i++) {
|
||||
if (selections[0][i].parentID === rootID) {
|
||||
childrenIDs.push(selections[0][i].id);
|
||||
childrenIndexes.push(i);
|
||||
|
@ -205,7 +205,7 @@ Groups = function () {
|
|||
|
||||
// Unlink children.
|
||||
isUngroupAll = hasSoloChildren !== hasGroupChildren;
|
||||
for (i = childrenIDs.length - 1; i >= 0; i -= 1) {
|
||||
for (i = childrenIDs.length - 1; i >= 0; i--) {
|
||||
if (isUngroupAll || childrenIndexIsGroup[i]) {
|
||||
undoData.push({
|
||||
entityID: childrenIDs[i],
|
||||
|
@ -227,8 +227,8 @@ Groups = function () {
|
|||
// If root group has physics, reset child groups to defaults for dynamic and collisionless. See
|
||||
// Selection.applyPhysics().
|
||||
if (selections[0][0].dynamic) {
|
||||
for (i = 1, lengthI = selections.length; i < lengthI; i += 1) {
|
||||
for (j = 0, lengthJ = selections[i].length; j < lengthJ; j += 1) {
|
||||
for (i = 1, lengthI = selections.length; i < lengthI; i++) {
|
||||
for (j = 0, lengthJ = selections[i].length; j < lengthJ; j++) {
|
||||
undoData.push({
|
||||
entityID: selections[i][j].id,
|
||||
properties: {
|
||||
|
|
|
@ -160,7 +160,7 @@ Hand = function (side) {
|
|||
if (overlayIDs.length > 1) {
|
||||
// Find closest overlay.
|
||||
overlayDistance = Vec3.length(Vec3.subtract(Overlays.getProperty(overlayID, "position"), palmPosition));
|
||||
for (i = 1, length = overlayIDs.length; i < length; i += 1) {
|
||||
for (i = 1, length = overlayIDs.length; i < length; i++) {
|
||||
distance =
|
||||
Vec3.length(Vec3.subtract(Overlays.getProperty(overlayIDs[i], "position"), palmPosition));
|
||||
if (distance > overlayDistance) {
|
||||
|
@ -191,7 +191,7 @@ Hand = function (side) {
|
|||
if (entityIDs.length > 1) {
|
||||
// Find smallest, editable entity.
|
||||
entitySize = HALF_TREE_SCALE;
|
||||
for (i = 0, length = entityIDs.length; i < length; i += 1) {
|
||||
for (i = 0, length = entityIDs.length; i < length; i++) {
|
||||
if (Entities.hasEditableRoot(entityIDs[i])) {
|
||||
size = Vec3.length(Entities.getEntityProperties(entityIDs[i], "dimensions").dimensions);
|
||||
if (size < entitySize) {
|
||||
|
|
|
@ -187,7 +187,7 @@ Handles = function (side) {
|
|||
// At right-most and opposite corners of bounding box.
|
||||
cameraUp = Quat.getUp(Camera.orientation);
|
||||
maxCrossProductScale = 0;
|
||||
for (i = 0; i < NUM_CORNERS; i += 1) {
|
||||
for (i = 0; i < NUM_CORNERS; i++) {
|
||||
cornerPosition = Vec3.sum(boundingBoxCenter,
|
||||
Vec3.multiplyQbyV(boundingBoxOrientation,
|
||||
Vec3.multiplyVbyV(CORNER_HANDLE_OVERLAY_AXES[i], boundingBoxDimensions)));
|
||||
|
@ -202,7 +202,7 @@ Handles = function (side) {
|
|||
cornerIndexes[0] = leftCornerIndex;
|
||||
cornerIndexes[1] = rightCornerIndex;
|
||||
cornerHandleDimensions = Vec3.multiply(distanceMultiplier, CORNER_HANDLE_OVERLAY_DIMENSIONS);
|
||||
for (i = 0; i < NUM_CORNER_HANDLES; i += 1) {
|
||||
for (i = 0; i < NUM_CORNER_HANDLES; i++) {
|
||||
cornerHandleOverlays[i] = Overlays.addOverlay("sphere", {
|
||||
parentID: rootEntityID,
|
||||
localPosition: Vec3.sum(boundingBoxLocalCenter,
|
||||
|
@ -224,7 +224,7 @@ Handles = function (side) {
|
|||
if (!isMultipleEntities) {
|
||||
faceHandleDimensions = Vec3.multiply(distanceMultiplier, FACE_HANDLE_OVERLAY_DIMENSIONS);
|
||||
faceHandleOffsets = Vec3.multiply(distanceMultiplier, FACE_HANDLE_OVERLAY_OFFSETS);
|
||||
for (i = 0; i < NUM_FACE_HANDLES; i += 1) {
|
||||
for (i = 0; i < NUM_FACE_HANDLES; i++) {
|
||||
if (!isSuppressZAxis || FACE_HANDLE_OVERLAY_AXES[i].z === 0) {
|
||||
faceHandleOverlays[i] = Overlays.addOverlay("shape", {
|
||||
parentID: rootEntityID,
|
||||
|
@ -263,7 +263,7 @@ Handles = function (side) {
|
|||
});
|
||||
|
||||
// Corner scale handles.
|
||||
for (i = 0; i < NUM_CORNER_HANDLES; i += 1) {
|
||||
for (i = 0; i < NUM_CORNER_HANDLES; i++) {
|
||||
Overlays.editOverlay(cornerHandleOverlays[i], {
|
||||
localPosition: Vec3.sum(scalingBoundingBoxDimensions,
|
||||
Vec3.multiplyVbyV(CORNER_HANDLE_OVERLAY_AXES[cornerIndexes[i]], scalingBoundingBoxLocalCenter))
|
||||
|
@ -272,7 +272,7 @@ Handles = function (side) {
|
|||
|
||||
// Face scale handles.
|
||||
if (faceHandleOverlays.length > 0) {
|
||||
for (i = 0; i < NUM_FACE_HANDLES; i += 1) {
|
||||
for (i = 0; i < NUM_FACE_HANDLES; i++) {
|
||||
Overlays.editOverlay(faceHandleOverlays[i], {
|
||||
localPosition: Vec3.sum(scalingBoundingBoxDimensions,
|
||||
Vec3.multiplyVbyV(FACE_HANDLE_OVERLAY_AXES[i],
|
||||
|
@ -314,7 +314,7 @@ Handles = function (side) {
|
|||
i,
|
||||
length;
|
||||
|
||||
for (i = 0, length = cornerHandleOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = cornerHandleOverlays.length; i < length; i++) {
|
||||
overlay = cornerHandleOverlays[i];
|
||||
Overlays.editOverlay(overlay, {
|
||||
visible: isVisible && (isShowAll || overlay === overlayID),
|
||||
|
@ -323,7 +323,7 @@ Handles = function (side) {
|
|||
});
|
||||
}
|
||||
|
||||
for (i = 0, length = faceHandleOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = faceHandleOverlays.length; i < length; i++) {
|
||||
overlay = faceHandleOverlays[i];
|
||||
Overlays.editOverlay(overlay, {
|
||||
visible: isVisible && (isShowAll || overlay === overlayID),
|
||||
|
@ -338,10 +338,10 @@ Handles = function (side) {
|
|||
length;
|
||||
|
||||
Overlays.deleteOverlay(boundingBoxOverlay);
|
||||
for (i = 0; i < NUM_CORNER_HANDLES; i += 1) {
|
||||
for (i = 0; i < NUM_CORNER_HANDLES; i++) {
|
||||
Overlays.deleteOverlay(cornerHandleOverlays[i]);
|
||||
}
|
||||
for (i = 0, length = faceHandleOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = faceHandleOverlays.length; i < length; i++) {
|
||||
Overlays.deleteOverlay(faceHandleOverlays[i]);
|
||||
}
|
||||
|
||||
|
|
|
@ -104,14 +104,14 @@ Highlights = function (side) {
|
|||
editEntityOverlay(0, selection[entityIndex], overlayColor);
|
||||
} else {
|
||||
// Add/edit entity overlays for all entities in selection.
|
||||
for (i = 0, length = selection.length; i < length; i += 1) {
|
||||
for (i = 0, length = selection.length; i < length; i++) {
|
||||
maybeAddEntityOverlay(i);
|
||||
editEntityOverlay(i, selection[i], overlayColor);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete extra entity overlays.
|
||||
for (i = entityOverlays.length - 1, length = selection.length; i >= length; i -= 1) {
|
||||
for (i = entityOverlays.length - 1, length = selection.length; i >= length; i--) {
|
||||
Overlays.deleteOverlay(entityOverlays[i]);
|
||||
entityOverlays.splice(i, 1);
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ Highlights = function (side) {
|
|||
Overlays.editOverlay(boundingBoxOverlay, { visible: false });
|
||||
|
||||
// Delete entity overlays.
|
||||
for (i = 0, length = entityOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = entityOverlays.length; i < length; i++) {
|
||||
Overlays.deleteOverlay(entityOverlays[i]);
|
||||
}
|
||||
entityOverlays = [];
|
||||
|
|
|
@ -96,7 +96,7 @@ History = (function () {
|
|||
}
|
||||
|
||||
history.push({ undoData: undoData, redoData: redoData });
|
||||
undoPosition += 1;
|
||||
undoPosition++;
|
||||
|
||||
undoData = {};
|
||||
redoData = {};
|
||||
|
@ -112,7 +112,7 @@ History = (function () {
|
|||
length;
|
||||
|
||||
if (properties) {
|
||||
for (i = 0, length = properties.length; i < length; i += 1) {
|
||||
for (i = 0, length = properties.length; i < length; i++) {
|
||||
if (properties[i].entityID === oldEntityID) {
|
||||
properties[i].entityID = newEntityID;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ History = (function () {
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0, length = history.length; i < length; i += 1) {
|
||||
for (i = 0, length = history.length; i < length; i++) {
|
||||
if (history[i].undoData) {
|
||||
updateEntityIDsInProperty(history[i].undoData.setProperties);
|
||||
updateEntityIDsInProperty(history[i].undoData.createEntities);
|
||||
|
@ -155,14 +155,14 @@ History = (function () {
|
|||
undoData = history[undoPosition].undoData;
|
||||
|
||||
if (undoData.createEntities) {
|
||||
for (i = 0, length = undoData.createEntities.length; i < length; i += 1) {
|
||||
for (i = 0, length = undoData.createEntities.length; i < length; i++) {
|
||||
entityID = Entities.addEntity(undoData.createEntities[i].properties);
|
||||
updateEntityIDs(undoData.createEntities[i].entityID, entityID);
|
||||
}
|
||||
}
|
||||
|
||||
if (undoData.setProperties) {
|
||||
for (i = 0, length = undoData.setProperties.length; i < length; i += 1) {
|
||||
for (i = 0, length = undoData.setProperties.length; i < length; i++) {
|
||||
Entities.editEntity(undoData.setProperties[i].entityID, undoData.setProperties[i].properties);
|
||||
if (undoData.setProperties[i].properties.gravity) {
|
||||
kickPhysics(undoData.setProperties[i].entityID);
|
||||
|
@ -171,12 +171,12 @@ History = (function () {
|
|||
}
|
||||
|
||||
if (undoData.deleteEntities) {
|
||||
for (i = 0, length = undoData.deleteEntities.length; i < length; i += 1) {
|
||||
for (i = 0, length = undoData.deleteEntities.length; i < length; i++) {
|
||||
Entities.deleteEntity(undoData.deleteEntities[i].entityID);
|
||||
}
|
||||
}
|
||||
|
||||
undoPosition -= 1;
|
||||
undoPosition--;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,14 +191,14 @@ History = (function () {
|
|||
redoData = history[undoPosition + 1].redoData;
|
||||
|
||||
if (redoData.createEntities) {
|
||||
for (i = 0, length = redoData.createEntities.length; i < length; i += 1) {
|
||||
for (i = 0, length = redoData.createEntities.length; i < length; i++) {
|
||||
entityID = Entities.addEntity(redoData.createEntities[i].properties);
|
||||
updateEntityIDs(redoData.createEntities[i].entityID, entityID);
|
||||
}
|
||||
}
|
||||
|
||||
if (redoData.setProperties) {
|
||||
for (i = 0, length = redoData.setProperties.length; i < length; i += 1) {
|
||||
for (i = 0, length = redoData.setProperties.length; i < length; i++) {
|
||||
Entities.editEntity(redoData.setProperties[i].entityID, redoData.setProperties[i].properties);
|
||||
if (redoData.setProperties[i].properties.gravity) {
|
||||
kickPhysics(redoData.setProperties[i].entityID);
|
||||
|
@ -207,12 +207,12 @@ History = (function () {
|
|||
}
|
||||
|
||||
if (redoData.deleteEntities) {
|
||||
for (i = 0, length = redoData.deleteEntities.length; i < length; i += 1) {
|
||||
for (i = 0, length = redoData.deleteEntities.length; i < length; i++) {
|
||||
Entities.deleteEntity(redoData.deleteEntities[i].entityID);
|
||||
}
|
||||
}
|
||||
|
||||
undoPosition += 1;
|
||||
undoPosition++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ SelectionManager = function (side) {
|
|||
}
|
||||
|
||||
children = Entities.getChildrenIDs(id);
|
||||
for (i = 0, length = children.length; i < length; i += 1) {
|
||||
for (i = 0, length = children.length; i < length; i++) {
|
||||
if (Entities.getNestableType(children[i]) === ENTITY_TYPE) {
|
||||
traverseEntityTree(children[i], selection, selectionIDs, selectionProperties);
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ SelectionManager = function (side) {
|
|||
min = Vec3.multiplyVbyV(Vec3.subtract(Vec3.ZERO, selection[0].registrationPoint), selection[0].dimensions);
|
||||
max = Vec3.multiplyVbyV(Vec3.subtract(Vec3.ONE, selection[0].registrationPoint), selection[0].dimensions);
|
||||
inverseOrientation = Quat.inverse(rootOrientation);
|
||||
for (i = 1, length = selection.length; i < length; i += 1) {
|
||||
for (i = 1, length = selection.length; i < length; i++) {
|
||||
|
||||
registration = selection[i].registrationPoint;
|
||||
corners[0] = { x: -registration.x, y: -registration.y, z: -registration.z };
|
||||
|
@ -180,7 +180,7 @@ SelectionManager = function (side) {
|
|||
rotation = selection[i].rotation;
|
||||
dimensions = selection[i].dimensions;
|
||||
|
||||
for (j = 0; j < NUM_CORNERS; j += 1) {
|
||||
for (j = 0; j < NUM_CORNERS; j++) {
|
||||
// Corner position in world coordinates.
|
||||
corners[j] = Vec3.sum(position, Vec3.multiplyQbyV(rotation, Vec3.multiplyVbyV(corners[j], dimensions)));
|
||||
// Corner position in root entity coordinates.
|
||||
|
@ -247,7 +247,7 @@ SelectionManager = function (side) {
|
|||
startOrientation = selection[0].rotation;
|
||||
|
||||
// Disable entity set's physics.
|
||||
for (i = selection.length - 1; i >= 0; i -= 1) {
|
||||
for (i = selection.length - 1; i >= 0; i--) {
|
||||
Entities.editEntity(selection[i].id, {
|
||||
dynamic: false, // So that gravity doesn't fight with us trying to hold the entity in place.
|
||||
collisionless: true, // So that entity doesn't bump us about as we resize the entity.
|
||||
|
@ -267,7 +267,7 @@ SelectionManager = function (side) {
|
|||
|
||||
// Restore entity set's physics.
|
||||
// Note: Need to apply children-first in order to avoid children's relative positions sometimes drifting.
|
||||
for (i = selection.length - 1; i >= 0; i -= 1) {
|
||||
for (i = selection.length - 1; i >= 0; i--) {
|
||||
Entities.editEntity(selection[i].id, {
|
||||
dynamic: selection[i].dynamic,
|
||||
collisionless: selection[i].collisionless
|
||||
|
@ -360,7 +360,7 @@ SelectionManager = function (side) {
|
|||
});
|
||||
|
||||
// Scale and position children.
|
||||
for (i = 1, length = selection.length; i < length; i += 1) {
|
||||
for (i = 1, length = selection.length; i < length; i++) {
|
||||
Entities.editEntity(selection[i].id, {
|
||||
dimensions: Vec3.multiply(factor, selection[i].dimensions),
|
||||
localPosition: Vec3.multiply(factor, selection[i].localPosition)
|
||||
|
@ -400,7 +400,7 @@ SelectionManager = function (side) {
|
|||
});
|
||||
|
||||
// Final scale and position of children.
|
||||
for (i = 1, length = selection.length; i < length; i += 1) {
|
||||
for (i = 1, length = selection.length; i < length; i++) {
|
||||
undoData.push({
|
||||
entityID: selection[i].id,
|
||||
properties: {
|
||||
|
@ -473,7 +473,7 @@ SelectionManager = function (side) {
|
|||
// Scale and position children.
|
||||
// Only corner handles are used for scaling multiple entities so scale factor is the same in all dimensions.
|
||||
// Therefore don't need to take into account orientation relative to parent when scaling local position.
|
||||
for (i = 1, length = selection.length; i < length; i += 1) {
|
||||
for (i = 1, length = selection.length; i < length; i++) {
|
||||
Entities.editEntity(selection[i].id, {
|
||||
dimensions: Vec3.multiplyVbyV(factor, selection[i].dimensions),
|
||||
localPosition: Vec3.multiplyVbyV(factor, selection[i].localPosition)
|
||||
|
@ -513,7 +513,7 @@ SelectionManager = function (side) {
|
|||
});
|
||||
|
||||
// Final scale and position of children.
|
||||
for (i = 1, length = selection.length; i < length; i += 1) {
|
||||
for (i = 1, length = selection.length; i < length; i++) {
|
||||
undoData.push({
|
||||
entityID: selection[i].id,
|
||||
properties: {
|
||||
|
@ -555,12 +555,12 @@ SelectionManager = function (side) {
|
|||
length;
|
||||
|
||||
// Map parent IDs; find intersectedEntityID's index.
|
||||
for (i = 1, length = selection.length; i < length; i += 1) {
|
||||
for (i = 1, length = selection.length; i < length; i++) {
|
||||
if (selection[i].id === intersectedEntityID) {
|
||||
intersectedEntityIndex = i;
|
||||
}
|
||||
parentID = selection[i].parentID;
|
||||
for (j = 0; j < i; j += 1) {
|
||||
for (j = 0; j < i; j++) {
|
||||
if (parentID === selection[j].id) {
|
||||
parentIDIndexes[i] = j;
|
||||
break;
|
||||
|
@ -569,7 +569,7 @@ SelectionManager = function (side) {
|
|||
}
|
||||
|
||||
// Clone entities.
|
||||
for (i = 0, length = selection.length; i < length; i += 1) {
|
||||
for (i = 0, length = selection.length; i < length; i++) {
|
||||
properties = Entities.getEntityProperties(selection[i].id);
|
||||
if (i > 0) {
|
||||
properties.parentID = selection[parentIDIndexes[i]].id;
|
||||
|
@ -600,7 +600,7 @@ SelectionManager = function (side) {
|
|||
length;
|
||||
|
||||
if (isApplyToAll) {
|
||||
for (i = 0, length = selection.length; i < length; i += 1) {
|
||||
for (i = 0, length = selection.length; i < length; i++) {
|
||||
properties = Entities.getEntityProperties(selection[i].id, ["type", "color"]);
|
||||
if (ENTITY_TYPES_WITH_COLOR.indexOf(properties.type) !== -1) {
|
||||
Entities.editEntity(selection[i].id, {
|
||||
|
@ -680,7 +680,7 @@ SelectionManager = function (side) {
|
|||
dynamic: physicsProperties.dynamic,
|
||||
collisionless: physicsProperties.dynamic || physicsProperties.collisionless
|
||||
};
|
||||
for (i = 1, length = selection.length; i < length; i += 1) {
|
||||
for (i = 1, length = selection.length; i < length; i++) {
|
||||
undoData.push({
|
||||
entityID: selection[i].id,
|
||||
properties: {
|
||||
|
|
|
@ -2094,7 +2094,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
Overlays.editOverlay(menuHeaderIconOverlay, { visible: false });
|
||||
|
||||
// Display menu items.
|
||||
for (i = 0, length = MENU_ITEMS.length; i < length; i += 1) {
|
||||
for (i = 0, length = MENU_ITEMS.length; i < length; i++) {
|
||||
properties = Object.clone(UI_ELEMENTS[MENU_ITEMS[i].type].properties);
|
||||
properties = Object.merge(properties, MENU_ITEMS[i].properties);
|
||||
properties.visible = isVisible;
|
||||
|
@ -2144,7 +2144,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
var i,
|
||||
length;
|
||||
|
||||
for (i = 0, length = menuOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = menuOverlays.length; i < length; i++) {
|
||||
Overlays.deleteOverlay(menuOverlays[i]);
|
||||
}
|
||||
|
||||
|
@ -2192,7 +2192,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
// Open specified options panel.
|
||||
optionsItems = OPTONS_PANELS[menuItem.toolOptions];
|
||||
parentID = menuPanelOverlay;
|
||||
for (i = 0, length = optionsItems.length; i < length; i += 1) {
|
||||
for (i = 0, length = optionsItems.length; i < length; i++) {
|
||||
properties = Object.clone(UI_ELEMENTS[optionsItems[i].type].properties);
|
||||
if (optionsItems[i].properties) {
|
||||
properties = Object.merge(properties, optionsItems[i].properties);
|
||||
|
@ -2447,7 +2447,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
swatchHighlightOverlay = null;
|
||||
}
|
||||
|
||||
for (i = 0, length = optionsOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = optionsOverlays.length; i < length; i++) {
|
||||
Overlays.deleteOverlay(optionsOverlays[i]);
|
||||
}
|
||||
optionsOverlays = [];
|
||||
|
@ -2477,7 +2477,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
length;
|
||||
|
||||
// Display footer items.
|
||||
for (i = 0, length = FOOTER_ITEMS.length; i < length; i += 1) {
|
||||
for (i = 0, length = FOOTER_ITEMS.length; i < length; i++) {
|
||||
properties = Object.clone(UI_ELEMENTS[FOOTER_ITEMS[i].type].properties);
|
||||
properties = Object.merge(properties, FOOTER_ITEMS[i].properties);
|
||||
properties.visible = isVisible;
|
||||
|
@ -2812,7 +2812,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
|
||||
// Hide options.
|
||||
items = optionsItems[index].items;
|
||||
for (i = 0, length = items.length; i < length; i += 1) {
|
||||
for (i = 0, length = items.length; i < length; i++) {
|
||||
index = optionsOverlaysIDs.indexOf(items[i]);
|
||||
Overlays.editOverlay(optionsOverlays[index], {
|
||||
localPosition: Vec3.ZERO,
|
||||
|
@ -2841,7 +2841,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
|
||||
// Show options.
|
||||
items = optionsItems[index].items;
|
||||
for (i = 0, length = items.length; i < length; i += 1) {
|
||||
for (i = 0, length = items.length; i < length; i++) {
|
||||
index = optionsOverlaysIDs.indexOf(items[i]);
|
||||
Overlays.editOverlay(optionsOverlays[index], {
|
||||
parentID: parentID,
|
||||
|
@ -2947,53 +2947,53 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
var i,
|
||||
length;
|
||||
|
||||
for (i = 0, length = staticOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = staticOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(staticOverlays[i], { visible: visible });
|
||||
}
|
||||
|
||||
if (isOptionsOpen) {
|
||||
Overlays.editOverlay(menuHeaderBackOverlay, { visible: visible });
|
||||
Overlays.editOverlay(menuHeaderIconOverlay, { visible: visible });
|
||||
for (i = 0, length = optionsOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = optionsOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(optionsOverlays[i], { visible: visible });
|
||||
}
|
||||
for (i = 0, length = optionsOverlaysLabels.length; i < length; i += 1) {
|
||||
for (i = 0, length = optionsOverlaysLabels.length; i < length; i++) {
|
||||
Overlays.editOverlay(optionsOverlaysLabels[i], { visible: visible });
|
||||
}
|
||||
for (i = 0, length = optionsOverlaysSublabels.length; i < length; i += 1) {
|
||||
for (i = 0, length = optionsOverlaysSublabels.length; i < length; i++) {
|
||||
Overlays.editOverlay(optionsOverlaysSublabels[i], { visible: visible });
|
||||
}
|
||||
for (i = 0, length = optionsExtraOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = optionsExtraOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(optionsExtraOverlays[i], { visible: visible });
|
||||
}
|
||||
} else {
|
||||
for (i = 0, length = menuOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = menuOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(menuOverlays[i], { visible: visible });
|
||||
}
|
||||
for (i = 0, length = menuIconOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = menuIconOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(menuIconOverlays[i], { visible: visible });
|
||||
}
|
||||
for (i = 0, length = menuLabelOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = menuLabelOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(menuLabelOverlays[i], { visible: visible });
|
||||
}
|
||||
if (!visible) {
|
||||
for (i = 0, length = menuHoverOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = menuHoverOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(menuHoverOverlays[i], { visible: false });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0, length = footerOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = footerOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(footerOverlays[i], { visible: visible });
|
||||
}
|
||||
for (i = 0, length = footerIconOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = footerIconOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(footerIconOverlays[i], { visible: visible });
|
||||
}
|
||||
for (i = 0, length = footerLabelOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = footerLabelOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(footerLabelOverlays[i], { visible: visible });
|
||||
}
|
||||
if (!visible) {
|
||||
for (i = 0, length = footerHoverOverlays.length; i < length; i += 1) {
|
||||
for (i = 0, length = footerHoverOverlays.length; i < length; i++) {
|
||||
Overlays.editOverlay(footerHoverOverlays[i], { visible: false });
|
||||
}
|
||||
}
|
||||
|
@ -3621,7 +3621,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
isGroupButtonEnabled = false;
|
||||
isUngroupButtonEnabled = false;
|
||||
isClearGroupingButtonEnabled = false;
|
||||
for (i = 0, length = OPTONS_PANELS.groupOptions.length; i < length; i += 1) {
|
||||
for (i = 0, length = OPTONS_PANELS.groupOptions.length; i < length; i++) {
|
||||
id = OPTONS_PANELS.groupOptions[i].id;
|
||||
if (id === "groupButton") {
|
||||
groupButtonIndex = i;
|
||||
|
|
|
@ -1330,7 +1330,7 @@
|
|||
i,
|
||||
length;
|
||||
children = Entities.getChildrenIDs(id);
|
||||
for (i = 0, length = children.length; i < length; i += 1) {
|
||||
for (i = 0, length = children.length; i < length; i++) {
|
||||
if (Entities.getNestableType(children[i]) === ENTITY_TYPE) {
|
||||
childrenIDs.push(children[i]);
|
||||
traverseEntityTree(children[i]);
|
||||
|
@ -1381,7 +1381,7 @@
|
|||
isInside = Math.abs(cornerPosition.x) <= boundingBoxHalfDimensions.x
|
||||
&& Math.abs(cornerPosition.y) <= boundingBoxHalfDimensions.y
|
||||
&& Math.abs(cornerPosition.z) <= boundingBoxHalfDimensions.z;
|
||||
i += 1;
|
||||
i++;
|
||||
}
|
||||
|
||||
return isInside;
|
||||
|
@ -1424,7 +1424,7 @@
|
|||
if (selectInBoxSelection.count() > 1) {
|
||||
boundingBox = selectInBoxSelection.boundingBox();
|
||||
entityIDs = Entities.findEntities(boundingBox.center, Vec3.length(boundingBox.dimensions) / 2);
|
||||
for (i = 0, lengthI = entityIDs.length; i < lengthI; i += 1) {
|
||||
for (i = 0, lengthI = entityIDs.length; i < lengthI; i++) {
|
||||
entityID = entityIDs[i];
|
||||
if (checkedEntityIDs.indexOf(entityID) === -1) {
|
||||
rootID = Entities.rootOf(entityID);
|
||||
|
@ -1435,7 +1435,7 @@
|
|||
lengthJ = groupIDs.length;
|
||||
while (doIncludeGroup && j < lengthJ) {
|
||||
doIncludeGroup = isInsideBoundingBox(groupIDs[j], boundingBox);
|
||||
j += 1;
|
||||
j++;
|
||||
}
|
||||
checkedEntityIDs = checkedEntityIDs.concat(groupIDs);
|
||||
if (doIncludeGroup) {
|
||||
|
@ -1465,7 +1465,7 @@
|
|||
rootEntityIDs = groups.rootEntityIDs();
|
||||
if (rootEntityIDs.length > 0) {
|
||||
selectInBoxSelection.select(rootEntityIDs[0]);
|
||||
for (i = 1, length = rootEntityIDs.length; i < length; i += 1) {
|
||||
for (i = 1, length = rootEntityIDs.length; i < length; i++) {
|
||||
selectInBoxSelection.append(rootEntityIDs[i]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue