summaryrefslogtreecommitdiffstats
path: root/modules/dlscript/godot/godot_plane.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-04-04 00:25:03 +0200
committerGitHub <noreply@github.com>2017-04-04 00:25:03 +0200
commit46bc14e66fe90430f1d74cdab6cca6acb5b2a3f6 (patch)
tree6d761531804ce9bb8e78b297598e06bea57dbe7b /modules/dlscript/godot/godot_plane.cpp
parent57badfd1df3a554b7f47793e73a887874e5ca2b1 (diff)
parentfd553087867187220d4f6b8217854dd8e9be2667 (diff)
downloadredot-engine-46bc14e66fe90430f1d74cdab6cca6acb5b2a3f6.tar.gz
Merge pull request #8246 from GodotNativeTools/dlscript-module
DLScript module
Diffstat (limited to 'modules/dlscript/godot/godot_plane.cpp')
-rw-r--r--modules/dlscript/godot/godot_plane.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/modules/dlscript/godot/godot_plane.cpp b/modules/dlscript/godot/godot_plane.cpp
new file mode 100644
index 0000000000..883aeb6282
--- /dev/null
+++ b/modules/dlscript/godot/godot_plane.cpp
@@ -0,0 +1,48 @@
+#include "godot_plane.h"
+
+#include "math/plane.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _plane_api_anchor() {
+}
+
+void GDAPI godot_plane_new(godot_plane *p_pl) {
+ Plane *pl = (Plane *)p_pl;
+ *pl = Plane();
+}
+
+void GDAPI godot_plane_new_with_normal(godot_plane *p_pl, const godot_vector3 *p_normal, const godot_real p_d) {
+ Plane *pl = (Plane *)p_pl;
+ const Vector3 *normal = (const Vector3 *)p_normal;
+ *pl = Plane(*normal, p_d);
+}
+
+void GDAPI godot_plane_set_normal(godot_plane *p_pl, const godot_vector3 *p_normal) {
+ Plane *pl = (Plane *)p_pl;
+ const Vector3 *normal = (const Vector3 *)p_normal;
+ pl->set_normal(*normal);
+}
+
+godot_vector3 godot_plane_get_normal(const godot_plane *p_pl) {
+ const Plane *pl = (const Plane *)p_pl;
+ const Vector3 normal = pl->get_normal();
+ godot_vector3 *v3 = (godot_vector3 *)&normal;
+ return *v3;
+}
+
+void GDAPI godot_plane_set_d(godot_plane *p_pl, const godot_real p_d) {
+ Plane *pl = (Plane *)p_pl;
+ pl->d = p_d;
+}
+
+godot_real GDAPI godot_plane_get_d(const godot_plane *p_pl) {
+ const Plane *pl = (const Plane *)p_pl;
+ return pl->d;
+}
+
+#ifdef __cplusplus
+}
+#endif