Skip to content

Commit

Permalink
Strip trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpeiris committed Nov 15, 2016
1 parent 2863233 commit b673b83
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions src/utilities/behaviors/Drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/behaviors/GamepadControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions src/utilities/behaviors/HoverColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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
}
Expand All @@ -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]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/behaviors/HoverScale.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions src/utilities/behaviors/Layout.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/behaviors/Spin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
**/
Expand Down
14 changes: 7 additions & 7 deletions src/utilities/shims/behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 () {
Expand Down Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand All @@ -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]');
Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit b673b83

Please sign in to comment.