diff --git a/src/modules/entity/components/components/lightComponent.ts b/src/modules/entity/components/components/LightComponent.ts similarity index 100% rename from src/modules/entity/components/components/lightComponent.ts rename to src/modules/entity/components/components/LightComponent.ts diff --git a/src/modules/entity/components/components/materialComponent.ts b/src/modules/entity/components/components/MaterialComponent.ts similarity index 100% rename from src/modules/entity/components/components/materialComponent.ts rename to src/modules/entity/components/components/MaterialComponent.ts diff --git a/src/modules/entity/components/components/shapeComponent.ts b/src/modules/entity/components/components/ShapeComponent.ts similarity index 100% rename from src/modules/entity/components/components/shapeComponent.ts rename to src/modules/entity/components/components/ShapeComponent.ts diff --git a/src/modules/entity/components/components/index.ts b/src/modules/entity/components/components/index.ts index bb1d7ddf..9a1e7bac 100644 --- a/src/modules/entity/components/components/index.ts +++ b/src/modules/entity/components/components/index.ts @@ -9,11 +9,11 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -export { KeyLightComponent } from "./KeyLightComponent.js"; -export { HazeComponent } from "./HazeComponent.js"; -export { SkyboxComponent } from "./SkyboxComponent.js"; -export { ModelComponent } from "./ModelComponent.js"; -export { ImageComponent } from "./ImageComponent.js"; -export { MaterialComponent } from "./MaterialComponent.js"; -export { ShapeComponent } from "./ShapeComponent.js"; -export { LightEntityComponent } from "./LightComponent.js"; +export { KeyLightComponent } from "./KeyLightComponent"; +export { HazeComponent } from "./HazeComponent"; +export { SkyboxComponent } from "./SkyboxComponent"; +export { ModelComponent } from "./ModelComponent"; +export { ImageComponent } from "./ImageComponent"; +export { MaterialComponent } from "./MaterialComponent"; +export { ShapeComponent } from "./ShapeComponent"; +export { LightEntityComponent } from "./LightComponent"; diff --git a/src/modules/scene/LODManager.ts b/src/modules/scene/LODManager.ts index ae2659d8..363a55a7 100644 --- a/src/modules/scene/LODManager.ts +++ b/src/modules/scene/LODManager.ts @@ -124,15 +124,34 @@ export class LODManager { } private static getMetadataFromMesh(mesh: AbstractMesh | Mesh | InstancedMesh) { - const metadata: Nullable = mesh.metadata?.gltf?.extras; + const meshExtras = mesh.metadata?.gltf?.extras; + const parentExtras = mesh.parent?.metadata?.gltf?.extras; + const meshMetadata: MeshMetadata = { - vircadia_lod_mode: metadata?.vircadia_lod_mode, - vircadia_lod_auto: metadata?.vircadia_lod_auto, - vircadia_lod_distance: metadata?.vircadia_lod_distance, - vircadia_lod_size: metadata?.vircadia_lod_size, - vircadia_lod_hide: metadata?.vircadia_lod_hide, - vircadia_billboard_mode: metadata?.vircadia_billboard_mode, + vircadia_lod_mode: undefined, + vircadia_lod_auto: undefined, + vircadia_lod_distance: undefined, + vircadia_lod_size: undefined, + vircadia_lod_hide: undefined, + vircadia_billboard_mode: undefined }; + + if (meshExtras === null || meshExtras === undefined && parentExtras !== null || parentExtras !== undefined) { + meshMetadata.vircadia_lod_mode = parentExtras?.vircadia_lod_mode; + meshMetadata.vircadia_lod_auto = parentExtras?.vircadia_lod_auto; + meshMetadata.vircadia_lod_distance = parentExtras?.vircadia_lod_distance; + meshMetadata.vircadia_lod_size = parentExtras?.vircadia_lod_size; + meshMetadata.vircadia_lod_hide = parentExtras?.vircadia_lod_hide; + meshMetadata.vircadia_billboard_mode = parentExtras?.vircadia_billboard_mode; + } else { + meshMetadata.vircadia_lod_mode = meshExtras?.vircadia_lod_mode; + meshMetadata.vircadia_lod_auto = meshExtras?.vircadia_lod_auto; + meshMetadata.vircadia_lod_distance = meshExtras?.vircadia_lod_distance; + meshMetadata.vircadia_lod_size = meshExtras?.vircadia_lod_size; + meshMetadata.vircadia_lod_hide = meshExtras?.vircadia_lod_hide; + meshMetadata.vircadia_billboard_mode = meshExtras?.vircadia_billboard_mode; + } + return meshMetadata; }