diff --git a/src/core/engine/SceneHelp.ts b/src/core/engine/SceneHelp.ts index 9986816..6d67715 100644 --- a/src/core/engine/SceneHelp.ts +++ b/src/core/engine/SceneHelp.ts @@ -65,11 +65,7 @@ export default class SceneHelp { this.scene.add(gridHelper2) // 光照 - // const ambientLight = new THREE.AmbientLight(0xffffff, 0.8) - // this.scene.add(ambientLight) - - // 光照 - const ambientLight = new THREE.AmbientLight(0xffffff, 1.5) + const ambientLight = new THREE.AmbientLight(0xffffff, 2.5) this.scene.add(ambientLight) 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 material = new THREE.MeshBasicMaterial({ + const material = new THREE.MeshToonMaterial({ color: '#ffffff', side: THREE.BackSide }) + material.color.convertSRGBToLinear(); const ground = new THREE.Mesh(geometry, material) ground.rotation.x = Math.PI / 2 ground.position.y = -0.01 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 } - // /** - // * 加载指定楼层的实体并添加到场景 - // * @param floorId 楼层 ID - // */ - // async loadFloorEntities(floorId: string): Promise { - // const items = await this.worldModel.loadFloor(floorId) - // items.forEach((item) => { - // this.entityManager.createOrUpdateEntity(item) - // }) - // } - remove(...objects: THREE.Object3D[]) { _.forEach(objects, (object) => { if (object?.parent) { diff --git a/src/types/Types.d.ts b/src/types/Types.d.ts index 66bd45b..8a48ca3 100644 --- a/src/types/Types.d.ts +++ b/src/types/Types.d.ts @@ -95,6 +95,11 @@ interface IGridHelper { axesWidth: number; /** + * 启用地板 + */ + groundColor: number; + + /** * 启用网格 */ gridEnabled: boolean;