From 58ae4696c032f8a915ca6fe0e1e0f15d1dc9e808 Mon Sep 17 00:00:00 2001 From: Steven Vergenz Date: Mon, 9 Oct 2017 15:02:58 -0700 Subject: [PATCH] Added polyfills for unused functions --- src/components/AltspaceComponent.js | 8 +++++--- src/components/AltspaceCursorCollider.js | 2 +- src/components/NColliders.js | 8 ++++---- src/components/NSmallComponents.js | 6 +++--- src/components/SyncSystem.js | 8 ++++---- src/components/instantiator.js | 2 +- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/components/AltspaceComponent.js b/src/components/AltspaceComponent.js index f9e39566..6a658156 100644 --- a/src/components/AltspaceComponent.js +++ b/src/components/AltspaceComponent.js @@ -38,7 +38,7 @@ class AltspaceComponent extends AFrameComponent * @default false * @memberof module:altspace/components.altspace */ - usePixelScale: { type: 'boolean', default: 'false'}, + usePixelScale: { type: 'boolean', default: false}, /** * Puts the origin at the `bottom`, `middle` (default), or `top` of the Altspace enclosure. @@ -56,7 +56,7 @@ class AltspaceComponent extends AFrameComponent * @default true * @memberof module:altspace/components.altspace */ - enclosuresOnly: { type: 'boolean', default: 'true'}, + enclosuresOnly: { type: 'boolean', default: true}, /** * Puts the app into fullspace mode. @@ -65,7 +65,7 @@ class AltspaceComponent extends AFrameComponent * @default false * @memberof module:altspace/components.altspace */ - fullspace: { type: 'boolean', default: 'false'} + fullspace: { type: 'boolean', default: false} } } @@ -160,8 +160,10 @@ class AltspaceComponent extends AFrameComponent renderer.getPixelRatio = noop; renderer.getMaxAnisotropy = noop; renderer.setFaceCulling = noop; + renderer.submitFrame = noop; renderer.context = {canvas: {}}; renderer.shadowMap = {}; + renderer.requestAnimationFrame = window.requestAnimationFrame; } /* diff --git a/src/components/AltspaceCursorCollider.js b/src/components/AltspaceCursorCollider.js index 95a82b70..22ce043f 100644 --- a/src/components/AltspaceCursorCollider.js +++ b/src/components/AltspaceCursorCollider.js @@ -22,7 +22,7 @@ class AltspaceCursorCollider extends AFrameComponent * @default true * @memberof module:altspace/components.altspace-cursor-collider */ - enabled: {type: 'boolean', default: 'true'} + enabled: {type: 'boolean', default: true} }; } diff --git a/src/components/NColliders.js b/src/components/NColliders.js index 746c3d02..8651e05e 100644 --- a/src/components/NColliders.js +++ b/src/components/NColliders.js @@ -101,7 +101,7 @@ class NBoxCollider extends NCollider { * @default [1, 1, 1] * @memberof module:altspace/components.n-box-collider */ - size: { type: 'vec3', default: '1 1 1' } + size: { type: 'vec3', default: {x:1,y:1,z:1} } }; } } @@ -125,7 +125,7 @@ class NCapsuleCollider extends NCollider { * @default 1 * @memberof module:altspace/components.n-capsule-collider */ - radius: { default: '0', type: 'number' }, + radius: { default: 0, type: 'number' }, /** * The height of the shaft of the capsule in meters. @@ -134,7 +134,7 @@ class NCapsuleCollider extends NCollider { * @default 0 * @memberof module:altspace/components.n-capsule-collider */ - height: { default: '0', type: 'number' }, + height: { default: 0, type: 'number' }, /** * The axis with which the capsule is aligned. Must be one of 'x', 'y' or 'z'. @@ -170,7 +170,7 @@ class NMeshCollider extends NCollider { * @default true * @memberof module:altspace/components.n-mesh-collider */ - convex: { type: 'boolean', default: 'true' } + convex: { type: 'boolean', default: true } }; } diff --git a/src/components/NSmallComponents.js b/src/components/NSmallComponents.js index 60675ad6..cc5df7b1 100644 --- a/src/components/NSmallComponents.js +++ b/src/components/NSmallComponents.js @@ -76,7 +76,7 @@ class NText extends NativeComponent { * @default 10 * @memberof module:altspace/components.n-text */ - fontSize: { default: '10', type: 'int' },//roughly a meter tall + fontSize: { default: 10, type: 'int' },//roughly a meter tall /** * The width of the text area in meters. If the @@ -86,7 +86,7 @@ class NText extends NativeComponent { * @default 10 * @memberof module:altspace/components.n-text */ - width: { default: '10', type: 'number' },//in meters + width: { default: 10, type: 'number' },//in meters /** * The height of the text area in meters. If the @@ -96,7 +96,7 @@ class NText extends NativeComponent { * @default 1 * @memberof module:altspace/components.n-text */ - height: { default: '1', type: 'number' },//in meters + height: { default: 1, type: 'number' },//in meters /** * The horizontal anchor point for the text. Can be `left`, `middle`, or `right`. diff --git a/src/components/SyncSystem.js b/src/components/SyncSystem.js index c73e81c6..6bfca7ae 100644 --- a/src/components/SyncSystem.js +++ b/src/components/SyncSystem.js @@ -21,7 +21,7 @@ class SyncSystem extends AFrameSystem * @member {string} author * @memberof module:altspace/components.sync-system */ - author: { type: 'string', default: null }, + author: { type: 'string' }, /** * The name of the app. @@ -29,7 +29,7 @@ class SyncSystem extends AFrameSystem * @member {string} app * @memberof module:altspace/components.sync-system */ - app: { type: 'string', default: null }, + app: { type: 'string' }, /** * Override the instance ID. Can also be overridden with a URL parameter. @@ -37,7 +37,7 @@ class SyncSystem extends AFrameSystem * @member {string} instance * @memberof module:altspace/components.sync-system */ - instance: { type: 'string', default: null }, + instance: { type: 'string' }, /** * Override the base reference. Set this to use your own Firebase. @@ -45,7 +45,7 @@ class SyncSystem extends AFrameSystem * @member {string} refUrl * @memberof module:altspace/components.sync-system */ - refUrl: { type: 'string', default: null } + refUrl: { type: 'string' } }; } diff --git a/src/components/instantiator.js b/src/components/instantiator.js index f5b0617d..a57b407a 100755 --- a/src/components/instantiator.js +++ b/src/components/instantiator.js @@ -54,7 +54,7 @@ class Instantiator extends AFrameComponent * @default true * @memberof module:altspace/components.instantiator */ - removeLast: {type: 'boolean', default: 'true'}, + removeLast: {type: 'boolean', default: true}, }; } init() {