aevyrie / big_space

Floating origin plugin for spaces larger than the universe
Apache License 2.0
168 stars 22 forks source link

offset childrens' GridCells from their parent #13

Closed oli-obk closed 7 months ago

oli-obk commented 11 months ago

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.

oli-obk commented 11 months ago

The commits all stand on their own. I can pull out 322e9d9, 622f6e0, and 6d2ceb1 into their own PRs if you'd like to review them that way.

aevyrie commented 7 months ago

I have a working prototype of this in the reference-frames branch.

aevyrie commented 7 months ago

Closing in favor of #16