The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

steamvr_lh: Correct angular and linear velocities

authored by

BabbleBones and committed by
Jakob Bornecrantz
9033ff4b 10d0ab7e

+9 -7
+9 -7
src/xrt/drivers/steamvr_lh/device.cpp
··· 481 481 rightEye_postquat.position.z = eyeToHeadRight.m[2][3]; 482 482 483 483 this->eye[0].orientation = leftEye_postquat.orientation; 484 - this->eye[0].position.x += leftEye_postquat.position.x; 485 - this->eye[0].position.y += leftEye_postquat.position.y; 486 - this->eye[0].position.z += leftEye_postquat.position.z; 484 + this->eye[0].position = leftEye_postquat.position; 487 485 this->eye[1].orientation = rightEye_postquat.orientation; 488 - this->eye[1].position.x += rightEye_postquat.position.x; 489 - this->eye[1].position.y += rightEye_postquat.position.y; 490 - this->eye[1].position.z += rightEye_postquat.position.z; 486 + this->eye[1].position = rightEye_postquat.position; 491 487 } 492 488 493 489 void ··· 505 501 out_poses); 506 502 507 503 out_poses[0].orientation = this->eye[0].orientation; 504 + out_poses[0].position.z = this->eye[0].position.z; 505 + out_poses[0].position.y = this->eye[0].position.y; 508 506 out_poses[1].orientation = this->eye[1].orientation; 507 + out_poses[1].position.z = this->eye[1].position.z; 508 + out_poses[1].position.y = this->eye[1].position.y; 509 509 } 510 510 511 511 bool ··· 620 620 }; 621 621 world_transform(pose.position); 622 622 math_quat_rotate(&to_world_rot, &pose.orientation, &pose.orientation); 623 + math_quat_rotate_vec3(&to_world_rot, &relation.linear_velocity, &relation.linear_velocity); 623 624 math_quat_rotate_vec3(&pose.orientation, &relation.angular_velocity, &relation.angular_velocity); 624 625 625 626 // apply local transform 626 627 xrt_vec3 local_rotated; 627 628 math_quat_rotate_vec3(&pose.orientation, &to_local_pos, &local_rotated); 628 629 math_vec3_accum(&local_rotated, &pose.position); 629 - math_vec3_accum(&local_rotated, &relation.linear_velocity); 630 630 math_quat_rotate(&pose.orientation, &to_local_rot, &pose.orientation); 631 631 632 632 // apply chaperone transform ··· 636 636 }; 637 637 chap_transform(pose.position); 638 638 math_quat_rotate(&chaperone_yaw, &pose.orientation, &pose.orientation); 639 + math_quat_rotate_vec3(&chaperone_yaw, &relation.linear_velocity, &relation.linear_velocity); 640 + math_quat_rotate_vec3(&chaperone_yaw, &relation.angular_velocity, &relation.angular_velocity); 639 641 } else { 640 642 relation.relation_flags = XRT_SPACE_RELATION_BITMASK_NONE; 641 643 }