MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / vibrate

Method vibrate

platform/android/java_godot_wrapper.cpp:455–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455void GodotJavaWrapper::vibrate(int p_duration_ms, float p_amplitude) {
456 if (_vibrate) {
457 JNIEnv *env = get_jni_env();
458 ERR_FAIL_NULL(env);
459
460 int j_amplitude = -1.0;
461
462 if (p_amplitude != -1.0) {
463 j_amplitude = CLAMP(int(p_amplitude * 255), 1, 255);
464 }
465
466 env->CallVoidMethod(godot_instance, _vibrate, p_duration_ms, j_amplitude);
467 }
468}
469
470int GodotJavaWrapper::create_new_godot_instance(const List<String> &args) {
471 if (_create_new_godot_instance) {

Callers 2

vibrate_handheldMethod · 0.45

Calls 2

get_jni_envFunction · 0.85
CLAMPFunction · 0.85

Tested by

no test coverage detected