1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Refactored binding system for core types

Moved to a system using variadic templates, shared with CallableBind.

New code is cleaner, faster and allows for much better optimization of core
type functions from GDScript and GDNative.

Added Variant::InternalMethod function for direct call access.
This commit is contained in:
reduz
2020-10-13 15:59:37 -03:00
committed by Juan Linietsky
parent bc91e088e4
commit b8c64184c6
15 changed files with 2229 additions and 1611 deletions

View File

@@ -31,6 +31,7 @@
#include "aabb.h"
#include "core/print_string.h"
#include "core/variant.h"
real_t AABB::get_area() const {
return size.x * size.y * size.z;
@@ -375,6 +376,21 @@ void AABB::get_edge(int p_edge, Vector3 &r_from, Vector3 &r_to) const {
}
}
Variant AABB::intersects_segment_bind(const Vector3 &p_from, const Vector3 &p_to) const {
Vector3 inters;
if (intersects_segment(p_from, p_to, &inters)) {
return inters;
}
return Variant();
}
Variant AABB::intersects_ray_bind(const Vector3 &p_from, const Vector3 &p_dir) const {
Vector3 inters;
if (intersects_ray(p_from, p_dir, &inters)) {
return inters;
}
return Variant();
}
AABB::operator String() const {
return String() + position + " - " + size;
}