Search the Community
Showing results for tags 'camerainputsmanager'.
-
Hi guys and gals, I was reading the docs on Customizing Camera Inputs https://doc.babylonjs.com/how_to/customizing_camera_inputs and I want to customize the camera input for the FollowCamera. But it has no camera.inputs set at the moment when I look at the definition: https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/babylon.followCamera.ts While for example the FreeCamera has: https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/babylon.freeCamera.ts#L164 My question is: Can you set the camera.inputs to a new CameraInputsManager instance? Perhaps a DummyCameraInputsManager that's just an empty shell, doesn't need to do anything with input for now... just being there. So then I can add my own inputs to this camera using: camera.inputs.add(new MyFancyNewFollowCameraKeyboardInput()); I can then write camera input controllers (in JavaScript) that would adjust the FollowCamera's radius, rotationOffset and heightOffset. If you like my camera input controllers for the FollowCamera I can share the code, so they might even become default. ? Some background info: I use a FollowCamera in my BabylonJS Model Train Simulator game. It follows the train quite nicely, even in curves. ? But when the train gets longer, I want the user to be able to adjust the radius to get the train in view again (zoom in/out). Also when the player operates the train at a station, I want the user to be able to adjust the rotationOffset to get a clear view on loading/unloading the train at that station. So it's kinda like an ArcRotate input but slightly different. Let me know how I can help achieve this or if there's a similar solution that achieves more or less the same. Thanks, Quintus
- 9 replies
-
- inputs
- camerainputsmanager
-
(and 1 more)
Tagged with: