Skip to content

Commit 31fd6b0

Browse files
committed
tilt and prsssure working
1 parent 0e30e42 commit 31fd6b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,8 @@ static boolean handleMouseEvent(final MotionEvent event) {
518518
sourceMouseRelative = event.isFromSource(InputDevice.SOURCE_MOUSE_RELATIVE);
519519
}
520520

521-
tiltX = (float) (tilt * Math.sin(orientation));
522-
tiltY = (float) (tilt * Math.cos(orientation));
521+
tiltX = (float) (tilt * Math.cos(orientation + Math.PI / 2));
522+
tiltY = (float) (tilt * Math.sin(orientation + Math.PI / 2));
523523
Log.d("GodotInputHandler", "move" + eventAction + " buttonMask " + buttonsMask + " pressure " + pressure + " tilt " + tiltX);
524524
pressure = event.getPressure();
525525
return handleMouseEvent(eventAction, buttonsMask, x, y, horizontalFactor, verticalFactor, false, sourceMouseRelative, pressure, tiltX, tiltY);

0 commit comments

Comments
 (0)