jps0611 Posted November 13, 2018 Share Posted November 13, 2018 Howdy friends, Got an issue I'm trying to sort out with how I want to customize the input controls for the ArcRotate Camera. I'd like to take the existing ArcRotate Camera and keep the Alpha inputs standard, but update the Beta inputs to move the lockedTarget of the camera. So imagine "scrolling" the canvas would move the camera and instead of move the Beta of the camera. Unclear where to begin on this. @Deltakosh I'd setup a playground but given it wouldn't be much more than the default ArcRotate template I've not done that here. Thanks for any help/suggestions! JPS Quote Link to comment Share on other sites More sharing options...
jps0611 Posted November 13, 2018 Author Share Posted November 13, 2018 Perhaps put more succinctly....I'd like to create a custom camera input that takes the existing inputs for the camera.beta controls....and remap them to update the camera.lockedTarget.y. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2018 Share Posted November 13, 2018 So I would probably recommend to inherit from the current input manager and just rewrite the part you want to change? Quote Link to comment Share on other sites More sharing options...
jps0611 Posted November 13, 2018 Author Share Posted November 13, 2018 I'm guessing this is the most viable file to get my hands into: https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/Inputs/babylon.arcRotateCameraPointersInput.ts Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 13, 2018 Share Posted November 13, 2018 Want a bootleg way? Something greasy? Try this. https://playground.babylonjs.com/#QY1WYT#30 Slimy, but seems to work fine. Lines 60-67. Quote Link to comment Share on other sites More sharing options...
jps0611 Posted November 13, 2018 Author Share Posted November 13, 2018 2 minutes ago, Wingnut said: Want a bootleg way? Something greasy? OOOOOOOh I like greasy! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
jps0611 Posted November 14, 2018 Author Share Posted November 14, 2018 21 hours ago, Wingnut said: https://playground.babylonjs.com/#QY1WYT#30 This is pretty clever @Wingnut @Deltakosh! And it's super performant. It's nice that it picks up the inertial properties of the angularSensibility. For the last piece...I was able to achieve my final effect by doing the same for radius as well. (Luckily I'm using an orthographic camera mode so I don't need to make use of the radius). Check it out: https://playground.babylonjs.com/#QY1WYT#39 Buttery smooth! Thanks as always pals! JPS Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted November 14, 2018 Share Posted November 14, 2018 perfect! Flagging as solved! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.