|
@@ -54,12 +54,12 @@ export default class XBreathPointManager {
|
|
// if(pointsArr1.indexOf(parseInt(id)) > -1) type = "p1"
|
|
// if(pointsArr1.indexOf(parseInt(id)) > -1) type = "p1"
|
|
// if(pointsArr2.indexOf(parseInt(id)) > -1) type = "p2"
|
|
// if(pointsArr2.indexOf(parseInt(id)) > -1) type = "p2"
|
|
// if(pointsArr3.indexOf(parseInt(id)) > -1) type = "p3"
|
|
// if(pointsArr3.indexOf(parseInt(id)) > -1) type = "p3"
|
|
- if(pointsArr3.indexOf(parseInt(id)) > -1) {
|
|
|
|
- type = "p3"
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- type = "p1"
|
|
|
|
- }
|
|
|
|
|
|
+ // if(pointsArr3.indexOf(parseInt(id)) > -1) {
|
|
|
|
+ // type = "p3"
|
|
|
|
+ // }
|
|
|
|
+ // else{
|
|
|
|
+ // type = "p1"
|
|
|
|
+ // }
|
|
|
|
|
|
let mat;
|
|
let mat;
|
|
if (this.materialMap.get(type)) {
|
|
if (this.materialMap.get(type)) {
|
|
@@ -74,17 +74,16 @@ export default class XBreathPointManager {
|
|
texture.name = "TexBreathPoint_" + id,
|
|
texture.name = "TexBreathPoint_" + id,
|
|
|
|
|
|
mat = new BABYLON.StandardMaterial(`MaterialBreathPoint_${id}`,this._scene)
|
|
mat = new BABYLON.StandardMaterial(`MaterialBreathPoint_${id}`,this._scene)
|
|
- // todo 暂改
|
|
|
|
- // mat.alpha = 1,
|
|
|
|
- // mat.emissiveTexture = texture,
|
|
|
|
- // mat.backFaceCulling = backfaceculling,
|
|
|
|
- // mat.diffuseTexture = texture,
|
|
|
|
- // mat.diffuseTexture.hasAlpha = !0,
|
|
|
|
- // mat.useAlphaFromDiffuseTexture = !0,
|
|
|
|
- if(type == "p1") mat.emissiveColor.set(1,1,1)
|
|
|
|
- else if(type == "p2") mat.emissiveColor.set(1,1,0.5)
|
|
|
|
- else if(type == "p3") mat.emissiveColor.set(1,0.5,0)
|
|
|
|
- else mat.emissiveColor.set(1,0,0)
|
|
|
|
|
|
+ mat.alpha = 1,
|
|
|
|
+ mat.emissiveTexture = texture,
|
|
|
|
+ mat.backFaceCulling = backfaceculling,
|
|
|
|
+ mat.diffuseTexture = texture,
|
|
|
|
+ mat.diffuseTexture.hasAlpha = !0,
|
|
|
|
+ mat.useAlphaFromDiffuseTexture = !0,
|
|
|
|
+ // if(type == "p1") mat.emissiveColor.set(1,1,1)
|
|
|
|
+ // else if(type == "p2") mat.emissiveColor.set(1,1,0.5)
|
|
|
|
+ // else if(type == "p3") mat.emissiveColor.set(1,0.5,0)
|
|
|
|
+ // else mat.emissiveColor.set(1,0,0)
|
|
|
|
|
|
this.materialMap.set(type, {
|
|
this.materialMap.set(type, {
|
|
mat,
|
|
mat,
|
|
@@ -110,7 +109,7 @@ export default class XBreathPointManager {
|
|
depth: .01,
|
|
depth: .01,
|
|
faceUV
|
|
faceUV
|
|
} : options = {
|
|
} : options = {
|
|
- size: size/2, // todo 暂改size
|
|
|
|
|
|
+ size: size,
|
|
depth: .01,
|
|
depth: .01,
|
|
faceUV
|
|
faceUV
|
|
};
|
|
};
|
|
@@ -173,22 +172,6 @@ export default class XBreathPointManager {
|
|
}
|
|
}
|
|
bpNumMesh.position = mesh.position
|
|
bpNumMesh.position = mesh.position
|
|
bpNumMesh.material = materialBPNum;
|
|
bpNumMesh.material = materialBPNum;
|
|
-
|
|
|
|
- // let standardVec = BABYLON.Vector3.Project(
|
|
|
|
- // mesh.position,
|
|
|
|
- // BABYLON.Matrix.Identity(),
|
|
|
|
- // this._scene.getViewMatrix(),
|
|
|
|
- // this._scene.getProjectionMatrix()
|
|
|
|
- // )
|
|
|
|
- // console.error(standardVec)
|
|
|
|
- // let screenX = Math.round(window.innerWidth / 2 * standardVec.x + window.innerWidth / 2)
|
|
|
|
- // let screenY = Math.round(window.innerHeight / 2 * standardVec.y + window.innerHeight / 2)
|
|
|
|
- // let idContant = document.createElement("div")
|
|
|
|
- // idContant.innerHTML = id
|
|
|
|
- // idContant.style.position = "absolute"
|
|
|
|
- // idContant.style.top = screenY + "px"
|
|
|
|
- // idContant.style.left = screenX + "px"
|
|
|
|
- // document.querySelector("#root").appendChild(idContant)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
});
|
|
});
|
|
@@ -223,8 +206,7 @@ export default class XBreathPointManager {
|
|
);
|
|
);
|
|
this._sceneManager = e,
|
|
this._sceneManager = e,
|
|
this._scene = e.Scene,
|
|
this._scene = e.Scene,
|
|
- // todo 暂改
|
|
|
|
- // this._scene.registerBeforeRender(this.reg_breathpoint_update),
|
|
|
|
|
|
+ this._scene.registerBeforeRender(this.reg_breathpoint_update),
|
|
this._scene.registerBeforeRender(this.reg_breathpoint_autovisible)
|
|
this._scene.registerBeforeRender(this.reg_breathpoint_autovisible)
|
|
}
|
|
}
|
|
setAllBreathPointVisibility(e) {
|
|
setAllBreathPointVisibility(e) {
|