summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-22 23:12:20 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-22 23:13:41 -0300
commitd6225b1e0004c57cc50452ddb5d512fd6556a523 (patch)
treeeeb6169dcc735c6b66052581b81bb5a71b466509 /core/math
parent842e7bfc2f81cda73fd9f16a1ade323a1a5d0292 (diff)
Improved binding system (ObjectTypeDB::bind_method) to be friendlier to statically typed languages, should help in the Mono integration.
Disabled by default.
Diffstat (limited to 'core/math')
-rw-r--r--core/math/bsp_tree.h27
-rw-r--r--core/math/face3.h2
2 files changed, 28 insertions, 1 deletions
diff --git a/core/math/bsp_tree.h b/core/math/bsp_tree.h
index 2bfc26b51e..6c36d80e3e 100644
--- a/core/math/bsp_tree.h
+++ b/core/math/bsp_tree.h
@@ -34,8 +34,8 @@
#include "face3.h"
#include "vector.h"
#include "dvector.h"
-
#include "variant.h"
+#include "method_ptrcall.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
@@ -138,4 +138,29 @@ bool BSP_Tree::convex_is_inside(const T& p_convex) const {
}
+#ifdef PTRCALL_ENABLED
+
+
+template<>
+struct PtrToArg<BSP_Tree> {
+ _FORCE_INLINE_ static BSP_Tree convert(const void* p_ptr) {
+ BSP_Tree s( Variant( *reinterpret_cast<const Dictionary*>(p_ptr) ) );
+ return s;
+ }
+ _FORCE_INLINE_ static void encode(BSP_Tree p_val,void* p_ptr) {
+ Dictionary *d = reinterpret_cast<Dictionary*>(p_ptr);
+ *d=Variant(p_val);
+ }
+};
+
+template<>
+struct PtrToArg<const BSP_Tree&> {
+ _FORCE_INLINE_ static BSP_Tree convert(const void* p_ptr) {
+ BSP_Tree s( Variant( *reinterpret_cast<const Dictionary*>(p_ptr) ) );
+ return s;
+ }
+};
+
+#endif
+
#endif
diff --git a/core/math/face3.h b/core/math/face3.h
index bc34be9935..3a81da74db 100644
--- a/core/math/face3.h
+++ b/core/math/face3.h
@@ -264,4 +264,6 @@ bool Face3::intersects_aabb2(const AABB& p_aabb) const {
}
+//this sucks...
+
#endif // FACE3_H