Giter VIP home page Giter VIP logo

Comments (1)

mafiesto4 avatar mafiesto4 commented on May 14, 2024 4

Added to the master! Can be enabled in a custom engine build by setting this to true:

"UseLargeWorlds": false

Soon there will be proper support for the rendering relative to the camera (work in progress) and implementation of 64-bit coordinates in other systems (audio, physics,..). Then, of course we will add documentation.

By setting UseLargeWorlds=true the Vector2/3/4 types are using double instead of float:

  • C++

    #if USE_LARGE_WORLDS
    // 64-bit precision for world coordinates
    API_TYPEDEF(Alias) typedef double Real;
    #define MIN_Real MIN_double
    #define MAX_Real MAX_double
    #else
    // 32-bit precision for world coordinates
    API_TYPEDEF(Alias) typedef float Real;
    #define MIN_Real MIN_float
    #define MAX_Real MAX_float
    #endif
    // Vector2
    template<typename T> struct Vector2Base;
    API_TYPEDEF() typedef Vector2Base<float> Float2;
    API_TYPEDEF() typedef Vector2Base<double> Double2;
    API_TYPEDEF() typedef Vector2Base<int32> Int2;
    API_TYPEDEF(Alias) typedef Vector2Base<Real> Vector2;
    // Vector3
    template<typename T> struct Vector3Base;
    API_TYPEDEF() typedef Vector3Base<float> Float3;
    API_TYPEDEF() typedef Vector3Base<double> Double3;
    API_TYPEDEF() typedef Vector3Base<int32> Int3;
    API_TYPEDEF(Alias) typedef Vector3Base<Real> Vector3;
    // Vector4
    template<typename T> struct Vector4Base;
    API_TYPEDEF() typedef Vector4Base<float> Float4;
    API_TYPEDEF() typedef Vector4Base<double> Double4;
    API_TYPEDEF() typedef Vector4Base<int32> Int4;
    API_TYPEDEF(Alias) typedef Vector4Base<Real> Vector4;

  • C#

    #if USE_LARGE_WORLDS
    using Real = System.Double;
    #else
    using Real = System.Single;
    #endif

We do have vector types Float2/3/4, Double2/3/4 and Int2/3/4 to explicitly use certain precision and data size.

from flaxengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.