From d82a084b810beb721ad01e943b093871cf9bf72c Mon Sep 17 00:00:00 2001 From: Benjythebee Date: Wed, 16 Oct 2024 10:48:40 +1300 Subject: [PATCH] fix culling distance and culling layer --- src/library/CharacterManifestData.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/library/CharacterManifestData.js b/src/library/CharacterManifestData.js index e90eee8e..ba33bd52 100644 --- a/src/library/CharacterManifestData.js +++ b/src/library/CharacterManifestData.js @@ -668,8 +668,11 @@ class ModelTrait{ this.thumbnail = thumbnail; this.fullThumbnail = fullThumbnail || traitGroup.manifestData.getThumbnailsDirectory() + thumbnail; - this.cullHiddenMeshes = cullingDistance; - this.cullingLayer = cullingLayer; + this.cullHiddenMeshes = cullingDistance|| [0,0]; + // Prioritize cullingLayer from trait, then from traitGroup, then default + this.cullingLayer = cullingLayer ?? traitGroup.manifestData.defaultCullingLayer ?? 0; + // Prioritize cullingDistance from trait, then from traitGroup, then default + this.cullingDistance = cullingDistance || traitGroup.manifestData.defaultCullingDistance || [0,0]; this.type = type; this.targetTextureCollection = textureCollection ? traitGroup.manifestData.getTextureGroup(textureCollection) : null;