add setCameraCulling method to set near/far culling plane and return vector_math:Frustum from planes returned by get_camera_frustum

This commit is contained in:
Nick Fisher
2023-11-09 15:08:34 +08:00
parent 76f723c497
commit f2a458b9ca
11 changed files with 227 additions and 104 deletions

View File

@@ -76,6 +76,7 @@ class ExampleWidgetState extends State<ExampleWidget> {
static FilamentEntity? directionalLight;
static bool loop = false;
static final showProjectionMatrices = ValueNotifier<bool>(false);
late StreamSubscription _listener;
@@ -158,7 +159,11 @@ class ExampleWidgetState extends State<ExampleWidget> {
? Container()
: Padding(
padding: const EdgeInsets.only(top: 40, left: 20, right: 20),
child: CameraMatrixOverlay(controller: _filamentController!),
child: ValueListenableBuilder(
valueListenable: showProjectionMatrices,
builder: (ctx, value, child) => CameraMatrixOverlay(
controller: _filamentController!,
showProjectionMatrices: value)),
),
_filamentController == null
? Container()