mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- replace FLOATTYPE with float in stereo3d code.
This commit is contained in:
parent
090d13b915
commit
ee9a40f5e9
5 changed files with 33 additions and 33 deletions
|
@ -46,7 +46,7 @@ MaskAnaglyph::MaskAnaglyph(const ColorMask& leftColorMask, double ipdMeters)
|
||||||
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
const GreenMagenta& GreenMagenta::getInstance(FLOATTYPE ipd)
|
const GreenMagenta& GreenMagenta::getInstance(float ipd)
|
||||||
{
|
{
|
||||||
static GreenMagenta instance(ipd);
|
static GreenMagenta instance(ipd);
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -54,7 +54,7 @@ const GreenMagenta& GreenMagenta::getInstance(FLOATTYPE ipd)
|
||||||
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
const RedCyan& RedCyan::getInstance(FLOATTYPE ipd)
|
const RedCyan& RedCyan::getInstance(float ipd)
|
||||||
{
|
{
|
||||||
static RedCyan instance(ipd);
|
static RedCyan instance(ipd);
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -62,7 +62,7 @@ const RedCyan& RedCyan::getInstance(FLOATTYPE ipd)
|
||||||
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
const AmberBlue& AmberBlue::getInstance(FLOATTYPE ipd)
|
const AmberBlue& AmberBlue::getInstance(float ipd)
|
||||||
{
|
{
|
||||||
static AmberBlue instance(ipd);
|
static AmberBlue instance(ipd);
|
||||||
return instance;
|
return instance;
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace s3d {
|
||||||
|
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
VSMatrix EyePose::GetProjection(FLOATTYPE fov, FLOATTYPE aspectRatio, FLOATTYPE fovRatio) const
|
VSMatrix EyePose::GetProjection(float fov, float aspectRatio, float fovRatio) const
|
||||||
{
|
{
|
||||||
VSMatrix result;
|
VSMatrix result;
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ Viewport EyePose::GetViewport(const Viewport& fullViewport) const
|
||||||
|
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
void EyePose::GetViewShift(FLOATTYPE yaw, FLOATTYPE outViewShift[3]) const
|
void EyePose::GetViewShift(float yaw, float outViewShift[3]) const
|
||||||
{
|
{
|
||||||
// pass-through for Mono view
|
// pass-through for Mono view
|
||||||
outViewShift[0] = 0;
|
outViewShift[0] = 0;
|
||||||
|
|
|
@ -60,9 +60,9 @@ class EyePose
|
||||||
public:
|
public:
|
||||||
EyePose() {}
|
EyePose() {}
|
||||||
virtual ~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 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 SetUp() const {};
|
||||||
virtual void TearDown() const {};
|
virtual void TearDown() const {};
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace s3d {
|
||||||
|
|
||||||
|
|
||||||
/* virtual */
|
/* 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 zNear = 5.0;
|
||||||
double zFar = 65536.0;
|
double zFar = 65536.0;
|
||||||
|
@ -71,10 +71,10 @@ VSMatrix ShiftedEyePose::GetProjection(FLOATTYPE fov, FLOATTYPE aspectRatio, FLO
|
||||||
|
|
||||||
|
|
||||||
/* virtual */
|
/* 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;
|
float dx = -cos(DEG2RAD(yaw)) * vr_hunits_per_meter * shift;
|
||||||
FLOATTYPE dy = sin(DEG2RAD(yaw)) * vr_hunits_per_meter * shift;
|
float dy = sin(DEG2RAD(yaw)) * vr_hunits_per_meter * shift;
|
||||||
outViewShift[0] = dx;
|
outViewShift[0] = dx;
|
||||||
outViewShift[1] = dy;
|
outViewShift[1] = dy;
|
||||||
outViewShift[2] = 0;
|
outViewShift[2] = 0;
|
||||||
|
@ -82,7 +82,7 @@ void ShiftedEyePose::GetViewShift(FLOATTYPE yaw, FLOATTYPE outViewShift[3]) cons
|
||||||
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
const LeftEyeView& LeftEyeView::getInstance(FLOATTYPE ipd)
|
const LeftEyeView& LeftEyeView::getInstance(float ipd)
|
||||||
{
|
{
|
||||||
static LeftEyeView instance(ipd);
|
static LeftEyeView instance(ipd);
|
||||||
instance.setIpd(ipd);
|
instance.setIpd(ipd);
|
||||||
|
@ -91,7 +91,7 @@ const LeftEyeView& LeftEyeView::getInstance(FLOATTYPE ipd)
|
||||||
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
const RightEyeView& RightEyeView::getInstance(FLOATTYPE ipd)
|
const RightEyeView& RightEyeView::getInstance(float ipd)
|
||||||
{
|
{
|
||||||
static RightEyeView instance(ipd);
|
static RightEyeView instance(ipd);
|
||||||
instance.setIpd(ipd);
|
instance.setIpd(ipd);
|
||||||
|
|
|
@ -44,31 +44,31 @@ namespace s3d {
|
||||||
class ShiftedEyePose : public EyePose
|
class ShiftedEyePose : public EyePose
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ShiftedEyePose(FLOATTYPE shift) : shift(shift) {};
|
ShiftedEyePose(float shift) : shift(shift) {};
|
||||||
FLOATTYPE getShift() const { return shift; }
|
float getShift() const { return shift; }
|
||||||
void setShift(FLOATTYPE shift) { this->shift = shift; }
|
void setShift(float shift) { this->shift = shift; }
|
||||||
virtual VSMatrix GetProjection(FLOATTYPE fov, FLOATTYPE aspectRatio, FLOATTYPE fovRatio) const;
|
virtual VSMatrix GetProjection(float fov, float aspectRatio, float fovRatio) const;
|
||||||
virtual void GetViewShift(FLOATTYPE yaw, FLOATTYPE outViewShift[3]) const;
|
virtual void GetViewShift(float yaw, float outViewShift[3]) const;
|
||||||
protected:
|
protected:
|
||||||
FLOATTYPE shift;
|
float shift;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class LeftEyePose : public ShiftedEyePose
|
class LeftEyePose : public ShiftedEyePose
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LeftEyePose(FLOATTYPE ipd) : ShiftedEyePose( FLOATTYPE(-0.5) * ipd) {}
|
LeftEyePose(float ipd) : ShiftedEyePose( float(-0.5) * ipd) {}
|
||||||
FLOATTYPE getIpd() const { return FLOATTYPE(-2.0)*getShift(); }
|
float getIpd() const { return float(-2.0)*getShift(); }
|
||||||
void setIpd(FLOATTYPE ipd) { setShift(FLOATTYPE(-0.5)*ipd); }
|
void setIpd(float ipd) { setShift(float(-0.5)*ipd); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class RightEyePose : public ShiftedEyePose
|
class RightEyePose : public ShiftedEyePose
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RightEyePose(FLOATTYPE ipd) : ShiftedEyePose(FLOATTYPE(+0.5)*ipd) {}
|
RightEyePose(float ipd) : ShiftedEyePose(float(+0.5)*ipd) {}
|
||||||
FLOATTYPE getIpd() const { return FLOATTYPE(+2.0)*shift; }
|
float getIpd() const { return float(+2.0)*shift; }
|
||||||
void setIpd(FLOATTYPE ipd) { setShift(FLOATTYPE(+0.5)*ipd); }
|
void setIpd(float ipd) { setShift(float(+0.5)*ipd); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,11 +78,11 @@ public:
|
||||||
class LeftEyeView : public Stereo3DMode
|
class LeftEyeView : public Stereo3DMode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const LeftEyeView& getInstance(FLOATTYPE ipd);
|
static const LeftEyeView& getInstance(float ipd);
|
||||||
|
|
||||||
LeftEyeView(FLOATTYPE ipd) : eye(ipd) { eye_ptrs.Push(&eye); }
|
LeftEyeView(float ipd) : eye(ipd) { eye_ptrs.Push(&eye); }
|
||||||
FLOATTYPE getIpd() const { return eye.getIpd(); }
|
float getIpd() const { return eye.getIpd(); }
|
||||||
void setIpd(FLOATTYPE ipd) { eye.setIpd(ipd); }
|
void setIpd(float ipd) { eye.setIpd(ipd); }
|
||||||
protected:
|
protected:
|
||||||
LeftEyePose eye;
|
LeftEyePose eye;
|
||||||
};
|
};
|
||||||
|
@ -91,11 +91,11 @@ protected:
|
||||||
class RightEyeView : public Stereo3DMode
|
class RightEyeView : public Stereo3DMode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const RightEyeView& getInstance(FLOATTYPE ipd);
|
static const RightEyeView& getInstance(float ipd);
|
||||||
|
|
||||||
RightEyeView(FLOATTYPE ipd) : eye(ipd) { eye_ptrs.Push(&eye); }
|
RightEyeView(float ipd) : eye(ipd) { eye_ptrs.Push(&eye); }
|
||||||
FLOATTYPE getIpd() const { return eye.getIpd(); }
|
float getIpd() const { return eye.getIpd(); }
|
||||||
void setIpd(FLOATTYPE ipd) { eye.setIpd(ipd); }
|
void setIpd(float ipd) { eye.setIpd(ipd); }
|
||||||
protected:
|
protected:
|
||||||
RightEyePose eye;
|
RightEyePose eye;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue