mirror of
https://github.com/godotengine/godot.git
synced 2025-10-22 17:33:33 +00:00
Align sensors and implement gravity sensor for Android
This commit is contained in:
parent
19b1ff0fc5
commit
6205eb40e7
8 changed files with 39 additions and 14 deletions
|
@ -608,6 +608,7 @@ static bool resized = false;
|
|||
static bool resized_reload = false;
|
||||
static Size2 new_size;
|
||||
static Vector3 accelerometer;
|
||||
static Vector3 gravity;
|
||||
static Vector3 magnetometer;
|
||||
static Vector3 gyroscope;
|
||||
static HashMap<String, JNISingleton *> jni_singletons;
|
||||
|
@ -1012,6 +1013,8 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, job
|
|||
|
||||
os_android->process_accelerometer(accelerometer);
|
||||
|
||||
os_android->process_gravity(gravity);
|
||||
|
||||
os_android->process_magnetometer(magnetometer);
|
||||
|
||||
os_android->process_gyroscope(gyroscope);
|
||||
|
@ -1386,6 +1389,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_accelerometer(JNIEnv
|
|||
accelerometer = Vector3(x, y, z);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_gravity(JNIEnv *env, jobject obj, jfloat x, jfloat y, jfloat z) {
|
||||
gravity = Vector3(x, y, z);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_magnetometer(JNIEnv *env, jobject obj, jfloat x, jfloat y, jfloat z) {
|
||||
magnetometer = Vector3(x, y, z);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue