29 #include "mathutils.h"
104 m_horizontalAperture(112.0),
105 m_verticalAperture(94.0),
106 m_halfImageWidth(0.0),
107 m_halfImageHeight(0.0),
108 m_inverseEyeMatrix(),
113 m_halfImageWidth = 1.0 * tan(deg2rad(m_horizontalAperture / 2.0));
114 m_halfImageHeight = 1.0 * tan(deg2rad(m_verticalAperture / 2.0));
126 m_inverseEyeMatrix = eye.
inverse();
135 void set3DPointWorld(
const wVector &point)
137 set3DPointEye(m_inverseEyeMatrix.transformVector(point));
146 void set3DPointEye(
const wVector &point)
155 m_imagePoint.x = -point.y / point.z;
156 m_imagePoint.y = -point.x / point.z;
159 m_imagePoint.valid =
true;
161 m_imagePoint.valid =
false;
187 ImagePoint p((m_imagePoint.x + m_halfImageWidth) / (2.0 * m_halfImageWidth), (m_imagePoint.y + m_halfImageHeight) / (2.0 * m_halfImageHeight));
196 bool pointInsideImage()
const
198 return (m_imagePoint.x <= m_halfImageWidth) && (m_imagePoint.x >= -m_halfImageWidth) &&
199 (m_imagePoint.y <= m_halfImageHeight) && (m_imagePoint.y >= -m_halfImageHeight)
200 && m_imagePoint.
valid;
207 double m_horizontalAperture;
212 double m_verticalAperture;
221 double m_halfImageWidth;
230 double m_halfImageHeight;