Skip to content

Commit

Permalink
Move glTF instantiator to modules/addons (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgios-uber committed Mar 26, 2019
1 parent 670899c commit 85d8574
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 21 deletions.
10 changes: 2 additions & 8 deletions examples/core/gltf/app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
/* global document, window */
import {GLTFParser} from '@loaders.gl/gltf';
import {DracoDecoder} from '@loaders.gl/draco';
import {
setParameters,
clear,
log,
createGLTFObjects,
_GLTFEnvironment as GLTFEnvironment
} from '@luma.gl/core';
import {VRAnimationLoop} from '@luma.gl/addons';
import {setParameters, clear, log} from '@luma.gl/core';
import {createGLTFObjects, GLTFEnvironment, VRAnimationLoop} from '@luma.gl/addons';
import GL from '@luma.gl/constants';
import {Matrix4, radians} from 'math.gl';

Expand Down
5 changes: 4 additions & 1 deletion modules/addons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
},
"dependencies": {
"@luma.gl/constants": "^7.0.0-alpha.18",
"@luma.gl/core": "^7.0.0-alpha.18"
"@luma.gl/core": "^7.0.0-alpha.18",
"@luma.gl/shadertools": "^7.0.0-alpha.18",
"@luma.gl/webgl": "^7.0.0-alpha.18",
"math.gl": "^2.3.1"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {pbr} from '@luma.gl/shadertools';
import {isWebGL2} from '@luma.gl/webgl';
import {log} from '../../utils';
import ModelNode from '../nodes/model-node';
import {ModelNode, log} from '@luma.gl/core';
import GLTFMaterialParser from './gltf-material-parser';

const vs = `
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {Matrix4} from 'math.gl';
import {Buffer, Accessor} from '@luma.gl/webgl';
import {log} from '../../utils';
import GroupNode from '../nodes/group-node';
import {GroupNode, log} from '@luma.gl/core';

import GLTFAnimator from './gltf-animator';
import createGLTFModel from './create-gltf-model';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Texture2D} from '@luma.gl/webgl';
import {log} from '../../utils';
import {log} from '@luma.gl/core';

export default class GLTFMaterialParser {
constructor(gl, {attributes, material, pbrDebug, imageBasedLightingEnvironment, lights}) {
Expand Down
4 changes: 4 additions & 0 deletions modules/addons/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// VR
export {default as VRAnimationLoop} from './webvr/vr-animation-loop';

// glTF Scenegraph Instantiator
export {default as createGLTFObjects} from './gltf/create-gltf-objects';
export {default as GLTFEnvironment} from './gltf/gltf-environment';

// Misc
export {addEvents} from './events/add-events';
4 changes: 0 additions & 4 deletions modules/core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ export {default as Plane} from './scenegraph/geometric-nodes/plane';
export {default as Sphere} from './scenegraph/geometric-nodes/sphere';
export {default as TruncatedCone} from './scenegraph/geometric-nodes/truncated-cone';

// glTF scenegraph instantiator
export {default as createGLTFObjects} from './scenegraph/gltf/create-gltf-objects';
export {default as _GLTFEnvironment} from './scenegraph/gltf/gltf-environment';

// TODO/CLEAN UP FOR V7
// We should have a minimal set of forwarding exports from shadertools (ideally none)
// Analyze risk of breaking apps
Expand Down
3 changes: 0 additions & 3 deletions modules/core/src/scenegraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ export {default as GroupNode} from './nodes/group-node';
export {default as ModelNode} from './nodes/model-node';
export {default as CameraNode} from './nodes/camera-node';

// GLTF SCENEGRAPH INSTANTIATOR
export {default as createGLTFObjects} from './gltf/create-gltf-objects';

// PREPACKAGED MODEL-NODES
export {default as Cone} from './geometric-nodes/cone';
export {default as Cube} from './geometric-nodes/cube';
Expand Down

0 comments on commit 85d8574

Please sign in to comment.