14 ViewVolume(isPerspective, isDepthRangeZeroOne),
15 mPreViewMatrix(
Matrix4x4<float>::Identity()),
16 mPostProjectionMatrix(
Matrix4x4<float>::Identity()),
17 mPreViewIsIdentity(true),
18 mPostProjectionIsIdentity(true)
25 LogAssert(nearExtrude > 0.0
f,
"Invalid nearExtrude.");
26 LogAssert(farExtrude > nearExtrude,
"Invalid farExtrude.");
45 #if defined(GTE_USE_MAT_VEC) 65 float n0 = 2.0f * a[0];
66 float n1 = 2.0f * a[1];
67 float n2 = 2.0f * a[2];
68 float d0 = +a[0] - a[1] - a[2] + 1.0f;
69 float d1 = -a[0] + a[1] - a[2] + 1.0f;
70 float d2 = -a[0] - a[1] + a[2] + 1.0f;
71 float d3 = +a[0] + a[1] + a[2] - 1.0f;
75 float n2divn0 = n2 / n0;
76 float n2divn1 = n2 / n1;
78 #if defined(GTE_USE_MAT_VEC) 79 project(0,0) = n2divn0 * (2.0f * d3 + d0);
80 project(0,1) = n2divn1 * d1;
83 project(1,0) = n2divn0 * d0;
84 project(1,1) = n2divn1 * (2.0f * d3 + d1);
91 project(3,0) = -n2divn0 * d0;
92 project(3,1) = -n2divn1 * d1;
101 project(0,0) = n2divn0 * (2.0f * d3 + d0);
102 project(1,0) = n2divn1 * d1;
105 project(0,1) = n2divn0 * d0;
106 project(1,1) = n2divn1 * (2.0f * d3 + d1);
113 project(0,3) = -n2divn0 * d0;
114 project(1,3) = -n2divn1 * d1;
142 if (viewX <= x && x <= viewX + viewW && viewY <= y && y <= viewY + viewH)
145 float r = ((float)(x - viewX)) / (
float)viewW;
146 float u = ((float)(y - viewY)) / (
float)viewH;
178 #if defined(GTE_USE_MAT_VEC)
virtual void UpdatePVMatrix()
void SetPreViewMatrix(Matrix4x4< float > const &preViewMatrix)
Vector4< float > const & GetRVector() const
Camera(bool isPerspective, bool isDepthRangeZeroOne)
#define LogAssert(condition, message)
void SetProjectionMatrix(Matrix4x4< float > const &projMatrix)
void SetParallaxProjectionMatrix(Vector4< float > const &p00, Vector4< float > const &p10, Vector4< float > const &p11, Vector4< float > const &p01, float nearExtrude, float farExtrude)
void SetPostProjectionMatrix(Matrix4x4< float > const &postProjMatrix)
GLboolean GLboolean GLboolean GLboolean a
bool IsPerspective() const
Vector4< float > const & GetPosition() const
Matrix4x4< float > mPostProjectionMatrix
Matrix4x4< float > mProjectionViewMatrix
void SetCol(int c, Vector< NumRows, Real > const &vec)
Real Normalize(GVector< Real > &v, bool robust=false)
virtual void UpdatePVMatrix()
Vector4< float > const & GetUVector() const
Vector4< float > const & GetDVector() const
void SetRow(int r, Vector< NumCols, Real > const &vec)
bool GetPickLine(int viewX, int viewY, int viewW, int viewH, int x, int y, Vector4< float > &origin, Vector4< float > &direction) const
Quaternion< Real > Inverse(Quaternion< Real > const &d)
Matrix4x4< float > mPreViewMatrix
bool mPostProjectionIsIdentity