24#ifndef _SpVolume_h_Included_
25#define _SpVolume_h_Included_
51 PlaneImpl(
const PlaneImpl &pl2) : m_origin(pl2.m_origin), m_normal(pl2.m_normal), m_dist(pl2.m_dist) { }
54 m_origin = pl2.m_origin; m_normal = pl2.m_normal; m_dist = pl2.m_dist;
62 m_dist = -m_normal.
dotProduct(m_origin.asVector());
66 m_origin.transformBy(xfm);
67 m_normal.transformBy(xfm);
69 m_dist = -m_normal.dotProduct(m_origin.asVector());
73 a = m_normal.x; b = m_normal.y; c = m_normal.z; d = m_dist;
86 if (
source.m_planeValid[npl])
92 double xFov,
double yFov,
bool xFovAsAspect =
false,
bool yFovAsAspect =
false,
93 bool bNearPlane =
false,
double fNearPlane = 0.01,
94 bool bFarPlane =
false,
double fFarPlane = 1.0 );
118 return 2.0 * (len * tan(fov * 0.5));
122 return atan(plane / len * .5) * 2.0;
142 double fLen = viewDistance;
150 eyeVector = ( newtrg - position );
151 fLen = eyeVector.
length();
157 newUpVector.
rotateBy( angleU, rightVector );
159 newRVector.
rotateBy( angleR, upVector );
168 bNearPnane, dNearPlane, bFarPlane, dFarPlane );
193 pt[0] = (pl[0] > 0.0) ? max.x : min.x;
194 pt[1] = (pl[1] > 0.0) ? max.y : min.y;
195 pt[2] = (pl[2] > 0.0) ? max.z : min.z;
196 return pl[0] * pt[0] + pl[1] * pt[1] + pl[2] * pt[2] + pl[3] >= -
tol.equalVector();
202 double xFov,
double yFov,
bool xFovAsAspect,
bool yFovAsAspect,
203 bool bNearPlane,
double fNearPlane,
204 bool bFarPlane,
double fFarPlane )
208 double nearPlane_ =
odmax(fNearPlane, 1.0);
209 double planeWidth = 1., planeHeight = 1.;
215 planeWidth = xFov * planeHeight;
217 planeHeight = planeWidth / yFov;
222 OdGePoint3d nearPlane = origin + basisZ * nearPlane_;
225 nearPlane - deltaX - deltaY,
226 nearPlane + deltaX - deltaY,
227 nearPlane + deltaX + deltaY,
228 nearPlane - deltaX + deltaY
234 if (bNearPlane || bFarPlane)
238 m_plane[4].set(origin + basisZ * fNearPlane, basisZ);
242 m_plane[5].set(origin + basisZ * fFarPlane, -basisZ);
OdGePoint2d center() const
const OdGePoint2d & maxPoint() const
const OdGePoint2d & minPoint() const
const OdGePoint3d & maxPoint() const
const OdGePoint3d & minPoint() const
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
bool isZeroLength(const OdGeTol &tol=OdGeContext::gTol) const
OdGeVector3d normal(const OdGeTol &tol=OdGeContext::gTol) const
OdGeVector3d & rotateBy(double angle, const OdGeVector3d &axis)
double dotProduct(const OdGeVector3d &vect) const
OdGeVector3d crossProduct(const OdGeVector3d &vect) const
static GE_STATIC_EXPORT const OdGeVector3d kYAxis
OdGeVector3d & normalize(const OdGeTol &tol=OdGeContext::gTol)
static GE_STATIC_EXPORT const OdGeVector3d kXAxis
void set(const OdGePoint3d &origin, const OdGeVector3d &normal)
PlaneImpl & operator=(const PlaneImpl &pl2)
void transformBy(const OdGeMatrix3d &xfm)
void getCoefficients(double &a, double &b, double &c, double &d) const
PlaneImpl(const PlaneImpl &pl2)
virtual bool contains(const OdGeExtents3d &extents, bool planar=false, const OdGeTol &tol=OdGeContext::gTol) const
static double fovToPlane(double fov, double len)
virtual OdSiShape * clone() const
static double fovFromPlane(double plane, double len)
Volume(const Volume &source)
virtual bool intersects(const OdGeExtents3d &extents, bool planar=false, const OdGeTol &tol=OdGeContext::gTol) const
static Volume buildPyramidInEyeCS(const OdGeExtents2d &baseProjecton, double viewDistance, bool bNearPnane=true, double dNearPlane=0., bool bFarPlane=false, double dFarPlane=0.)
virtual void transform(const OdGeMatrix3d &mtx)
static bool aabbInsidePlane(const OdGePoint3d &min, const OdGePoint3d &max, const PlaneImpl &plane, const OdGeTol &tol)
static bool planeFromTri(const OdGePoint3d &A, const OdGePoint3d &B, const OdGePoint3d &C, PlaneImpl &pl)
GLsizei GLsizei GLchar * source
static GE_STATIC_EXPORT OdGeTol gTol