浏览代码

Fix Imports A to G without camera

sebastien 6 年之前
父节点
当前提交
dadff1f624
共有 100 个文件被更改,包括 777 次插入485 次删除
  1. 1 1
      Tools/Gulp/helpers/gulp-processShaders.js
  2. 8 7
      src/Actions/action.ts
  3. 10 6
      src/Actions/actionManager.ts
  4. 2 1
      src/Actions/condition.ts
  5. 6 3
      src/Actions/directActions.ts
  6. 4 2
      src/Actions/directAudioActions.ts
  7. 7 4
      src/Actions/interpolateValueAction.ts
  8. 4 2
      src/Animations/animatable.ts
  9. 9 4
      src/Animations/animation.ts
  10. 5 3
      src/Animations/animationGroup.ts
  11. 2 1
      src/Animations/animationPropertiesOverride.ts
  12. 1 1
      src/Animations/easing.ts
  13. 4 2
      src/Animations/runtimeAnimation.ts
  14. 2 2
      src/Audio/analyser.ts
  15. 5 3
      src/Audio/audioEngine.ts
  16. 7 5
      src/Audio/audioSceneComponent.ts
  17. 7 5
      src/Audio/sound.ts
  18. 3 2
      src/Audio/soundtrack.ts
  19. 2 2
      src/Audio/weightedsound.ts
  20. 6 4
      src/Behaviors/Cameras/autoRotationBehavior.ts
  21. 8 6
      src/Behaviors/Cameras/bouncingBehavior.ts
  22. 11 8
      src/Behaviors/Cameras/framingBehavior.ts
  23. 5 4
      src/Behaviors/Mesh/attachToBoxBehavior.ts
  24. 3 2
      src/Behaviors/Mesh/fadeInOutBehavior.ts
  25. 5 4
      src/Behaviors/Mesh/multiPointerScaleBehavior.ts
  26. 7 6
      src/Behaviors/Mesh/pointerDragBehavior.ts
  27. 9 9
      src/Behaviors/Mesh/sixDofDragBehavior.ts
  28. 8 6
      src/Bones/bone.ts
  29. 4 3
      src/Bones/boneIKController.ts
  30. 5 4
      src/Bones/boneLookController.ts
  31. 11 7
      src/Bones/skeleton.ts
  32. 3 2
      src/Collisions/collider.ts
  33. 12 5
      src/Collisions/collisionCoordinator.ts
  34. 3 2
      src/Collisions/collisionWorker.ts
  35. 5 4
      src/Collisions/pickingInfo.ts
  36. 6 4
      src/Culling/Octrees/octree.ts
  37. 5 3
      src/Culling/Octrees/octreeBlock.ts
  38. 8 5
      src/Culling/Octrees/octreeSceneComponent.ts
  39. 6 3
      src/Culling/boundingBox.ts
  40. 8 5
      src/Culling/boundingInfo.ts
  41. 3 2
      src/Culling/boundingSphere.ts
  42. 3 2
      src/Debug/axesViewer.ts
  43. 4 4
      src/Debug/boneAxesViewer.ts
  44. 2 1
      src/Debug/debugLayer.ts
  45. 4 2
      src/Debug/physicsViewer.ts
  46. 5 3
      src/Debug/rayHelper.ts
  47. 7 4
      src/Debug/skeletonViewer.ts
  48. 4 4
      src/Events/pointerEvents.ts
  49. 9 5
      src/Gamepad/Controllers/daydreamController.ts
  50. 11 6
      src/Gamepad/Controllers/gearVRController.ts
  51. 8 4
      src/Gamepad/Controllers/genericController.ts
  52. 8 5
      src/Gamepad/Controllers/oculusTouchController.ts
  53. 15 9
      src/Gamepad/Controllers/poseEnabledController.ts
  54. 8 4
      src/Gamepad/Controllers/viveController.ts
  55. 5 4
      src/Gamepad/Controllers/webVRController.ts
  56. 15 8
      src/Gamepad/Controllers/windowsMotionController.ts
  57. 4 3
      src/Gamepad/gamepad.ts
  58. 7 3
      src/Gamepad/gamepadManager.ts
  59. 5 3
      src/Gamepad/gamepadSceneComponent.ts
  60. 3 3
      src/Gamepad/xboxGamepad.ts
  61. 12 9
      src/Gizmos/axisDragGizmo.ts
  62. 12 9
      src/Gizmos/axisScaleGizmo.ts
  63. 12 9
      src/Gizmos/boundingBoxGizmo.ts
  64. 7 6
      src/Gizmos/gizmo.ts
  65. 15 9
      src/Gizmos/gizmoManager.ts
  66. 11 9
      src/Gizmos/planeRotationGizmo.ts
  67. 9 6
      src/Gizmos/positionGizmo.ts
  68. 9 6
      src/Gizmos/rotationGizmo.ts
  69. 8 5
      src/Gizmos/scaleGizmo.ts
  70. 12 7
      src/Helpers/environmentHelper.ts
  71. 6 4
      src/Helpers/photoDome.ts
  72. 12 5
      src/Helpers/sceneHelpers.ts
  73. 7 3
      src/Helpers/videoDome.ts
  74. 4 3
      src/Instrumentation/engineInstrumentation.ts
  75. 4 3
      src/Instrumentation/sceneInstrumentation.ts
  76. 21 9
      src/Layer/effectLayer.ts
  77. 6 6
      src/Layer/effectLayerSceneComponent.ts
  78. 16 8
      src/Layer/glowLayer.ts
  79. 19 9
      src/Layer/highlightLayer.ts
  80. 9 7
      src/Layer/layer.ts
  81. 4 4
      src/Layer/layerSceneComponent.ts
  82. 5 5
      src/LensFlare/lensFlare.ts
  83. 13 8
      src/LensFlare/lensFlareSystem.ts
  84. 4 4
      src/LensFlare/lensFlareSystemSceneComponent.ts
  85. 21 8
      src/Lights/Shadows/shadowGenerator.ts
  86. 4 4
      src/Lights/Shadows/shadowGeneratorSceneComponent.ts
  87. 9 8
      src/Lights/directionalLight.ts
  88. 8 6
      src/Lights/hemisphericLight.ts
  89. 3 3
      src/Lights/index.ts
  90. 8 7
      src/Lights/light.ts
  91. 9 7
      src/Lights/pointLight.ts
  92. 6 6
      src/Lights/shadowLight.ts
  93. 10 7
      src/Lights/spotLight.ts
  94. 9 2
      src/Materials/Background/backgroundMaterial.ts
  95. 67 22
      src/Materials/PBR/pbrBaseMaterial.ts
  96. 6 4
      src/Materials/PBR/pbrBaseSimpleMaterial.ts
  97. 13 9
      src/Materials/PBR/pbrMaterial.ts
  98. 5 4
      src/Materials/PBR/pbrMetallicRoughnessMaterial.ts
  99. 5 4
      src/Materials/PBR/pbrSpecularGlossinessMaterial.ts
  100. 0 0
      src/Materials/Textures/Loaders/ddsTextureLoader.ts

+ 1 - 1
Tools/Gulp/helpers/gulp-processShaders.js

