Fix building with ptrcall on.

This commit is contained in:
Relintai 2023-06-11 18:02:58 +02:00
parent 4cc77216d7
commit 50c96d5414
12 changed files with 29 additions and 16 deletions

View File

@ -98,7 +98,7 @@ void NavigationAgent2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("distance_to_target"), &NavigationAgent2D::distance_to_target); ClassDB::bind_method(D_METHOD("distance_to_target"), &NavigationAgent2D::distance_to_target);
ClassDB::bind_method(D_METHOD("get_current_navigation_result"), &NavigationAgent2D::get_current_navigation_result); ClassDB::bind_method(D_METHOD("get_current_navigation_result"), &NavigationAgent2D::get_current_navigation_result);
ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent2D::get_current_navigation_path); ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent2D::get_current_navigation_path_bind);
ClassDB::bind_method(D_METHOD("get_current_navigation_path_index"), &NavigationAgent2D::get_current_navigation_path_index); ClassDB::bind_method(D_METHOD("get_current_navigation_path_index"), &NavigationAgent2D::get_current_navigation_path_index);
ClassDB::bind_method(D_METHOD("is_target_reached"), &NavigationAgent2D::is_target_reached); ClassDB::bind_method(D_METHOD("is_target_reached"), &NavigationAgent2D::is_target_reached);
ClassDB::bind_method(D_METHOD("is_target_reachable"), &NavigationAgent2D::is_target_reachable); ClassDB::bind_method(D_METHOD("is_target_reachable"), &NavigationAgent2D::is_target_reachable);
@ -600,6 +600,10 @@ const Vector<Vector2> &NavigationAgent2D::get_current_navigation_path() const {
return navigation_result->get_path(); return navigation_result->get_path();
} }
Vector<Vector2> NavigationAgent2D::get_current_navigation_path_bind() const {
return navigation_result->get_path();
}
real_t NavigationAgent2D::distance_to_target() const { real_t NavigationAgent2D::distance_to_target() const {
ERR_FAIL_COND_V(agent_parent == nullptr, 0.0); ERR_FAIL_COND_V(agent_parent == nullptr, 0.0);
return agent_parent->get_global_transform().get_origin().distance_to(target_position); return agent_parent->get_global_transform().get_origin().distance_to(target_position);

View File

@ -198,6 +198,7 @@ public:
Ref<NavigationPathQueryResult2D> get_current_navigation_result() const; Ref<NavigationPathQueryResult2D> get_current_navigation_result() const;
const Vector<Vector2> &get_current_navigation_path() const; const Vector<Vector2> &get_current_navigation_path() const;
Vector<Vector2> get_current_navigation_path_bind() const;
int get_current_navigation_path_index() const { int get_current_navigation_path_index() const {
return nav_path_index; return nav_path_index;

View File

@ -52,7 +52,7 @@ void NavigationObstacle2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_velocity"), &NavigationObstacle2D::get_velocity); ClassDB::bind_method(D_METHOD("get_velocity"), &NavigationObstacle2D::get_velocity);
ClassDB::bind_method(D_METHOD("set_vertices", "vertices"), &NavigationObstacle2D::set_vertices); ClassDB::bind_method(D_METHOD("set_vertices", "vertices"), &NavigationObstacle2D::set_vertices);
ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle2D::get_vertices); ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle2D::get_vertices_bind);
ClassDB::bind_method(D_METHOD("set_avoidance_layers", "layers"), &NavigationObstacle2D::set_avoidance_layers); ClassDB::bind_method(D_METHOD("set_avoidance_layers", "layers"), &NavigationObstacle2D::set_avoidance_layers);
ClassDB::bind_method(D_METHOD("get_avoidance_layers"), &NavigationObstacle2D::get_avoidance_layers); ClassDB::bind_method(D_METHOD("get_avoidance_layers"), &NavigationObstacle2D::get_avoidance_layers);

View File

@ -93,6 +93,7 @@ public:
void set_vertices(const Vector<Vector2> &p_vertices); void set_vertices(const Vector<Vector2> &p_vertices);
const Vector<Vector2> &get_vertices() const { return vertices; }; const Vector<Vector2> &get_vertices() const { return vertices; };
Vector<Vector2> get_vertices_bind() const { return vertices; };
void set_avoidance_layers(uint32_t p_layers); void set_avoidance_layers(uint32_t p_layers);
uint32_t get_avoidance_layers() const; uint32_t get_avoidance_layers() const;

View File

@ -111,7 +111,7 @@ void NavigationAgent::_bind_methods() {
ClassDB::bind_method(D_METHOD("distance_to_target"), &NavigationAgent::distance_to_target); ClassDB::bind_method(D_METHOD("distance_to_target"), &NavigationAgent::distance_to_target);
ClassDB::bind_method(D_METHOD("get_current_navigation_result"), &NavigationAgent::get_current_navigation_result); ClassDB::bind_method(D_METHOD("get_current_navigation_result"), &NavigationAgent::get_current_navigation_result);
ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent::get_current_navigation_path); ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent::get_current_navigation_path_bind);
ClassDB::bind_method(D_METHOD("get_current_navigation_path_index"), &NavigationAgent::get_current_navigation_path_index); ClassDB::bind_method(D_METHOD("get_current_navigation_path_index"), &NavigationAgent::get_current_navigation_path_index);
ClassDB::bind_method(D_METHOD("is_target_reached"), &NavigationAgent::is_target_reached); ClassDB::bind_method(D_METHOD("is_target_reached"), &NavigationAgent::is_target_reached);
ClassDB::bind_method(D_METHOD("is_target_reachable"), &NavigationAgent::is_target_reachable); ClassDB::bind_method(D_METHOD("is_target_reachable"), &NavigationAgent::is_target_reachable);
@ -577,6 +577,10 @@ const Vector<Vector3> &NavigationAgent::get_current_navigation_path() const {
return navigation_result->get_path(); return navigation_result->get_path();
} }
Vector<Vector3> NavigationAgent::get_current_navigation_path_bind() const {
return navigation_result->get_path();
}
real_t NavigationAgent::distance_to_target() const { real_t NavigationAgent::distance_to_target() const {
ERR_FAIL_COND_V_MSG(agent_parent == nullptr, 0.0, "The agent has no parent."); ERR_FAIL_COND_V_MSG(agent_parent == nullptr, 0.0, "The agent has no parent.");
return agent_parent->get_global_transform().origin.distance_to(target_position); return agent_parent->get_global_transform().origin.distance_to(target_position);

View File

@ -32,6 +32,7 @@
/*************************************************************************/ /*************************************************************************/
#include "core/containers/vector.h" #include "core/containers/vector.h"
#include "scene/main/node.h" #include "scene/main/node.h"
class Spatial; class Spatial;
@ -222,6 +223,7 @@ public:
Ref<NavigationPathQueryResult3D> get_current_navigation_result() const; Ref<NavigationPathQueryResult3D> get_current_navigation_result() const;
const Vector<Vector3> &get_current_navigation_path() const; const Vector<Vector3> &get_current_navigation_path() const;
Vector<Vector3> get_current_navigation_path_bind() const;
int get_current_navigation_path_index() const { int get_current_navigation_path_index() const {
return nav_path_index; return nav_path_index;

View File

@ -62,7 +62,7 @@ void NavigationObstacle::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_velocity"), &NavigationObstacle::get_velocity); ClassDB::bind_method(D_METHOD("get_velocity"), &NavigationObstacle::get_velocity);
ClassDB::bind_method(D_METHOD("set_vertices", "vertices"), &NavigationObstacle::set_vertices); ClassDB::bind_method(D_METHOD("set_vertices", "vertices"), &NavigationObstacle::set_vertices);
ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle::get_vertices); ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle::get_vertices_bind);
ClassDB::bind_method(D_METHOD("set_avoidance_layers", "layers"), &NavigationObstacle::set_avoidance_layers); ClassDB::bind_method(D_METHOD("set_avoidance_layers", "layers"), &NavigationObstacle::set_avoidance_layers);
ClassDB::bind_method(D_METHOD("get_avoidance_layers"), &NavigationObstacle::get_avoidance_layers); ClassDB::bind_method(D_METHOD("get_avoidance_layers"), &NavigationObstacle::get_avoidance_layers);

View File

@ -106,6 +106,7 @@ public:
void set_vertices(const Vector<Vector3> &p_vertices); void set_vertices(const Vector<Vector3> &p_vertices);
const Vector<Vector3> &get_vertices() const { return vertices; }; const Vector<Vector3> &get_vertices() const { return vertices; };
Vector<Vector3> get_vertices_bind() const { return vertices; };
void set_avoidance_layers(uint32_t p_layers); void set_avoidance_layers(uint32_t p_layers);
uint32_t get_avoidance_layers() const; uint32_t get_avoidance_layers() const;

View File

@ -34,7 +34,7 @@ void NavigationPathQueryResult2D::set_path(const Vector<Vector2> &p_path) {
path = p_path; path = p_path;
} }
const Vector<Vector2> &NavigationPathQueryResult2D::get_path() const { Vector<Vector2> NavigationPathQueryResult2D::get_path() const {
return path; return path;
} }
@ -42,7 +42,7 @@ void NavigationPathQueryResult2D::set_path_types(const Vector<int32_t> &p_path_t
path_types = p_path_types; path_types = p_path_types;
} }
const Vector<int32_t> &NavigationPathQueryResult2D::get_path_types() const { Vector<int32_t> NavigationPathQueryResult2D::get_path_types() const {
return path_types; return path_types;
} }
@ -58,7 +58,7 @@ void NavigationPathQueryResult2D::set_path_owner_ids(const Vector<ObjectID> &p_p
path_owner_ids = p_path_owner_ids; path_owner_ids = p_path_owner_ids;
} }
const Vector<ObjectID> &NavigationPathQueryResult2D::get_path_owner_ids() const { Vector<ObjectID> NavigationPathQueryResult2D::get_path_owner_ids() const {
return path_owner_ids; return path_owner_ids;
} }

