diff --git a/src/Data.cs b/src/Data.cs index f0e57b5..0700e15 100644 --- a/src/Data.cs +++ b/src/Data.cs @@ -31,7 +31,7 @@ public class Grab { held_by = hand; grab_ref = this; - pos_offset = hand.palm.position - pose.position; + pos_offset = hand.palm.orientation.Inverse * (hand.palm.position - pose.position); ori_offset = hand.palm.orientation.Inverse * pose.orientation; return true; } @@ -50,8 +50,8 @@ public class Grab { if (Held) { - pose.position = held_by.palm.position - pos_offset; pose.orientation = held_by.palm.orientation * ori_offset; + pose.position = held_by.palm.position - held_by.palm.orientation * pos_offset; } } } \ No newline at end of file