@@ -105,7 +105,7 @@ function main(isCore) {
 
             // Chose shader store.
             const shaderStore = directory.indexOf("ShadersInclude") > -1 ? "IncludesShadersStore" : "ShadersStore";
-            const effectLocation = isCore ? "Materials" : "babylonjs";
+            const effectLocation = isCore ? "Materials/effect" : "babylonjs";
 
             // Fill template in.
             let tsContent = tsShaderTemplate.replace('##EFFECTLOCATION_PLACEHOLDER##', effectLocation);

+ 8 - 7
src/Actions/action.ts

@@ -1,11 +1,12 @@
-import { Observable } from "Tools";
-import { Vector2, Vector3, Color3, Color4 } from "Math";
+import { Observable } from "Tools/observable";
+import { Vector2, Vector3, Color3, Color4 } from "Math/math";
 import { Scene } from "scene";
-import { Mesh } from "Mesh";
-import { Light } from "Lights";
-import { Camera } from "Cameras";
-import { Node } from "Node";
-import { ActionManager, Condition, ActionEvent } from "Actions";
+import { Mesh } from "Mesh/mesh";
+import { Light } from "Lights/light";
+import { Camera } from "Cameras/camera";
+import { Node } from "node";
+import { ActionManager, ActionEvent } from "./actionManager";
+import { Condition } from "./condition";
     /**
      * The action to be carried out following a trigger
      * @see http://doc.babylonjs.com/how_to/how_to_use_actions#available-actions

+ 10 - 6
src/Actions/actionManager.ts

@@ -1,11 +1,15 @@
 import { Nullable } from "types";
-import { AbstractMesh } from "Mesh";
-import { Sprite } from "Sprites";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Sprite } from "Sprites/sprite";
 import { Scene } from "scene";
-import { Vector2, Vector3, Vector4, Color3, Color4 } from "Math";
-import { Action, Condition, ValueCondition, DoNothingAction } from "Actions";
-import { Engine } from "Engine";
-import { Tools } from "Tools";
+import { Vector2, Vector3, Vector4, Color3, Color4 } from "Math/math";
+
+import { Condition, ValueCondition } from "./condition";
+import { Action } from "./action";
+import { DoNothingAction } from "./directActions";
+
+import { Engine } from "Engine/engine";
+import { Tools } from "Tools/tools";
 
     /**
      * ActionEvent is the event being sent when an action is triggered.

+ 2 - 1
src/Actions/condition.ts

@@ -1,4 +1,5 @@
-import { ActionManager, Action } from "Actions";
+import { ActionManager } from "./actionManager";
+import { Action } from "./action";
 
     /**
      * A Condition applied to an Action

+ 6 - 3
src/Actions/directActions.ts

@@ -1,6 +1,9 @@
-import { Action, Condition, ActionManager, ActionEvent } from "Actions";
-import { Tools } from "Tools";
-import { Vector3 } from "Math";
+import { Action } from "./action";
+import { Condition } from "./condition";
+import { ActionManager, ActionEvent } from "./actionManager";
+
+import { Tools } from "Tools/tools";
+import { Vector3 } from "Math/math";
 
     /**
      * This defines an action responsible to toggle a boolean once triggered.

+ 4 - 2
src/Actions/directAudioActions.ts

@@ -1,5 +1,7 @@
-import { Action, Condition } from "Actions";
-import { Sound } from "Audio";
+import { Action } from "./action";
+import { Condition } from "./condition";
+
+import { Sound } from "Audio/sound";
 
     /**
      * This defines an action helpful to play a defined sound on a triggered action.

+ 7 - 4
src/Actions/interpolateValueAction.ts

@@ -1,7 +1,10 @@
-import { Action, Condition } from "Actions";
-import { Observable, Tools } from "Tools";
-import { Color3, Vector3, Matrix, Quaternion } from "Math";
-import { Animation } from "Animations";
+import { Action } from "./action";
+import { Condition } from "./condition";
+
+import { Tools } from "Tools/tools";
+import { Observable } from "Tools/observable";
+import { Color3, Vector3, Matrix, Quaternion } from "Math/math";
+import { Animation } from "Animations/animation";
 
     /**
      * This defines an action responsible to change the value of a property

+ 4 - 2
src/Animations/animatable.ts

@@ -1,7 +1,9 @@
+import { Animation } from "./animation";
+import { RuntimeAnimation } from "./runtimeAnimation";
+
 import { Nullable } from "types";
-import { RuntimeAnimation, Animation } from "Animations";
+import { Observable } from "Tools/observable";
 import { Scene } from "scene";
-import { Observable } from "Tools";
 
     /**
      * Class used to store an actual running animation

+ 9 - 4
src/Animations/animation.ts

@@ -1,9 +1,14 @@
-import { Path2, Vector3, Quaternion, Vector2, Color3, Size, Scalar, Matrix } from "Math";
-import { IEasingFunction, RuntimeAnimation, EasingFunction, Animatable } from "Animations";
+import { Animatable } from "./animatable";
+import { IEasingFunction, EasingFunction } from "./easing";
+import { RuntimeAnimation } from "./runtimeAnimation";
+
+import { Path2, Vector3, Quaternion, Vector2, Color3, Size, Matrix } from "Math/math";
+import { Scalar } from "Math/math.scalar";
+
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { IAnimatable } from "Tools";
-import { Node } from "Node";
+import { IAnimatable } from "Tools/tools";
+import { Node } from "node";
 
     /**
      * Represents the range of an animation

+ 5 - 3
src/Animations/animationGroup.ts

@@ -1,8 +1,10 @@
+import { Animatable } from "./animatable";
+import { IAnimationKey, Animation } from "./animation";
+
 import { Scene, IDisposable } from "scene";
-import { Observable } from "Tools";
+import { Observable } from "Tools/observable";
 import { Nullable } from "types";
-import { IAnimationKey, Animation, Animatable } from "Animations";
-import { Engine } from "Engine";
+import { Engine } from "Engine/engine";
     /**
      * This class defines the direct association between an animation and a target
      */

+ 2 - 1
src/Animations/animationPropertiesOverride.ts

@@ -1,4 +1,5 @@
-    import { Animation } from "Animations";
+import { Animation } from "Animations/animation";
+
     /**
      * Class used to override all child animations of a given target
      */

+ 1 - 1
src/Animations/easing.ts

@@ -1,4 +1,4 @@
-    import { BezierCurve } from "Math";
+import { BezierCurve } from "Math/math";
 
     /**
      * This represents the main contract an easing function should follow.

+ 4 - 2
src/Animations/runtimeAnimation.ts

@@ -1,5 +1,7 @@
-import { Quaternion, Vector3, Vector2, Size, Color3, Matrix } from "Math";
-import { Animatable, Animation, AnimationEvent } from "Animations";
+import { Quaternion, Vector3, Vector2, Size, Color3, Matrix } from "Math/math";
+import { Animatable } from "./animatable";
+import { Animation, AnimationEvent } from "./animation";
+
 import { Scene } from "scene";
 
     // Static values to help the garbage collector

+ 2 - 2
src/Audio/analyser.ts

@@ -1,7 +1,7 @@
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { IAudioEngine } from "Audio";
-import { Engine } from "Engine";
+import { IAudioEngine } from "Audio/audioEngine";
+import { Engine } from "Engine/engine";
 
     /**
      * Class used to work with sound analyzer using fast fourier transform (FFT)

+ 5 - 3
src/Audio/audioEngine.ts

@@ -1,8 +1,10 @@
 import { IDisposable } from "scene";
+import { Analyser } from "./analyser";
+
 import { Nullable } from "types";
-import { Observable, Tools } from "Tools";
-import { Engine } from "Engine";
-import { Analyser } from "Audio";
+import { Observable } from "Tools/observable";
+import { Tools } from "Tools/tools";
+import { Engine } from "Engine/engine";
 
     /**
      * This represents an audio engine and it is responsible

+ 7 - 5
src/Audio/audioSceneComponent.ts

@@ -1,10 +1,12 @@
-import { Engine } from "Engine";
-import { Camera } from "Cameras";
-import { Sound, SoundTrack } from "Audio";
+import { Sound } from "./sound";
+import { SoundTrack } from "./soundTrack";
+
+import { Engine } from "Engine/engine";
+import { Camera } from "Cameras/camera";
 import { Nullable } from "types";
-import { Scene } from "scene";
-import { Matrix, Vector3 } from "Math";
+import { Matrix, Vector3 } from "Math/math";
 import { SceneComponentConstants, ISceneSerializableComponent } from "sceneComponent";
+import { Scene } from "scene";
 import { AbstractScene } from "abstractScene";
 import { AssetContainer } from "assetContainer";
 

+ 7 - 5
src/Audio/sound.ts

@@ -1,10 +1,12 @@
-import { Observable, Tools } from "Tools";
-import { Vector3, Tmp } from "Math";
+import { Tools } from "Tools/tools";
+import { Observable } from "Tools/observable";
+import { Vector3, Tmp } from "Math/math";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Engine } from "Engine";
-import { AudioSceneComponent } from "Audio";
-import { TransformNode, AbstractMesh } from "Mesh";
+import { Engine } from "Engine/engine";
+import { AudioSceneComponent } from "Audio/audioSceneComponent";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { TransformNode } from "Mesh/transformNode";
 import { SceneComponentConstants } from "sceneComponent";
 
     /**

+ 3 - 2
src/Audio/soundtrack.ts

@@ -1,7 +1,8 @@
-import { Sound, Analyser } from "Audio";
+import { Sound } from "Audio/sound";
+import { Analyser } from "Audio/analyser";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Engine } from "Engine";
+import { Engine } from "Engine/engine";
 
     /**
      * Options allowed during the creation of a sound track.

+ 2 - 2
src/Audio/weightedsound.ts

@@ -1,5 +1,5 @@
-import { Sound } from "Audio";
-import { Tools } from "Tools";
+import { Sound } from "Audio/sound";
+import { Tools } from "Tools/tools";
 
     /**
      * Wraps one or more Sound objects and selects one with random weight for playback.

+ 6 - 4
src/Behaviors/Cameras/autoRotationBehavior.ts

@@ -1,8 +1,10 @@
-import { Behavior } from "Behaviors";
-import { ArcRotateCamera, Camera } from "Cameras";
+import { Behavior } from "Behaviors/behavior";
+import { Camera } from "Cameras/camera";
+import { ArcRotateCamera } from "Cameras/arcRotateCamera";
 import { Nullable } from "types";
-import { Observer, Tools } from "Tools";
-import { PointerInfoPre, PointerEventTypes } from "Events";
+import { Tools } from "Tools/tools";
+import { Observer } from "Tools/observable";
+import { PointerInfoPre, PointerEventTypes } from "Events/pointerEvents";
 
     /**
      * The autoRotation behavior (AutoRotationBehavior) is designed to create a smooth rotation of an ArcRotateCamera when there is no user interaction.

+ 8 - 6
src/Behaviors/Cameras/bouncingBehavior.ts

@@ -1,10 +1,12 @@
-import { Behavior } from "Behaviors";
-import { ArcRotateCamera, Camera } from "Cameras";
-import { BackEase, EasingFunction } from "Animations";
+import { Behavior } from "Behaviors/behavior";
+import { Camera } from "Cameras/camera";
+import { ArcRotateCamera } from "Cameras/arcRotateCamera";
+import { BackEase, EasingFunction } from "Animations/easing";
 import { Nullable } from "types";
-import { Observer } from "Tools";
-import { AbstractMesh } from "Mesh";
-import { Animation, Animatable } from "Animations";
+import { Observer } from "Tools/observable";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Animatable } from "Animations/animatable";
+import { Animation } from "Animations/animation";
 
     /**
      * Add a bouncing effect to an ArcRotateCamera when reaching a specified minimum and maximum radius

+ 11 - 8
src/Behaviors/Cameras/framingBehavior.ts

@@ -1,12 +1,15 @@
-import { Behavior } from "Behaviors";
-import { ArcRotateCamera, Camera } from "Cameras";
-import { ExponentialEase, EasingFunction } from "Animations";
+import { Behavior } from "Behaviors/behavior";
+import { Camera } from "Cameras/camera";
+import { ArcRotateCamera } from "Cameras/arcRotateCamera";
+import { ExponentialEase, EasingFunction } from "Animations/easing";
 import { Nullable } from "types";
-import { PointerInfoPre, PointerEventTypes } from "Events";
-import { Observer, Tools } from "Tools";
-import { AbstractMesh } from "Mesh";
-import { Vector3, Vector2 } from "Math";
-import { Animation, Animatable } from "Animations";
+import { PointerInfoPre, PointerEventTypes } from "Events/pointerEvents";
+import { Tools } from "Tools/tools";
+import { Observer } from "Tools/observable";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Vector3, Vector2 } from "Math/math";
+import { Animatable } from "Animations/animatable";
+import { Animation } from "Animations/animation";
 
     /**
      * The framing behavior (FramingBehavior) is designed to automatically position an ArcRotateCamera when its target is set to a mesh. It is also useful if you want to prevent the camera to go under a virtual horizontal plane.

+ 5 - 4
src/Behaviors/Mesh/attachToBoxBehavior.ts

@@ -1,9 +1,10 @@
-import { Vector3, Matrix, Quaternion } from "Math";
-import { Mesh, TransformNode } from "Mesh";
+import { Vector3, Matrix, Quaternion } from "Math/math";
+import { Mesh } from "Mesh/mesh";
+import { TransformNode } from "Mesh/transformNode";
 import { Scene } from "scene";
 import { Nullable } from "types";
-import { Observer } from "Tools";
-import { Behavior } from "Behaviors";
+import { Observer } from "Tools/observable";
+import { Behavior } from "Behaviors/behavior";
 
     /**
      * @hidden

+ 3 - 2
src/Behaviors/Mesh/fadeInOutBehavior.ts

@@ -1,5 +1,6 @@
-import { Behavior } from "index";
-import { Mesh, AbstractMesh } from "Mesh";
+import { Behavior } from "../behavior";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
 import { Nullable } from "types";
 
     /**

+ 5 - 4
src/Behaviors/Mesh/multiPointerScaleBehavior.ts

@@ -1,8 +1,9 @@
-import { Mesh } from "Mesh";
-import { PointerDragBehavior, Behavior } from "Behaviors";
-import { Vector3 } from "Math";
+import { Mesh } from "Mesh/mesh";
+import { Behavior } from "../behavior";
+import { PointerDragBehavior } from "./pointerDragBehavior";
+import { Vector3 } from "Math/math";
 import { Nullable } from "types";
-import { Observer } from "Tools";
+import { Observer } from "Tools/observable";
 import { Scene } from "scene";
 
     /**

+ 7 - 6
src/Behaviors/Mesh/pointerDragBehavior.ts

@@ -1,11 +1,12 @@
-import { Behavior } from "Behaviors";
-import { Mesh, AbstractMesh } from "Mesh";
+import { Behavior } from "Behaviors/behavior";
+import { Mesh } from "Mesh/mesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
 import { Scene } from "scene";
 import { Nullable } from "types";
-import { Observer, Observable } from "Tools";
-import { Vector3 } from "Math";
-import { PointerInfo, PointerEventTypes } from "Events";
-import { BoundingBoxGizmo } from "Gizmos";
+import { Observer, Observable } from "Tools/observable";
+import { Vector3 } from "Math/math";
+import { PointerInfo, PointerEventTypes } from "Events/pointerEvents";
+import { BoundingBoxGizmo } from "Gizmos/boundingBoxGizmo";
 import { Ray } from "Culling/ray";
 
     /**

+ 9 - 9
src/Behaviors/Mesh/sixDofDragBehavior.ts

@@ -1,13 +1,13 @@
-import { Behavior } from "Behaviors";
-import { Mesh, AbstractMesh } from "Mesh";
+import { Behavior } from "Behaviors/behavior";
+import { Mesh } from "Mesh/mesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
 import { Scene } from "scene";
-import { Nullable, PointerEventTypes } from "index";
-import { Vector3, Quaternion } from "Math";
-import { PointerInfo } from "Events";
-import { Observer, Observable } from "Tools";
-import { BoundingBoxGizmo } from "Gizmos";
-import { Camera } from "Cameras";
-import { Matrix } from "Math";
+import { Nullable } from "types";
+import { PointerInfo, PointerEventTypes } from "Events/pointerEvents";
+import { Vector3, Quaternion, Matrix } from "Math/math";
+import { Observer, Observable } from "Tools/observable";
+import { BoundingBoxGizmo } from "Gizmos/boundingBoxGizmo";
+import { Camera } from "Cameras/camera";
     /**
      * A behavior that when attached to a mesh will allow the mesh to be dragged around based on directions and origin of the pointer's ray
      */

+ 8 - 6
src/Bones/bone.ts

@@ -1,10 +1,12 @@
-import { Vector3, Quaternion, Matrix, Space } from "Math";
-import { Tools } from "Tools";
+import { Skeleton } from "./skeleton";
+
+import { Vector3, Quaternion, Matrix, Space } from "Math/math";
+import { Tools } from "Tools/tools";
 import { Nullable } from "types";
-import { Skeleton } from "Bones";
-import { AnimationPropertiesOverride, Animation } from "Animations";
-import { AbstractMesh } from "Mesh";
-import { Node } from "Node";
+import { Animation } from "Animations/animation";
+import { AnimationPropertiesOverride } from "Animations/animationPropertiesOverride";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Node } from "node";
 
     /**
      * Class used to store bone information

+ 4 - 3
src/Bones/boneIKController.ts

@@ -1,7 +1,8 @@
-import { Vector3, Quaternion, Matrix, Space } from "Math";
-import { AbstractMesh } from "Mesh";
+import { Bone } from "./bone";
+
+import { Vector3, Quaternion, Matrix, Space } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
 import { Nullable } from "types";
-import { Bone } from "Bones";
 
     /**
      * Class used to apply inverse kinematics to bones

+ 5 - 4
src/Bones/boneLookController.ts

@@ -1,7 +1,8 @@
-import { Vector3, Quaternion, Matrix, Space, Axis } from "Math";
-import { Tools } from "Tools";
-import { AbstractMesh } from "Mesh";
-import { Bone } from "Bones";
+import { Bone } from "./bone";
+
+import { Vector3, Quaternion, Matrix, Space, Axis } from "Math/math";
+import { Tools } from "Tools/tools";
+import { AbstractMesh } from "Mesh/abstractMesh";
 import { Nullable } from "types";
 
     /**

+ 11 - 7
src/Bones/skeleton.ts

@@ -1,12 +1,16 @@
-import { IAnimatable, Observable, Tools } from "Tools";
-import { Bone } from "Bones";
-import { Vector3, Matrix, Tmp } from "Math";
+import { Bone } from "./bone";
+
+import { IAnimatable, Tools } from "Tools/tools";
+import { Observable } from "Tools/observable";
+import { Vector3, Matrix, Tmp } from "Math/math";
 import { Scene } from "scene";
 import { Nullable } from "types";
-import { AbstractMesh } from "Mesh";
-import { RawTexture } from "Materials";
-import { AnimationRange, AnimationPropertiesOverride, Animation, Animatable } from "Animations";
-import { Engine } from "Engine";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { RawTexture } from "Materials/Textures/rawTexture";
+import { Animatable } from "Animations/animatable";
+import { AnimationPropertiesOverride } from "Animations/animationPropertiesOverride";
+import { AnimationRange, Animation } from "Animations/animation";
+import { Engine } from "Engine/engine";
 
     /**
      * Class used to handle skinning animations

+ 3 - 2
src/Collisions/collider.ts

@@ -1,6 +1,7 @@
 import { Nullable, IndicesArray } from "types";
-import { Vector3, Plane } from "Math";
-import { AbstractMesh } from "Mesh";
+import { Vector3, Plane } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+
     var intersectBoxAASphere = (boxMin: Vector3, boxMax: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean => {
         if (boxMin.x > sphereCenter.x + sphereRadius) {
             return false;

+ 12 - 5
src/Collisions/collisionCoordinator.ts

@@ -1,10 +1,17 @@
-import { Tools } from "Tools";
+import { Tools } from "Tools/tools";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Vector3 } from "Math";
-import { Engine } from "Engine";
-import { Mesh, AbstractMesh, Geometry, InstancedMesh, VertexBuffer, TransformNode } from "Mesh";
-import { Collider, WorkerIncluded } from "Collisions";
+import { Vector3 } from "Math/math";
+import { Engine } from "Engine/engine";
+import { Collider } from "./collider";
+import { WorkerIncluded } from "./collisionWorker";
+import { TransformNode } from "Mesh/transformNode";
+import { Geometry } from "Mesh/geometry";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { InstancedMesh } from "Mesh/instancedMesh";
+import { Mesh } from "Mesh/mesh";
+
     //WebWorker code will be inserted to this variable.
     /** @hidden */
     export var CollisionWorker = "";

