Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move glTF instantiator to modules/addons #1007

Merged
merged 1 commit into from Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 2 additions & 8 deletions examples/core/gltf/app.js
@@ -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
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"
}
}
@@ -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
@@ -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
@@ -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
@@ -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
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
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