diff --git a/src/utilities/behaviors/Drag.js b/src/utilities/behaviors/Drag.js index efe74726..4ebb8a50 100644 --- a/src/utilities/behaviors/Drag.js +++ b/src/utilities/behaviors/Drag.js @@ -9,11 +9,11 @@ window.altspace.utilities.behaviors = window.altspace.utilities.behaviors || {}; /** * A behavior that makes an object draggable along a plane. * @class Drag - * @param {Object} [config] Specify the axes along which the object can be + * @param {Object} [config] Specify the axes along which the object can be * dragged. - * E.g. To constraint th object to an XY plane: `{x: true, y: true}` + * E.g. To constraint th object to an XY plane: `{x: true, y: true}` * Each axis can also be an object specifying the minimum and maximum limits - * of the constraint. E.g. `{x: {min: -10, max: 20}, y: true}` + * of the constraint. E.g. `{x: {min: -10, max: 20}, y: true}` * **Note:** Currently you must specify exactly two axes. * @memberof module:altspace/utilities/behaviors */ @@ -98,7 +98,7 @@ altspace.utilities.behaviors.Drag = function (config) { } else if (axisCount === 1) { throw new Error('Single axis dragging currently unsupported.'); - //TODO: make possible, possibly via view-aligned plane + //TODO: make possible, possibly via view-aligned plane } else { throw new Error('Invalid axis configuration'); @@ -128,7 +128,7 @@ altspace.utilities.behaviors.Drag = function (config) { scene.addEventListener('cursorup', stopDrag); scene.addEventListener('cursormove', moveDrag); - //Remember difference between center of object and drag point. + //Remember difference between center of object and drag point. //Otherwise, object appears to 'jump' when selected, moving so its //center is directly until the cursor. We allow drag on edge of object. raycaster.set(event.ray.origin, event.ray.direction); diff --git a/src/utilities/behaviors/GamepadControls.js b/src/utilities/behaviors/GamepadControls.js index 59a39eb1..1515da72 100644 --- a/src/utilities/behaviors/GamepadControls.js +++ b/src/utilities/behaviors/GamepadControls.js @@ -122,7 +122,7 @@ altspace.utilities.behaviors.GamepadControls = function (config) { } if (!gamepad) return; - //For axis and button numbers see: https://w3c.github.io/gamepad/ + //For axis and button numbers see: https://w3c.github.io/gamepad/ var isResetButton = gamepad.buttons[8].pressed;//reset / back button if (isResetButton) { if (!sync.isMine) sync.takeOwnership(); diff --git a/src/utilities/behaviors/HoverColor.js b/src/utilities/behaviors/HoverColor.js index 2e087a00..fcdbbd2e 100644 --- a/src/utilities/behaviors/HoverColor.js +++ b/src/utilities/behaviors/HoverColor.js @@ -54,7 +54,7 @@ altspace.utilities.behaviors.HoverColor = function(config){ //for example during a drag we don't want to change highlight if (cursordownObject && cursordownObject !== object3d){ return; - } + } if (cursorenterObject){ unsetcolor(cursorenterObject); } @@ -79,10 +79,10 @@ altspace.utilities.behaviors.HoverColor = function(config){ function setColor(o){ if (o.material && o.material.color){ o.userData.origColor = o.material.color; - o.material.color = config.color; + o.material.color = config.color; //Not strictly needed but seems to make updating faster in Altspace. if (o.material) o.material.needsUpdate = true; - } + } for (var i = 0; i < o.children.length; i++){ setColor(o.children[i], config.color);//recursively apply to children } @@ -96,7 +96,7 @@ altspace.utilities.behaviors.HoverColor = function(config){ } o.material.color = o.userData.origColor; if (o.material) o.material.needsUpdate = true; - } + } for (var i = 0; i < o.children.length; i++){ unsetColor(o.children[i]); } diff --git a/src/utilities/behaviors/HoverScale.js b/src/utilities/behaviors/HoverScale.js index 730f4e04..15ed4684 100644 --- a/src/utilities/behaviors/HoverScale.js +++ b/src/utilities/behaviors/HoverScale.js @@ -16,7 +16,7 @@ altspace.utilities.behaviors.HoverScale = function(config) { var scale = config.scale || 1.15; var duration = config.duration || 75; // Milliseconds var revertOnDispose = ((config.revertOnDispose !== undefined) ? config.revertOnDispose : true); - + var object3d; var originalScale; var elapsedTime; diff --git a/src/utilities/behaviors/Layout.es6.js b/src/utilities/behaviors/Layout.es6.js index 304193be..529fbd62 100644 --- a/src/utilities/behaviors/Layout.es6.js +++ b/src/utilities/behaviors/Layout.es6.js @@ -15,27 +15,27 @@ let origParentBoundingBoxes = new Map(); /** - * The Layout behavior allows you to position objects easily. You can - * position an object relative to its parent (either the Scene or a + * The Layout behavior allows you to position objects easily. You can + * position an object relative to its parent (either the Scene or a * another object) by using a position specifier for each of the axes. * The position specifier can be one of 'min', 'center' or 'max'. The default * specifier is 'center'. You can also add a modifier to the position in pixels - * ('min+5'), a percentage ('min+10%') or meters ('min+1m'). Finally, you can - * choose the location of the anchor on the object you are trying to position + * ('min+5'), a percentage ('min+10%') or meters ('min+1m'). Finally, you can + * choose the location of the anchor on the object you are trying to position * by using the 'my' parameter. * You must specify at least one axis on the 'at' parameter. * * @example * // Position the top of the cube at 1.5 meters above the bottom of its parent. * cube.addBehavior(new altpsace.utilities.behaviors.Layout({ - * my: {y: 'max'}, + * my: {y: 'max'}, * at: {y: 'min+1.5m'} * }); * * @class Layout * @memberof module:altspace/utilities/behaviors * @param {Object} config - * @param {Object} config.at An object containing the axes and position + * @param {Object} config.at An object containing the axes and position * specifiers. At least one axis must be specificed. E.g. `{x: 'min', y: 'max-5%'}` * @param {Object} [config.my] An object containing the axes and position * specifiers for the layout anchor. @@ -127,7 +127,7 @@ class Layout { altspace.getEnclosure().then((_enclosure) => { this[enclosure] = _enclosure; if (this[object3D].parent instanceof THREE.Scene) { - let + let hw = this[enclosure].innerWidth / 2, hh = this[enclosure].innerHeight / 2, hd = this[enclosure].innerDepth / 2; diff --git a/src/utilities/behaviors/Spin.js b/src/utilities/behaviors/Spin.js index 71a4641c..c2478d8f 100644 --- a/src/utilities/behaviors/Spin.js +++ b/src/utilities/behaviors/Spin.js @@ -7,7 +7,7 @@ window.altspace.utilities.behaviors = window.altspace.utilities.behaviors || {}; * * @class Spin * @param {Object} [config] - * @param {Number} [config.speed=0.0001] Rotation speed in radians per + * @param {Number} [config.speed=0.0001] Rotation speed in radians per * millisecond * @memberof module:altspace/utilities/behaviors **/ diff --git a/src/utilities/shims/behaviors.js b/src/utilities/shims/behaviors.js index a77778d5..3e27c471 100644 --- a/src/utilities/shims/behaviors.js +++ b/src/utilities/shims/behaviors.js @@ -3,9 +3,9 @@ */ /** - * The AltspaceDK includes a Behaviors shim that adds Behavior capabilities to + * The AltspaceDK includes a Behaviors shim that adds Behavior capabilities to * Three.js. - * It adds methods to Three.js' Scene and Object3D classes which allow you to + * It adds methods to Three.js' Scene and Object3D classes which allow you to * add, remove, retrieve and use Behaviors. * * @namespace THREE @@ -20,7 +20,7 @@ /** * Update the behaviors of all the objects in this Scene. * @instance - * @method updateAllBehaviors + * @method updateAllBehaviors * @memberof THREE.Scene */ THREE.Scene.prototype.updateAllBehaviors = function () { @@ -61,7 +61,7 @@ THREE.Scene.prototype.updateAllBehaviors = function () { /** * Adds the given behavior to this object. * @instance - * @method addBehavior + * @method addBehavior * @param {Behavior} behavior Behavior to add. * @memberof THREE.Object3D */ @@ -88,7 +88,7 @@ THREE.Object3D.prototype.addBehaviors = function() * Removes the given behavior from this object. The behavior is disposed if * possible. * @instance - * @method removeBehavior + * @method removeBehavior * @param {...Behavior} behavior Behavior to remove. * @memberof THREE.Object3D */ @@ -102,7 +102,7 @@ THREE.Object3D.prototype.removeBehavior = function(behavior) if (behavior.dispose) behavior.dispose.call(behavior, this); } catch (error) { - + console.group(); (console.error || console.log).call(console, error.stack || error); console.log('[Behavior]'); @@ -151,7 +151,7 @@ THREE.Object3D.prototype.removeAllBehaviors = function () * Retrieve a behavior by type. * @instance * @method getBehaviorByType - * @param {String} type + * @param {String} type * @returns {Behavior} * @memberof THREE.Object3D */