Camera Framing Behaviors

I’m trying to understand how the Framing Behavior “IgnoreBoundsSizeMode” and “FitFrustumSidesMode” work. Both of these properties are numbers, but I don’t see any reference to what these numbers should be.

Here is the playground I’m working with: https://playground.babylonjs.com/#6FBD14#1657

When I set the FitFrustumSidesMode to less than 1 it seems to do nothing. I’m assuming that value is close to the default used. When I set it to 1 it sometimes shoots through the mesh, sometimes this also happens when I change it below one as well. I don’t know if that’s a playground issue or something to do with the number I’m using.

I get somewhat similar issues with the IgnoreBoundsSizeMode. I looked through the API docs and the manual and they both essentially say the same thing. I think I’m missing the “modes” I’m supposed to use for this. I remember seeing something similar with the animation modes where I could reference modes directly or as a number. Is this the case with this as well? If so where can I find what modes to use for the framing behaviors?

Ok, I figured out what I was doing wrong and I’ll post it here for anyone else that might run into this problem. I was a bit confused at first. From what I understand you set the mode on the camera as such:

camera.framingBehavior.mode = BABYLON.FramingBehavior.IgnoreBoundsSizeMode; 

or

camera.framingBehavior.mode = BABYLON.FramingBehavior.FitFrustumSidesMode;
1 Like

Yes, these are just numeric constants and not intended to be used “manually” (without referring the constant). They will generally be listed in the API documentation for the respective class that uses it, or in BABYLON.Constants from what I can tell.