View File

@ -52,16 +52,16 @@ public:
}; };
void set_path(const Vector<Vector2> &p_path); void set_path(const Vector<Vector2> &p_path);
const Vector<Vector2> &get_path() const; Vector<Vector2> get_path() const;
void set_path_types(const Vector<int> &p_path_types); void set_path_types(const Vector<int> &p_path_types);
const Vector<int> &get_path_types() const; Vector<int> get_path_types() const;
void set_path_rids(const Array &p_path_rids); void set_path_rids(const Array &p_path_rids);
Array get_path_rids() const; Array get_path_rids() const;
void set_path_owner_ids(const Vector<ObjectID> &p_path_owner_ids); void set_path_owner_ids(const Vector<ObjectID> &p_path_owner_ids);
const Vector<ObjectID> &get_path_owner_ids() const; Vector<ObjectID> get_path_owner_ids() const;
void set_path_owner_ids_bind(const Array p_path_owner_ids); void set_path_owner_ids_bind(const Array p_path_owner_ids);
Array get_path_owner_ids_bind() const; Array get_path_owner_ids_bind() const;

View File

@ -34,7 +34,7 @@ void NavigationPathQueryResult3D::set_path(const Vector<Vector3> &p_path) {
path = p_path; path = p_path;
} }
const Vector<Vector3> &NavigationPathQueryResult3D::get_path() const { Vector<Vector3> NavigationPathQueryResult3D::get_path() const {
return path; return path;
} }
@ -42,7 +42,7 @@ void NavigationPathQueryResult3D::set_path_types(const Vector<int> &p_path_types
path_types = p_path_types; path_types = p_path_types;
} }
const Vector<int> &NavigationPathQueryResult3D::get_path_types() const { Vector<int> NavigationPathQueryResult3D::get_path_types() const {
return path_types; return path_types;
} }
@ -58,7 +58,7 @@ void NavigationPathQueryResult3D::set_path_owner_ids(const Vector<ObjectID> &p_p
path_owner_ids = p_path_owner_ids; path_owner_ids = p_path_owner_ids;
} }
const Vector<ObjectID> &NavigationPathQueryResult3D::get_path_owner_ids() const { Vector<ObjectID> NavigationPathQueryResult3D::get_path_owner_ids() const {
return path_owner_ids; return path_owner_ids;
} }

View File

@ -53,16 +53,16 @@ public:
}; };
void set_path(const Vector<Vector3> &p_path); void set_path(const Vector<Vector3> &p_path);
const Vector<Vector3> &get_path() const; Vector<Vector3> get_path() const;
void set_path_types(const Vector<int> &p_path_types); void set_path_types(const Vector<int> &p_path_types);
const Vector<int> &get_path_types() const; Vector<int> get_path_types() const;
void set_path_rids(const Array &p_path_rids); void set_path_rids(const Array &p_path_rids);
Array get_path_rids() const; Array get_path_rids() const;
void set_path_owner_ids(const Vector<ObjectID> &p_path_owner_ids); void set_path_owner_ids(const Vector<ObjectID> &p_path_owner_ids);
const Vector<ObjectID> &get_path_owner_ids() const; Vector<ObjectID> get_path_owner_ids() const;
void set_path_owner_ids_bind(const Array p_path_owner_ids); void set_path_owner_ids_bind(const Array p_path_owner_ids);
Array get_path_owner_ids_bind() const; Array get_path_owner_ids_bind() const;