I've #include <godot_cpp/core/vector3.hpp>, but it returns this output:

src/hexmap.cpp:4:10: fatal error: godot_cpp/core/math/vector3.hpp: No such file or directory
    4 | #include <godot_cpp/core/math/vector3.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Where is the proper vector3.hpp located?

  • xyz replied to this.

    xyz That may be true for Godot source, but in GDExtension, the following includes work without throwing an error, and when I tried to change the include for vector3, it didn't work:

    #include <godot_cpp/classes/node3d.hpp>
    
    #include <godot_cpp/core/class_db.hpp>
    #include <godot_cpp/variant/variant.hpp>
    #include <godot_cpp/variant/utility_functions.hpp>
    src/hexmap.cpp:4:10: fatal error: godot_cpp/core/math/vector3.h: No such file or directory
        4 | #include <godot_cpp/core/math/vector3.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • xyz replied to this.

      Lousifr Did you check if the file is actually there? Also make sure the compiler include paths are properly set up.

        Apparently you don't need to include files for Vector3's. It compiled just fine when I removed the #include.

        xyz Do you know if there's any documentation for GDExtension? I'd really like a reference manual.

        • xyz replied to this.

          Lousifr I don't know of anything other than what's in official docs. Imho, that's really enough. If you're up to the task of writing an extension, you're supposed be able to deduce everything you need from peeking into Godot's source code. Luckily, it is very well written. Looking at class interfaces is almost like reading a reference manual 🙂

          Ah, yeah haven’t peeked at the source yet. Will do that today.