+ 3 - 2
src/Collisions/collisionWorker.ts

@@ -1,6 +1,7 @@
 import { Nullable } from "types";
-import { Matrix, Vector3 } from "Math";
-import { Collider, SerializedMesh, SerializedGeometry, SerializedSubMesh, InitPayload, UpdatePayload, CollidePayload, WorkerReply, WorkerReplyType, WorkerTaskType, CollisionReplyPayload, BabylonMessage } from "Collisions";
+import { Matrix, Vector3 } from "Math/math";
+import { Collider } from "Collisions/collider";
+import { SerializedMesh, SerializedGeometry, SerializedSubMesh, InitPayload, UpdatePayload, CollidePayload, WorkerReply, WorkerReplyType, WorkerTaskType, CollisionReplyPayload, BabylonMessage } from "Collisions/collisionCoordinator";
 
 declare function importScripts(...urls: string[]): void;
 

+ 5 - 4
src/Collisions/pickingInfo.ts

@@ -1,8 +1,9 @@
 import { Nullable, FloatArray } from "types";
-import { Vector3, Vector2, Tmp } from "Math";
-import { AbstractMesh, VertexBuffer } from "Mesh";
-import { Ray } from "Culling";
-import { Sprite } from "Sprites";
+import { Vector3, Vector2, Tmp } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { Ray } from "Culling/ray";
+import { Sprite } from "Sprites/sprite";
     /**
      * @hidden
      */

+ 6 - 4
src/Culling/Octrees/octree.ts

@@ -1,7 +1,9 @@
-import { SmartArray, SmartArrayNoDuplicate } from "Tools";
-import { Vector3, Plane } from "Math";
-import { AbstractMesh, SubMesh } from "Mesh";
-import { Ray, OctreeBlock } from "Culling";
+import { SmartArray, SmartArrayNoDuplicate } from "Tools/smartArray";
+import { Vector3, Plane } from "Math/math";
+import { SubMesh } from "Mesh/subMesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Ray } from "Culling/ray";
+import { OctreeBlock } from "./octreeBlock";
     /**
      * Contains an array of blocks representing the octree
      */

+ 5 - 3
src/Culling/Octrees/octreeBlock.ts

@@ -1,6 +1,8 @@
-import { SmartArrayNoDuplicate } from "Tools";
-import { Vector3, Plane } from "Math";
-import { Ray, BoundingBox, Octree } from "Culling";
+import { SmartArrayNoDuplicate } from "Tools/smartArray";
+import { Vector3, Plane } from "Math/math";
+import { Ray } from "Culling/ray";
+import { BoundingBox } from "Culling/boundingBox";
+import { Octree } from "./octree";
     /**
      * Class used to store a cell in an octree
      * @see http://doc.babylonjs.com/how_to/optimizing_your_scene_with_octrees

+ 8 - 5
src/Culling/Octrees/octreeSceneComponent.ts

@@ -1,11 +1,14 @@
-import { ISmartArrayLike } from "Tools";
+import { ISmartArrayLike } from "Tools/smartArray";
 import { Scene } from "scene";
-import { Vector3 } from "Math";
-import { AbstractMesh, SubMesh } from "Mesh";
-import { Collider } from "Collisions";
-import { Ray, Octree } from "Culling";
+import { Vector3 } from "Math/math";
+import { SubMesh } from "Mesh/subMesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Collider } from "Collisions/collider";
+import { Ray } from "Culling/ray";
 import { SceneComponentConstants } from "sceneComponent";
 
+import { Octree } from "./octree";
+
 declare module "scene" {
     export interface Scene {
         /**

+ 6 - 3
src/Culling/boundingBox.ts

@@ -1,6 +1,9 @@
-import { Tools } from "Tools";
-import { Matrix, Vector3, Plane, Epsilon } from "Math";
-import { ICullable, BoundingSphere } from "Culling";
+import { Tools } from "Tools/tools";
+import { Matrix, Vector3, Plane, Epsilon } from "Math/math";
+import { BoundingSphere } from "Culling/boundingSphere";
+
+import { ICullable } from "./boundingInfo";
+
     /**
      * Class used to store bounding box information
      */

+ 8 - 5
src/Culling/boundingInfo.ts

