mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 18:45:35 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -100,7 +100,7 @@ export class WorldEngine extends EventEmitter<WorldEngineEvents> {
|
||||
|
||||
this.scene.collisionsEnabled = true;
|
||||
|
||||
this.camera = new BABYLON.UniversalCamera('camera', new BABYLON.Vector3(cm(0), cm(200), cm(3000)), this.scene);
|
||||
this.camera = new BABYLON.UniversalCamera('camera', new BABYLON.Vector3(cm(0), cm(250), cm(3000)), this.scene);
|
||||
this.camera.inputs.removeByType('FreeCameraKeyboardMoveInput');
|
||||
this.camera.inputs.add(new HorizontalCameraKeyboardMoveInput(this.camera, 0.3));
|
||||
this.camera.attachControl(this.canvas);
|
||||
@@ -230,7 +230,10 @@ export class WorldEngine extends EventEmitter<WorldEngineEvents> {
|
||||
envObj.meshes[0].bakeCurrentTransformIntoVertices();
|
||||
for (const mesh of envObj.meshes) {
|
||||
if (mesh.name === '__root__') continue;
|
||||
mesh.checkCollisions = true;
|
||||
if (mesh.name.includes('__COLLISION__')) {
|
||||
mesh.checkCollisions = true;
|
||||
mesh.isVisible = false;
|
||||
}
|
||||
if (this.reflectionProbe != null) {
|
||||
if (mesh.material) (mesh.material as BABYLON.PBRMaterial).reflectionTexture = this.reflectionProbe.cubeTexture;
|
||||
if (mesh.material) (mesh.material as BABYLON.PBRMaterial).realTimeFiltering = true;
|
||||
|
||||
@@ -299,13 +299,14 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
||||
|
||||
const ambientLight = new BABYLON.HemisphericLight('ambientLight', new BABYLON.Vector3(0, 1, -0.5), this.scene);
|
||||
ambientLight.diffuse = new BABYLON.Color3(1.0, 1.0, 1.0);
|
||||
ambientLight.intensity = 0.5;
|
||||
ambientLight.intensity = 0.3;
|
||||
//ambientLight.intensity = 0;
|
||||
|
||||
this.roomLight = new BABYLON.SpotLight('roomLight', new BABYLON.Vector3(0, cm(249), 0), new BABYLON.Vector3(0, -1, 0), 16, 8, this.scene);
|
||||
this.roomLight.diffuse = new BABYLON.Color3(1.0, 0.9, 0.8);
|
||||
this.roomLight.shadowMinZ = cm(10);
|
||||
this.roomLight.shadowMaxZ = cm(300);
|
||||
this.roomLight.radius = cm(30);
|
||||
|
||||
this.shadowGeneratorForRoomLight = new BABYLON.ShadowGenerator(2048, this.roomLight);
|
||||
this.shadowGeneratorForRoomLight.forceBackFacesOnly = true;
|
||||
|
||||
@@ -56,6 +56,7 @@ export const allInOnePc = defineObject({
|
||||
light.parent = model.root;
|
||||
light.diffuse = new BABYLON.Color3(1.0, 1.0, 1.0);
|
||||
light.range = cm(100);
|
||||
light.radius = cm(20);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light);
|
||||
|
||||
const screenMesh = model.findMesh('__X_SCREEN__');
|
||||
|
||||
@@ -68,6 +68,7 @@ export const laptopPc = defineObject({
|
||||
light.parent = hutaNode;
|
||||
light.diffuse = new BABYLON.Color3(1.0, 1.0, 1.0);
|
||||
light.range = cm(100);
|
||||
light.radius = cm(15);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light);
|
||||
|
||||
const bodyMaterial = model.findMaterial('__X_BODY__');
|
||||
|
||||
@@ -42,6 +42,7 @@ export const tv = defineObject({
|
||||
light.parent = model.root;
|
||||
light.diffuse = new BABYLON.Color3(1.0, 1.0, 1.0);
|
||||
light.range = cm(150);
|
||||
light.radius = cm(40);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light);
|
||||
|
||||
const screenMesh = model.findMesh('__TV_SCREEN__');
|
||||
|
||||
@@ -65,6 +65,7 @@ export const woodRingFloorLamp = defineObject({
|
||||
for (const lamp of lamps) {
|
||||
const light = new BABYLON.SpotLight('', new BABYLON.Vector3(cm(0), cm(0), 0), new BABYLON.Vector3(0, -1, 0), Math.PI / 1, 2, scene, room?.lightContainer != null);
|
||||
light.parent = lamp;
|
||||
light.radius = cm(5);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light);
|
||||
lights.push(light);
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ export const woodRingsPendantLight = defineObject({
|
||||
const lamp = model.findMesh('__X_LAMP__');
|
||||
const light = new BABYLON.PointLight('', new BABYLON.Vector3(0, 0, 0), scene, room?.lightContainer != null);
|
||||
light.parent = lamp;
|
||||
light.radius = cm(5);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light);
|
||||
|
||||
const applyLightColor = () => {
|
||||
|
||||
Reference in New Issue
Block a user