You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Implement amplitude to Input.vibrate_handheld
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: m4gr3d <m4gr3d@users.noreply.github.com>
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
/**************************************************************************/
|
||||
|
||||
#include "input.h"
|
||||
#include "input.compat.inc"
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/input/default_controller_mappings.h"
|
||||
@@ -120,7 +121,7 @@ void Input::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_joy_vibration_duration", "device"), &Input::get_joy_vibration_duration);
|
||||
ClassDB::bind_method(D_METHOD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0));
|
||||
ClassDB::bind_method(D_METHOD("stop_joy_vibration", "device"), &Input::stop_joy_vibration);
|
||||
ClassDB::bind_method(D_METHOD("vibrate_handheld", "duration_ms"), &Input::vibrate_handheld, DEFVAL(500));
|
||||
ClassDB::bind_method(D_METHOD("vibrate_handheld", "duration_ms", "amplitude"), &Input::vibrate_handheld, DEFVAL(500), DEFVAL(-1.0));
|
||||
ClassDB::bind_method(D_METHOD("get_gravity"), &Input::get_gravity);
|
||||
ClassDB::bind_method(D_METHOD("get_accelerometer"), &Input::get_accelerometer);
|
||||
ClassDB::bind_method(D_METHOD("get_magnetometer"), &Input::get_magnetometer);
|
||||
@@ -803,8 +804,8 @@ void Input::stop_joy_vibration(int p_device) {
|
||||
joy_vibration[p_device] = vibration;
|
||||
}
|
||||
|
||||
void Input::vibrate_handheld(int p_duration_ms) {
|
||||
OS::get_singleton()->vibrate_handheld(p_duration_ms);
|
||||
void Input::vibrate_handheld(int p_duration_ms, float p_amplitude) {
|
||||
OS::get_singleton()->vibrate_handheld(p_duration_ms, p_amplitude);
|
||||
}
|
||||
|
||||
void Input::set_gravity(const Vector3 &p_gravity) {
|
||||
|
||||
Reference in New Issue
Block a user