Closed tad-lispy closed 6 months ago
Hi! You're correct that the target_focus
is automatically adjusted and reflect the camera's height. I'll need to think about this a bit more but a hacky way to get the actual focal point is to reverse engineer it by subtracting cam.height_max.lerp(cam.height_min, cam.target_zoom)
from the Y coordinate of focus
or target_focus
. (That's the value added to the ground surface in order to follow the ground.)
EDIT: use zoom
in that lerp if using focus
I have pushed 0.4.2 which contains https://github.com/Plonq/bevy_rts_camera/pull/8. focus
now isn't moved up to the camera's height and you can use it directly instead of subtracting the height from it.
Hi again! I'm trying to implement custom controls for my camera and for that I need to know where the camera is pointing at on the ground. My understanding was that the
focus
ortarget_focus
contain this information, but when reading those properties I'm getting a point high above the ground (largey
coordinate), even if I manually set the target focus to be aty = 0.0
. It also changes whenzoom
is changed. I think it basically contains the current camera height. Is this intentional? Could you please advise how to get the coordinates on the ground?My naive way of doing that is as follows, but it doesn't account for any ground topology.