Even when I provide a small vector to the `cameraDirection` of a camera with `checkCollision`, it doesn't work

I’m creating a custom camera input. To make the camera move, I’m trying to pass a vector to cameraDirection.

However, while there’s no issue when the vector is large, if it falls below a certain threshold (0.0001), the camera stops moving entirely.

Please see the playground for details.

It works correctly if I set the value to 0.0002 or disable checkCollision.

Furthermore, when using Babylon’s native camera input instead of my custom one, it seems to work correctly even when I provide small `camera.speed` (even with checkCollision set to true).

What is the difference between my implementation and Babylon’s implementation?
How can I fix this so that the camera moves even with a small vector and checkCollision enabled?

Thank you for this great framework!

There is a threshold. When that value is too small, it’s just discarded and nothing happens.

cc @georgie

Thank you for your reply!

Is this threshold an intentional limitation? If so, is there a way to change it?

I model in Blender with the units set to centimeters, and then import the model into Babylon. For example, if I import a room model that is 300 cm × 300 cm, its size in Babylon becomes 3 × 3.

Suppose a camera moves around inside that room from a first-person perspective. In that case, a camera movement vector such as (0, 0, 1) per frame would be far too fast.

To achieve a “slow walking” speed inside a 3 × 3 room, the movement vector per frame would be something like (0, 0, 0.0001).

Also, what happens when the frame rate is high? For example, at 120 fps, compared to 60 fps, the camera movement vector needs to be halved using something like scene.getAnimationRatio; otherwise, the camera moves too fast. In other words, the vector per frame becomes smaller, making it more likely to fall below the 0.0001 threshold.

I would appreciate any advice.

Also, why is Babylon’s standard camera able to move correctly even when its speed is set extremely low?