Jelajahi Sumber

Update push materials for useRightHandedSystem

Gary Hsu 8 tahun lalu
induk
melakukan
d8270322d4

+ 1 - 0
materialsLibrary/src/cell/babylon.cellMaterial.ts

@@ -18,6 +18,7 @@ module BABYLON {
         public NDOTL = true;
         public CUSTOMUSERLIGHTING = true;
         public CELLBASIC = true;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 1 - 0
materialsLibrary/src/fur/babylon.furMaterial.ts

@@ -17,6 +17,7 @@ module BABYLON {
         public BonesPerMesh = 0;
         public INSTANCES = false;
         public HIGHLEVEL = false;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 1 - 0
materialsLibrary/src/gradient/babylon.gradientMaterial.ts

@@ -48,6 +48,7 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 2 - 0
materialsLibrary/src/grid/babylon.gridmaterial.ts

@@ -6,6 +6,8 @@ module BABYLON {
 
         public FOG = false;
 
+        public USERIGHTHANDEDSYSTEM = false;
+
         constructor() {
             super();
             this.rebuild();

+ 1 - 0
materialsLibrary/src/lava/babylon.lavaMaterial.ts

@@ -48,6 +48,7 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 1 - 0
materialsLibrary/src/normal/babylon.normalMaterial.ts

@@ -48,6 +48,7 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 1 - 0
materialsLibrary/src/shadowOnly/babylon.shadowOnlyMaterial.ts

@@ -9,6 +9,7 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 1 - 0
materialsLibrary/src/simple/babylon.simpleMaterial.ts

@@ -15,6 +15,7 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 1 - 0
materialsLibrary/src/sky/babylon.skyMaterial.ts

@@ -7,6 +7,7 @@ module BABYLON {
         public FOG = false;
         public VERTEXCOLOR = false;
         public VERTEXALPHA = false;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 1 - 0
materialsLibrary/src/terrain/babylon.terrainMaterial.ts

@@ -18,6 +18,7 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 1 - 0
materialsLibrary/src/triPlanar/babylon.triPlanarMaterial.ts

@@ -21,6 +21,7 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 1 - 1
materialsLibrary/src/water/babylon.waterMaterial.ts

@@ -21,7 +21,7 @@ module BABYLON {
         public FRESNELSEPARATE = false;
         public BUMPSUPERIMPOSE = false;
         public BUMPAFFECTSREFLECTION = false;
-
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 1 - 0
src/Materials/babylon.materialHelper.ts

@@ -6,6 +6,7 @@
                 defines["LOGARITHMICDEPTH"] = useLogarithmicDepth;
                 defines["POINTSIZE"] = (pointsCloud || scene.forcePointsCloud);
                 defines["FOG"] = (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE && fogEnabled);
+                defines["USERIGHTHANDEDSYSTEM"] = scene.useRightHandedSystem;
             }
         }
 

+ 1 - 0
src/Materials/babylon.standardMaterial.ts

@@ -63,6 +63,7 @@ module BABYLON {
         public MORPHTARGETS_NORMAL = false;
         public MORPHTARGETS_TANGENT = false;
         public NUM_MORPH_INFLUENCERS = 0;
+        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 17 - 1
src/babylon.scene.ts

@@ -206,7 +206,6 @@
         public clipPlane: Plane;
         public animationsEnabled = true;
         public constantlyUpdateMeshUnderPointer = false;
-        public useRightHandedSystem = false;
 
         public hoverCursor = "pointer";
 
@@ -414,6 +413,23 @@
         private _onKeyDown: (evt: Event) => void;
         private _onKeyUp: (evt: Event) => void;
 
+        // Coordinate system
+        /**
+        * use right-handed coordinate system on this scene.
+        * @type {boolean}
+        */
+        private _useRightHandedSystem = false;
+        public set useRightHandedSystem(value: boolean) {
+            if (this._useRightHandedSystem === value) {
+                return;
+            }
+            this._useRightHandedSystem = value;
+            this.markAllMaterialsAsDirty(Material.MiscDirtyFlag);
+        }
+        public get useRightHandedSystem(): boolean {
+            return this._useRightHandedSystem;
+        }
+
         // Fog
         /**
         * is fog enabled on this scene.