Modulo some cleanups and writing a demo, this is the absolute minimal change (on top of #12) that fixes #11
It is hacky, as it accumulates floating point errors across children. This is likely no issue, but it may become an issue if the camera is a child of a moving object, or if a child of a faraway object is near the camera. I have not tested this yet, but I would like to fix it properly.
The proper fix that I can think of is to do something like GlobalTransform (GlobalGridCell) that is the accumulated result of all parents' grid cells. Though if we implemented that naively, we'd be ignoring the rotations and scales of the Transforms of the parents. This could all get very expensive, so it doesn't seem unreasonable to me to just reject this PR and #11 and add some helper logic to handle a GlobalGridCell scheme that doesn't allow for rotation and scaling.
Modulo some cleanups and writing a demo, this is the absolute minimal change (on top of #12) that fixes #11
It is hacky, as it accumulates floating point errors across children. This is likely no issue, but it may become an issue if the camera is a child of a moving object, or if a child of a faraway object is near the camera. I have not tested this yet, but I would like to fix it properly.
The proper fix that I can think of is to do something like
GlobalTransform
(GlobalGridCell
) that is the accumulated result of all parents' grid cells. Though if we implemented that naively, we'd be ignoring the rotations and scales of theTransform
s of the parents. This could all get very expensive, so it doesn't seem unreasonable to me to just reject this PR and #11 and add some helper logic to handle aGlobalGridCell
scheme that doesn't allow for rotation and scaling.