mirror of
https://github.com/amwatson/CitraVR.git
synced 2024-09-20 03:11:40 +02:00
[vr_main] remove explicit 'hand' vector variables and do vector subtraction instead
This commit is contained in:
parent
8340e84691
commit
fe37e902d1
1 changed files with 7 additions and 25 deletions
|
@ -389,30 +389,12 @@ private:
|
|||
: immersiveScaleFactor[2];
|
||||
|
||||
{
|
||||
const XrVector3f leftVec = {
|
||||
gOpenXr->headLocation.pose.position.x -
|
||||
mInputStateFrame.mHandPositions[InputStateFrame::LEFT_CONTROLLER]
|
||||
.pose.position.x,
|
||||
gOpenXr->headLocation.pose.position.y -
|
||||
mInputStateFrame.mHandPositions[InputStateFrame::LEFT_CONTROLLER]
|
||||
.pose.position.y,
|
||||
gOpenXr->headLocation.pose.position.z -
|
||||
mInputStateFrame.mHandPositions[InputStateFrame::LEFT_CONTROLLER]
|
||||
.pose.position.z,
|
||||
};
|
||||
const float lengthLeft = XrMath::Vector3f::Length(leftVec);
|
||||
const XrVector3f rightVec = {
|
||||
gOpenXr->headLocation.pose.position.x -
|
||||
mInputStateFrame.mHandPositions[InputStateFrame::RIGHT_CONTROLLER]
|
||||
.pose.position.x,
|
||||
gOpenXr->headLocation.pose.position.y -
|
||||
mInputStateFrame.mHandPositions[InputStateFrame::RIGHT_CONTROLLER]
|
||||
.pose.position.y,
|
||||
gOpenXr->headLocation.pose.position.z -
|
||||
mInputStateFrame.mHandPositions[InputStateFrame::RIGHT_CONTROLLER]
|
||||
.pose.position.z,
|
||||
};
|
||||
const float lengthRight = XrMath::Vector3f::Length(rightVec);
|
||||
const float lengthLeft = XrMath::Vector3f::Length(
|
||||
gOpenXr->headLocation.pose.position -
|
||||
mInputStateFrame.mHandPositions[InputStateFrame::LEFT_CONTROLLER].pose.position);
|
||||
const float lengthRight = XrMath::Vector3f::Length(
|
||||
gOpenXr->headLocation.pose.position -
|
||||
mInputStateFrame.mHandPositions[InputStateFrame::RIGHT_CONTROLLER].pose.position);
|
||||
const float length = std::min(lengthLeft, lengthRight);
|
||||
|
||||
// This block is for testing which uinform offset is needed
|
||||
|
|
Loading…
Reference in a new issue