bounding box geometry doesn't cast/receive shadows

This commit is contained in:
Nick Fisher
2025-03-05 14:57:20 +08:00
parent 593bca3365
commit 5b80dd3a3d
2 changed files with 9 additions and 6 deletions

View File

@@ -263,8 +263,8 @@ class FFIAsset extends ThermionAsset {
@override
Future<void> setBoundingBoxVisibility(bool visible) async {
if (boundingBoxAsset == null) {
final boundingBox = await SceneAsset_getBoundingBox(pointer!);
final boundingBox = await SceneAsset_getBoundingBox(pointer);
final min = [
boundingBox.centerX - boundingBox.halfExtentX,
boundingBox.centerY - boundingBox.halfExtentY,
@@ -343,6 +343,9 @@ class FFIAsset extends ThermionAsset {
keepData: false,
) as FFIAsset;
await viewer.setCastShadows(boundingBoxAsset!.entity, false);
await viewer.setReceiveShadows(boundingBoxAsset!.entity, false);
TransformManager_setParent(Engine_getTransformManager(engine),
boundingBoxAsset!.entity, entity, false);
}

View File

@@ -92,17 +92,17 @@ namespace thermion
return nullptr;
}
Log("Creating buffers...");
TRACE("Creating buffers...");
auto [vertexBuffer, indexBuffer] = createBuffers();
if (!vertexBuffer || !indexBuffer)
{
Log("Failed to create buffers: VB=%p, IB=%p", vertexBuffer, indexBuffer);
return nullptr;
}
Log("Buffers created successfully: VB=%p, IB=%p", vertexBuffer, indexBuffer);
TRACE("Buffers created successfully: VB=%p, IB=%p", vertexBuffer, indexBuffer);
Box boundingBox = computeBoundingBox();
Log("Computed bounding box: min={%f,%f,%f}, max={%f,%f,%f}",
TRACE("Computed bounding box: min={%f,%f,%f}, max={%f,%f,%f}",
boundingBox.getMin().x, boundingBox.getMin().y, boundingBox.getMin().z,
boundingBox.getMax().x, boundingBox.getMax().y, boundingBox.getMax().z);
@@ -285,7 +285,7 @@ namespace thermion
return false;
}
Log("Validation passed: vertices=%d, normals=%s, uvs=%d, indices=%d",
TRACE("Validation passed: vertices=%d, normals=%s, uvs=%d, indices=%d",
mVertices->size(),
(!mNormals->empty() ? "yes" : "no"),
mUVs->size(),