@@ -1,8 +1,11 @@
-import { Tools } from "Tools";
-import { Matrix, Vector3, Plane } from "Math";
-import { AbstractMesh } from "Mesh";
-import { Collider } from "Collisions";
-import { ICullable, BoundingBox, BoundingSphere } from "Culling";
+import { Tools } from "Tools/tools";
+import { Matrix, Vector3, Plane } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Collider } from "Collisions/collider";
+
+import { BoundingBox } from "./boundingBox";
+import { BoundingSphere } from "./boundingSphere";
+
     const _result0 = { min: 0, max: 0};
     const _result1 = { min: 0, max: 0};
     const computeBoxExtents = (axis: Readonly<Vector3>, box: Readonly<BoundingBox>, result: {min: number, max: number}) => {

+ 3 - 2
src/Culling/boundingSphere.ts

@@ -1,5 +1,6 @@
-import { Tools } from "Tools";
-import { Matrix, Vector3, Plane } from "Math";
+import { Tools } from "Tools/tools";
+import { Matrix, Vector3, Plane } from "Math/math";
+
     /**
      * Class used to store bounding sphere information
      */

+ 3 - 2
src/Debug/axesViewer.ts

@@ -1,7 +1,8 @@
-import { Vector3, Color3 } from "Math";
+import { Vector3, Color3 } from "Math/math";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { LinesMesh, Mesh } from "Mesh";
+import { Mesh } from "Mesh/mesh";
+import { LinesMesh } from "Mesh/linesMesh";
 
 /**
      * The Axes viewer will show 3 axes in a specific point in space

+ 4 - 4
src/Debug/boneAxesViewer.ts

@@ -1,8 +1,8 @@
-import { AxesViewer } from "Debug";
 import { Nullable } from "types";
-import { Mesh } from "Mesh";
-import { Bone } from "Bones";
-import { Vector3, Axis } from "Math";
+import { AxesViewer } from "Debug/axesViewer";
+import { Vector3, Axis } from "Math/math";
+import { Mesh } from "Mesh/mesh";
+import { Bone } from "Bones/bone";
 import { Scene } from "scene";
 
 /**

+ 2 - 1
src/Debug/debugLayer.ts

@@ -1,4 +1,5 @@
-import { Tools, Observable } from "Tools";
+import { Tools } from "Tools/tools";
+import { Observable } from "Tools/observable";
 import { Scene } from "scene";
 
     // declare INSPECTOR namespace for compilation issue

+ 4 - 2
src/Debug/physicsViewer.ts

@@ -1,8 +1,10 @@
 import { Nullable } from "types";
 import { PhysicsImpostor, IPhysicsEnginePlugin, StandardMaterial, Engine, Material } from "index";
 import { Scene } from "scene";
-import { Mesh, MeshBuilder, AbstractMesh } from "Mesh";
-import { Quaternion } from "Math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { MeshBuilder } from "Mesh/meshBuilder";
+import { Quaternion } from "Math/math";
 
 /**
      * Used to show the physics impostor around the specific mesh

+ 5 - 3
src/Debug/rayHelper.ts

@@ -1,8 +1,10 @@
 import { Nullable } from "types";
-import { Ray } from "index";
-import { Vector3, Color3 } from "Math";
+import { Ray } from "Culling/ray";
+import { Vector3, Color3 } from "Math/math";
 import { Scene } from "scene";
-import { AbstractMesh, LinesMesh, Mesh } from "Mesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { LinesMesh } from "Mesh/linesMesh";
 
     /**
      * As raycast might be hard to debug, the RayHelper can help rendering the different rays

+ 7 - 4
src/Debug/skeletonViewer.ts

@@ -1,9 +1,12 @@
-import { Color3, Vector3, Matrix, Tmp } from "Math";
+import { Color3, Vector3, Matrix, Tmp } from "Math/math";
 import { Scene } from "scene";
 import { Nullable } from "types";
-import { Skeleton, Bone } from "Bones";
-import { AbstractMesh, LinesMesh, MeshBuilder } from "Mesh";
-import { UtilityLayerRenderer } from "Rendering";
+import { Bone } from "Bones/bone";
+import { Skeleton } from "Bones/skeleton";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { LinesMesh } from "Mesh/linesMesh";
+import { MeshBuilder } from "Mesh/meshBuilder";
+import { UtilityLayerRenderer } from "Rendering/utilityLayerRenderer";
 
 /**
      * Class used to render a debug view of a given skeleton

+ 4 - 4
src/Events/pointerEvents.ts

@@ -1,8 +1,8 @@
 import { Nullable } from "types";
-import { Vector2 } from "Math";
-import { PickingInfo } from "Collisions";
-import { Ray } from "Culling";
-import { _TimeToken } from "Instrumentation";
+import { Vector2 } from "Math/math";
+import { PickingInfo } from "Collisions/pickingInfo";
+import { Ray } from "Culling/ray";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Gather the list of pointer event types as constants.

+ 9 - 5
src/Gamepad/Controllers/daydreamController.ts

@@ -1,10 +1,14 @@
-import { Tools } from "Tools";
+import { Tools } from "Tools/tools";
 import { Scene } from "scene";
-import { WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges } from "Gamepad";
-import { AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
-import { SceneLoader } from "Loading";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { _TimeToken } from "Instrumentation/timeToken";
+import { SceneLoader } from "Loading/sceneLoader";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+
+import { GamepadButtonChanges } from "Gamepad/gamepad";
+import { WebVRController } from "./webVRController";
+import { PoseEnabledControllerType, ExtendedGamepadButton } from "./poseEnabledController";
+
     /**
      * Google Daydream controller
      */

+ 11 - 6
src/Gamepad/Controllers/gearVRController.ts

@@ -1,11 +1,16 @@
 import { Scene } from "scene";
-import { Vector3 } from "Math";
-import { WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges } from "Gamepad";
-import { AbstractMesh, Mesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
-import { SceneLoader } from "Loading";
+import { Vector3 } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { _TimeToken } from "Instrumentation/timeToken";
+import { SceneLoader } from "Loading/sceneLoader";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-    /**
+
+import { GamepadButtonChanges } from "Gamepad/gamepad";
+import { WebVRController } from "./webVRController";
+import { PoseEnabledControllerType, ExtendedGamepadButton } from "./poseEnabledController";
+
+/**
      * Gear VR Controller
      */
     export class GearVRController extends WebVRController {

+ 8 - 4
src/Gamepad/Controllers/genericController.ts

@@ -1,9 +1,13 @@
 import { Scene } from "scene";
-import { WebVRController, ExtendedGamepadButton, GamepadButtonChanges } from "Gamepad";
-import { AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
-import { SceneLoader } from "Loading";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { _TimeToken } from "Instrumentation/timeToken";
+import { SceneLoader } from "Loading/sceneLoader";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+
+import { WebVRController } from "./webVRController";
+import { ExtendedGamepadButton } from "./poseEnabledController";
+import { GamepadButtonChanges } from "Gamepad/gamepad";
+
     /**
      * Generic Controller
      */

+ 8 - 5
src/Gamepad/Controllers/oculusTouchController.ts

@@ -1,10 +1,13 @@
-import { Observable } from "Tools";
+import { Observable } from "Tools/observable";
 import { Scene } from "scene";
-import { WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges } from "Gamepad";
-import { AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
-import { SceneLoader } from "Loading";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { _TimeToken } from "Instrumentation/timeToken";
+import { SceneLoader } from "Loading/sceneLoader";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+
+import { WebVRController } from "./webVRController";
+import { PoseEnabledControllerType, ExtendedGamepadButton } from "./poseEnabledController";
+import { GamepadButtonChanges } from "Gamepad/gamepad";
     /**
      * Oculus Touch Controller
      */

+ 15 - 9
src/Gamepad/Controllers/poseEnabledController.ts

@@ -1,14 +1,20 @@
-import { Observable } from "Tools";
+import { Observable } from "Tools/observable";
 import { Nullable } from "types";
-import { WebVRFreeCamera, TargetCamera, PoseControlled, DevicePose } from "Cameras";
-import { Quaternion, Matrix, Vector3, Tmp } from "Math";
-import { Gamepad, ExtendedGamepadButton, OculusTouchController, WindowsMotionController, ViveController, GearVRController, DaydreamController, GenericController } from "Gamepad";
-import { Node } from "Node";
-import { AbstractMesh, TransformNode } from "Mesh";
-import { Ray } from "Culling";
-import { _TimeToken } from "Instrumentation";
+import { Quaternion, Matrix, Vector3, Tmp } from "Math/math";
+import { Node } from "node";
+import { TransformNode } from "Mesh/transformNode";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Ray } from "Culling/ray";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Engine } from "Engine";
+import { Engine } from "Engine/engine";
+
+import { Gamepad } from "Gamepad/gamepad";
+import { ExtendedGamepadButton } from "./poseEnabledController";
+
+import { OculusTouchController, WindowsMotionController, ViveController, GearVRController, DaydreamController, GenericController } from "Gamepad";
+
+import { WebVRFreeCamera, TargetCamera, PoseControlled, DevicePose } from "Cameras";
     /**
     * Defines the types of pose enabled controllers that are supported
     */

+ 8 - 4
src/Gamepad/Controllers/viveController.ts

@@ -1,9 +1,13 @@
 import { Scene } from "scene";
-import { WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges } from "Gamepad";
-import { AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
-import { SceneLoader } from "Loading";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { _TimeToken } from "Instrumentation/timeToken";
+import { SceneLoader } from "Loading/sceneLoader";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+
+import { WebVRController } from "./webVRController";
+import { PoseEnabledControllerType, ExtendedGamepadButton } from "./poseEnabledController";
+import { GamepadButtonChanges } from "Gamepad/gamepad";
+
     /**
      * Vive Controller
      */

+ 5 - 4
src/Gamepad/Controllers/webVRController.ts

@@ -1,9 +1,10 @@
-import { Observable } from "Tools";
+import { Observable } from "Tools/observable";
 import { Scene } from "scene";
-import { PoseEnabledController, StickValues, ExtendedGamepadButton, GamepadButtonChanges, MutableGamepadButton } from "Gamepad";
-import { AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+import { PoseEnabledController, ExtendedGamepadButton, MutableGamepadButton } from "./poseEnabledController";
+import { StickValues, GamepadButtonChanges } from "Gamepad/gamepad";
     /**
      * Defines the WebVRController object that represents controllers tracked in 3D space
      */

+ 15 - 8
src/Gamepad/Controllers/windowsMotionController.ts

@@ -1,14 +1,21 @@
-import { Observable, Tools } from "Tools";
+import { Tools } from "Tools/tools";
+import { Observable } from "Tools/observable";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Quaternion, Vector3 } from "Math";
-import { WebVRController, PoseEnabledController, StickValues, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges, GenericController } from "Gamepad";
-import { Node } from "Node";
-import { Mesh, AbstractMesh, TransformNode } from "Mesh";
-import { Ray } from "Culling";
-import { _TimeToken } from "Instrumentation";
-import { SceneLoader } from "Loading";
+import { Quaternion, Vector3 } from "Math/math";
+import { Node } from "node";
+import { Mesh } from "Mesh/mesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { TransformNode } from "Mesh/transformNode";
+import { Ray } from "Culling/ray";
+import { _TimeToken } from "Instrumentation/timeToken";
+import { SceneLoader } from "Loading/sceneLoader";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+
+import { WebVRController } from "./webVRController";
+import { GenericController } from "./genericController";
+import { PoseEnabledController, PoseEnabledControllerType, ExtendedGamepadButton } from "./poseEnabledController";
+import { StickValues, GamepadButtonChanges } from "Gamepad/gamepad";
     /**
      * Defines the LoadedMeshInfo object that describes information about the loaded webVR controller mesh
      */

+ 4 - 3
src/Gamepad/gamepad.ts

@@ -1,7 +1,8 @@
-import { Observable } from "Tools";
-import { GamepadButtonChanges } from "Gamepad";
-import { _TimeToken } from "Instrumentation";
+import { Observable } from "Tools/observable";
+import { GamepadButtonChanges } from "Gamepad/gamepad";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+
     /**
      * Represents a gamepad control stick position
      */

+ 7 - 3
src/Gamepad/gamepadManager.ts

@@ -1,9 +1,13 @@
-import { Observable, Tools } from "Tools";
+import { Tools } from "Tools/tools";
+import { Observable } from "Tools/observable";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Gamepad, Xbox360Pad, PoseEnabledControllerHelper, GenericPad } from "Gamepad";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+
+import { PoseEnabledControllerHelper } from "Gamepad/Controllers/poseEnabledController";
+import { Xbox360Pad } from "./xboxGamepad";
+import { Gamepad, GenericPad } from "./gamepad";
     /**
      * Manager for handling gamepads
      */

+ 5 - 3
src/Gamepad/gamepadSceneComponent.ts

@@ -1,11 +1,13 @@
 import { Nullable } from "types";
-import { FreeCameraGamepadInput, FreeCameraInputsManager, ArcRotateCameraInputsManager, ArcRotateCameraGamepadInput } from "Cameras";
 import { Scene } from "scene";
-import { GamepadManager } from "Gamepad";
 import { SceneComponentConstants, ISceneComponent } from "sceneComponent";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 
+import { GamepadManager } from "./gamepadManager";
+
+import { FreeCameraGamepadInput, FreeCameraInputsManager, ArcRotateCameraInputsManager, ArcRotateCameraGamepadInput } from "Cameras";
+
 declare module "scene" {
     export interface Scene {
         /** @hidden */

+ 3 - 3
src/Gamepad/xboxGamepad.ts

@@ -1,6 +1,6 @@
-import { Observable } from "Tools";
-import { Gamepad } from "Gamepad";
-import { _TimeToken } from "Instrumentation";
+import { Observable } from "Tools/observable";
+import { Gamepad } from "Gamepad/gamepad";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Defines supported buttons for XBox360 compatible gamepads

+ 12 - 9
src/Gizmos/axisDragGizmo.ts

@@ -1,14 +1,17 @@
-import { Observer, Observable } from "Tools";
+import { Observer, Observable } from "Tools/observable";
 import { Nullable } from "types";
-import { PointerInfo } from "Events";
-import { Vector3, Color3, Matrix } from "Math";
-import { Mesh, AbstractMesh, LinesMesh, MeshBuilder } from "Mesh";
-import { PointerDragBehavior } from "Behaviors";
-import { _TimeToken } from "Instrumentation";
+import { PointerInfo } from "Events/pointerEvents";
+import { Vector3, Color3, Matrix } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { LinesMesh } from "Mesh/linesMesh";
+import { MeshBuilder } from "Mesh/meshBuilder";
+import { PointerDragBehavior } from "Behaviors/Mesh/pointerDragBehavior";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Gizmo } from "Gizmos";
-import { UtilityLayerRenderer } from "Rendering";
-import { StandardMaterial } from "Materials";
+import { Gizmo } from "./gizmo";
+import { UtilityLayerRenderer } from "Rendering/utilityLayerRenderer";
+import { StandardMaterial } from "Materials/standardMaterial";
     /**
      * Single axis drag gizmo
      */

+ 12 - 9
src/Gizmos/axisScaleGizmo.ts

@@ -1,14 +1,17 @@
-import { Observer, Observable } from "Tools";
+import { Observer, Observable } from "Tools/observable";
 import { Nullable } from "types";
-import { PointerInfo } from "Events";
-import { Vector3, Color3 } from "Math";
-import { Mesh, AbstractMesh, LinesMesh, MeshBuilder } from "Mesh";
-import { StandardMaterial } from "Materials";
-import { PointerDragBehavior } from "Behaviors";
-import { _TimeToken } from "Instrumentation";
+import { PointerInfo } from "Events/pointerEvents";
+import { Vector3, Color3 } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { LinesMesh } from "Mesh/linesMesh";
+import { MeshBuilder } from "Mesh/meshBuilder";
+import { StandardMaterial } from "Materials/standardMaterial";
+import { PointerDragBehavior } from "Behaviors/Mesh/pointerDragBehavior";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Gizmo } from "Gizmos";
-import { UtilityLayerRenderer } from "Rendering";
+import { Gizmo } from "./gizmo";
+import { UtilityLayerRenderer } from "Rendering/utilityLayerRenderer";
     /**
      * Single axis scale gizmo
      */

+ 12 - 9
src/Gizmos/boundingBoxGizmo.ts

@@ -1,15 +1,18 @@
-import { Observer, Observable, Tools } from "Tools";
+import { Observer, Observable } from "Tools/observable";
+import { Tools } from "Tools/tools";
 import { Nullable } from "types";
-import { PointerInfo } from "Events";
+import { PointerInfo } from "Events/pointerEvents";
 import { Scene } from "scene";
-import { Quaternion, Matrix, Vector3, Color3 } from "Math";
-import { Mesh, AbstractMesh, MeshBuilder } from "Mesh";
-import { PointerDragBehavior } from "Behaviors";
-import { _TimeToken } from "Instrumentation";
+import { Quaternion, Matrix, Vector3, Color3 } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { MeshBuilder } from "Mesh/meshBuilder";
+import { PointerDragBehavior } from "Behaviors/Mesh/pointerDragBehavior";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Gizmo } from "Gizmos";
-import { UtilityLayerRenderer } from "Rendering";
-import { StandardMaterial } from "Materials";
+import { Gizmo } from "./gizmo";
+import { UtilityLayerRenderer } from "Rendering/utilityLayerRenderer";
+import { StandardMaterial } from "Materials/standardMaterial";
     /**
      * Bounding box gizmo
      */

+ 7 - 6
src/Gizmos/gizmo.ts

@@ -1,12 +1,13 @@
-import { Observer } from "Tools";
+import { Observer } from "Tools/observable";
 import { Nullable } from "types";
-import { WebVRFreeCamera } from "Cameras";
+import { WebVRFreeCamera } from "Cameras/VR/webVRCamera";
 import { Scene, IDisposable } from "scene";
-import { Quaternion, Matrix, Vector3 } from "Math";
-import { Mesh, AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
+import { Quaternion, Matrix, Vector3 } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { UtilityLayerRenderer } from "Rendering";
+import { UtilityLayerRenderer } from "Rendering/utilityLayerRenderer";
     /**
      * Renders gizmos on top of an existing scene which provide controls for position, rotation, etc.
      */

+ 15 - 9
src/Gizmos/gizmoManager.ts

@@ -1,15 +1,21 @@
-import { Observer } from "Tools";
+import { Observer } from "Tools/observable";
 import { Nullable } from "types";
-import { PointerInfo, PointerEventTypes } from "Events";
+import { PointerInfo, PointerEventTypes } from "Events/pointerEvents";
 import { Scene, IDisposable } from "scene";
-import { Node } from "Node";
-import { AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
+import { Node } from "node";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Gizmo, RotationGizmo, PositionGizmo, ScaleGizmo, BoundingBoxGizmo } from "Gizmos";
-import { UtilityLayerRenderer } from "Rendering";
-import { Color3 } from "Math";
-import { SixDofDragBehavior } from "Behaviors";
+import { UtilityLayerRenderer } from "Rendering/utilityLayerRenderer";
+import { Color3 } from "Math/math";
+import { SixDofDragBehavior } from "Behaviors/Mesh/sixDofDragBehavior";
+
+import { Gizmo } from "./gizmo";
+import { RotationGizmo } from "./rotationGizmo";
+import { PositionGizmo } from "./positionGizmo";
+import { ScaleGizmo } from "./scaleGizmo";
+import { BoundingBoxGizmo } from "./boundingBoxGizmo";
+
     /**
      * Helps setup gizmo's in the scene to rotate/scale/position meshes
      */

+ 11 - 9
src/Gizmos/planeRotationGizmo.ts

@@ -1,14 +1,16 @@
-import { Observer, Observable } from "Tools";
+import { Observer, Observable } from "Tools/observable";
 import { Nullable } from "types";
-import { PointerInfo } from "Events";
-import { Quaternion, Matrix, Vector3, Color3 } from "Math";
-import { Mesh, AbstractMesh, LinesMesh } from "Mesh";
-import { PointerDragBehavior } from "Behaviors";
-import { _TimeToken } from "Instrumentation";
+import { PointerInfo } from "Events/pointerEvents";
+import { Quaternion, Matrix, Vector3, Color3 } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { LinesMesh } from "Mesh/linesMesh";
+import { PointerDragBehavior } from "Behaviors/Mesh/pointerDragBehavior";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Gizmo } from "Gizmos";
-import { UtilityLayerRenderer } from "Rendering";
-import { StandardMaterial } from "Materials";
+import { Gizmo } from "./gizmo";
+import { UtilityLayerRenderer } from "Rendering/utilityLayerRenderer";
+import { StandardMaterial } from "Materials/standardMaterial";
     /**
      * Single plane rotation gizmo
      */

+ 9 - 6
src/Gizmos/positionGizmo.ts

@@ -1,11 +1,14 @@
-import { Observable, Tools } from "Tools";
+import { Tools } from "Tools/tools";
+import { Observable } from "Tools/observable";
 import { Nullable } from "types";
-import { Vector3, Color3 } from "Math";
-import { Mesh, AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
+import { Vector3, Color3 } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Gizmo, AxisDragGizmo } from "Gizmos";
-import { UtilityLayerRenderer } from "Rendering";
+import { Gizmo } from "./gizmo";
+import { AxisDragGizmo } from "./axisDragGizmo";
+import { UtilityLayerRenderer } from "Rendering/utilityLayerRenderer";
     /**
      * Gizmo that enables dragging a mesh along 3 axis
      */

+ 9 - 6
src/Gizmos/rotationGizmo.ts

@@ -1,11 +1,14 @@
-import { Observable, Tools } from "Tools";
+import { Tools } from "Tools/tools";
+import { Observable } from "Tools/observable";
 import { Nullable } from "types";
-import { Vector3, Color3 } from "Math";
-import { Mesh, AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
+import { Vector3, Color3 } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Gizmo, PlaneRotationGizmo } from "Gizmos";
-import { UtilityLayerRenderer } from "Rendering";
+import { Gizmo } from "./gizmo";
+import { PlaneRotationGizmo } from "./planeRotationGizmo";
+import { UtilityLayerRenderer } from "Rendering/utilityLayerRenderer";
     /**
      * Gizmo that enables rotating a mesh along 3 axis
      */

+ 8 - 5
src/Gizmos/scaleGizmo.ts

@@ -1,9 +1,12 @@
-import { Observable, Tools } from "Tools";
+import { Tools } from "Tools/tools";
+import { Observable } from "Tools/observable";
 import { Nullable } from "types";
-import { Vector3, Color3 } from "Math";
-import { AbstractMesh, Mesh } from "Mesh";
-import { Gizmo, AxisScaleGizmo } from "Gizmos";
-import { UtilityLayerRenderer } from "Rendering";
+import { Vector3, Color3 } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { Gizmo } from "./gizmo";
+import { AxisScaleGizmo } from "./axisScaleGizmo";
+import { UtilityLayerRenderer } from "Rendering/utilityLayerRenderer";
     /**
      * Gizmo that enables scaling a mesh along 3 axis
      */

+ 12 - 7
src/Helpers/environmentHelper.ts

@@ -1,12 +1,17 @@
-import { Observable } from "Tools";
+import { Observable } from "Tools/observable";
 import { Nullable } from "types";
-import { ArcRotateCamera } from "Cameras";
+import { ArcRotateCamera } from "Cameras/arcRotateCamera";
 import { Scene } from "scene";
-import { Vector3, Color3, Color4, Plane } from "Math";
-import { Engine } from "Engine";
-import { Mesh, AbstractMesh } from "Mesh";
-import { Texture, BaseTexture, BackgroundMaterial, MirrorTexture, CubeTexture } from "Materials";
-import { _TimeToken } from "Instrumentation";
+import { Vector3, Color3, Color4, Plane } from "Math/math";
+import { Engine } from "Engine/engine";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { Texture } from "Materials/Textures/texture";
+import { MirrorTexture } from "Materials/Textures/mirrorTexture";
+import { CubeTexture } from "Materials/Textures/cubeTexture";
+import { BackgroundMaterial } from "Materials/Background/backgroundMaterial";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Represents the different options available during the creation of

+ 6 - 4
src/Helpers/photoDome.ts

@@ -1,9 +1,11 @@
-import { Observable } from "Tools";
+import { Observable } from "Tools/observable";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Mesh, TransformNode } from "Mesh";
-import { Texture, BackgroundMaterial } from "Materials";
-import { _TimeToken } from "Instrumentation";
+import { TransformNode } from "Mesh/transformNode";
+import { Mesh } from "Mesh/mesh";
+import { Texture } from "Materials/Textures/texture";
+import { BackgroundMaterial } from "Materials/Background/backgroundMaterial";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Display a 360 degree photo on an approximately spherical surface, useful for VR applications or skyboxes.

+ 12 - 5
src/Helpers/sceneHelpers.ts

@@ -1,12 +1,19 @@
-import { Tools } from "Tools";
+import { Tools } from "Tools/tools";
 import { Nullable } from "types";
-import { FreeCamera, ArcRotateCamera, TargetCamera, WebXRExperienceHelper, VRExperienceHelperOptions, VRExperienceHelper, WebXRManagedOutputCanvas, WebXRInput, WebXREnterExitUI } from "Cameras";
 import { Scene } from "scene";
-import { Vector3 } from "Math";
-import { Mesh } from "Mesh";
+import { Vector3 } from "Math/math";
+import { Mesh } from "Mesh/mesh";
 import { StandardMaterial, Texture, BaseTexture, PBRMaterial } from "Materials";
-import { HemisphericLight } from "Lights";
+import { HemisphericLight } from "Lights/hemisphericLight";
 import { IEnvironmentHelperOptions, EnvironmentHelper } from "./environmentHelper";
+import { FreeCamera } from "Cameras/freeCamera";
+import { ArcRotateCamera } from "Cameras/arcRotateCamera";
+import { TargetCamera } from "Cameras/targetCamera";
+import { WebXRManagedOutputCanvas } from "Cameras/XR/webXRManagedOutputCanvas";
+import { WebXRInput } from "Cameras/XR/webXRInput";
+import { WebXREnterExitUI } from "Cameras/XR/webXREnterExitUI";
+import { WebXRExperienceHelper } from "Cameras/XR/webXRExperienceHelper";
+import { VRExperienceHelperOptions, VRExperienceHelper } from "Cameras/VR/vrExperienceHelper";
 
 declare module "scene" {
     export interface Scene {

+ 7 - 3
src/Helpers/videoDome.ts

@@ -1,8 +1,12 @@
 import { Scene } from "scene";
-import { Mesh, TransformNode } from "Mesh";
-import { Texture, VideoTexture, BackgroundMaterial, VideoTextureSettings } from "Materials";
-import { _TimeToken } from "Instrumentation";
+import { TransformNode } from "Mesh/transformNode";
+import { Mesh } from "Mesh/mesh";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+import { Texture } from "Materials/Textures/texture";
+import { VideoTexture, VideoTextureSettings } from "Materials/Textures/videoTexture";
+import { BackgroundMaterial } from "Materials/Background/backgroundMaterial";
+
     /**
      * Display a 360 degree video on an approximately spherical surface, useful for VR applications or skyboxes.
      * As a subclass of TransformNode, this allow parenting to the camera or multiple videos with different locations in the scene.

+ 4 - 3
src/Instrumentation/engineInstrumentation.ts

@@ -1,8 +1,9 @@
-import { Observer, PerfCounter } from "Tools";
+import { Observer } from "Tools/observable";
+import { PerfCounter } from "Tools/tools";
 import { Nullable } from "types";
 import { IDisposable } from "scene";
-import { Engine } from "Engine";
-import { _TimeToken } from "Instrumentation";
+import { Engine } from "Engine/engine";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * This class can be used to get instrumentation data from a Babylon engine

+ 4 - 3
src/Instrumentation/sceneInstrumentation.ts

@@ -1,8 +1,9 @@
-import { Observer, Tools, PerfCounter } from "Tools";
+import { Tools, PerfCounter } from "Tools/tools";
+import { Observer } from "Tools/observable";
 import { Nullable } from "types";
-import { Camera } from "Cameras";
+import { Camera } from "Cameras/camera";
 import { Scene, IDisposable } from "scene";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * This class can be used to get instrumentation data from a Babylon engine

+ 21 - 9
src/Layer/effectLayer.ts

@@ -1,16 +1,28 @@
-import { serialize, Observable, Tools, SmartArray, serializeAsColor4, serializeAsCameraReference } from "Tools";
+import { serialize, serializeAsColor4, serializeAsCameraReference } from "Tools/decorators";
+import { Tools } from "Tools/tools";
+import { SmartArray } from "Tools/smartArray";
+import { Observable } from "Tools/observable";
 import { Nullable } from "types";
-import { Camera } from "Cameras";
+import { Camera } from "Cameras/camera";
 import { Scene } from "scene";
-import { Color4, ISize } from "Math";
-import { Engine } from "Engine";
-import { Mesh, AbstractMesh, VertexBuffer, SubMesh } from "Mesh";
-import { RenderTargetTexture, Material, Texture, Effect, BaseTexture, MaterialHelper } from "Materials";
-import { PostProcess } from "PostProcess";
+import { Color4, ISize } from "Math/math";
+import { Engine } from "Engine/engine";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { SubMesh } from "Mesh/subMesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { PostProcess } from "PostProcess/postProcess";
 import { SceneComponentConstants } from "sceneComponent";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { EffectLayerSceneComponent } from "Layer";
+import { EffectLayerSceneComponent } from "./effectLayerSceneComponent";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { Texture } from "Materials/Textures/texture";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+import { Effect } from "Materials/effect";
+import { Material } from "Materials/material";
+import { MaterialHelper } from "Materials/materialHelper";
+
     /**
      * Effect layer options. This helps customizing the behaviour
      * of the effect layer.

+ 6 - 6
src/Layer/effectLayerSceneComponent.ts

@@ -1,12 +1,12 @@
-import { Camera } from "Cameras";
+import { Camera } from "Cameras/camera";
 import { Scene } from "scene";
-import { Engine } from "Engine";
-import { AbstractMesh } from "Mesh";
-import { RenderTargetTexture } from "Materials";
+import { Engine } from "Engine/engine";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
 import { SceneComponentConstants, ISceneSerializableComponent } from "sceneComponent";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { EffectLayer } from "Layer";
+import { EffectLayer } from "./effectLayer";
 import { AbstractScene } from "abstractScene";
 import { AssetContainer } from "assetContainer";
     // Adds the parser to the scene parsers.

+ 16 - 8
src/Layer/glowLayer.ts

@@ -1,13 +1,21 @@
-import { serialize, Tools, SerializationHelper } from "Tools";
+import { serialize, SerializationHelper } from "Tools/decorators";
+import { Tools } from "Tools/tools";
 import { Nullable } from "types";
-import { Camera } from "Cameras";
+import { Camera } from "Cameras/camera";
 import { Scene } from "scene";
-import { Vector2, Color4 } from "Math";
-import { Engine } from "Engine";
-import { Mesh, AbstractMesh, VertexBuffer, SubMesh } from "Mesh";
-import { RenderTargetTexture, Material, Texture, Effect } from "Materials";
-import { PostProcess, BlurPostProcess } from "PostProcess";
-import { EffectLayer } from "Layer";
+import { Vector2, Color4 } from "Math/math";
+import { Engine } from "Engine/engine";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { SubMesh } from "Mesh/subMesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { Texture } from "Materials/Textures/texture";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+import { Effect } from "Materials/effect";
+import { Material } from "Materials/material";
+import { PostProcess } from "PostProcess/postProcess";
+import { BlurPostProcess } from "PostProcess/blurPostProcess";
+import { EffectLayer } from "./effectLayer";
 import { AbstractScene } from "abstractScene";
 
 declare module "abstractScene" {

+ 19 - 9
src/Layer/highlightLayer.ts

@@ -1,15 +1,25 @@
-import { serialize, Observer, Observable, Tools, SerializationHelper } from "Tools";
+import { serialize, SerializationHelper } from "Tools/decorators";
+import { Observer, Observable } from "Tools/observable";
+import { Tools } from "Tools/tools";
 import { Nullable } from "types";
-import { Camera } from "Cameras";
+import { Camera } from "Cameras/camera";
 import { Scene } from "scene";
-import { Vector2, Color3, Color4 } from "Math";
-import { Engine } from "Engine";
-import { Mesh, AbstractMesh, VertexBuffer, SubMesh } from "Mesh";
-import { RenderTargetTexture, Material, Texture, Effect } from "Materials";
-import { PostProcess, PassPostProcess, BlurPostProcess, PostProcessOptions } from "PostProcess";
-import { _TimeToken } from "Instrumentation";
+import { Vector2, Color3, Color4 } from "Math/math";
+import { Engine } from "Engine/engine";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { SubMesh } from "Mesh/subMesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { Effect } from "Materials/effect";
+import { Material } from "Materials/material";
+import { Texture } from "Materials/Textures/texture";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+import { PostProcess, PostProcessOptions } from "PostProcess/postProcess";
+import { PassPostProcess } from "PostProcess/passPostProcess";
+import { BlurPostProcess } from "PostProcess/blurPostProcess";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { EffectLayer } from "Layer";
+import { EffectLayer } from "./effectLayer";
 import { AbstractScene } from "abstractScene";
 
 declare module "abstractScene" {

+ 9 - 7
src/Layer/layer.ts

@@ -1,14 +1,16 @@
-import { Observer, Observable } from "Tools";
+import { Observer, Observable } from "Tools/observable";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Vector2, Color4 } from "Math";
-import { Engine } from "Engine";
-import { VertexBuffer } from "Mesh";
-import { Material, Texture, Effect } from "Materials";
+import { Vector2, Color4 } from "Math/math";
+import { Engine } from "Engine/engine";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { Effect } from "Materials/effect";
+import { Material } from "Materials/material";
+import { Texture } from "Materials/Textures/texture";
 import { SceneComponentConstants } from "sceneComponent";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { LayerSceneComponent } from "Layer";
+import { LayerSceneComponent } from "./layerSceneComponent";
     /**
      * This represents a full screen 2d layer.
      * This can be usefull to display a picture in the  background of your scene for instance.

+ 4 - 4
src/Layer/layerSceneComponent.ts

@@ -1,10 +1,10 @@
-import { Camera } from "Cameras";
+import { Camera } from "Cameras/camera";
 import { Scene } from "scene";
-import { Engine } from "Engine";
+import { Engine } from "Engine/engine";
 import { SceneComponentConstants, ISceneComponent } from "sceneComponent";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Layer } from "Layer";
+import { Layer } from "./layer";
 
 declare module "abstractScene" {
     export interface AbstractScene {

+ 5 - 5
src/LensFlare/lensFlare.ts

@@ -1,10 +1,10 @@
 import { Nullable } from "types";
-import { Color3 } from "Math";
-import { Engine } from "Engine";
-import { Texture } from "Materials";
-import { _TimeToken } from "Instrumentation";
+import { Color3 } from "Math/math";
+import { Engine } from "Engine/engine";
+import { Texture } from "Materials/Textures/texture";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { LensFlareSystem } from "LensFlare";
+import { LensFlareSystem } from "./lensFlareSystem";
     /**
      * This represents one of the lens effect in a `lensFlareSystem`.
      * It controls one of the indiviual texture used in the effect.

+ 13 - 8
src/LensFlare/lensFlareSystem.ts

@@ -1,15 +1,20 @@
-import { Tools } from "Tools";
+import { Tools } from "Tools/tools";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Matrix, Vector3, Color3, Viewport, Scalar } from "Math";
-import { Engine } from "Engine";
-import { AbstractMesh, VertexBuffer } from "Mesh";
-import { Ray } from "Culling";
-import { Material, Effect } from "Materials";
+import { Matrix, Vector3, Color3, Viewport } from "Math/math";
+import { Scalar } from "Math/math.scalar";
+import { Engine } from "Engine/engine";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { Ray } from "Culling/ray";
+import { Effect } from "Materials/effect";
+import { Material } from "Materials/material";
 import { SceneComponentConstants } from "sceneComponent";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { LensFlare, LensFlareSystemSceneComponent } from "LensFlare";
+import { LensFlare } from "./lensFlare";
+import { LensFlareSystemSceneComponent } from "./lensFlareSystemSceneComponent";
+
     /**
      * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
      * It is usually composed of several `lensFlare`.

+ 4 - 4
src/LensFlare/lensFlareSystemSceneComponent.ts

@@ -1,13 +1,13 @@
-import { Tools } from "Tools";
+import { Tools } from "Tools/tools";
 import { Nullable } from "types";
-import { Camera } from "Cameras";
+import { Camera } from "Cameras/camera";
 import { Scene } from "scene";
 import { SceneComponentConstants, ISceneSerializableComponent } from "sceneComponent";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { AbstractScene } from "abstractScene";
 import { AssetContainer } from "assetContainer";
-import { LensFlareSystem } from "LensFlare";
+import { LensFlareSystem } from "./lensFlareSystem";
     // Adds the parser to the scene parsers.
     AbstractScene.AddParser(SceneComponentConstants.NAME_LENSFLARESYSTEM, (parsedData: any, scene: Scene, container: AssetContainer, rootUrl: string) => {
         // Lens flares

+ 21 - 8
src/Lights/Shadows/shadowGenerator.ts

@@ -1,14 +1,27 @@
-import { SmartArray } from "Tools";
+import { SmartArray } from "Tools/smartArray";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Matrix, Vector3, Vector2, Color4 } from "Math";
-import { Engine } from "Engine";
-import { Mesh, AbstractMesh, VertexBuffer, SubMesh } from "Mesh";
-import { RenderTargetTexture, Material, Texture, Effect, MaterialHelper, MaterialDefines } from "Materials";
-import { PostProcess, BlurPostProcess } from "PostProcess";
-import { IShadowLight, ShadowGeneratorSceneComponent, Light } from "Lights";
+import { Matrix, Vector3, Vector2, Color4 } from "Math/math";
+import { Engine } from "Engine/engine";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { SubMesh } from "Mesh/subMesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+
+import { IShadowLight } from "Lights/shadowLight";
+import { Light } from "Lights/light";
+import { ShadowGeneratorSceneComponent } from "./shadowGeneratorSceneComponent";
+
+import { Material, MaterialDefines } from "Materials/material";
+import { MaterialHelper } from "Materials/materialHelper";
+import { Effect } from "Materials/effect";
+import { Texture } from "Materials/Textures/texture";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+
+import { PostProcess } from "PostProcess/postProcess";
+import { BlurPostProcess } from "PostProcess/blurPostProcess";
 import { SceneComponentConstants } from "sceneComponent";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Interface to implement to create a shadow generator compatible with BJS.

+ 4 - 4
src/Lights/Shadows/shadowGeneratorSceneComponent.ts

@@ -1,9 +1,9 @@
-import { SmartArrayNoDuplicate } from "Tools";
+import { SmartArrayNoDuplicate } from "Tools/smartArray";
 import { Scene } from "scene";
-import { RenderTargetTexture } from "Materials";
-import { ShadowGenerator } from "Lights";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+import { ShadowGenerator } from "./shadowGenerator";
 import { SceneComponentConstants, ISceneSerializableComponent } from "sceneComponent";
-import { _TimeToken } from "Instrumentation";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { AbstractScene } from "abstractScene";
     // Adds the parser to the scene parsers.

+ 9 - 8
src/Lights/directionalLight.ts

@@ -1,13 +1,14 @@
-import { serialize } from "Tools";
-import { Camera } from "Cameras";
+import { serialize } from "Tools/decorators";
+import { Camera } from "Cameras/camera";
 import { Scene } from "scene";
-import { Matrix, Vector3 } from "Math";
-import { Node } from "Node";
-import { AbstractMesh } from "Mesh";
-import { ShadowLight, Light } from "Lights";
-import { _TimeToken } from "Instrumentation";
+import { Matrix, Vector3 } from "Math/math";
+import { Node } from "node";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Light } from "./light";
+import { ShadowLight } from "./shadowLight";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Effect } from "Materials";
+import { Effect } from "Materials/effect";
     Node.AddNodeConstructor("Light_Type_1", (name, scene) => {
         return () => new DirectionalLight(name, Vector3.Zero(), scene);
     });

+ 8 - 6
src/Lights/hemisphericLight.ts

@@ -1,12 +1,14 @@
+import { serializeAsColor3, serializeAsVector3 } from "Tools/decorators";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Matrix, Vector3, Color3 } from "Math";
-import { Node } from "Node";
-import { Effect } from "Materials";
-import { Light, IShadowGenerator } from "Lights";
-import { _TimeToken } from "Instrumentation";
+import { Matrix, Vector3, Color3 } from "Math/math";
+import { Node } from "node";
+import { Effect } from "Materials/effect";
+import { Light } from "./light";
+import { IShadowGenerator } from "./Shadows/shadowGenerator";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { serializeAsColor3, serializeAsVector3 } from "index";
+
     Node.AddNodeConstructor("Light_Type_3", (name, scene) => {
         return () => new HemisphericLight(name, Vector3.Zero(), scene);
     });

+ 3 - 3
src/Lights/index.ts

@@ -1,7 +1,7 @@
-export * from "./directionalLight";
-export * from "./hemisphericLight";
 export * from "./light";
-export * from "./pointLight";
 export * from "./shadowLight";
 export * from "./Shadows";
+export * from "./directionalLight";
+export * from "./hemisphericLight";
+export * from "./pointLight";
 export * from "./spotLight";

+ 8 - 7
src/Lights/light.ts

@@ -1,12 +1,13 @@
-import { serialize, SerializationHelper, serializeAsColor3, expandToProperty } from "Tools";
+import { serialize, SerializationHelper, serializeAsColor3, expandToProperty } from "Tools/decorators";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Vector3, Color3 } from "Math";
-import { Node } from "Node";
-import { AbstractMesh } from "Mesh";
-import { UniformBuffer, Effect } from "Materials";
-import { Animation } from "Animations";
-import { IShadowGenerator } from "Lights";
+import { Vector3, Color3 } from "Math/math";
+import { Node } from "node";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Effect } from "Materials/effect";
+import { UniformBuffer } from "Materials/uniformBuffer";
+import { Animation } from "Animations/animation";
+import { IShadowGenerator } from "./Shadows/shadowGenerator";
     /**
      * Base class of all the lights in Babylon. It groups all the generic information about lights.
      * Lights are used, as you would expect, to affect how meshes are seen, in terms of both illumination and colour.

+ 9 - 7
src/Lights/pointLight.ts

@@ -1,12 +1,14 @@
-import { serialize } from "Tools";
+import { serialize } from "Tools/decorators";
 import { Scene } from "scene";
-import { Matrix, Vector3 } from "Math";
-import { Node } from "Node";
-import { AbstractMesh } from "Mesh";
-import { ShadowLight, Light } from "Lights";
-import { _TimeToken } from "Instrumentation";
+import { Matrix, Vector3 } from "Math/math";
+import { Node } from "node";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Light } from "./light";
+import { ShadowLight } from "./shadowLight";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
-import { Effect } from "Materials";
+import { Effect } from "Materials/effect";
+
     Node.AddNodeConstructor("Light_Type_0", (name, scene) => {
         return () => new PointLight(name, Vector3.Zero(), scene);
     });

+ 6 - 6
src/Lights/shadowLight.ts

@@ -1,10 +1,10 @@
-import { serialize, serializeAsVector3 } from "Tools";
-import { Camera } from "Cameras";
+import { serialize, serializeAsVector3 } from "Tools/decorators";
+import { Camera } from "Cameras/camera";
 import { Scene } from "scene";
-import { Matrix, Vector3, Axis } from "Math";
-import { AbstractMesh } from "Mesh";
-import { IShadowLight, Light } from "Lights";
-import { _TimeToken } from "Instrumentation";
+import { Matrix, Vector3, Axis } from "Math/math";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Light } from "./light";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Interface describing all the common properties and methods a shadow light needs to implement.

+ 10 - 7
src/Lights/spotLight.ts

@@ -1,13 +1,16 @@
-import { serialize, serializeAsTexture } from "Tools";
+import { serialize, serializeAsTexture } from "Tools/decorators";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Matrix, Vector3 } from "Math";
-import { Node } from "Node";
-import { AbstractMesh } from "Mesh";
-import { Effect, BaseTexture } from "Materials";
-import { ShadowLight, Light } from "Lights";
-import { _TimeToken } from "Instrumentation";
+import { Matrix, Vector3 } from "Math/math";
+import { Node } from "node";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Effect } from "Materials/effect";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { Light } from "./light";
+import { ShadowLight } from "./shadowLight";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+
     Node.AddNodeConstructor("Light_Type_2", (name, scene) => {
         return () => new SpotLight(name, Vector3.Zero(), Vector3.Zero(), 0, 0, scene);
     });

+ 9 - 2
src/Materials/Background/backgroundMaterial.ts

@@ -1,13 +1,20 @@
-import { serialize, Observer, Tools, SmartArray, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture, serializeAsVector3, serializeAsImageProcessingConfiguration } from "Tools";
+import { serialize, serializeAsColor3, expandToProperty, serializeAsTexture, serializeAsVector3, serializeAsImageProcessingConfiguration } from "Tools/decorators";
+import { Observer, Tools, SmartArray, SerializationHelper } from "Tools";
 import { Nullable, int, float } from "types";
 import { Scene } from "scene";
 import { Matrix, Vector3, Color3, Vector4 } from "Math";
 import { Engine } from "Engine";
 import { Mesh, AbstractMesh, VertexBuffer, SubMesh } from "Mesh";
-import { StandardMaterial, ImageProcessingConfiguration, RenderTargetTexture, Texture, Effect, BaseTexture, MaterialHelper, IImageProcessingConfigurationDefines, PushMaterial, ColorCurves, EffectFallbacks, EffectCreationOptions, MaterialDefines } from "Materials";
+import { MaterialDefines } from "../material";
+import { PushMaterial } from "../pushMaterial";
+import { StandardMaterial, ImageProcessingConfiguration, RenderTargetTexture, Texture, Effect, BaseTexture, MaterialHelper, IImageProcessingConfigurationDefines, ColorCurves, EffectFallbacks, EffectCreationOptions } from "Materials";
 import { IShadowLight } from "Lights";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+
+import "Shaders/background.fragment";
+import "Shaders/background.vertex";
+
     /**
      * Background material defines definition.
      * @hidden Mainly internal Use

+ 67 - 22
src/Materials/PBR/pbrBaseMaterial.ts

@@ -1,13 +1,36 @@
-import { serialize, Observer, Tools, SmartArray, serializeAsImageProcessingConfiguration, TextureTools, IAnimatable } from "Tools";
+import { serialize, serializeAsImageProcessingConfiguration } from "Tools/decorators";
+import { Observer } from "Tools/observable";
+import { Tools, IAnimatable } from "Tools/tools";
+import { SmartArray } from "Tools/smartArray";
+import { TextureTools } from "Tools/textureTools";
 import { Nullable } from "types";
-import { Camera } from "Cameras";
+import { Camera } from "Cameras/camera";
 import { Scene } from "scene";
-import { Matrix, Color3, Vector4 } from "Math";
-import { Engine } from "Engine";
-import { Mesh, AbstractMesh, VertexBuffer, SubMesh } from "Mesh";
-import { StandardMaterial, ImageProcessingConfiguration, RenderTargetTexture, Material, Texture, Effect, BaseTexture, CubeTexture, MaterialHelper, IImageProcessingConfigurationDefines, PushMaterial, EffectFallbacks, EffectCreationOptions, MaterialDefines, PBRMaterial } from "Materials";
-import { _TimeToken } from "Instrumentation";
+import { Matrix, Color3, Vector4, Tmp } from "Math/math";
+import { Engine } from "Engine/engine";
+import { VertexBuffer } from "Mesh/vertexBuffer";
+import { SubMesh } from "Mesh/subMesh";
+import { AbstractMesh } from "Mesh/abstractMesh";
+import { Mesh } from "Mesh/mesh";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+
+import { ImageProcessingConfiguration, IImageProcessingConfigurationDefines } from "Materials/imageProcessingConfiguration";
+import { Effect, EffectFallbacks, EffectCreationOptions } from "Materials/effect";
+import { Material, MaterialDefines } from "Materials/material";
+import { PushMaterial } from "Materials/pushMaterial";
+import { MaterialHelper } from "Materials/materialHelper";
+
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { Texture } from "Materials/Textures/texture";
+import { RenderTargetTexture } from "Materials/Textures/renderTargetTexture";
+import { CubeTexture } from "Materials/Textures/cubeTexture";
+
+import { StandardMaterial } from "Materials/standardMaterial";
+
+import "Shaders/pbr.fragment";
+import "Shaders/pbr.vertex";
+
     /**
      * Manages the defines for the PBR Material.
      * @hiddenChildren
@@ -181,6 +204,33 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
      */
     export abstract class PBRBaseMaterial extends PushMaterial {
         /**
+         * PBRMaterialTransparencyMode: No transparency mode, Alpha channel is not use.
+         */
+        public static readonly PBRMATERIAL_OPAQUE = 0;
+
+        /**
+         * PBRMaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.
+         */
+        public static readonly PBRMATERIAL_ALPHATEST = 1;
+
+        /**
+         * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
+         */
+        public static readonly PBRMATERIAL_ALPHABLEND = 2;
+
+        /**
+         * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
+         * They are also discarded below the alpha cutoff threshold to improve performances.
+         */
+        public static readonly PBRMATERIAL_ALPHATESTANDBLEND = 3;
+
+        /**
+         * Defines the default value of how much AO map is occluding the analytical lights
+         * (point spot...).
+         */
+        public static DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 1;
+
+        /**
          * PBRMaterialLightFalloff Physical: light is falling off following the inverse squared distance law.
          */
         public static readonly LIGHTFALLOFF_PHYSICAL = 0;
@@ -198,11 +248,6 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
         public static readonly LIGHTFALLOFF_STANDARD = 2;
 
         /**
-         * Stores the reflectivity values based on metallic roughness workflow.
-         */
-        private static _scaledReflectivity = new Color3();
-
-        /**
          * Intensity of the direct lights e.g. the four lights available in your scene.
          * This impacts both the direct diffuse and specular highlights.
          */
@@ -256,7 +301,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * 1 means it completely occludes it
          * 0 mean it has no impact
          */
-        protected _ambientTextureImpactOnAnalyticalLights: number = PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;
+        protected _ambientTextureImpactOnAnalyticalLights: number = PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;
 
         /**
          * Stores the alpha values in a texture.
@@ -687,7 +732,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 
             this._transparencyMode = value;
 
-            this._forceAlphaTest = (value === PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND);
+            this._forceAlphaTest = (value === PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND);
 
             this._markAllSubMeshesAsTexturesAndMiscDirty();
         }
@@ -697,8 +742,8 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          */
         private get _disableAlphaBlending(): boolean {
             return (this._linkRefractionWithTransparency ||
-                this._transparencyMode === PBRMaterial.PBRMATERIAL_OPAQUE ||
-                this._transparencyMode === PBRMaterial.PBRMATERIAL_ALPHATEST);
+                this._transparencyMode === PBRBaseMaterial.PBRMATERIAL_OPAQUE ||
+                this._transparencyMode === PBRBaseMaterial.PBRMATERIAL_ALPHATEST);
         }
 
         /**
@@ -736,14 +781,14 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
                 return false;
             }
 
-            return this._albedoTexture != null && this._albedoTexture.hasAlpha && (this._transparencyMode == null || this._transparencyMode === PBRMaterial.PBRMATERIAL_ALPHATEST);
+            return this._albedoTexture != null && this._albedoTexture.hasAlpha && (this._transparencyMode == null || this._transparencyMode === PBRBaseMaterial.PBRMATERIAL_ALPHATEST);
         }
 
         /**
          * Specifies whether or not the alpha value of the albedo texture should be used for alpha blending.
          */
         protected _shouldUseAlphaFromAlbedoTexture(): boolean {
-            return this._albedoTexture != null && this._albedoTexture.hasAlpha && this._useAlphaFromAlbedoTexture && this._transparencyMode !== PBRMaterial.PBRMATERIAL_OPAQUE;
+            return this._albedoTexture != null && this._albedoTexture.hasAlpha && this._useAlphaFromAlbedoTexture && this._transparencyMode !== PBRBaseMaterial.PBRMATERIAL_OPAQUE;
         }
 
         /**
@@ -1331,7 +1376,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
             MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false, useClipPlane);
 
             // Attribs
-            MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true, true, this._transparencyMode !== PBRMaterial.PBRMATERIAL_OPAQUE);
+            MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true, true, this._transparencyMode !== PBRBaseMaterial.PBRMATERIAL_OPAQUE);
         }
 
         /**
@@ -1574,9 +1619,9 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 
                     // Colors
                     if (defines.METALLICWORKFLOW) {
-                        PBRMaterial._scaledReflectivity.r = (this._metallic === undefined || this._metallic === null) ? 1 : this._metallic;
-                        PBRMaterial._scaledReflectivity.g = (this._roughness === undefined || this._roughness === null) ? 1 : this._roughness;
-                        this._uniformBuffer.updateColor4("vReflectivityColor", PBRMaterial._scaledReflectivity, 0);
+                        Tmp.Color3[0].r = (this._metallic === undefined || this._metallic === null) ? 1 : this._metallic;
+                        Tmp.Color3[0].g = (this._roughness === undefined || this._roughness === null) ? 1 : this._roughness;
+                        this._uniformBuffer.updateColor4("vReflectivityColor", Tmp.Color3[0], 0);
                     }
                     else {
                         this._uniformBuffer.updateColor4("vReflectivityColor", this._reflectivityColor, this._microSurface);

+ 6 - 4
src/Materials/PBR/pbrBaseSimpleMaterial.ts

@@ -1,8 +1,10 @@
-import { serialize, serializeAsColor3, expandToProperty, serializeAsTexture } from "Tools";
+import { serialize, serializeAsColor3, expandToProperty, serializeAsTexture } from "Tools/decorators";
 import { Scene } from "scene";
-import { Color3 } from "Math";
-import { BaseTexture, PBRBaseMaterial } from "Materials";
-import { _TimeToken } from "Instrumentation";
+import { Color3 } from "Math/math";
+import { PBRBaseMaterial } from "./pbrBaseMaterial";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * The Physically based simple base material of BJS.

+ 13 - 9
src/Materials/PBR/pbrMaterial.ts

@@ -1,10 +1,14 @@
-import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, TextureTools, serializeAsTexture } from "Tools";
+import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture } from "Tools/decorators";
+import { TextureTools } from "Tools/textureTools";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import { Color3 } from "Math";
-import { ImageProcessingConfiguration, BaseTexture, ColorCurves, PBRBaseMaterial } from "Materials";
-import { _TimeToken } from "Instrumentation";
+import { Color3 } from "Math/math";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+import { ImageProcessingConfiguration } from "Materials/imageProcessingConfiguration";
+import { ColorCurves } from "Materials/colorCurves";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { PBRBaseMaterial } from "./pbrBaseMaterial";
     /**
      * The Physically based material of BJS.
      *
@@ -16,29 +20,29 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
         /**
          * PBRMaterialTransparencyMode: No transparency mode, Alpha channel is not use.
          */
-        public static readonly PBRMATERIAL_OPAQUE = 0;
+        public static readonly PBRMATERIAL_OPAQUE = PBRBaseMaterial.PBRMATERIAL_OPAQUE;
 
         /**
          * PBRMaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.
          */
-        public static readonly PBRMATERIAL_ALPHATEST = 1;
+        public static readonly PBRMATERIAL_ALPHATEST = PBRBaseMaterial.PBRMATERIAL_ALPHATEST;
 
         /**
          * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
          */
-        public static readonly PBRMATERIAL_ALPHABLEND = 2;
+        public static readonly PBRMATERIAL_ALPHABLEND = PBRBaseMaterial.PBRMATERIAL_ALPHABLEND;
 
         /**
          * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
          * They are also discarded below the alpha cutoff threshold to improve performances.
          */
-        public static readonly PBRMATERIAL_ALPHATESTANDBLEND = 3;
+        public static readonly PBRMATERIAL_ALPHATESTANDBLEND = PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND;
 
         /**
          * Defines the default value of how much AO map is occluding the analytical lights
          * (point spot...).
          */
-        public static DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 1;
+        public static DEFAULT_AO_ON_ANALYTICAL_LIGHTS = PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;
 
         /**
          * Intensity of the direct lights e.g. the four lights available in your scene.

+ 5 - 4
src/Materials/PBR/pbrMetallicRoughnessMaterial.ts

@@ -1,9 +1,10 @@
-import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture } from "Tools";
+import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture } from "Tools/decorators";
 import { Scene } from "scene";
-import { Color3 } from "Math";
-import { BaseTexture, PBRBaseSimpleMaterial } from "Materials";
-import { _TimeToken } from "Instrumentation";
+import { Color3 } from "Math/math";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { PBRBaseSimpleMaterial } from "./pbrBaseSimpleMaterial";
     /**
      * The PBR material of BJS following the metal roughness convention.
      *

+ 5 - 4
src/Materials/PBR/pbrSpecularGlossinessMaterial.ts

@@ -1,9 +1,10 @@
-import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture } from "Tools";
+import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture } from "Tools/decorators";
 import { Scene } from "scene";
-import { Color3 } from "Math";
-import { BaseTexture, PBRBaseSimpleMaterial } from "Materials";
-import { _TimeToken } from "Instrumentation";
+import { Color3 } from "Math/math";
+import { _TimeToken } from "Instrumentation/timeToken";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+import { BaseTexture } from "Materials/Textures/baseTexture";
+import { PBRBaseSimpleMaterial } from "./pbrBaseSimpleMaterial";
     /**
      * The PBR material of BJS following the specular glossiness convention.
      *

+ 0 - 0
src/Materials/Textures/Loaders/ddsTextureLoader.ts


部分文件因为文件数量过多而无法显示