The open source OpenXR runtime
0
fork

Configure Feed

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

d/ns: Fix all warnings and tidy code

+63 -20
+2 -2
src/xrt/drivers/north_star/distortion/deformation_northstar.cpp
··· 221 221 Vector2 error = curDisplayUV - inputUV; 222 222 Vector2 step = Vector2::zero(); 223 223 224 - if (!displayUVGradX.x == 0.f || !displayUVGradX.y == 0.f) { 224 + if ((!displayUVGradX.x) == 0.f || (!displayUVGradX.y) == 0.f) { 225 225 step = step + (displayUVGradX * error.x); 226 226 } 227 - if (!displayUVGradY.x == 0.f || !displayUVGradY.y == 0.f) { 227 + if ((!displayUVGradY.x) == 0.f || (!displayUVGradY.y) == 0.f) { 228 228 step = step + (displayUVGradY * error.y); 229 229 } 230 230
+2 -10
src/xrt/drivers/north_star/distortion/deformation_northstar.h
··· 4 4 5 5 #pragma once 6 6 7 - #include <map> 8 7 #include "utility_northstar.h" 9 8 #include "../ns_hmd.h" 10 - #include <chrono> 9 + #include <map> 11 10 12 - using namespace std::chrono; 13 - 14 - static char *s_strLeftEye = "leftEye"; 15 - static char *s_strRightEye = "rightEye"; 16 11 17 12 class OpticalSystem 18 13 { ··· 71 66 void 72 67 UpdateClipToWorld(Matrix4x4 eyeRotationMatrix) 73 68 { 74 - // TEST DELETEME 75 - float time = clock() / (float)CLOCKS_PER_SEC; 76 - float osc = sinf(time * 2 * LP_PI); 77 69 Matrix4x4 eyeToWorld = 78 70 Matrix4x4::Translate(eyePosition) * eyeRotationMatrix; 79 71 eyeToWorld.m02 *= -1; ··· 99 91 clipToWorld.MultiplyPoint(tmp * 2.f) - cameraPosition; 100 92 101 93 float mag = dir.Magnitude(); 102 - out = dir / dir.Magnitude(); 94 + out = dir / mag; 103 95 return; 104 96 } 105 97
+59 -8
src/xrt/drivers/north_star/distortion/utility_northstar.h
··· 44 44 z = 0.f; 45 45 }; 46 46 47 + constexpr Vector3 & 48 + operator=(const Vector3 &lhr) 49 + { 50 + this->x = lhr.x; 51 + this->y = lhr.y; 52 + this->z = lhr.z; 53 + return *this; 54 + } 55 + 47 56 inline static Vector3 48 57 Up() 49 58 { ··· 137 146 ret.y = -y; 138 147 ret.z = -z; 139 148 return ret; 140 - } 141 - 142 - inline void 143 - copy(Vector3 &lhs, Vector3 rhs) 144 - { 145 - rhs.x = lhs.x; 146 - rhs.y = lhs.y; 147 - rhs.z = lhs.z; 148 149 } 149 150 150 151 inline float static Dot(Vector3 lhs, Vector3 rhs) ··· 300 301 y = _y; 301 302 }; 302 303 304 + constexpr Vector2 & 305 + operator=(const Vector2 &lhr) 306 + { 307 + this->x = lhr.x; 308 + this->y = lhr.y; 309 + return *this; 310 + } 311 + 303 312 inline static Vector2 304 313 zero() 305 314 { ··· 434 443 m33 = in33; 435 444 }; 436 445 446 + constexpr Matrix4x4 & 447 + operator=(const Matrix4x4 &lhr) 448 + { 449 + this->m00 = lhr.m00; 450 + this->m01 = lhr.m01; 451 + this->m02 = lhr.m02; 452 + this->m03 = lhr.m03; 453 + this->m10 = lhr.m10; 454 + this->m11 = lhr.m11; 455 + this->m12 = lhr.m12; 456 + this->m13 = lhr.m13; 457 + this->m20 = lhr.m20; 458 + this->m21 = lhr.m21; 459 + this->m22 = lhr.m22; 460 + this->m23 = lhr.m23; 461 + this->m30 = lhr.m30; 462 + this->m31 = lhr.m31; 463 + this->m32 = lhr.m32; 464 + this->m33 = lhr.m33; 465 + return *this; 466 + }; 467 + 437 468 inline static Matrix4x4 438 469 Identity() 439 470 { ··· 688 719 w = in.w; 689 720 } 690 721 722 + constexpr Vector4 & 723 + operator=(const Vector4 &lhr) 724 + { 725 + this->x = lhr.x; 726 + this->y = lhr.y; 727 + this->z = lhr.z; 728 + this->w = lhr.w; 729 + return *this; 730 + } 731 + 691 732 inline Matrix4x4 692 733 ComposeProjection() 693 734 { ··· 783 824 z = _in.z; 784 825 w = _in.w; 785 826 }; 827 + 828 + constexpr Quaternion & 829 + operator=(const Quaternion &lhr) 830 + { 831 + this->x = lhr.x; 832 + this->y = lhr.y; 833 + this->z = lhr.z; 834 + this->w = lhr.w; 835 + return *this; 836 + } 786 837 787 838 inline static Quaternion 788 839 Identity()