Why not intersecting with the camera?


The PG

May someone tell me why the camera doesn’t intersect with the sphere and change the donut scale ?
It works if I replace camera with donut, but I am interested in the camera.



ActionManager only works on objects of type Mesh or in the Scene itself: Actions | Babylon.js Documentation (babylonjs.com)

Also there is no ellipsoid/checkCollisions-property for FollowCamera. Maybe this is what you want?

  1. Define your min-max camera size.

  2. Add Observer to onViewMatrixChangedObservable or donut.onAfterWorldMatrixUpdateObservable:

  1. To evaluate intersection get BoundingBox and use
intersectsMinMax(minCameraSize.add(camera.position), maxCameraSize.add(camera.position))

Or get BoundingSphere and call

with min-max BoundingSphere.

  1. Call your instructions.

Example PG:

Thanks, you inspired me,

I just created a box, parented it to my camera and let BJS do the work


Thanks a lot!

1 Like