浏览代码

More Targetted import

sebastien 6 年之前
父节点
当前提交
d6635d9874

+ 3 - 3
src/Engine/Extensions/engine.occlusionQuery.ts

@@ -1,7 +1,7 @@
 import { Nullable, int } from "types";
-import { Engine } from "Engine";
-import { AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
+import { Engine } from "Engine/engine";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { _TimeToken } from "Instrumentation/timeToken";
     /** @hidden */
     class _OcclusionDataStorage {
         /** @hidden */

+ 2 - 2
src/Engine/Extensions/engine.transformFeedback.ts

@@ -1,6 +1,6 @@
 import { Nullable } from "types";
-import { Engine } from "Engine";
-import { _TimeToken } from "Instrumentation";
+import { Engine } from "Engine/engine";
+import { _TimeToken } from "Instrumentation/timeToken";
 
 declare module "Engine/Engine" {
     export interface Engine {

+ 26 - 13
src/Engine/engine.ts

@@ -1,16 +1,29 @@
 import { Observer, Observable, Tools, ICustomAnimationFrameRequester, PerfCounter, PerformanceMonitor, StringDictionary, IFileRequest, PromisePolyfill, DDSTools, DDSInfo } from "Tools";
 import { Nullable, FloatArray, DataArray, IndicesArray } from "types";
-import { Camera } from "Cameras";
+import { Camera } from "Cameras/camera";
 import { Scene } from "scene";
-import { Matrix, Color3, Color4, Viewport, Size, Scalar, Vector4, SphericalPolynomial } from "Math";
-import { IDisplayChangedEventArgs } from "Engine";
-import { VertexBuffer } from "Mesh";
-import { RenderTargetTexture, Material, IInternalTextureLoader, Texture, UniformBuffer, InternalTexture, Effect, DummyInternalTextureTracker, IMultiRenderTargetOptions, BaseTexture, IInternalTextureTracker, VideoTexture, EffectCreationOptions, EffectFallbacks } from "Materials";
-import { PostProcess, PassPostProcess } from "PostProcess";
-import { _TimeToken } from "Instrumentation";
-import { IAudioEngine } from "Audio";
-import { IOfflineProvider } from "Offline";
-import { ILoadingScreen, DefaultLoadingScreen } from "Loading";
+import { Matrix, Color3, Color4, Viewport, Size, Vector4 } from "Math/math";
+import { Scalar } from "Math/math.scalar";
+import { SphericalPolynomial } from "Math/sphericalPolynomial";
+import { IDisplayChangedEventArgs } from "Engine/engine";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { UniformBuffer } from "Materials/uniformBuffer";
+import { Effect, EffectCreationOptions, EffectFallbacks } from "Materials/effect";
+import { Material } from "Materials/material";
+import { IInternalTextureTracker, DummyInternalTextureTracker } from "Materials/Textures/internalTextureTracker";
+import { IInternalTextureLoader } from "Materials/Textures/internalTextureLoader";
+import { InternalTexture } from "Materials/Textures/internalTexture";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { Texture } from "Materials/Textures/texture";
+import { VideoTexture } from "Materials/Textures/videoTexture";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+import { IMultiRenderTargetOptions } from "Materials/Textures/multiRenderTarget";
+import { PostProcess } from "PostProcess/postProcess";
+import { PassPostProcess } from "PostProcess/passPostProcess";
+import { _TimeToken } from "Instrumentation/timeToken";
+import { IAudioEngine } from "Audio/audioEngine";
+import { IOfflineProvider } from "Offline/IOfflineProvider";
+import { ILoadingScreen, DefaultLoadingScreen } from "Loading/loadingScreen";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Keeps track of all the buffer info used in engine.
@@ -331,7 +344,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
         /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
         public static readonly NEVER = 0x0200;
         /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
-        public static readonly ALWAYS = 0x0207;
+        public static readonly ALWAYS = _StencilState.ALWAYS;
         /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
         public static readonly LESS = 0x0201;
         /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
@@ -347,9 +360,9 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 
         // Stencil Actions Constants.
         /** Passed to stencilOperation to specify that stencil value must be kept */
-        public static readonly KEEP = 0x1E00;
+        public static readonly KEEP = _StencilState.KEEP;
         /** Passed to stencilOperation to specify that stencil value must be replaced */
-        public static readonly REPLACE = 0x1E01;
+        public static readonly REPLACE = _StencilState.REPLACE;
         /** Passed to stencilOperation to specify that stencil value must be incremented */
         public static readonly INCR = 0x1E02;
         /** Passed to stencilOperation to specify that stencil value must be decremented */

+ 8 - 6
src/Engine/nullEngine.ts

@@ -1,11 +1,13 @@
-import { Tools } from "Tools";
+import { Tools } from "Tools/tools";
 import { Nullable, FloatArray, IndicesArray } from "types";
 import { Scene } from "scene";
-import { Matrix, Color3, Color4, Viewport } from "Math";
-import { Engine, EngineCapabilities, RenderTargetCreationOptions } from "Engine";
-import { VertexBuffer } from "Mesh";
-import { Texture, InternalTexture, Effect } from "Materials";
-import { _TimeToken } from "Instrumentation";
+import { Matrix, Color3, Color4, Viewport } from "Math/math";
+import { Engine, EngineCapabilities, RenderTargetCreationOptions } from "Engine/engine";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { InternalTexture } from "Materials/Textures/internalTexture";
+import { Texture } from "Materials/Textures/texture";
+import { Effect } from "Materials/effect";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Options to create the null engine

+ 3 - 3
src/Sprites/sprite.ts

@@ -1,7 +1,7 @@
-import { Vector3, Color4 } from "Math";
+import { Vector3, Color4 } from "Math/math";
 import { Nullable } from "types";
-import { ActionManager } from "Actions";
-import { ISpriteManager } from "Sprites";
+import { ActionManager } from "Actions/actionManager";
+import { ISpriteManager } from "./spriteManager";
 
     /**
      * Class used to represent a sprite

+ 14 - 5
src/Sprites/spriteManager.ts

@@ -1,10 +1,19 @@
 import { IDisposable, Scene } from "scene";
 import { Nullable } from "types";
-import { Observable, Observer } from "Tools";
-import { VertexBuffer, Buffer } from "Mesh";
-import { Vector3 } from "Math";
-import { Sprite, SpriteSceneComponent } from ".";
-import { Ray, Camera, PickingInfo, Texture, Effect, SceneComponentConstants, Material, Engine } from "index";
+import { Observable, Observer } from "Tools/observable";
+import { Buffer } from "Mesh/buffer";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { Vector3 } from "Math/math";
+import { Sprite } from "./sprite";
+import { SpriteSceneComponent } from "./spriteSceneComponent";
+import { Ray } from "Culling/ray";
+import { PickingInfo } from "Collisions/pickingInfo";
+import { Camera } from "Cameras/camera";
+import { Texture } from "Materials/Textures/texture";
+import { Effect } from "Materials/effect";
+import { Material } from "Materials/material";
+import { SceneComponentConstants } from "sceneComponent";
+import { Engine } from "Engine/engine";
 
     /**
      * Defines the minimum interface to fullfil in order to be a sprite manager.

+ 7 - 6
src/Sprites/spriteSceneComponent.ts

@@ -1,12 +1,13 @@
 import { Nullable } from "types";
-import { Observable } from "Tools";
+import { Observable } from "Tools/observable";
 import { Scene } from "scene";
-import { Sprite, ISpriteManager } from "Sprites";
-import { Ray } from "Culling";
-import { Camera } from "Cameras";
-import { PickingInfo } from "Collisions";
+import { Sprite } from "./sprite";
+import { ISpriteManager } from "./spriteManager";
+import { Ray } from "Culling/ray";
+import { Camera } from "Cameras/camera";
+import { PickingInfo } from "Collisions/pickingInfo";
 import { ISceneComponent, SceneComponentConstants } from "sceneComponent";
-import { ActionManager, ActionEvent } from "index";
+import { ActionManager, ActionEvent } from "Actions/actionManager";
 
 declare module "scene" {
     export interface Scene {

+ 11 - 6
src/States/stencilState.ts

@@ -1,9 +1,14 @@
-import { Engine } from "Engine";
-
     /**
      * @hidden
      **/
     export class _StencilState {
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
+        public static readonly ALWAYS = 0x0207;
+        /** Passed to stencilOperation to specify that stencil value must be kept */
+        public static readonly KEEP = 0x1E00;
+        /** Passed to stencilOperation to specify that stencil value must be replaced */
+        public static readonly REPLACE = 0x1E01;
+
         private _isStencilTestDirty = false;
         private _isStencilMaskDirty = false;
         private _isStencilFuncDirty = false;
@@ -137,13 +142,13 @@ import { Engine } from "Engine";
             this._stencilTest = false;
             this._stencilMask = 0xFF;
 
-            this._stencilFunc = Engine.ALWAYS;
+            this._stencilFunc = _StencilState.ALWAYS;
             this._stencilFuncRef = 1;
             this._stencilFuncMask = 0xFF;
 
-            this._stencilOpStencilFail = Engine.KEEP;
-            this._stencilOpDepthFail = Engine.KEEP;
-            this._stencilOpStencilDepthPass = Engine.REPLACE;
+            this._stencilOpStencilFail = _StencilState.KEEP;
+            this._stencilOpDepthFail = _StencilState.KEEP;
+            this._stencilOpStencilDepthPass = _StencilState.REPLACE;
 
             this._isStencilTestDirty = true;
             this._isStencilMaskDirty = true;

+ 6 - 4
src/Tools/HDR/cubemapToSphericalPolynomial.ts

@@ -1,8 +1,10 @@
-import { Vector3, SphericalPolynomial, SphericalHarmonics, Scalar, ToLinearSpace, Color3 } from "Math";
-import { BaseTexture } from "Materials";
+import { Vector3, ToLinearSpace, Color3 } from "Math/math";
+import { Scalar } from "Math/math.scalar";
+import { SphericalPolynomial, SphericalHarmonics } from "Math/sphericalPolynomial";
+import { BaseTexture } from "Materials/Textures/baseTexture";
 import { Nullable } from "types";
-import { Engine } from "Engine";
-import { CubeMapInfo } from "Tools";
+import { Engine } from "Engine/engine";
+import { CubeMapInfo } from "./panoramaToCubemap";
 
     class FileFaceOrientation {
         public name: string;

+ 1 - 1
src/Tools/HDR/hdr.ts

@@ -1,4 +1,4 @@
-import { CubeMapInfo, PanoramaToCubeMapTools } from "Tools";
+import { CubeMapInfo, PanoramaToCubeMapTools } from "./panoramaToCubemap";
 
     /**
      * Header information of HDR texture files.

+ 2 - 2
src/Tools/HDR/panoramaToCubemap.ts

@@ -1,6 +1,6 @@
 import { Nullable } from "types";
-import { Vector3 } from "Math";
-import { Engine } from "Engine";
+import { Vector3 } from "Math/math";
+import { Engine } from "Engine/engine";
 
     /**
      * CubeMap information grouping all the data for each faces as well as the cubemap size.

+ 10 - 6
src/Tools/assetsManager.ts

@@ -1,10 +1,14 @@
 import { Scene } from "scene";
-import { AbstractMesh } from "Mesh";
-import { IParticleSystem } from "Particles";
-import { Skeleton } from "Bones";
-import { SceneLoader } from "Loading";
-import { Tools, Observable } from "Tools";
-import { BaseTexture, Texture, CubeTexture, HDRCubeTexture } from "Materials";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { IParticleSystem } from "Particles/IParticleSystem";
+import { Skeleton } from "Bones/skeleton";
+import { SceneLoader } from "Loading/sceneLoader";
+import { Tools } from "./tools";
+import { Observable } from "./observable";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { Texture } from "Materials/Textures/texture";
+import { CubeTexture } from "Materials/Textures/cubeTexture";
+import { HDRCubeTexture } from "Materials/Textures/hdrCubeTexture";
 
     /**
      * Defines the list of states available for a task inside a AssetsManager

+ 6 - 6
src/Tools/dds.ts

@@ -1,10 +1,10 @@
-import { SphericalPolynomial, Scalar } from "Math";
-
-import { Engine, InternalTexture } from "index";
-
+import { Scalar } from "Math/math.scalar";
+import { SphericalPolynomial } from "Math/sphericalPolynomial";
+import { Engine } from "Engine/engine";
+import { InternalTexture } from "Materials/Textures/internalTexture";
 import { Nullable } from "types";
-
-import { Tools, CubeMapToSphericalPolynomialTools } from ".";
+import { Tools } from "./tools";
+import { CubeMapToSphericalPolynomialTools } from "Tools/HDR/cubemapToSphericalPolynomial";
 
     // Based on demo done by Brandon Jones - http://media.tojicode.com/webgl-samples/dds.html
     // All values and structures referenced from:

+ 7 - 2
src/Tools/decorators.ts

@@ -1,7 +1,12 @@
 import { Tags } from ".";
 import { Nullable } from "types";
-import { Color4, Quaternion, Color3, Vector2, Vector3 } from "Math";
-import { ImageProcessingConfiguration, Camera, Scene, Texture, FresnelParameters, ColorCurves } from "index";
+import { Color4, Quaternion, Color3, Vector2, Vector3 } from "Math/math";
+import { ImageProcessingConfiguration } from "Materials/imageProcessingConfiguration";
+import { Camera } from "Cameras/camera";
+import { Scene } from "scene";
+import { Texture } from "Materials/Textures/texture";
+import { FresnelParameters } from "Materials/fresnelParameters";
+import { ColorCurves } from "Materials/colorCurves";
 
     var __decoratorInitialStore = {};
     var __mergedStore = {};

+ 18 - 13
src/Tools/environmentTextureTools.ts

@@ -1,10 +1,15 @@
 import { Nullable } from "types";
-
-import { Tools } from ".";
-
-import { CubeTexture, Engine, Scene, Texture, PostProcess, InternalTexture, BaseTexture } from "index";
-
-import { Scalar, SphericalPolynomial, Vector3 } from "Math";
+import { Tools } from "./tools";
+import { Vector3 } from "Math/math";
+import { Scalar } from "Math/math.scalar";
+import { SphericalPolynomial } from "Math/sphericalPolynomial";
+import { InternalTexture } from "Materials/Textures/internalTexture";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+//import { Texture } from "Materials/Textures/texture";
+import { CubeTexture } from "Materials/Textures/cubeTexture";
+import { Engine } from "Engine/engine";
+import { Scene } from "scene";
+import { PostProcess } from "PostProcess/postProcess";
 
     /**
      * Raw texture data and descriptor sufficient for WebGL texture upload
@@ -181,10 +186,10 @@ import { Scalar, SphericalPolynomial, Vector3 } from "Math";
                     let data = texture.readPixels(face, i);
 
                     // Creates a temp texture with the face data.
-                    let tempTexture = engine.createRawTexture(data, faceWidth, faceWidth, Engine.TEXTUREFORMAT_RGBA, false, false, Texture.NEAREST_SAMPLINGMODE, null, textureType);
+                    let tempTexture = engine.createRawTexture(data, faceWidth, faceWidth, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE, null, textureType);
                     // And rgbdEncode them.
                     let promise = new Promise<void>((resolve, reject) => {
-                        let rgbdPostProcess = new PostProcess("rgbdEncode", "rgbdEncode", null, null, 1, null, Texture.NEAREST_SAMPLINGMODE, engine, false, undefined, Engine.TEXTURETYPE_UNSIGNED_INT, undefined, null, false);
+                        let rgbdPostProcess = new PostProcess("rgbdEncode", "rgbdEncode", null, null, 1, null, Engine.TEXTURE_NEAREST_SAMPLINGMODE, engine, false, undefined, Engine.TEXTURETYPE_UNSIGNED_INT, undefined, null, false);
                         rgbdPostProcess.getEffect().executeWhenCompiled(() => {
                             rgbdPostProcess.onApply = (effect) => {
                                 effect._bindTexture("textureSampler", tempTexture);
@@ -376,7 +381,7 @@ import { Scalar, SphericalPolynomial, Vector3 } from "Math";
             texture.format = Engine.TEXTUREFORMAT_RGBA;
             texture.type = Engine.TEXTURETYPE_UNSIGNED_INT;
             texture.generateMipMaps = true;
-            engine.updateTextureSamplingMode(Texture.TRILINEAR_SAMPLINGMODE, texture);
+            engine.updateTextureSamplingMode(Engine.TEXTURE_TRILINEAR_SAMPLINGMODE, texture);
 
             // Add extra process if texture lod is not supported
             if (!caps.textureLOD) {
@@ -402,7 +407,7 @@ import { Scalar, SphericalPolynomial, Vector3 } from "Math";
             // Expand the texture if possible
             if (expandTexture) {
                 // Simply run through the decode PP
-                rgbdPostProcess = new PostProcess("rgbdDecode", "rgbdDecode", null, null, 1, null, Texture.TRILINEAR_SAMPLINGMODE, engine, false, undefined, texture.type, undefined, null, false);
+                rgbdPostProcess = new PostProcess("rgbdDecode", "rgbdDecode", null, null, 1, null, Engine.TEXTURE_TRILINEAR_SAMPLINGMODE, engine, false, undefined, texture.type, undefined, null, false);
 
                 texture._isRGBD = false;
                 texture.invertY = false;
@@ -410,7 +415,7 @@ import { Scalar, SphericalPolynomial, Vector3 } from "Math";
                     generateDepthBuffer: false,
                     generateMipMaps: true,
                     generateStencilBuffer: false,
-                    samplingMode: Texture.TRILINEAR_SAMPLINGMODE,
+                    samplingMode: Engine.TEXTURE_TRILINEAR_SAMPLINGMODE,
                     type: texture.type,
                     format: Engine.TEXTUREFORMAT_RGBA
                 });
@@ -440,7 +445,7 @@ import { Scalar, SphericalPolynomial, Vector3 } from "Math";
                         glTextureFromLod.isCube = true;
                         glTextureFromLod.invertY = true;
                         glTextureFromLod.generateMipMaps = false;
-                        engine.updateTextureSamplingMode(Texture.LINEAR_LINEAR, glTextureFromLod);
+                        engine.updateTextureSamplingMode(Engine.TEXTURE_LINEAR_LINEAR, glTextureFromLod);
 
                         // Wrap in a base texture for easy binding.
                         let lodTexture = new BaseTexture(null);
@@ -479,7 +484,7 @@ import { Scalar, SphericalPolynomial, Vector3 } from "Math";
                     let promise = new Promise<void>((resolve, reject) => {
                         image.onload = () => {
                             if (expandTexture) {
-                                let tempTexture = engine.createTexture(null, true, true, null, Texture.NEAREST_SAMPLINGMODE, null,
+                                let tempTexture = engine.createTexture(null, true, true, null, Engine.TEXTURE_NEAREST_SAMPLINGMODE, null,
                                     (message) => {
                                         reject(message);
                                     },

+ 4 - 3
src/Tools/filesInput.ts

@@ -1,6 +1,7 @@
-import { Engine, Scene, SceneLoaderProgressEvent, SceneLoader } from "index";
-
-import { Tools } from ".";
+import { Engine } from "Engine/engine";
+import { Scene } from "scene";
+import { SceneLoaderProgressEvent, SceneLoader } from "Loading/sceneLoader";
+import { Tools } from "./tools";
 
     /**
      * Class used to help managing file picking and drag'n'drop

+ 2 - 3
src/Tools/khronosTextureContainer.ts

@@ -1,6 +1,5 @@
-import { Tools } from ".";
-
-import { InternalTexture } from "index";
+import { Tools } from "./tools";
+import { InternalTexture } from "Materials/Textures/internalTexture";
 
     /**
      * for description see https://www.khronos.org/opengles/sdk/tools/KTX/

+ 1 - 2
src/Tools/observable.ts

@@ -1,6 +1,5 @@
 import { Nullable } from "types";
-
-import { Tools } from ".";
+import { Tools } from "./tools";
 
     /**
      * A class serves as a medium between the observable and its observers

+ 1 - 2
src/Tools/performanceMonitor.ts

@@ -1,6 +1,5 @@
 import { Nullable } from "types";
-
-import { Tools } from ".";
+import { Tools } from "./tools";
 
     /**
 	 * Performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window

+ 1 - 2
src/Tools/promise.ts

@@ -1,6 +1,5 @@
 import { Nullable } from "types";
-
-import { Tools } from ".";
+import { Tools } from "./tools";
 
     enum PromiseStates {
         Pending,

+ 5 - 6
src/Tools/sceneOptimizer.ts

@@ -1,10 +1,9 @@
-import { Scene, IDisposable, Engine } from "index";
-
-import { AbstractMesh, Mesh } from "Mesh";
-
+import { Scene, IDisposable } from "scene";
+import { Engine } from "Engine/engine";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/Mesh";
 import { Nullable } from "types";
-
-import { Observer, Observable } from ".";
+import { Observer, Observable } from "./observable";
 
     /**
      * Defines the root class used to create scene optimization to use with SceneOptimizer

+ 9 - 7
src/Tools/sceneSerializer.ts

@@ -1,10 +1,12 @@
-import { Geometry, BoxGeometry, SphereGeometry, CylinderGeometry, TorusGeometry, GroundGeometry, TorusKnotGeometry, _PrimitiveGeometry, Mesh } from "Mesh";
-
-import { Plane } from "Math";
-
-import { Engine, MultiMaterial, Material, Scene, Light } from "index";
-
-import { Animation } from "Animations";
+import { Geometry, BoxGeometry, SphereGeometry, CylinderGeometry, TorusGeometry, GroundGeometry, TorusKnotGeometry, _PrimitiveGeometry } from "Mesh/geometry";
+import { Mesh } from "Mesh/mesh";
+import { Plane } from "Math/math";
+import { Animation } from "Animations/animation";
+import { Engine } from "Engine/engine";
+import { MultiMaterial } from "Materials/multiMaterial";
+import { Material } from "Materials/material";
+import { Scene } from "scene";
+import { Light } from "Lights/light";
 
     var serializedGeometries: Geometry[] = [];
     var serializeGeometry = (geometry: Geometry, serializationGeometries: any): any => {

+ 2 - 1
src/Tools/tags.ts

@@ -1,4 +1,5 @@
-import { Tools, AndOrNotEvaluator } from ".";
+import { Tools } from "./tools";
+import { AndOrNotEvaluator } from "./andOrNotEvaluator";
 
     /**
      * Class used to store custom tags

+ 7 - 1
src/Tools/textureTools.ts

@@ -1,4 +1,10 @@
-import { Texture, Scene, RenderTargetTexture, InternalTexture, PassPostProcess, Engine, BaseTexture } from "index";
+import { InternalTexture } from "Materials/Textures/internalTexture";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { Texture } from "Materials/Textures/texture";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+import { PassPostProcess } from "PostProcess/passPostProcess";
+import { Engine } from "Engine/engine";
+import { Scene } from "scene";
 
     /**
      * Class used to host texture specific utilities

+ 2 - 3
src/Tools/tga.ts

@@ -1,6 +1,5 @@
-import { InternalTexture } from "index";
-
-import { Tools } from ".";
+import { InternalTexture } from "Materials/Textures/internalTexture";
+import { Tools } from "./tools";
 
     /**
      * Based on jsTGALoader - Javascript loader for TGA file

+ 12 - 3
src/Tools/tools.ts

@@ -1,7 +1,16 @@
-import { Animation } from "Animations";
-import { Color4, Color3, Scalar, Vector2, Vector3 } from "Math";
-import { Observable, Engine, IOfflineProvider, FilesInput, Camera, RenderTargetTexture, Texture, FxaaPostProcess, TGATools } from "index";
 import { FloatArray, IndicesArray, Nullable } from "types";
+import { Animation } from "Animations/animation";
+import { Color4, Color3, Vector2, Vector3 } from "Math/math";
+import { Scalar } from "Math/math.scalar";
+import { Engine } from "Engine/engine";
+import { IOfflineProvider } from "Offline/IOfflineProvider";
+import { Camera } from "Cameras/camera";
+import { Texture } from "Materials/Textures/texture";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+import { FxaaPostProcess } from "PostProcess/fxaaPostProcess";
+import { Observable } from "./observable";
+import { FilesInput } from "./filesInput";
+import { TGATools } from "./tga";
 
     /**
      * Interface for any object that can request an animation frame

+ 2 - 4
src/Tools/videoRecorder.ts

@@ -1,8 +1,6 @@
-import { Engine } from "index";
-
 import { Nullable } from "types";
-
-import { Tools } from ".";
+import { Tools } from "./tools";
+import { Engine } from "Engine/engine";
 
 interface MediaRecorder {
     /** Starts recording */

+ 2 - 4
src/Tools/virtualJoystick.ts

@@ -1,8 +1,6 @@
-import { Vector3, Vector2 } from "Math";
-
 import { Nullable } from "types";
-
-import { StringDictionary } from ".";
+import { Vector3, Vector2 } from "Math/math";
+import { StringDictionary } from "./stringDictionary";
 
 // Mainly based on these 2 articles :
 // Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx

+ 15 - 10
src/abstractScene.ts

@@ -1,16 +1,21 @@
 import { Scene } from "scene";
 import { Nullable } from "types";
-import { AbstractMesh, Geometry, TransformNode } from "Mesh";
-import { Skeleton } from "Bones";
-import { MorphTargetManager } from "Morph";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { TransformNode } from "Mesh/transformNode";
+import { Geometry } from "Mesh/geometry";
+import { Skeleton } from "Bones/skeleton";
+import { MorphTargetManager } from "Morph/morphTargetManager";
 import { AssetContainer } from "assetContainer";
-import { IParticleSystem } from "Particles";
-import { AnimationGroup, Animation } from "Animations";
-import { MultiMaterial, Material, BaseTexture } from "Materials";
-import { ActionManager } from "Actions";
-import { Camera } from "Cameras";
-import { Light } from "Lights";
-import { Node } from "Node";
+import { IParticleSystem } from "Particles/IParticleSystem";
+import { Animation } from "Animations/animation";
+import { AnimationGroup } from "Animations/animationGroup";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { Material } from "Materials/material";
+import { MultiMaterial } from "Materials/multiMaterial";
+import { ActionManager } from "Actions/actionManager";
+import { Camera } from "Cameras/camera";
+import { Light } from "Lights/light";
+import { Node } from "node";
 
     /**
      * Defines how the parser contract is defined.

+ 1 - 1
src/assetContainer.ts

@@ -1,6 +1,6 @@
 import { AbstractScene } from "abstractScene";
 import { Scene } from "scene";
-import { Mesh } from "Mesh";
+import { Mesh } from "Mesh/mesh";
 
     /**
      * Set of assets to keep when moving a scene into an asset container.

+ 41 - 17
src/scene.ts

@@ -1,24 +1,48 @@
 import { Nullable } from "types";
-import { IAnimatable, Observable, Observer, SmartArrayNoDuplicate, PerfCounter, IFileRequest, SmartArray, StringDictionary, Tools, ISmartArrayLike, Tags } from "Tools";
-import { Color4, Color3, Plane, Vector2, Vector3, Matrix, Tmp, Quaternion, Frustum } from "Math";
-import { Geometry, TransformNode, Mesh, SubMesh, AbstractMesh } from "Mesh";
-import { IParticleSystem } from "Particles";
-import { Skeleton, Bone } from "Bones";
-import { MorphTargetManager } from "Morph";
-import { Camera } from "Cameras";
+import { IAnimatable, IFileRequest, Tools, PerfCounter } from "Tools/tools";
+import { Observable, Observer } from "Tools/observable";
+import { SmartArrayNoDuplicate, SmartArray, ISmartArrayLike } from "Tools/smartArray";
+import { StringDictionary } from "Tools/stringDictionary";
+import { Tags } from "Tools/tags";
+import { Color4, Color3, Plane, Vector2, Vector3, Matrix, Tmp, Quaternion, Frustum } from "Math/math";
+import { Geometry } from "Mesh/geometry";
+import { TransformNode } from "Mesh/transformNode";
+import { SubMesh } from "Mesh/subMesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { IParticleSystem } from "Particles/IParticleSystem";
+import { Bone } from "Bones/bone";
+import { Skeleton } from "Bones/skeleton";
+import { MorphTargetManager } from "Morph/morphTargetManager";
+import { Camera } from "Cameras/camera";
 import { AbstractScene } from "abstractScene";
-import { BaseTexture, Material, ImageProcessingConfiguration, StandardMaterial, RenderTargetTexture, Effect, UniformBuffer, MultiMaterial, Texture } from "Materials";
-import { AnimationPropertiesOverride, Animatable, RuntimeAnimation, AnimationGroup, Animation } from "Animations";
-import { Light } from "Lights";
-import { PickingInfo, ICollisionCoordinator, CollisionCoordinatorLegacy, CollisionWorker, CollisionCoordinatorWorker, Collider } from "Collisions";
-import { PointerEventTypes, PointerInfoPre, PointerInfo, KeyboardInfoPre, KeyboardInfo, KeyboardEventTypes } from "Events";
-import { ActionManager, ActionEvent } from "Actions";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { Texture } from "Materials/Textures/texture";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+import { Material } from "Materials/material";
+import { ImageProcessingConfiguration } from "Materials/imageProcessingConfiguration";
+import { StandardMaterial } from "Materials/standardMaterial";
+import { Effect } from "Materials/effect";
+import { UniformBuffer } from "Materials/uniformBuffer";
+import { MultiMaterial } from "Materials/multiMaterial";
+import { Animation } from "Animations/animation";
+import { RuntimeAnimation } from "Animations/runtimeAnimation";
+import { AnimationGroup } from "Animations/animationGroup";
+import { Animatable } from "Animations/animatable";
+import { AnimationPropertiesOverride } from "Animations/animationPropertiesOverride";
+import { Light } from "Lights/light";
+import { PickingInfo } from "Collisions/pickingInfo";
+import { Collider } from "Collisions/collider";
+import { ICollisionCoordinator, CollisionWorker, CollisionCoordinatorWorker, CollisionCoordinatorLegacy } from "Collisions/collisionCoordinator";
+import { PointerEventTypes, PointerInfoPre, PointerInfo } from "Events/pointerEvents";
+import { KeyboardInfoPre, KeyboardInfo, KeyboardEventTypes } from "Events/keyboardEvents";
+import { ActionManager, ActionEvent } from "Actions/actionManager";
 import { PostProcess, PostProcessManager } from "PostProcess";
-import { IOfflineProvider } from "Offline";
-import { RenderingManager, IRenderingManagerAutoClearSetup } from "Rendering";
+import { IOfflineProvider } from "Offline/IOfflineProvider";
+import { RenderingManager, IRenderingManagerAutoClearSetup } from "Rendering/renderingManager";
 import { ISceneComponent, ISceneSerializableComponent, Stage, SimpleStageAction, RenderTargetsStageAction, MeshStageAction, EvaluateSubMeshStageAction, ActiveMeshStageAction, CameraStageAction, RenderingGroupStageAction, RenderingMeshStageAction, PointerMoveStageAction, PointerUpDownStageAction } from "sceneComponent";
-import { Engine } from "Engine";
-import { Ray } from "Culling";
+import { Engine } from "Engine/engine";
+import { Ray } from "Culling/ray";
 import { Node } from "node";
 
     /**

+ 7 - 5
src/sceneComponent.ts

@@ -1,10 +1,12 @@
 import { Scene } from "scene";
-import { AbstractMesh, SubMesh, _InstancesBatch } from "Mesh";
-import { SmartArrayNoDuplicate } from "Tools";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { SubMesh, } from "Mesh/subMesh";
+import { _InstancesBatch } from "Mesh";
+import { SmartArrayNoDuplicate } from "Tools/smartArray";
 import { Nullable } from "types";
-import { Camera } from "Cameras";
-import { RenderTargetTexture } from "Materials";
-import { PickingInfo } from "Collisions";
+import { Camera } from "Cameras/camera";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+import { PickingInfo } from "Collisions/pickingInfo";
 import { AbstractScene } from "abstractScene";
 
     /**