mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +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 */
|
||||
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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {};
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue