From ee9a40f5e94458a83502330d6343e8a13b8c08b0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 26 Apr 2016 14:03:10 +0200 Subject: [PATCH] - replace FLOATTYPE with float in stereo3d code. --- src/gl/stereo3d/gl_anaglyph.cpp | 6 ++-- src/gl/stereo3d/gl_stereo3d.cpp | 4 +-- src/gl/stereo3d/gl_stereo3d.h | 4 +-- src/gl/stereo3d/gl_stereo_leftright.cpp | 12 ++++---- src/gl/stereo3d/gl_stereo_leftright.h | 40 ++++++++++++------------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/gl/stereo3d/gl_anaglyph.cpp b/src/gl/stereo3d/gl_anaglyph.cpp index 7cc66e28b8..c84c350913 100644 --- a/src/gl/stereo3d/gl_anaglyph.cpp +++ b/src/gl/stereo3d/gl_anaglyph.cpp @@ -46,7 +46,7 @@ MaskAnaglyph::MaskAnaglyph(const ColorMask& leftColorMask, double ipdMeters) /* static */ -const GreenMagenta& GreenMagenta::getInstance(FLOATTYPE ipd) +const GreenMagenta& GreenMagenta::getInstance(float ipd) { static GreenMagenta instance(ipd); return instance; @@ -54,7 +54,7 @@ const GreenMagenta& GreenMagenta::getInstance(FLOATTYPE ipd) /* static */ -const RedCyan& RedCyan::getInstance(FLOATTYPE ipd) +const RedCyan& RedCyan::getInstance(float ipd) { static RedCyan instance(ipd); return instance; @@ -62,7 +62,7 @@ const RedCyan& RedCyan::getInstance(FLOATTYPE ipd) /* static */ -const AmberBlue& AmberBlue::getInstance(FLOATTYPE ipd) +const AmberBlue& AmberBlue::getInstance(float ipd) { static AmberBlue instance(ipd); return instance; diff --git a/src/gl/stereo3d/gl_stereo3d.cpp b/src/gl/stereo3d/gl_stereo3d.cpp index d7f5183d08..d686a4a43e 100644 --- a/src/gl/stereo3d/gl_stereo3d.cpp +++ b/src/gl/stereo3d/gl_stereo3d.cpp @@ -43,7 +43,7 @@ namespace s3d { /* virtual */ -VSMatrix EyePose::GetProjection(FLOATTYPE fov, FLOATTYPE aspectRatio, FLOATTYPE fovRatio) const +VSMatrix EyePose::GetProjection(float fov, float aspectRatio, float fovRatio) const { VSMatrix result; @@ -62,7 +62,7 @@ Viewport EyePose::GetViewport(const Viewport& fullViewport) const /* virtual */ -void EyePose::GetViewShift(FLOATTYPE yaw, FLOATTYPE outViewShift[3]) const +void EyePose::GetViewShift(float yaw, float outViewShift[3]) const { // pass-through for Mono view outViewShift[0] = 0; diff --git a/src/gl/stereo3d/gl_stereo3d.h b/src/gl/stereo3d/gl_stereo3d.h index 48b6ef9003..303f188252 100644 --- a/src/gl/stereo3d/gl_stereo3d.h +++ b/src/gl/stereo3d/gl_stereo3d.h @@ -60,9 +60,9 @@ class EyePose public: EyePose() {} virtual ~EyePose() {} - virtual VSMatrix GetProjection(FLOATTYPE fov, FLOATTYPE aspectRatio, FLOATTYPE fovRatio) const; + virtual VSMatrix GetProjection(float fov, float aspectRatio, float fovRatio) const; virtual Viewport GetViewport(const Viewport& fullViewport) const; - virtual void GetViewShift(FLOATTYPE yaw, FLOATTYPE outViewShift[3]) const; + virtual void GetViewShift(float yaw, float outViewShift[3]) const; virtual void SetUp() const {}; virtual void TearDown() const {}; }; diff --git a/src/gl/stereo3d/gl_stereo_leftright.cpp b/src/gl/stereo3d/gl_stereo_leftright.cpp index 7b12283d2f..354185792b 100644 --- a/src/gl/stereo3d/gl_stereo_leftright.cpp +++ b/src/gl/stereo3d/gl_stereo_leftright.cpp @@ -47,7 +47,7 @@ namespace s3d { /* virtual */ -VSMatrix ShiftedEyePose::GetProjection(FLOATTYPE fov, FLOATTYPE aspectRatio, FLOATTYPE fovRatio) const +VSMatrix ShiftedEyePose::GetProjection(float fov, float aspectRatio, float fovRatio) const { double zNear = 5.0; double zFar = 65536.0; @@ -71,10 +71,10 @@ VSMatrix ShiftedEyePose::GetProjection(FLOATTYPE fov, FLOATTYPE aspectRatio, FLO /* virtual */ -void ShiftedEyePose::GetViewShift(FLOATTYPE yaw, FLOATTYPE outViewShift[3]) const +void ShiftedEyePose::GetViewShift(float yaw, float outViewShift[3]) const { - FLOATTYPE dx = -cos(DEG2RAD(yaw)) * vr_hunits_per_meter * shift; - FLOATTYPE dy = sin(DEG2RAD(yaw)) * vr_hunits_per_meter * shift; + float dx = -cos(DEG2RAD(yaw)) * vr_hunits_per_meter * shift; + float dy = sin(DEG2RAD(yaw)) * vr_hunits_per_meter * shift; outViewShift[0] = dx; outViewShift[1] = dy; outViewShift[2] = 0; @@ -82,7 +82,7 @@ void ShiftedEyePose::GetViewShift(FLOATTYPE yaw, FLOATTYPE outViewShift[3]) cons /* static */ -const LeftEyeView& LeftEyeView::getInstance(FLOATTYPE ipd) +const LeftEyeView& LeftEyeView::getInstance(float ipd) { static LeftEyeView instance(ipd); instance.setIpd(ipd); @@ -91,7 +91,7 @@ const LeftEyeView& LeftEyeView::getInstance(FLOATTYPE ipd) /* static */ -const RightEyeView& RightEyeView::getInstance(FLOATTYPE ipd) +const RightEyeView& RightEyeView::getInstance(float ipd) { static RightEyeView instance(ipd); instance.setIpd(ipd); diff --git a/src/gl/stereo3d/gl_stereo_leftright.h b/src/gl/stereo3d/gl_stereo_leftright.h index 6bca9de90c..de13a32cb8 100644 --- a/src/gl/stereo3d/gl_stereo_leftright.h +++ b/src/gl/stereo3d/gl_stereo_leftright.h @@ -44,31 +44,31 @@ namespace s3d { class ShiftedEyePose : public EyePose { public: - ShiftedEyePose(FLOATTYPE shift) : shift(shift) {}; - FLOATTYPE getShift() const { return shift; } - void setShift(FLOATTYPE shift) { this->shift = shift; } - virtual VSMatrix GetProjection(FLOATTYPE fov, FLOATTYPE aspectRatio, FLOATTYPE fovRatio) const; - virtual void GetViewShift(FLOATTYPE yaw, FLOATTYPE outViewShift[3]) const; + ShiftedEyePose(float shift) : shift(shift) {}; + float getShift() const { return shift; } + void setShift(float shift) { this->shift = shift; } + virtual VSMatrix GetProjection(float fov, float aspectRatio, float fovRatio) const; + virtual void GetViewShift(float yaw, float outViewShift[3]) const; protected: - FLOATTYPE shift; + float shift; }; class LeftEyePose : public ShiftedEyePose { public: - LeftEyePose(FLOATTYPE ipd) : ShiftedEyePose( FLOATTYPE(-0.5) * ipd) {} - FLOATTYPE getIpd() const { return FLOATTYPE(-2.0)*getShift(); } - void setIpd(FLOATTYPE ipd) { setShift(FLOATTYPE(-0.5)*ipd); } + LeftEyePose(float ipd) : ShiftedEyePose( float(-0.5) * ipd) {} + float getIpd() const { return float(-2.0)*getShift(); } + void setIpd(float ipd) { setShift(float(-0.5)*ipd); } }; class RightEyePose : public ShiftedEyePose { public: - RightEyePose(FLOATTYPE ipd) : ShiftedEyePose(FLOATTYPE(+0.5)*ipd) {} - FLOATTYPE getIpd() const { return FLOATTYPE(+2.0)*shift; } - void setIpd(FLOATTYPE ipd) { setShift(FLOATTYPE(+0.5)*ipd); } + RightEyePose(float ipd) : ShiftedEyePose(float(+0.5)*ipd) {} + float getIpd() const { return float(+2.0)*shift; } + void setIpd(float ipd) { setShift(float(+0.5)*ipd); } }; @@ -78,11 +78,11 @@ public: class LeftEyeView : public Stereo3DMode { public: - static const LeftEyeView& getInstance(FLOATTYPE ipd); + static const LeftEyeView& getInstance(float ipd); - LeftEyeView(FLOATTYPE ipd) : eye(ipd) { eye_ptrs.Push(&eye); } - FLOATTYPE getIpd() const { return eye.getIpd(); } - void setIpd(FLOATTYPE ipd) { eye.setIpd(ipd); } + LeftEyeView(float ipd) : eye(ipd) { eye_ptrs.Push(&eye); } + float getIpd() const { return eye.getIpd(); } + void setIpd(float ipd) { eye.setIpd(ipd); } protected: LeftEyePose eye; }; @@ -91,11 +91,11 @@ protected: class RightEyeView : public Stereo3DMode { public: - static const RightEyeView& getInstance(FLOATTYPE ipd); + static const RightEyeView& getInstance(float ipd); - RightEyeView(FLOATTYPE ipd) : eye(ipd) { eye_ptrs.Push(&eye); } - FLOATTYPE getIpd() const { return eye.getIpd(); } - void setIpd(FLOATTYPE ipd) { eye.setIpd(ipd); } + RightEyeView(float ipd) : eye(ipd) { eye_ptrs.Push(&eye); } + float getIpd() const { return eye.getIpd(); } + void setIpd(float ipd) { eye.setIpd(ipd); } protected: RightEyePose eye; };