Browse Source

BreathPointLight

zhouenguang 3 years ago
parent
commit
cb05d96238
2 changed files with 13 additions and 10 deletions
  1. 9 10
      src/BreathPoint.js
  2. 4 0
      src/XLightManager.js

+ 9 - 10
src/BreathPoint.js

@@ -21,16 +21,15 @@ export default class BreathPoint {
         this._isInScene = !0;
 
         if(location.href.indexOf("debug") > -1) {
-            var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
-            light.intensity = 0.7;
-            var ground = BABYLON.MeshBuilder.CreatePlane("ground1", {width: 0.4, height: 0.2, subdivisions: 25}, this._scene);
-            ground.position = xStaticMesh.mesh.position
-            ground.rotation = new BABYLON.Vector3(Math.PI / 2, 0, 0)
-            var materialGround = new BABYLON.StandardMaterial("Mat", this._scene);
-            ground.material = materialGround;
-            var textureGround = new BABYLON.DynamicTexture("dynamic texture", {width:350, height:300}, this._scene);  
-            textureGround.drawText(id, 0, 200, "bold 200px monospace", "red", "white", true, true); 
-            materialGround.diffuseTexture = textureGround;
+            var textureBPNum = new BABYLON.DynamicTexture("dynamic texture", {width:350, height:300}, this._scene);  
+            textureBPNum.drawText(id, 0, 200, "bold 200px monospace", "red", "white", true, true); 
+            var materialBPNum = new BABYLON.StandardMaterial("MatBPNum", this._scene);
+            materialBPNum.diffuseTexture = textureBPNum;
+
+            var bpNumMesh = BABYLON.MeshBuilder.CreatePlane("BreathPointNum" + id, {width: 0.4, height: 0.2, subdivisions: 25}, this._scene);
+            bpNumMesh.position = xStaticMesh.mesh.position
+            bpNumMesh.rotation = new BABYLON.Vector3(Math.PI / 2, 0, 0)
+            bpNumMesh.material = materialBPNum;
         }
         
     }

+ 4 - 0
src/XLightManager.js

@@ -24,6 +24,10 @@ export default class XLightManager {
         this._shadowGenerator = new BABYLON.ShadowGenerator(r,this._shadowLight,!0),
         this._avatarShadowMeshMap = new Map,
         this._cullingShadowObservers = new Map
+
+        if(location.href.indexOf("debug") > -1) {
+            this.bpNumlight = new BABYLON.HemisphericLight("BreathPointNumLight", new BABYLON.Vector3(0, 1, 0), this._scene);
+        }
     }
     set shadowLean(e) {
         e = Math.min(e, 1),