Bugfixes and Improvements.

This commit is contained in:
2016-12-22 00:51:17 +01:00
parent 613610c050
commit 3f53235b1b
8 changed files with 215 additions and 178 deletions
+1
View File
@@ -174,6 +174,7 @@ int main(int argc, char *argv[]) {
}
conf.setRemainingToDefault();
el::Loggers::reconfigureAllLoggers(conf);
LOG(INFO) << "Application started";
LOG(INFO) << "Log Config: " << QDir::toNativeSeparators(logconfigfile).toStdString();
if (!logFilePath.isEmpty()) {
LOG(INFO) << "Log File: " << logFilePath;
+2 -2
View File
@@ -407,7 +407,7 @@ void OverlayController::RotateUniverseCenter(vr::ETrackingUniverseOrigin univers
vr::HmdMatrix34_t rotMat;
vr::HmdMatrix34_t newPos;
utils::initRotationMatrix(rotMat, 0, yAngle);
utils::initRotationMatrix(rotMat, 1, yAngle);
utils::matMul33(newPos, rotMat, curPos);
newPos.m[0][3] = curPos.m[0][3];
newPos.m[1][3] = curPos.m[1][3];
@@ -464,7 +464,7 @@ void OverlayController::RotateCollisionBounds(float angle, bool commit) {
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo(collisionBounds, &collisionBoundsCount);
vr::HmdMatrix34_t rotMat;
utils::initRotationMatrix(rotMat, 0, angle);
utils::initRotationMatrix(rotMat, 1, angle);
for (unsigned b = 0; b < collisionBoundsCount; b++) {
for (unsigned c = 0; c < 4; c++) {
auto& corner = collisionBounds[b].vCorners[c];
+27 -24
View File
@@ -90,35 +90,38 @@ void MoveCenterTabController::setAdjustChaperone(bool value, bool notify) {
m_adjustChaperone = value;
if (m_trackingUniverse == vr::TrackingUniverseStanding) {
vr::VRChaperoneSetup()->RevertWorkingCopy();
float offsetdir;
if (m_adjustChaperone) {
if (m_offsetX != 0.0f) {
parent->AddOffsetToCollisionBounds(0, -m_offsetX, false);
}
if (m_offsetY != 0.0f) {
parent->AddOffsetToCollisionBounds(1, -m_offsetY, false);
}
if (m_offsetZ != 0.0f) {
parent->AddOffsetToCollisionBounds(2, -m_offsetZ, false);
}
if (m_rotation != 0) {
float angle = m_rotation * 2 * M_PI / 360.0;
parent->RotateCollisionBounds(-angle, false);
}
offsetdir = -1.0;
} else {
if (m_offsetX != 0.0f) {
parent->AddOffsetToCollisionBounds(0, m_offsetX, false);
offsetdir = 1.0;
}
if (m_offsetX != 0.0f) {
if (m_adjustChaperone || m_rotation == 0) {
parent->AddOffsetToCollisionBounds(0, offsetdir * m_offsetX, false);
} else {
auto angle = m_rotation * 2 * M_PI / 360.0;
parent->AddOffsetToCollisionBounds(0, offsetdir * m_offsetX * std::cos(angle), false);
parent->AddOffsetToCollisionBounds(2, offsetdir * m_offsetX * std::sin(angle), false);
}
if (m_offsetY != 0.0f) {
parent->AddOffsetToCollisionBounds(1, m_offsetY, false);
}
if (m_offsetZ != 0.0f) {
parent->AddOffsetToCollisionBounds(2, m_offsetZ, false);
}
if (m_rotation != 0) {
float angle = m_rotation * 2 * M_PI / 360.0;
parent->RotateCollisionBounds(angle, false);
}
if (m_offsetY != 0.0f) {
parent->AddOffsetToCollisionBounds(1, offsetdir * m_offsetY, false);
}
if (m_offsetZ != 0.0f) {
if (m_adjustChaperone || m_rotation == 0) {
parent->AddOffsetToCollisionBounds(2, offsetdir * m_offsetZ, false);
} else {
auto angle = m_rotation * 2 * M_PI / 360.0;
parent->AddOffsetToCollisionBounds(2, offsetdir * m_offsetZ * std::cos(angle), false);
parent->AddOffsetToCollisionBounds(0, -offsetdir * m_offsetZ * std::sin(angle), false);
}
}
if (m_rotation != 0) {
float angle = m_rotation * 2 * M_PI / 360.0;
parent->RotateCollisionBounds(offsetdir * angle, false);
}
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
}
auto settings = OverlayController::appSettings();