You've already forked godot
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:
@@ -31,6 +31,7 @@
|
||||
#include "plane.h"
|
||||
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/variant.h"
|
||||
|
||||
void Plane::set_normal(const Vector3 &p_normal) {
|
||||
normal = p_normal;
|
||||
@@ -138,6 +139,31 @@ bool Plane::intersects_segment(const Vector3 &p_begin, const Vector3 &p_end, Vec
|
||||
return true;
|
||||
}
|
||||
|
||||
Variant Plane::intersect_3_bind(const Plane &p_plane1, const Plane &p_plane2) const {
|
||||
Vector3 inters;
|
||||
if (intersect_3(p_plane1, p_plane2, &inters)) {
|
||||
return inters;
|
||||
} else {
|
||||
return Variant();
|
||||
}
|
||||
}
|
||||
Variant Plane::intersects_ray_bind(const Vector3 &p_from, const Vector3 &p_dir) const {
|
||||
Vector3 inters;
|
||||
if (intersects_ray(p_from, p_dir, &inters)) {
|
||||
return inters;
|
||||
} else {
|
||||
return Variant();
|
||||
}
|
||||
}
|
||||
Variant Plane::intersects_segment_bind(const Vector3 &p_begin, const Vector3 &p_end) const {
|
||||
Vector3 inters;
|
||||
if (intersects_segment(p_begin, p_end, &inters)) {
|
||||
return inters;
|
||||
} else {
|
||||
return Variant();
|
||||
}
|
||||
}
|
||||
|
||||
/* misc */
|
||||
|
||||
bool Plane::is_equal_approx_any_side(const Plane &p_plane) const {
|
||||
|
||||
Reference in New Issue
Block a user