Manual Merge Cleanup
This commit is contained in:
@@ -18,6 +18,12 @@ DISTFILES += \
|
||||
src/res/qml/ChaperoneWarningsPage.qml \
|
||||
src/res/qml/FixFloorPage.qml \
|
||||
src/res/qml/PlayspacePage.qml \
|
||||
src/res/qml/motion_page/* \
|
||||
src/res/qml/motion_page/gravity/* \
|
||||
src/res/qml/motion_page/height_toggle/* \
|
||||
src/res/qml/motion_page/snap_turn/* \
|
||||
src/res/qml/motion_page/universe_drag/* \
|
||||
src/res/qml/motion_page/universe_turn/* \
|
||||
src/res/qml/RevivePage.qml \
|
||||
src/res/qml/RootPage.qml \
|
||||
src/res/qml/SettingsPage.qml \
|
||||
|
||||
@@ -31,6 +31,7 @@ HEADERS += src/overlaycontroller.h \
|
||||
src/tabcontrollers/KeyboardInput.h \
|
||||
src/utils/Matrix.h \
|
||||
src/utils/ChaperoneUtils.h \
|
||||
src/utils/quaternion.h \
|
||||
src/tabcontrollers/audiomanager/AudioManagerDummy.h \
|
||||
src/tabcontrollers/keyboardinput/KeyboardInputDummy.h \
|
||||
src/overlaycontroller/openvr_init.h \
|
||||
|
||||
@@ -187,10 +187,12 @@ void MoveCenterTabController::setRotation( int value, bool notify )
|
||||
= devicePosesForRot[0].mDeviceToAbsoluteTracking;
|
||||
|
||||
// Set up xyz coordinate values from pose matrix.
|
||||
double oldHmdXyz[3]
|
||||
= { oldHmdPos.m[0][3], oldHmdPos.m[1][3], oldHmdPos.m[2][3] };
|
||||
double newHmdXyz[3]
|
||||
= { oldHmdPos.m[0][3], oldHmdPos.m[1][3], oldHmdPos.m[2][3] };
|
||||
double oldHmdXyz[3] = { static_cast<double>( oldHmdPos.m[0][3] ),
|
||||
static_cast<double>( oldHmdPos.m[1][3] ),
|
||||
static_cast<double>( oldHmdPos.m[2][3] ) };
|
||||
double newHmdXyz[3] = { static_cast<double>( oldHmdPos.m[0][3] ),
|
||||
static_cast<double>( oldHmdPos.m[1][3] ),
|
||||
static_cast<double>( oldHmdPos.m[2][3] ) };
|
||||
|
||||
// Convert oldHmdXyz into un-rotated coordinates.
|
||||
double oldAngle = -m_rotation * k_centidegreesToRadians;
|
||||
@@ -281,9 +283,9 @@ void MoveCenterTabController::setAdjustChaperone( bool value, bool notify )
|
||||
{
|
||||
double angle = m_rotation * k_centidegreesToRadians;
|
||||
double offsetdir = m_adjustChaperone ? -1.0 : 1.0;
|
||||
double offset[3] = { offsetdir * m_offsetX,
|
||||
offsetdir * m_offsetY,
|
||||
offsetdir * m_offsetZ };
|
||||
double offset[3] = { offsetdir * static_cast<double>( m_offsetX ),
|
||||
offsetdir * static_cast<double>( m_offsetY ),
|
||||
offsetdir * static_cast<double>( m_offsetZ ) };
|
||||
rotateCoordinates( offset, angle );
|
||||
|
||||
// We're done with calculations so down-cast to float for
|
||||
@@ -505,7 +507,7 @@ void MoveCenterTabController::modOffsetX( float value, bool notify )
|
||||
if ( !m_lockXToggle )
|
||||
{
|
||||
double angle = m_rotation * k_centidegreesToRadians;
|
||||
double offset[3] = { value, 0, 0 };
|
||||
double offset[3] = { static_cast<double>( value ), 0, 0 };
|
||||
rotateCoordinates( offset, angle );
|
||||
float offsetFloat[3] = { static_cast<float>( offset[0] ),
|
||||
static_cast<float>( offset[1] ),
|
||||
@@ -544,7 +546,7 @@ void MoveCenterTabController::modOffsetZ( float value, bool notify )
|
||||
if ( !m_lockZToggle )
|
||||
{
|
||||
double angle = m_rotation * k_centidegreesToRadians;
|
||||
double offset[3] = { 0, 0, value };
|
||||
double offset[3] = { 0, 0, static_cast<double>( value ) };
|
||||
rotateCoordinates( offset, angle );
|
||||
float offsetFloat[3] = { static_cast<float>( offset[0] ),
|
||||
static_cast<float>( offset[1] ),
|
||||
@@ -1086,10 +1088,11 @@ void MoveCenterTabController::updateHandDrag(
|
||||
return;
|
||||
}
|
||||
|
||||
double relativeControllerPosition[]
|
||||
= { movePose->mDeviceToAbsoluteTracking.m[0][3],
|
||||
movePose->mDeviceToAbsoluteTracking.m[1][3],
|
||||
movePose->mDeviceToAbsoluteTracking.m[2][3] };
|
||||
double relativeControllerPosition[] = {
|
||||
static_cast<double>( movePose->mDeviceToAbsoluteTracking.m[0][3] ),
|
||||
static_cast<double>( movePose->mDeviceToAbsoluteTracking.m[1][3] ),
|
||||
static_cast<double>( movePose->mDeviceToAbsoluteTracking.m[2][3] )
|
||||
};
|
||||
|
||||
rotateCoordinates( relativeControllerPosition, -angle );
|
||||
float absoluteControllerPosition[] = {
|
||||
@@ -1101,9 +1104,12 @@ void MoveCenterTabController::updateHandDrag(
|
||||
if ( m_lastMoveHand == m_activeDragHand )
|
||||
{
|
||||
double diff[3] = {
|
||||
absoluteControllerPosition[0] - m_lastControllerPosition[0],
|
||||
absoluteControllerPosition[1] - m_lastControllerPosition[1],
|
||||
absoluteControllerPosition[2] - m_lastControllerPosition[2],
|
||||
static_cast<double>( absoluteControllerPosition[0]
|
||||
- m_lastControllerPosition[0] ),
|
||||
static_cast<double>( absoluteControllerPosition[1]
|
||||
- m_lastControllerPosition[1] ),
|
||||
static_cast<double>( absoluteControllerPosition[2]
|
||||
- m_lastControllerPosition[2] ),
|
||||
};
|
||||
|
||||
// offset is un-rotated coordinates
|
||||
|
||||
+18
-11
@@ -9,21 +9,28 @@ inline vr::HmdQuaternion_t quaternionFromHmdMatrix34( vr::HmdMatrix34_t matrix )
|
||||
{
|
||||
vr::HmdQuaternion_t q;
|
||||
|
||||
q.w = sqrt(
|
||||
fmax( 0, 1 + matrix.m[0][0] + matrix.m[1][1] + matrix.m[2][2] ) )
|
||||
q.w = sqrt( fmax( 0,
|
||||
static_cast<double>( 1 + matrix.m[0][0] + matrix.m[1][1]
|
||||
+ matrix.m[2][2] ) ) )
|
||||
/ 2;
|
||||
q.x = sqrt(
|
||||
fmax( 0, 1 + matrix.m[0][0] - matrix.m[1][1] - matrix.m[2][2] ) )
|
||||
q.x = sqrt( fmax( 0,
|
||||
static_cast<double>( 1 + matrix.m[0][0] - matrix.m[1][1]
|
||||
- matrix.m[2][2] ) ) )
|
||||
/ 2;
|
||||
q.y = sqrt(
|
||||
fmax( 0, 1 - matrix.m[0][0] + matrix.m[1][1] - matrix.m[2][2] ) )
|
||||
q.y = sqrt( fmax( 0,
|
||||
static_cast<double>( 1 - matrix.m[0][0] + matrix.m[1][1]
|
||||
- matrix.m[2][2] ) ) )
|
||||
/ 2;
|
||||
q.z = sqrt(
|
||||
fmax( 0, 1 - matrix.m[0][0] - matrix.m[1][1] + matrix.m[2][2] ) )
|
||||
q.z = sqrt( fmax( 0,
|
||||
static_cast<double>( 1 - matrix.m[0][0] - matrix.m[1][1]
|
||||
+ matrix.m[2][2] ) ) )
|
||||
/ 2;
|
||||
q.x = copysign( q.x, matrix.m[2][1] - matrix.m[1][2] );
|
||||
q.y = copysign( q.y, matrix.m[0][2] - matrix.m[2][0] );
|
||||
q.z = copysign( q.z, matrix.m[1][0] - matrix.m[0][1] );
|
||||
q.x = copysign( q.x,
|
||||
static_cast<double>( matrix.m[2][1] - matrix.m[1][2] ) );
|
||||
q.y = copysign( q.y,
|
||||
static_cast<double>( matrix.m[0][2] - matrix.m[2][0] ) );
|
||||
q.z = copysign( q.z,
|
||||
static_cast<double>( matrix.m[1][0] - matrix.m[0][1] ) );
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user