From 714865c4dd194b6b074e578770bb04eff3518ca8 Mon Sep 17 00:00:00 2001 From: Noeri Huisman Date: Tue, 13 Feb 2024 11:14:00 +0100 Subject: [PATCH] Fix typos and spelling --- examples/mixed-reality/watch/hand-menu-button.js | 2 +- examples/mixed-reality/watch/hand-menu.js | 4 ++-- examples/showcase/model-viewer/model-viewer.js | 2 +- src/components/animation.js | 4 ++-- src/components/cursor.js | 2 +- src/components/hand-tracking-grab-controls.js | 10 +++++----- src/components/hp-mixed-reality-controls.js | 4 ++-- src/components/layer.js | 2 +- src/components/link.js | 4 ++-- src/components/look-controls.js | 2 +- src/components/oculus-touch-controls.js | 2 +- src/components/raycaster.js | 4 ++-- src/components/scene/ar-hit-test.js | 6 +++--- src/components/scene/real-world-meshing.js | 2 +- src/components/scene/screenshot.js | 6 +++--- src/components/scene/xr-mode-ui.js | 2 +- src/components/tracked-controls-webvr.js | 4 ++-- src/components/tracked-controls-webxr.js | 4 ++-- src/components/valve-index-controls.js | 2 +- src/components/windows-motion-controls.js | 2 +- src/core/a-entity.js | 6 +++--- src/core/component.js | 6 +++--- src/core/scene/a-scene.js | 4 ++-- src/core/schema.js | 2 +- src/systems/geometry.js | 2 +- src/systems/light.js | 2 +- src/systems/renderer.js | 2 +- src/utils/math.js | 2 +- src/utils/tracked-controls.js | 10 +++++----- tests/__init.test.js | 4 ++-- tests/components/cursor.test.js | 2 +- tests/components/material.test.js | 6 +++--- tests/components/oculus-go-controls.test.js | 2 +- tests/components/sound.test.js | 2 +- tests/components/vive-focus-controls.test.js | 2 +- tests/components/windows-motion-controls.test.js | 4 ++-- tests/helpers.js | 2 +- tests/systems/camera.test.js | 2 +- tests/systems/shadow.test.js | 2 +- tests/utils/coordinates.test.js | 2 +- 40 files changed, 68 insertions(+), 68 deletions(-) diff --git a/examples/mixed-reality/watch/hand-menu-button.js b/examples/mixed-reality/watch/hand-menu-button.js index 98cc08fd972..80e56c45d12 100644 --- a/examples/mixed-reality/watch/hand-menu-button.js +++ b/examples/mixed-reality/watch/hand-menu-button.js @@ -96,7 +96,7 @@ AFRAME.registerComponent('hand-menu-button', { }); /* - User's hand can collide with multiple buttons simulatenously but only want one in a hovered state. + User's hand can collide with multiple buttons simultaneously but only want one in a hovered state. This system keeps track of all the collided buttons, keeping just the closest to the hand in a hovered state. */ AFRAME.registerSystem('hand-menu-button', { diff --git a/examples/mixed-reality/watch/hand-menu.js b/examples/mixed-reality/watch/hand-menu.js index 22a93ea33fa..2b745bfcdf1 100644 --- a/examples/mixed-reality/watch/hand-menu.js +++ b/examples/mixed-reality/watch/hand-menu.js @@ -182,7 +182,7 @@ AFRAME.registerComponent('hand-menu', { }, onPinchStarted: (function () { - var auxMaxtrix = new THREE.Matrix4(); + var auxMatrix = new THREE.Matrix4(); var auxQuaternion = new THREE.Quaternion(); return function (evt) { if (!this.handHoveringEl || this.opened) { return; } @@ -191,7 +191,7 @@ AFRAME.registerComponent('hand-menu', { this.menuEl.emit('open'); function lookAtVector (sourcePoint, destPoint) { return auxQuaternion.setFromRotationMatrix( - auxMaxtrix.identity() + auxMatrix.identity() .lookAt(sourcePoint, destPoint, new THREE.Vector3(0, 1, 0))); } diff --git a/examples/showcase/model-viewer/model-viewer.js b/examples/showcase/model-viewer/model-viewer.js index 5e97a28fff4..8d7ca0e8595 100644 --- a/examples/showcase/model-viewer/model-viewer.js +++ b/examples/showcase/model-viewer/model-viewer.js @@ -203,7 +203,7 @@ AFRAME.registerComponent('model-viewer', { var arShadowEl = this.arShadowEl = document.createElement('a-entity'); // The title / legend displayed above the model. var titleEl = this.titleEl = document.createElement('a-entity'); - // Scene ligthing. + // Scene lighting. var lightEl = this.lightEl = document.createElement('a-entity'); var sceneLightEl = this.sceneLightEl = document.createElement('a-entity'); diff --git a/src/components/animation.js b/src/components/animation.js index ec8ba5bc925..523e70a7a38 100644 --- a/src/components/animation.js +++ b/src/components/animation.js @@ -323,8 +323,8 @@ module.exports.Component = registerComponent('animation', { value = anim.animatables[0].target.aframeProperty; // Need to do a last value check for animation timeline since all the tweening - // begins simultaenously even if the value has not changed. Also better for perf - // anyways. + // begins simultaneously even if the value has not changed. Also better for perf + // anyway. if (value === lastValue) { return; } lastValue = value; diff --git a/src/components/cursor.js b/src/components/cursor.js index cfddbd2d3d9..c2ebf867bdb 100644 --- a/src/components/cursor.js +++ b/src/components/cursor.js @@ -459,7 +459,7 @@ module.exports.Component = registerComponent('cursor', { // Clear fuseTimeout. clearTimeout(this.fuseTimeout); - // Set intersection to another raycasted element if any. + // Set intersection to another raycast element if any. if (ignoreRemaining === true) { return; } intersections = this.el.components.raycaster.intersections; if (intersections.length === 0) { return; } diff --git a/src/components/hand-tracking-grab-controls.js b/src/components/hand-tracking-grab-controls.js index 7f43bd0f68d..cebcd0659d9 100644 --- a/src/components/hand-tracking-grab-controls.js +++ b/src/components/hand-tracking-grab-controls.js @@ -119,11 +119,11 @@ registerComponent('hand-tracking-grab-controls', { grab: function () { var grabbedEl = this.grabbedEl; - var grabedObjectWorldPosition; + var grabbedObjectWorldPosition; - grabedObjectWorldPosition = grabbedEl.object3D.getWorldPosition(this.grabbedObjectPosition); + grabbedObjectWorldPosition = grabbedEl.object3D.getWorldPosition(this.grabbedObjectPosition); - this.grabDeltaPosition.copy(grabedObjectWorldPosition).sub(this.pinchPosition); + this.grabDeltaPosition.copy(grabbedObjectWorldPosition).sub(this.pinchPosition); this.grabInitialRotation.copy(this.auxQuaternion.copy(this.wristRotation).invert()); this.originalUpdateMatrixWorld = grabbedEl.object3D.updateMatrixWorld; @@ -159,8 +159,8 @@ registerComponent('hand-tracking-grab-controls', { // Both grabbing and grabbed entities position and rotation. // 1. Move grabbed entity to the pinch position (middle point between index and thumb) - // 2. Apply the rotation delta (substract initial rotation) of the grabbing entity position (wrist). - // 3. Translate grabbed entity to the original position: distance betweeen grabbed and grabbing entities at collision time. + // 2. Apply the rotation delta (subtract initial rotation) of the grabbing entity position (wrist). + // 3. Translate grabbed entity to the original position: distance between grabbed and grabbing entities at collision time. // 4. Apply grabbed entity rotation. // 5. Preserve original scale. diff --git a/src/components/hp-mixed-reality-controls.js b/src/components/hp-mixed-reality-controls.js index e2f72f59c35..8af348aad5d 100644 --- a/src/components/hp-mixed-reality-controls.js +++ b/src/components/hp-mixed-reality-controls.js @@ -11,7 +11,7 @@ var onButtonEvent = trackedControlsUtils.onButtonEvent; // TODO: Add a more robust system for deriving gamepad name. var GAMEPAD_ID = 'hp-mixed-reality'; var AFRAME_CDN_ROOT = require('../constants').AFRAME_CDN_ROOT; -var HP_MIXEDL_REALITY_MODEL_GLB_BASE_URL = AFRAME_CDN_ROOT + 'controllers/hp/mixed-reality/'; +var HP_MIXED_REALITY_MODEL_GLB_BASE_URL = AFRAME_CDN_ROOT + 'controllers/hp/mixed-reality/'; var HP_MIXED_REALITY_POSITION_OFFSET = {x: 0, y: 0, z: 0.06}; var HP_MIXED_REALITY_ROTATION_OFFSET = {_x: Math.PI / 4, _y: 0, _z: 0, _order: 'XYZ'}; @@ -131,7 +131,7 @@ module.exports.Component = registerComponent('hp-mixed-reality-controls', { // Load model. if (!this.data.model) { return; } - this.el.setAttribute('gltf-model', HP_MIXEDL_REALITY_MODEL_GLB_BASE_URL + this.data.hand + '.glb'); + this.el.setAttribute('gltf-model', HP_MIXED_REALITY_MODEL_GLB_BASE_URL + this.data.hand + '.glb'); }, addControllersUpdateListener: function () { diff --git a/src/components/layer.js b/src/components/layer.js index d9db209e307..dc4f42c8ba7 100644 --- a/src/components/layer.js +++ b/src/components/layer.js @@ -179,7 +179,7 @@ module.exports.Component = registerComponent('layer', { var gl = this.el.sceneEl.renderer.getContext(); var cubefaceTextures; - // dont flip the pixels as we load them into the texture buffer. + // don't flip the pixels as we load them into the texture buffer. // TEXTURE_CUBE_MAP expects the Y to be flipped for the faces and it already // is flipped in our texture image. gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); diff --git a/src/components/link.js b/src/components/link.js index 9cd93650710..d6a56eae033 100644 --- a/src/components/link.js +++ b/src/components/link.js @@ -168,7 +168,7 @@ module.exports.Component = registerComponent('link', { /** * 1. Swap plane that represents portal with sphere with a hole when the camera is close - * so user can peek inside portal. Sphere is rendered on oposite side of portal + * so user can peek inside portal. Sphere is rendered on opposite side of portal * from where user enters. * 2. Place the url/title above or inside portal depending on distance to camera. * 3. Face portal to camera when far away from user. @@ -228,7 +228,7 @@ module.exports.Component = registerComponent('link', { this.semiSphereEl.setAttribute('visible', true); this.peekCameraPortalOrientation = cameraPortalOrientation; } else { - // Calculate wich side the camera is approaching the camera (back / front). + // Calculate which side the camera is approaching the camera (back / front). // Adjust text orientation based on camera position. if (cameraPortalOrientation <= 0.0) { textEl.setAttribute('rotation', '0 180 0'); diff --git a/src/components/look-controls.js b/src/components/look-controls.js index a508487c22e..d78d5b4bf11 100644 --- a/src/components/look-controls.js +++ b/src/components/look-controls.js @@ -358,7 +358,7 @@ module.exports.Component = registerComponent('look-controls', { deltaY = 2 * Math.PI * (evt.touches[0].pageX - this.touchStart.x) / canvas.clientWidth; direction = this.data.reverseTouchDrag ? 1 : -1; - // Limit touch orientaion to to yaw (y axis). + // Limit touch orientation to to yaw (y axis). yawObject.rotation.y -= deltaY * 0.5 * direction; this.touchStart = { x: evt.touches[0].pageX, diff --git a/src/components/oculus-touch-controls.js b/src/components/oculus-touch-controls.js index 039e66018ca..c844030bdee 100644 --- a/src/components/oculus-touch-controls.js +++ b/src/components/oculus-touch-controls.js @@ -358,7 +358,7 @@ module.exports.Component = registerComponent('oculus-touch-controls', { } } } - // Pass along changed event with button state, using the buttom mapping for convenience. + // Pass along changed event with button state, using the button mapping for convenience. this.el.emit(button + 'changed', evt.detail.state); }, diff --git a/src/components/raycaster.js b/src/components/raycaster.js index 3c10dd3bd38..b8a44ce9319 100644 --- a/src/components/raycaster.js +++ b/src/components/raycaster.js @@ -103,7 +103,7 @@ module.exports.Component = registerComponent('raycaster', { (data.far !== oldData.far || data.origin !== oldData.origin || data.direction !== oldData.direction || !oldData.showLine)) { // Calculate unit vector for line direction. Can be multiplied via scalar and added - // to orign to adjust line length. + // to origin to adjust line length. this.unitLineEndVec3.copy(data.direction).normalize(); this.drawLine(); } @@ -400,7 +400,7 @@ module.exports.Component = registerComponent('raycaster', { * Children are flattened by one level, removing the THREE.Group wrapper, * so that non-recursive raycasting remains useful. * - * Only push children defined as component attachements (e.g., setObject3D), + * Only push children defined as component attachments (e.g., setObject3D), * NOT actual children in the scene graph hierarchy. * * @param {Array} els diff --git a/src/components/scene/ar-hit-test.js b/src/components/scene/ar-hit-test.js index 039e80a740a..1fe6f80db75 100644 --- a/src/components/scene/ar-hit-test.js +++ b/src/components/scene/ar-hit-test.js @@ -292,7 +292,7 @@ module.exports.Component = register('ar-hit-test', { this.el.emit('ar-hit-test-start'); }.bind(this)); - // These are transient inputs so need to be handled seperately + // These are transient inputs so need to be handled separately var profileToSupport = 'generic-touchscreen'; var transientHitTest = new HitTest(renderer, { profile: profileToSupport @@ -345,7 +345,7 @@ module.exports.Component = register('ar-hit-test', { applyPose(applyPose.tempFakePose, object, this.bboxOffset); object.visible = true; - // create an anchor attatched to the object + // create an anchor attached to the object this.hitTest.anchorFromLastHitTestResult(object, this.bboxOffset); } } @@ -452,7 +452,7 @@ module.exports.Component = register('ar-hit-test', { var renderer = this.el.sceneEl.renderer; if (frame) { - // if we are in XR then update the positions of the objects attatched to anchors + // if we are in XR then update the positions of the objects attached to anchors HitTest.updateAnchorPoses(frame, renderer.xr.getReferenceSpace()); } if (this.bboxNeedsUpdate) { diff --git a/src/components/scene/real-world-meshing.js b/src/components/scene/real-world-meshing.js index 76fdb1e1932..416d73f3f0a 100644 --- a/src/components/scene/real-world-meshing.js +++ b/src/components/scene/real-world-meshing.js @@ -5,7 +5,7 @@ var THREE = require('../../lib/three'); /** * Real World Meshing. * - * Create entities with meshes corresponding to 3D surfaces detected in user's enviornment. + * Create entities with meshes corresponding to 3D surfaces detected in user's environment. * It requires a browser with support for the WebXR Mesh and Plane detection modules. * */ diff --git a/src/components/scene/screenshot.js b/src/components/scene/screenshot.js index bee23fa19ac..398e4832749 100644 --- a/src/components/scene/screenshot.js +++ b/src/components/scene/screenshot.js @@ -34,14 +34,14 @@ var FRAGMENT_SHADER = [ ].join('\n'); /** - * Component to take screenshots of the scene using a keboard shortcut (alt+s). + * Component to take screenshots of the scene using a keyboard shortcut (alt+s). * It can be configured to either take 360° captures (`equirectangular`) * or regular screenshots (`projection`) * * This is based on https://github.com/spite/THREE.CubemapToEquirectangular * To capture an equirectangular projection of the scene a THREE.CubeCamera is used * The cube map produced by the CubeCamera is projected on a quad and then rendered to - * WebGLRenderTarget with an ortographic camera. + * WebGLRenderTarget with an orthographic camera. */ module.exports.Component = registerComponent('screenshot', { schema: { @@ -216,7 +216,7 @@ module.exports.Component = registerComponent('screenshot', { renderer.setRenderTarget(output); renderer.render(el.object3D, camera); renderer.autoClear = autoClear; - // Read image pizels back. + // Read image pixels back. renderer.readRenderTargetPixels(output, 0, 0, size.width, size.height, pixels); renderer.setRenderTarget(null); if (projection === 'perspective') { diff --git a/src/components/scene/xr-mode-ui.js b/src/components/scene/xr-mode-ui.js index bd482228310..d7616c50f65 100644 --- a/src/components/scene/xr-mode-ui.js +++ b/src/components/scene/xr-mode-ui.js @@ -11,7 +11,7 @@ var HIDDEN_CLASS = 'a-hidden'; var ORIENTATION_MODAL_CLASS = 'a-orientation-modal'; /** - * UI for Aentering VR mode. + * UI for entering VR mode. */ module.exports.Component = registerComponent('xr-mode-ui', { dependencies: ['canvas'], diff --git a/src/components/tracked-controls-webvr.js b/src/components/tracked-controls-webvr.js index c0b7ec79e9c..c886f22e072 100644 --- a/src/components/tracked-controls-webvr.js +++ b/src/components/tracked-controls-webvr.js @@ -277,7 +277,7 @@ module.exports.Component = registerComponent('tracked-controls-webvr', { }, /** - * Determine whether a button press has occured and emit events as appropriate. + * Determine whether a button press has occurred and emit events as appropriate. * * @param {string} id - ID of the button to check. * @param {object} buttonState - State of the button to check. @@ -297,7 +297,7 @@ module.exports.Component = registerComponent('tracked-controls-webvr', { }, /** - * Determine whether a button touch has occured and emit events as appropriate. + * Determine whether a button touch has occurred and emit events as appropriate. * * @param {string} id - ID of the button to check. * @param {object} buttonState - State of the button to check. diff --git a/src/components/tracked-controls-webxr.js b/src/components/tracked-controls-webxr.js index 66f0355acd9..92f345b4ae5 100644 --- a/src/components/tracked-controls-webxr.js +++ b/src/components/tracked-controls-webxr.js @@ -165,7 +165,7 @@ module.exports.Component = registerComponent('tracked-controls-webxr', { }, /** - * Determine whether a button press has occured and emit events as appropriate. + * Determine whether a button press has occurred and emit events as appropriate. * * @param {string} id - ID of the button to check. * @param {object} buttonState - State of the button to check. @@ -185,7 +185,7 @@ module.exports.Component = registerComponent('tracked-controls-webxr', { }, /** - * Determine whether a button touch has occured and emit events as appropriate. + * Determine whether a button touch has occurred and emit events as appropriate. * * @param {string} id - ID of the button to check. * @param {object} buttonState - State of the button to check. diff --git a/src/components/valve-index-controls.js b/src/components/valve-index-controls.js index dc595e9a1ae..c00f016dd2f 100644 --- a/src/components/valve-index-controls.js +++ b/src/components/valve-index-controls.js @@ -216,7 +216,7 @@ module.exports.Component = registerComponent('valve-index-controls', { controllerObject3D.rotation.copy(INDEX_CONTROLLER_ROTATION_OFFSET[this.data.hand]); this.el.emit('controllermodelready', { - name: 'valve-index-controlls', + name: 'valve-index-controls', model: this.data.model, rayOrigin: new THREE.Vector3(0, 0, 0) }); diff --git a/src/components/windows-motion-controls.js b/src/components/windows-motion-controls.js index 29d39d84d32..b2a4058cd3f 100644 --- a/src/components/windows-motion-controls.js +++ b/src/components/windows-motion-controls.js @@ -262,7 +262,7 @@ module.exports.Component = registerComponent('windows-motion-controls', { }, loadModel: function (url) { - // The model is loaded by the gltf-model compoent when this attribute is initially set, + // The model is loaded by the gltf-model component when this attribute is initially set, // removed and re-loaded if the given url changes. this.el.setAttribute('gltf-model', 'url(' + url + ')'); }, diff --git a/src/core/a-entity.js b/src/core/a-entity.js index 8f5d34a56b9..9b8549e3f55 100644 --- a/src/core/a-entity.js +++ b/src/core/a-entity.js @@ -310,7 +310,7 @@ class AEntity extends ANode { // Initialize dependencies first this.initComponentDependencies(componentName); - // If component name has an id we check component type multiplic + // If component name has an id we check component type multiplicity. if (componentId && !COMPONENTS[componentName].multiple) { throw new Error('Trying to initialize multiple ' + 'components of type `' + componentName + @@ -677,7 +677,7 @@ class AEntity extends ANode { newAttrValue[arg1] = arg2; clobber = false; } else { - // Update with a value, object, or CSS-style property string, with the possiblity + // Update with a value, object, or CSS-style property string, with the possibility // of clobbering previous values. newAttrValue = arg1; clobber = (arg2 === true); @@ -845,7 +845,7 @@ function mergeComponentData (attrValue, extraData) { return utils.extend(extraData, utils.styleParser.parse(attrValue || {})); } - // Return data, precendence to the defined value. + // Return data, precedence to the defined value. return attrValue || extraData; } diff --git a/src/core/component.js b/src/core/component.js index 99f3fe89a1c..40df3ab1cce 100644 --- a/src/core/component.js +++ b/src/core/component.js @@ -92,7 +92,7 @@ Component.prototype = { init: function () { /* no-op */ }, /** - * Map of event names to binded event handlers that will be lifecycle-handled. + * Map of event names to bound event handlers that will be lifecycle-handled. * Will be detached on pause / remove. * Will be attached on play. */ @@ -495,7 +495,7 @@ Component.prototype = { if (this.isObjectBased) { utils.objectPool.clearObject(nextData); } - // 1. Gather default values (lowest precendence). + // 1. Gather default values (lowest precedence). if (this.isSingleProperty) { if (this.isObjectBased) { // If object-based single-prop, then copy over the data to our pooled object. @@ -532,7 +532,7 @@ Component.prototype = { data = extendProperties(data, mixinData, this.isObjectBased); } - // 3. Gather attribute values (highest precendence). + // 3. Gather attribute values (highest precedence). if (componentDefined) { if (this.isSingleProperty) { // If object-based, copy the value to not modify the original. diff --git a/src/core/scene/a-scene.js b/src/core/scene/a-scene.js index 50d5fad2e5a..52d67bc994e 100644 --- a/src/core/scene/a-scene.js +++ b/src/core/scene/a-scene.js @@ -25,7 +25,7 @@ if (isIOS) { require('../../utils/ios-orientationchange-blank-bug'); } updated on every tick. * @member {object} camera - three.js Camera object. * @member {object} canvas - * @member {bool} isScene - Differentiates as scene entity as opposed to other entites. + * @member {bool} isScene - Differentiates as scene entity as opposed to other entities. * @member {bool} isMobile - Whether browser is mobile (via UA detection). * @member {object} object3D - Root three.js Scene object. * @member {object} renderer @@ -902,7 +902,7 @@ function setupCanvas (sceneEl) { document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement; - // No fullscren element === exit fullscreen + // No fullscreen element === exit fullscreen if (!fullscreenEl) { sceneEl.exitVR(); } document.activeElement.blur(); document.body.focus(); diff --git a/src/core/schema.js b/src/core/schema.js index 0655a0a071e..7a3e7dc80aa 100644 --- a/src/core/schema.js +++ b/src/core/schema.js @@ -195,7 +195,7 @@ function stringifyProperty (value, propDefinition) { // value when it's not an object we save one unnecessary call // to JSON.stringify. if (typeof value !== 'object') { return value; } - // if there's no schema for the property we use standar JSON stringify + // if there's no schema for the property we use standard JSON stringify if (!propDefinition || value === null) { return JSON.stringify(value); } return propDefinition.stringify(value); } diff --git a/src/systems/geometry.js b/src/systems/geometry.js index e1b524a926b..a0d978899c0 100755 --- a/src/systems/geometry.js +++ b/src/systems/geometry.js @@ -106,7 +106,7 @@ function createGeometry (data) { } /** - * Decreate count of entity using a geometry. + * Decrease count of entity using a geometry. */ function decrementCacheCount (cacheCount, hash) { cacheCount[hash]--; diff --git a/src/systems/light.js b/src/systems/light.js index 1c3d4b564de..4d2fd18e148 100755 --- a/src/systems/light.js +++ b/src/systems/light.js @@ -52,7 +52,7 @@ module.exports.System = registerSystem('light', { }, /** - * Prescibe default lights to the scene. + * Prescribe default lights to the scene. * Does so by injecting markup such that this state is not invisible. * These lights are removed if the user adds any lights. */ diff --git a/src/systems/renderer.js b/src/systems/renderer.js index 758e2f8410b..5b924bc1afd 100644 --- a/src/systems/renderer.js +++ b/src/systems/renderer.js @@ -51,7 +51,7 @@ module.exports.System = registerSystem('renderer', { warn('Component `logarithmicDepthBuffer` is deprecated. Use `renderer="logarithmicDepthBuffer: true"` instead.'); } - // These properties are always the same, regardless of rendered oonfiguration + // These properties are always the same, regardless of rendered configuration renderer.sortObjects = true; renderer.setOpaqueSort(sortFrontToBack); }, diff --git a/src/utils/math.js b/src/utils/math.js index 6fa169da712..50cdc1fad8b 100644 --- a/src/utils/math.js +++ b/src/utils/math.js @@ -1,5 +1,5 @@ /** - * Find the disatance from a plane defined by a point on the plane and the normal of the plane to any point. + * Find the distance from a plane defined by a point on the plane and the normal of the plane to any point. * @param {THREE.Vector3} positionOnPlane any point on the plane. * @param {THREE.Vector3} planeNormal the normal of the plane * @param {THREE.Vector3} pointToTest point to test diff --git a/src/utils/tracked-controls.js b/src/utils/tracked-controls.js index b48653b5cf9..bc61bf142fc 100644 --- a/src/utils/tracked-controls.js +++ b/src/utils/tracked-controls.js @@ -118,7 +118,7 @@ function findMatchingControllerWebVR (controllers, filterIdExact, filterIdPrefix filterControllerIndex) { var controller; var i; - var matchingControllerOccurence = 0; + var matchingControllerOccurrence = 0; var targetControllerMatch = filterControllerIndex >= 0 ? filterControllerIndex : 0; for (i = 0; i < controllers.length; i++) { @@ -144,10 +144,10 @@ function findMatchingControllerWebVR (controllers, filterIdExact, filterIdPrefix return controller; } - // We are looking for the nth occurence of a matching controller + // We are looking for the nth occurrence of a matching controller // (n equals targetControllerMatch). - if (matchingControllerOccurence === targetControllerMatch) { return controller; } - ++matchingControllerOccurence; + if (matchingControllerOccurrence === targetControllerMatch) { return controller; } + ++matchingControllerOccurrence; } return undefined; } @@ -190,7 +190,7 @@ module.exports.findMatchingControllerWebVR = findMatchingControllerWebVR; module.exports.findMatchingControllerWebXR = findMatchingControllerWebXR; /** - * Emit specific `moved` event(s) if axes changed based on original axismoved event. + * Emit specific `moved` event(s) if axes changed based on original axismove event. * * @param {object} component - Controller component in use. * @param {array} axesMapping - For example `{thumbstick: [0, 1]}`. diff --git a/tests/__init.test.js b/tests/__init.test.js index 8382f712ecc..c187b787efb 100644 --- a/tests/__init.test.js +++ b/tests/__init.test.js @@ -21,8 +21,8 @@ navigator.getVRDisplays = function () { const AFRAME = require('index'); var AScene = require('core/scene/a-scene').AScene; -// Make sure WebGL context is not created since Travix CT runs headless. -// Stubs below failed once in a while due to asynchronous tesst setup / teardown. +// Make sure WebGL context is not created since CI runs headless. +// Stubs below failed once in a while due to asynchronous test setup / teardown. AScene.prototype.setupRenderer = function () {}; setup(function () { diff --git a/tests/components/cursor.test.js b/tests/components/cursor.test.js index b1812673906..5e31a2ae028 100644 --- a/tests/components/cursor.test.js +++ b/tests/components/cursor.test.js @@ -220,7 +220,7 @@ suite('cursor', function () { }); }); - test('emits mousenter event on intersectedEl, ignoring el intersection', function (done) { + test('emits mouseenter event on intersectedEl, ignoring el intersection', function (done) { once(intersectedEl, 'mouseenter', function (evt) { assert.equal(evt.detail.cursorEl, el); done(); diff --git a/tests/components/material.test.js b/tests/components/material.test.js index 487a2394d4b..99ebc33a3e2 100644 --- a/tests/components/material.test.js +++ b/tests/components/material.test.js @@ -247,7 +247,7 @@ suite('material', function () { assert.equal(el.getObject3D('mesh').material.side, THREE.DoubleSide); }); - test('sets material.needsUpdate true if side switchs from/to double', function () { + test('sets material.needsUpdate true if side switches from/to double', function () { var oldMaterialVersion = el.getObject3D('mesh').material.version; el.setAttribute('material', 'side: front'); assert.equal(el.getObject3D('mesh').material.version, oldMaterialVersion); @@ -308,7 +308,7 @@ suite('material', function () { el.setAttribute('material', 'alphaTest: 0.0'); assert.equal(el.getObject3D('mesh').material.version, oldMaterialVersion); el.setAttribute('material', 'alphaTest: 1.0'); - // A-Frame sets needsUpdate twice and THREE one more internaly when setting alphaTest. + // A-Frame sets needsUpdate twice and THREE one more internally when setting alphaTest. assert.equal(el.getObject3D('mesh').material.version, oldMaterialVersion + 3); }); }); @@ -349,7 +349,7 @@ suite('material', function () { assert.equal(el.components.material.material.blending, THREE.AdditiveBlending); }); - test('can set to subtractibv', function () { + test('can set to subtractive', function () { el.setAttribute('material', 'blending', 'subtractive'); assert.equal(el.components.material.material.blending, THREE.SubtractiveBlending); }); diff --git a/tests/components/oculus-go-controls.test.js b/tests/components/oculus-go-controls.test.js index 2af7202e240..897e87c540f 100644 --- a/tests/components/oculus-go-controls.test.js +++ b/tests/components/oculus-go-controls.test.js @@ -203,7 +203,7 @@ suite('oculus-go-controls', function () { // Verify that the function which applies arm model is not called when disabled. sinon.assert.notCalled(applyArmModelSpy); - // Additionally verify that no other offets have been applied. + // Additionally verify that no other offsets have been applied. assert.strictEqual(el.object3D.position.x, 0); assert.strictEqual(el.object3D.position.y, 0); assert.strictEqual(el.object3D.position.z, 0); diff --git a/tests/components/sound.test.js b/tests/components/sound.test.js index 61e55f48ad3..9a9b54b96c9 100644 --- a/tests/components/sound.test.js +++ b/tests/components/sound.test.js @@ -102,7 +102,7 @@ suite('sound', function () { el.pause(); // Currently we're calling stop when the component is paused as we reset - // the state on `play` instad of resuming it + // the state on `play` instead of resuming it assert.notOk(sound.pause.called); assert.ok(sound.stop.called); }); diff --git a/tests/components/vive-focus-controls.test.js b/tests/components/vive-focus-controls.test.js index 323e7e950a7..fc2a01ba233 100644 --- a/tests/components/vive-focus-controls.test.js +++ b/tests/components/vive-focus-controls.test.js @@ -208,7 +208,7 @@ suite('vive-focus-controls', function () { // Verify that the function which applies arm model is not called when disabled. sinon.assert.notCalled(applyArmModelSpy); - // Additionally verify that no other offets have been applied. + // Additionally verify that no other offsets have been applied. assert.strictEqual(el.object3D.position.x, 0); assert.strictEqual(el.object3D.position.y, 0); assert.strictEqual(el.object3D.position.z, 0); diff --git a/tests/components/windows-motion-controls.test.js b/tests/components/windows-motion-controls.test.js index c1662a681be..5601854c6a8 100644 --- a/tests/components/windows-motion-controls.test.js +++ b/tests/components/windows-motion-controls.test.js @@ -47,7 +47,7 @@ suite('windows-motion-controls', function () { assert.notOk(injectTrackedControlsSpy.called, 'injectTrackedControls not called'); assert.notOk(addEventListenersSpy.called, 'addEventListeners not called'); assert.ok(removeEventListenersSpy.called, 'removeEventListeners called'); - assert.strictEqual(component.controllerPresent, false, 'contollers not present'); + assert.strictEqual(component.controllerPresent, false, 'controllers not present'); }); test('does not call removeEventListeners multiple times', function () { @@ -64,7 +64,7 @@ suite('windows-motion-controls', function () { assert.notOk(injectTrackedControlsSpy.called, 'injectTrackedControls not called'); assert.notOk(addEventListenersSpy.called, 'addEventListeners not called'); assert.notOk(removeEventListenersSpy.called, 'removeEventListeners not called'); - assert.strictEqual(component.controllerPresent, false, 'contollers not present'); + assert.strictEqual(component.controllerPresent, false, 'controllers not present'); }); test('attach events if controller is newly present', function () { diff --git a/tests/helpers.js b/tests/helpers.js index 363fa62d23e..a01c4791759 100644 --- a/tests/helpers.js +++ b/tests/helpers.js @@ -44,7 +44,7 @@ module.exports.entityFactory = entityFactory; /** * A more robust entity factory that resolves once stuff is loaded without having to wait - * on fragile asynchrony. + * on fragile asynchronicity. * * @returns {Promise} */ diff --git a/tests/systems/camera.test.js b/tests/systems/camera.test.js index b1a413fdc13..5241d95a5c5 100644 --- a/tests/systems/camera.test.js +++ b/tests/systems/camera.test.js @@ -59,7 +59,7 @@ suite('camera system', function () { document.body.appendChild(sceneEl); // Trigger scene load through assets. Camera will be waiting for assets. - // Add `setTimeout` to mimic asynchrony of asset loading. + // Add `setTimeout` to mimic asynchronicity of asset loading. setTimeout(function () { assetsEl.load(); }); }); diff --git a/tests/systems/shadow.test.js b/tests/systems/shadow.test.js index d23685ef924..8f1bd216696 100644 --- a/tests/systems/shadow.test.js +++ b/tests/systems/shadow.test.js @@ -33,7 +33,7 @@ suite('shadow system', function () { document.body.appendChild(div); }); - test('shadwMap automatically enables', function (done) { + test('shadowMap automatically enables', function (done) { var el = this.el; el.setAttribute('shadow', 'receive: false'); el.addEventListener('loaded', function () { diff --git a/tests/utils/coordinates.test.js b/tests/utils/coordinates.test.js index 813cfc345d8..6b3dce290a7 100644 --- a/tests/utils/coordinates.test.js +++ b/tests/utils/coordinates.test.js @@ -51,7 +51,7 @@ suite('utils.coordinates', function () { {x: 1, y: 2, z: -3}); }); - test('zero value of object won\'t be overriden by defaults', function () { + test('zero value of object won\'t be overridden by defaults', function () { assert.shallowDeepEqual( coordinates.parse({x: 0, y: 1}, {x: 4, y: 5, z: 6}), {x: 0, y: 1, z: 6});