Announcement

Collapse
No announcement yet.

Vector conversion errors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Vector conversion errors

    Greetings,
    Been working on a double precision vector system for ue4, seem to have fixed the majority of the issues arising but im stuck on one.
    I need a conversion from the double Vectors back to the float Vectors but the issue is that its throwing a error on compile,

    "left of '.X' must have class/struct/union \engine\source\runtime\core\public\Math\VectorF.h"

    same with Y and Z, then says "use of undefined type FVector" but its included at the start of the header and VS has no issue jumping to the definition of it.

    code section
    Code:
    FORCEINLINE FVector2::FVector2(const FVector V)
        : X(V.X), Y(V.Y), Z(V.Z)
    {
        DiagnosticCheckNaN();
    }
    thanks

    #2
    I'm not quite sure what your issue is, but I suspect it's to do with accessibility of FVector from where your code is.

    As an aside, I'd probably name the type 'FVectorDouble', since FVector2 sounds a lot like a 2d vector.

    Comment


      #3
      Originally posted by Rareden View Post
      Greetings,
      "left of '.X' must have class/struct/union \engine\source\runtime\core\public\Math\VectorF.h"
      The proper include should be \engine\source\runtime\core\public\Math\Vector.h

      not sure where VectorF.h comes from.
      CTO | Head of VR Development - Visit us at http://humanxr.com
      My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

      Comment


        #4
        Originally posted by ambershee View Post
        I'm not quite sure what your issue is, but I suspect it's to do with accessibility of FVector from where your code is.

        As an aside, I'd probably name the type 'FVectorDouble', since FVector2 sounds a lot like a 2d vector.

        Originally posted by vr_marco View Post

        The proper include should be \engine\source\runtime\core\public\Math\Vector.h

        not sure where VectorF.h comes from.

        Edit:Changed FVector2 to FVectorFloat and VectorF.h to VectorFloat.h to help.

        VectorFloat is a copy of the original float vectors which has FVectorFloat as the struct, FVector is the double version
        The code is in the same public/Math as the rest of the vector.h files, ive tried adding #include math/vector.h into the VectorFloat.h but it still gives me the same issue


        It seems if i remove the include of "vectorFloat.h" from Vector.h it produces a similar error within vector.h but says that FVectorFloat is undefined, but VS can still jump to the definition.

        source link https://github.com/Rareden/UnrealEng...48396229f53252

        Conversion snippet from Vector.h, (doubles one) that is also producing the error
        Code:
        FORCEINLINE FVector::FVector(const FVectorFloat& V)
            : X(V.X), Y(V.Y), Z(V.Z)
        {
            DiagnosticCheckNaN();
        }
        EDIT:well i fixed it, turns out i had to define that in the .h that its converting from, not to.
        Last edited by Rareden; 11-27-2017, 01:36 AM.

        Comment

        Working...
        X