Camera-centric coordinate system in UE4?
A bit of background (optional for reading):
I've been working on my own game engine for a game with real-sized planet generation(a kind of space simulator), using C++/DirectX/HLSL. I have some good looking results, but what I have so far is pure graphics, a game engine needs much more like physics, audio-subsystem, level-editor, scripting and so on. I realize I won't handle that on my own.
So I started exploring UE4, and it seems like I can port my code related to mesh/texture generation, shaders. What isn't clear to me is how UE4 would help me fight 4-byte float point precision issues. There are number of tricks that one can apply, I'm specifically interested in camera-centric coordinate system. While on CPU object coordinates can be stored relative to the absolute world origin (say using doubles), each objects position can be recalculated against camera just before calculation of "LocalToWorld" matrix and passing it to GPU.
Using UE4, how can I have the camera as the world origin (0,0,0) and represent object coordinates relative to the camera? In addition: is there an in-built class for double precision vectors?
Update: Digging through the docs and sources I found UWorld::RequestNewWorldOrigin / UWorld::SetNewWorldOrigin / AActor::ApplyWorldOffset, so that's probably the first thing I need to check. It doesn't seem like it can be used on every frame though.
Thanks in advance, -Ziabar
Follow this question
Once you sign in you will be able to subscribe for any updates here