mirror of https://github.com/wayvr-org/wayvr.git
openvr: seated space drag
This commit is contained in:
parent
38395c9183
commit
88bcd42e56
|
|
@ -46,9 +46,10 @@ impl PlayspaceMover {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let new_hand =
|
let new_hand = data
|
||||||
state.input_state.pointers[data.hand].raw_pose.translation + data.pose.translation;
|
.pose
|
||||||
let relative_pos = data.pose.transform_vector3a(new_hand - data.hand_pos);
|
.transform_point3a(state.input_state.pointers[data.hand].raw_pose.translation);
|
||||||
|
let relative_pos = new_hand - data.hand_pos;
|
||||||
|
|
||||||
if relative_pos.length_squared() > 1000.0 {
|
if relative_pos.length_squared() > 1000.0 {
|
||||||
log::warn!("Space drag too fast, ignoring");
|
log::warn!("Space drag too fast, ignoring");
|
||||||
|
|
@ -74,7 +75,7 @@ impl PlayspaceMover {
|
||||||
log::warn!("Can't space drag - failed to get zero pose");
|
log::warn!("Can't space drag - failed to get zero pose");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
let hand_pos = pointer.raw_pose.translation + mat.translation;
|
let hand_pos = mat.transform_point3a(pointer.raw_pose.translation);
|
||||||
self.last = Some(DragData {
|
self.last = Some(DragData {
|
||||||
pose: mat,
|
pose: mat,
|
||||||
hand: i,
|
hand: i,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue