|
@@ -31,6 +31,9 @@ export default class App {
|
|
|
skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
|
|
|
skybox.material = skyboxMaterial;
|
|
|
|
|
|
+ this.hasVideoTexture = false
|
|
|
+ this.hasVideoTexture = true
|
|
|
+
|
|
|
this.init()
|
|
|
this.bindEvents()
|
|
|
setTimeout(() => this.bindSocketEvents(), 1000)
|
|
@@ -45,10 +48,10 @@ export default class App {
|
|
|
BABYLON.SceneLoader.ImportMesh("", "../scenes/house/", "close_to_bottom_L.glb", this.scene, async function (newMeshes, particleSystems, skeletons, animationGroups) {
|
|
|
|
|
|
self.house = newMeshes
|
|
|
- // self.house[0].position = new BABYLON.Vector3(0.6, 2.1, 1.5)
|
|
|
+ // self.house[0].position = new BABYLON.Vector3(0, 0, -0.5)
|
|
|
// self.house[0].position = new BABYLON.Vector3(-22, 0, 12)
|
|
|
|
|
|
- let houseVideo = document.getElementById("houseTexture0")
|
|
|
+ let houseVideo = document.getElementById("houseTexture")
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
@@ -103,7 +106,7 @@ export default class App {
|
|
|
))
|
|
|
shaderMaterial.setFloat("isYUV", 0)
|
|
|
|
|
|
- m.material = shaderMaterial
|
|
|
+ if(self.hasVideoTexture) m.material = shaderMaterial
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -205,13 +208,11 @@ export default class App {
|
|
|
let charactor = this.charactorManager.charactor
|
|
|
let video = common.createVideoElement0(url) //await common.createVideoElement(url)
|
|
|
|
|
|
- console.error(charactor.walkData.currentPoint+1)
|
|
|
charactor.walkData.pathArr[charactor.walkData.currentPoint+1].video = video
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
// 获得旋转视频
|
|
|
-
|
|
|
let video = this.isReverse ? document.getElementById("houseTextureReverse")
|
|
|
: document.getElementById("houseTexture")
|
|
|
|
|
@@ -221,7 +222,7 @@ export default class App {
|
|
|
|
|
|
// 页面刷新后初次加载视频
|
|
|
if(this.initVideo) {
|
|
|
- this.updateHouseVideo(video, true)
|
|
|
+ // this.updateHouseVideo(video, true)
|
|
|
this.initVideo = false
|
|
|
this.cameraController.camera.minZ = 0.001
|
|
|
}
|
|
@@ -277,7 +278,7 @@ export default class App {
|
|
|
updateHouseVideo(video, notPlay) {
|
|
|
let videoTexture = new BABYLON.VideoTexture("", video, this.scene)
|
|
|
this.house.forEach(mesh => {
|
|
|
- mesh.material && mesh.material.setTexture("texture_video", videoTexture)
|
|
|
+ // mesh.material && mesh.material.setTexture("texture_video", videoTexture)
|
|
|
})
|
|
|
!notPlay && video.play()
|
|
|
}
|
|
@@ -286,7 +287,7 @@ export default class App {
|
|
|
let video = await common.createVideoElement(blobUrl)
|
|
|
// video.loop = "loop"
|
|
|
let videoTexture = new BABYLON.VideoTexture("", video, this.scene)
|
|
|
- this.house.forEach(mesh => {
|
|
|
+ this.hasVideoTexture && this.house.forEach(mesh => {
|
|
|
mesh.material && mesh.material.setTexture("texture_video", videoTexture)
|
|
|
})
|
|
|
!notPlay && video.play()
|