fix grab offset
This commit is contained in:
parent
148d2d3429
commit
e42bafc962
1 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ public class Grab
|
||||||
{
|
{
|
||||||
held_by = hand;
|
held_by = hand;
|
||||||
grab_ref = this;
|
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;
|
ori_offset = hand.palm.orientation.Inverse * pose.orientation;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,8 @@ public class Grab
|
||||||
{
|
{
|
||||||
if (Held)
|
if (Held)
|
||||||
{
|
{
|
||||||
pose.position = held_by.palm.position - pos_offset;
|
|
||||||
pose.orientation = held_by.palm.orientation * ori_offset;
|
pose.orientation = held_by.palm.orientation * ori_offset;
|
||||||
|
pose.position = held_by.palm.position - held_by.palm.orientation * pos_offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue