mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-20 19:55:28 +02:00
wip
This commit is contained in:
@@ -88,12 +88,12 @@ export const ductRailSpotLights = defineObject({
|
|||||||
|
|
||||||
const applyLightBrightness = () => {
|
const applyLightBrightness = () => {
|
||||||
for (const light of lights) {
|
for (const light of lights) {
|
||||||
light.intensity = 2 * options.lightBrightness * WORLD_SCALE * WORLD_SCALE;
|
light.intensity = 3 * options.lightBrightness * WORLD_SCALE * WORLD_SCALE;
|
||||||
light.range = cm(300) * getLightRangeFactorByGraphicsQuality(graphicsQuality);
|
light.range = cm(300) * getLightRangeFactorByGraphicsQuality(graphicsQuality);
|
||||||
}
|
}
|
||||||
for (const lamp of lamps) {
|
for (const lamp of lamps) {
|
||||||
const emissive = lamp.material as BABYLON.PBRMaterial;
|
const emissive = lamp.material as BABYLON.PBRMaterial;
|
||||||
emissive.emissiveIntensity = options.lightBrightness * 20;
|
emissive.emissiveIntensity = options.lightBrightness * 100;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,16 @@ export const hangingDuctRail = defineObject({
|
|||||||
hasCollisions: false,
|
hasCollisions: false,
|
||||||
createInstance: async ({ options, model }) => {
|
createInstance: async ({ options, model }) => {
|
||||||
const bodyMaterial = model.findMaterial('__X_BODY__');
|
const bodyMaterial = model.findMaterial('__X_BODY__');
|
||||||
const bodyMesh = model.findMesh('__X_BODY__');
|
|
||||||
|
|
||||||
const applySize = () => {
|
const applySize = () => {
|
||||||
bodyMesh.morphTargetManager!.getTargetByName('W')!.influence = options.width;
|
for (const mesh of model.root.getChildMeshes()) {
|
||||||
bodyMesh.morphTargetManager!.getTargetByName('H')!.influence = options.height;
|
if (mesh.morphTargetManager != null && mesh.morphTargetManager.getTargetByName('W') != null) {
|
||||||
|
mesh.morphTargetManager.getTargetByName('W').influence = options.width;
|
||||||
|
}
|
||||||
|
if (mesh.morphTargetManager != null && mesh.morphTargetManager.getTargetByName('H') != null) {
|
||||||
|
mesh.morphTargetManager.getTargetByName('H').influence = options.height;
|
||||||
|
}
|
||||||
|
}
|
||||||
model.updated();
|
model.updated();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -79,10 +79,10 @@ export const spotLight = defineObject({
|
|||||||
applyLightColor();
|
applyLightColor();
|
||||||
|
|
||||||
const applyLightBrightness = () => {
|
const applyLightBrightness = () => {
|
||||||
light.intensity = 2 * options.lightBrightness * WORLD_SCALE * WORLD_SCALE;
|
light.intensity = 3 * options.lightBrightness * WORLD_SCALE * WORLD_SCALE;
|
||||||
light.range = cm(300) * getLightRangeFactorByGraphicsQuality(graphicsQuality);
|
light.range = cm(300) * getLightRangeFactorByGraphicsQuality(graphicsQuality);
|
||||||
const emissive = lamp.material as BABYLON.PBRMaterial;
|
const emissive = lamp.material as BABYLON.PBRMaterial;
|
||||||
emissive.emissiveIntensity = options.lightBrightness * 20;
|
emissive.emissiveIntensity = options.lightBrightness * 100;
|
||||||
};
|
};
|
||||||
|
|
||||||
applyLightBrightness();
|
applyLightBrightness();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export function getLightRangeFactorByGraphicsQuality(quality: number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SYSTEM_MESH_NAMES = ['__TOP__', '__SIDE__', '__PICK__', '__COLLISION__'];
|
export const SYSTEM_MESH_NAMES = ['__TOP__', '__SIDE__', '__BOTTOM__', '__PICK__', '__COLLISION__'];
|
||||||
export const SYSTEM_HEYA_MESH_NAMES = ['__ROOM_WALL__', '__ROOM_SIDE__', '__ROOM_FLOOR__', '__ROOM_CEILING__', '__ROOM_TOP__', '__ROOM_BOTTOM__', '__COLLISION__'];
|
export const SYSTEM_HEYA_MESH_NAMES = ['__ROOM_WALL__', '__ROOM_SIDE__', '__ROOM_FLOOR__', '__ROOM_CEILING__', '__ROOM_TOP__', '__ROOM_BOTTOM__', '__COLLISION__'];
|
||||||
|
|
||||||
export function yuge(scene: BABYLON.Scene, mesh: BABYLON.Mesh, offset: BABYLON.Vector3) {
|
export function yuge(scene: BABYLON.Scene, mesh: BABYLON.Mesh, offset: BABYLON.Vector3) {
|
||||||
|
|||||||
Reference in New Issue
Block a user