[GDExtension] Camera3D::set_position doens't work

Godot Version



I was setting the camera’s position in _ready function (in c++), the code is below:

void ThirdPersonController::setup(godot::Camera3D *camera, godot::Node3D *trackingNode) {
    // if (Engine::get_singleton()->is_editor_hint()) return;
    if (camera && trackingNode) {
        _trackingNode = trackingNode;
        Vector3 trackingPos = _trackingNode->to_global(Vector3());
        Vector3 cameraPos = trackingPos + Vector3(0.0, _height, 0.0) + maths_3d::localBackward(camera) * _startDistance;
        camera->set_rotation(Vector3(_pitch, _head, 0.0));
        camera->set_position(cameraPos);   // The issue happens here..
        _lastTrackingPosition = trackingPos;

Whatever the argument I set, the camera always stay at (0,0,0). So I attempted to debug the code, when I debug at the above code, the cameraPos in debugger is:
When I step into it and after a few steps, as the debugger enters the Node3D::set_position, the argument becomes (0,0,0), like below:
How could it be? I really don’t know how to find the problem after that.

I found the problem, I removed REAL_T_IS_DOUBLE macro from my GDExtension, seems like the Vector3 structure of my extension and Vector3 of editor is not compatible. So the argument convertion causes incorrectness. So If I would like to use double as real_t, I shall compile a specified editor, right?