1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Script API methods must return Ref<T> instead of Reference*

ptrcall assumes methods that return a Reference type do so with Ref<T>. Returning Reference* from a method exposed to the scripting API completely breaks ptrcalls to this method (it can be quite hard to debug!).
This commit is contained in:
Ignacio Etcheverry
2019-07-03 09:49:46 +02:00
parent 270af6fa08
commit aa9908e4f6
4 changed files with 10 additions and 3 deletions

View File

@@ -119,7 +119,7 @@ public:
void set_spatial_node(Spatial *p_node);
Spatial *get_spatial_node() const { return spatial_node; }
EditorSpatialGizmoPlugin *get_plugin() const { return gizmo_plugin; }
Ref<EditorSpatialGizmoPlugin> get_plugin() const { return gizmo_plugin; }
Vector3 get_handle_pos(int p_idx) const;
bool intersect_frustum(const Camera *p_camera, const Vector<Plane> &p_frustum);
bool intersect_ray(Camera *p_camera, const Point2 &p_point, Vector3 &r_pos, Vector3 &r_normal, int *r_gizmo_handle = NULL, bool p_sec_first = false);