summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorfluffrabbit <fluffrabbit@aol.com>2016-05-27 14:29:37 -0300
committerGeorge Marques <george@gmarqu.es>2016-05-27 14:36:55 -0300
commit4877b714b3f8b0f0af2bce7a32691fc2202c8acc (patch)
tree26df024d25fbbcd11b27a560644273a2599d947c /core
parenteb7227a20b27e91c6e2adfb1ded738f2dd7e453b (diff)
Add magnetometer sensor support for Android
Diffstat (limited to 'core')
-rw-r--r--core/os/input.cpp1
-rw-r--r--core/os/input.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/core/os/input.cpp b/core/os/input.cpp
index 6e1e618d9a..a766ef87fc 100644
--- a/core/os/input.cpp
+++ b/core/os/input.cpp
@@ -60,6 +60,7 @@ void Input::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_joy_name","device"),&Input::get_joy_name);
ObjectTypeDB::bind_method(_MD("get_joy_guid","device"),&Input::get_joy_guid);
ObjectTypeDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer);
+ ObjectTypeDB::bind_method(_MD("get_magnetometer"),&Input::get_magnetometer);
//ObjectTypeDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want
ObjectTypeDB::bind_method(_MD("get_mouse_speed"),&Input::get_mouse_speed);
ObjectTypeDB::bind_method(_MD("get_mouse_button_mask"),&Input::get_mouse_button_mask);
diff --git a/core/os/input.h b/core/os/input.h
index 535776f39c..46edb30aa1 100644
--- a/core/os/input.h
+++ b/core/os/input.h
@@ -75,6 +75,7 @@ public:
virtual void warp_mouse_pos(const Vector2& p_to)=0;
virtual Vector3 get_accelerometer()=0;
+ virtual Vector3 get_magnetometer()=0;
virtual void action_press(const StringName& p_action)=0;
virtual void action_release(const StringName& p_action)=0;