Merge pull request #53741 from DmitriySalnikov/exposed_sensor_setters_master

This commit is contained in:
Rémi Verschelde 2021-10-18 23:00:56 +02:00 committed by GitHub
commit f4d9749e23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View file

@ -117,6 +117,10 @@ void Input::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_accelerometer"), &Input::get_accelerometer);
ClassDB::bind_method(D_METHOD("get_magnetometer"), &Input::get_magnetometer);
ClassDB::bind_method(D_METHOD("get_gyroscope"), &Input::get_gyroscope);
ClassDB::bind_method(D_METHOD("set_gravity", "value"), &Input::set_gravity);
ClassDB::bind_method(D_METHOD("set_accelerometer", "value"), &Input::set_accelerometer);
ClassDB::bind_method(D_METHOD("set_magnetometer", "value"), &Input::set_magnetometer);
ClassDB::bind_method(D_METHOD("set_gyroscope", "value"), &Input::set_gyroscope);
ClassDB::bind_method(D_METHOD("get_last_mouse_speed"), &Input::get_last_mouse_speed);
ClassDB::bind_method(D_METHOD("get_mouse_button_mask"), &Input::get_mouse_button_mask);
ClassDB::bind_method(D_METHOD("set_mouse_mode", "mode"), &Input::set_mouse_mode);

View file

@ -269,6 +269,14 @@
Removes all mappings from the internal database that match the given GUID.
</description>
</method>
<method name="set_accelerometer">
<return type="void" />
<argument index="0" name="value" type="Vector3" />
<description>
Sets the acceleration value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
[b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS.
</description>
</method>
<method name="set_custom_mouse_cursor">
<return type="void" />
<argument index="0" name="image" type="Resource" />
@ -291,6 +299,30 @@
[b]Note:[/b] This method generates an [InputEventMouseMotion] to update cursor immediately.
</description>
</method>
<method name="set_gravity">
<return type="void" />
<argument index="0" name="value" type="Vector3" />
<description>
Sets the gravity value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
[b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS.
</description>
</method>
<method name="set_gyroscope">
<return type="void" />
<argument index="0" name="value" type="Vector3" />
<description>
Sets the value of the rotation rate of the gyroscope sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
[b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS.
</description>
</method>
<method name="set_magnetometer">
<return type="void" />
<argument index="0" name="value" type="Vector3" />
<description>
Sets the value of the magnetic field of the magnetometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
[b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS.
</description>
</method>
<method name="set_mouse_mode">
<return type="void" />
<argument index="0" name="mode" type="int" enum="Input.MouseMode" />