dragonmagi said:
@Tape_Worm Hi there,
I'm curious why you think there is “there's actually precious little about continuous floating origin).”
Is the y offset code correct?:
"_x = (decimal)-_offset.X;
_y = (decimal)-_offset.X;"
looks like the second line should end with _offset.Y
And, yes, doubles can't solve the real issues when the underlying system is float based.
BTW, since you are using 2D, don't you just keep Z=0f; all the time?
Wow, I was hoping you were on here and would respond.
So, regarding x/y: Yeah, that's a bug, but those two variables were used for display purposes only, I didn't use them for anything else. It's kind of a leftover, pay it no mind.
Regarding Z: I do use the Z because I use a depth buffer to help with sorting the sprites and keeping batching sane, those Z values + the depth buffer allow me to layer things and have them interact with post processing effects such as bloom. Regardless, this has no effect on my positioning of objects in the world.
And finally, yeah, when I said precious little, I meant that the only things I've found are your comments, videos and research papers. Any sample code I've found is not actually floating origin (at least, according to what I've read from your comments to other people). It's pretty difficult to find a working implementation to see if I'm on the right track or not. I'm aware you have an implementation up on the Unity asset store. However, I don't use Unity, just my own custom thing that I've built up over time, it just looks Unity-like.
The issue was that I had an object at ~800,000 x 200x000 in space, and I wanted to teleport to that object. Using my (probably quite bastardized) floating origin, I found that I could end up near the object (although the motion was not jittery either, so that part worked fine). However, I could never exactly land directly onto it, it shifted around (and quite randomly too, sometimes to the left, or north east, etc…) My guess was due to floating point inaccuracies that built up as I moved around a bit before teleporting. When I switched to doubles, it worked exactly as it should have, but of course that introduced other issues.