TheGrumps

Members
  • Content count

    3
  • Joined

  • Last visited

  1. Hi Wingnut, Thanks for the response! Sorry, I think I'm confusing you with the terminology I'm using - by "pan" I refer to moving the camera and target around in the scene. (I agree that "pan" isn't really the correct term for this - "track" seems more correct to me, but the ArcRotateCamera uses the term "pan" for this.) Yes, that's what I'm referring to. 😄 (All the settings for this on the camera, such as intertia and origin target refer to this as "pan" - sorry for the confusion!) In my original playground, you can control + left mouse button drag to move the camera (and the target) around the scene, and the target position is being clamped in the render loop. However this results in strange behaviour when the target reaches the clamped boundary - you can see this by moving to the edges. (There's some wobbly and "elastic" camera behaviour.) Therefore I assume this is not the correct way to limit the target position, and was wondering whether there is a way to achieve this correctly? As mentioned in my previous post, no problem if there isn't one since it would be possible to achieve by manually handling panning and only updating the inertialPanningX and inertialPanningY values when suitable, but the amount of matrix math involved is likely to be a pain! But if I do go that route I'd be happy to share if anyone needs. Thanks!
  2. Hi Wingnut, thanks for the welcome and the response. 🙂 Sorry, I think I wasn't clear - I see limiting rotation and radius, but I'm not clear on how to limit the pan. To make things clearer, I've put together a playground: https://playground.babylonjs.com/#XEIQ25 Welcome any suggestions! If need be I can always implement the pan behaviour myself to support the clamping of the target position, but the amount of math involved would be a pain so I thought I'd double check I haven't missed anything obvious before heading down that path. Thanks!
  3. I'm using the ArcRotateCamera and controlling pan by updating the inertialPanningX & inertialPanningY properties, and it's working well. However I'm not clear on the best way to limit the target position within a box. I have attempted clamping the target position in the render loop, however it creates a wobble effect when near the edges. Is there another way that a limit can be defined? (I see the camera allows limiting the rotation and distance, so am I missing the pan limits?) Thanks in advance!