Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

The question:

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

Product Version: UE 4.16
more ▼

asked Jun 17 '17 at 08:43 PM in Using UE4

avatar image

11 3

avatar image M0xim Oct 30 '17 at 03:43 PM

Hello, Any luck with these methods? I am making an endless game and don' t want to be far from world's origin.

avatar image mxnko Jun 15 '19 at 02:58 AM

@M0xim, you can move world origin, I have made an endless runner too, it works amazingly well.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question