Skip to content

Commit

Permalink
Update: Upgrade Box3D to 14.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MiiBond authored Oct 4, 2017
1 parent ec68fd1 commit 04d3cc7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/lib/viewers/box3d/Box3DRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ class Box3DRenderer extends EventEmitter {
// If there are common entities for left-right controllers, load them first.
if (!this.vrCommonLoadPromise) {
if (commonEntities) {
this.vrCommonLoadPromise = this.box3d.addRemoteEntities(
this.vrCommonLoadPromise = this.box3d.importEntitiesFromUrl(
`${this
.staticBaseURI}third-party/model3d/${MODEL3D_STATIC_ASSETS_VERSION}/WebVR/${commonEntities}/entities.json`,
{ isExternal: true }
Expand All @@ -537,7 +537,7 @@ class Box3DRenderer extends EventEmitter {
}
if (!this.vrGamepadLoadPromises[controllerName]) {
this.vrGamepadLoadPromises[controllerName] = this.vrCommonLoadPromise.then(() => {
return this.box3d.addRemoteEntities(
return this.box3d.importEntitiesFromUrl(
`${this
.staticBaseURI}third-party/model3d/${MODEL3D_STATIC_ASSETS_VERSION}/WebVR/${controllerName}/entities.json`,
{ isExternal: true }
Expand Down
2 changes: 1 addition & 1 deletion src/lib/viewers/box3d/image360/Image360Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Image360Renderer extends Box3DRenderer {
*/
loadPanoramaFile(assetUrl) {
/* istanbul ignore next */
return this.box3d.addRemoteEntities(assetUrl).then(
return this.box3d.importEntitiesFromUrl(assetUrl).then(
() => {
this.imageAsset = this.box3d.getAssetByClass(Box3D.ImageAsset);
this.textureAsset = this.box3d.createTexture2d();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/viewers/box3d/model3d/Model3DRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ class Model3DRenderer extends Box3DRenderer {
const camera = cameraObject.runtimeData;
camera.position.set(0, 0, orbitController.getOrbitDistance());
camera.position.applyQuaternion(camera.quaternion);
camera.position.add(orbitController.originPoint);
camera.position.add(orbitController.pivotPoint.position);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => {
when: () => {}
};
renderer.box3d = {
addRemoteEntities: () => Promise.resolve(),
importEntitiesFromUrl: () => Promise.resolve(),
canvas: {
addEventListener: () => {},
removeEventListener: () => {}
Expand Down Expand Up @@ -964,7 +964,8 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => {
position = sandbox.mock(pos);
quaternion = { x: 1, y: 2, z: 3, w: 1 };
orbitCam = {
getOrbitDistance: () => orbitDist
getOrbitDistance: () => orbitDist,
pivotPoint: {position: pos}
};
camera = {
runtimeData: {
Expand Down
2 changes: 1 addition & 1 deletion src/third-party/model3d/1.12.0/box3d-runtime.min.js

Large diffs are not rendered by default.

0 comments on commit 04d3cc7

Please sign in to comment.