|
|
@ -65,11 +65,7 @@ export default class SceneHelp { |
|
|
this.scene.add(gridHelper2) |
|
|
this.scene.add(gridHelper2) |
|
|
|
|
|
|
|
|
// 光照
|
|
|
// 光照
|
|
|
// const ambientLight = new THREE.AmbientLight(0xffffff, 0.8)
|
|
|
const ambientLight = new THREE.AmbientLight(0xffffff, 2.5) |
|
|
// this.scene.add(ambientLight)
|
|
|
|
|
|
|
|
|
|
|
|
// 光照
|
|
|
|
|
|
const ambientLight = new THREE.AmbientLight(0xffffff, 1.5) |
|
|
|
|
|
this.scene.add(ambientLight) |
|
|
this.scene.add(ambientLight) |
|
|
|
|
|
|
|
|
const directionalLight = new THREE.DirectionalLight(0xffffff, 1.5) |
|
|
const directionalLight = new THREE.DirectionalLight(0xffffff, 1.5) |
|
|
@ -82,36 +78,19 @@ export default class SceneHelp { |
|
|
|
|
|
|
|
|
// 完全不透明的地板
|
|
|
// 完全不透明的地板
|
|
|
const geometry = new THREE.PlaneGeometry(gridOption.gridSize, gridOption.gridSize) |
|
|
const geometry = new THREE.PlaneGeometry(gridOption.gridSize, gridOption.gridSize) |
|
|
const material = new THREE.MeshBasicMaterial({ |
|
|
const material = new THREE.MeshToonMaterial({ |
|
|
color: '#ffffff', |
|
|
color: '#ffffff', |
|
|
side: THREE.BackSide |
|
|
side: THREE.BackSide |
|
|
}) |
|
|
}) |
|
|
|
|
|
material.color.convertSRGBToLinear(); |
|
|
const ground = new THREE.Mesh(geometry, material) |
|
|
const ground = new THREE.Mesh(geometry, material) |
|
|
ground.rotation.x = Math.PI / 2 |
|
|
ground.rotation.x = Math.PI / 2 |
|
|
ground.position.y = -0.01 |
|
|
ground.position.y = -0.01 |
|
|
this.scene.add(ground) |
|
|
this.scene.add(ground) |
|
|
|
|
|
|
|
|
// const directionalLight = new THREE.DirectionalLight(0xffffff, 1.5)
|
|
|
|
|
|
// directionalLight.position.set(5, 5, 5).multiplyScalar(3)
|
|
|
|
|
|
// directionalLight.castShadow = true
|
|
|
|
|
|
// this.scene.add(directionalLight)
|
|
|
|
|
|
//
|
|
|
|
|
|
// const hemisphereLight = new THREE.HemisphereLight(0xffffff, 0x444444, 1)
|
|
|
|
|
|
// this.scene.add(hemisphereLight)
|
|
|
|
|
|
window['scene'] = this.scene |
|
|
window['scene'] = this.scene |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
|
// * 加载指定楼层的实体并添加到场景
|
|
|
|
|
|
// * @param floorId 楼层 ID
|
|
|
|
|
|
// */
|
|
|
|
|
|
// async loadFloorEntities(floorId: string): Promise<void> {
|
|
|
|
|
|
// const items = await this.worldModel.loadFloor(floorId)
|
|
|
|
|
|
// items.forEach((item) => {
|
|
|
|
|
|
// this.entityManager.createOrUpdateEntity(item)
|
|
|
|
|
|
// })
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
remove(...objects: THREE.Object3D[]) { |
|
|
remove(...objects: THREE.Object3D[]) { |
|
|
_.forEach(objects, (object) => { |
|
|
_.forEach(objects, (object) => { |
|
|
if (object?.parent) { |
|
|
if (object?.parent) { |
|
|
|