From 1ba91a1fd6f4f48d4e9e5820a385c563727ab8ae Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 11 Sep 2024 23:08:07 +0800 Subject: [PATCH] rename getBoundingBox to getViewportBoundingBox and add camera methods --- .../lib/thermion_dart/thermion_viewer.dart | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/thermion_dart/lib/thermion_dart/thermion_viewer.dart b/thermion_dart/lib/thermion_dart/thermion_viewer.dart index d1e2c225..f7e2b927 100644 --- a/thermion_dart/lib/thermion_dart/thermion_viewer.dart +++ b/thermion_dart/lib/thermion_dart/thermion_viewer.dart @@ -492,15 +492,26 @@ abstract class ThermionViewer { Future setCameraCulling(double near, double far); /// - /// Get the distance (in world units) to the near culling plane for the active camera. + /// Get the distance (in world units) to the near plane for the active camera. /// + @Deprecated("Use getCameraNear") Future getCameraCullingNear(); + /// + /// Get the distance (in world units) to the near plane for the active camera. + /// + Future getCameraNear(); + /// /// Get the distance (in world units) to the far culling plane for the active camera. /// Future getCameraCullingFar(); + /// + /// + /// + Future setCameraLensProjection(double near, double far, double aspect, double focalLength); + /// /// Sets the focus distance for the camera. /// @@ -571,8 +582,14 @@ abstract class ThermionViewer { /// /// Sets the camera model matrix. /// + @Deprecated("Will be superseded by setCameraModelMatrix4") Future setCameraModelMatrix(List matrix); + /// + /// Sets the camera model matrix. + /// + Future setCameraModelMatrix4(Matrix4 matrix); + /// /// Sets the `baseColorFactor` property for the material at index [materialIndex] in [entity] under node [meshName] to [color]. /// @@ -631,8 +648,6 @@ abstract class ThermionViewer { Future queueRelativePositionUpdateWorldAxis(ThermionEntity entity, double viewportX, double viewportY, double x, double y, double z); - - /// /// Queues an update to the worldspace rotation for [entity]. /// The actual update will occur on the next frame, and will be subject to collision detection. @@ -783,12 +798,12 @@ abstract class ThermionViewer { PrimitiveType primitiveType = PrimitiveType.TRIANGLES}); /// - /// Gets the parent entity of [entity]. Returns null if the entity has no parent. + /// Gets the parent entity of [entity]. Returns null if the entity has no parent. /// Future getParent(ThermionEntity entity); /// - /// Gets the ancestor (ultimate parent) entity of [entity]. Returns null if the entity has no parent. + /// Gets the ancestor (ultimate parent) entity of [entity]. Returns null if the entity has no parent. /// Future getAncestor(ThermionEntity entity); @@ -827,7 +842,7 @@ abstract class ThermionViewer { /// /// Gets the 2D bounding box (in viewport coordinates) for the given entity. /// - Future getBoundingBox(ThermionEntity entity); + Future getViewportBoundingBox(ThermionEntity entity); /// /// Filament assigns renderables to a numeric layer.