Graphic3d_CullingTool class provides a possibility to store parameters of view volume, such as its vertices and equations, and contains methods detecting if given AABB overlaps view volume.
More...
#include <Graphic3d_CullingTool.hxx>
|
| | Graphic3d_CullingTool () |
| | Creates an empty selector object with parallel projection type by default.
|
| |
| void | SetViewVolume (const occ::handle< Graphic3d_Camera > &theCamera, const NCollection_Mat4< double > &theModelWorld=NCollection_Mat4< double >()) |
| | Retrieves view volume's planes equations and its vertices from projection and world-view matrices.
|
| |
| void | SetViewportSize (int theViewportWidth, int theViewportHeight, double theResolutionRatio) |
| |
| void | SetCullingDistance (CullingContext &theCtx, double theDistance) const |
| | Setup distance culling.
|
| |
| void | SetCullingSize (CullingContext &theCtx, double theSize) const |
| | Setup size culling.
|
| |
| void | CacheClipPtsProjections () |
| | Caches view volume's vertices projections along its normals and AABBs dimensions. Must be called at the beginning of each BVH tree traverse loop.
|
| |
| bool | IsCulled (const CullingContext &theCtx, const NCollection_Vec3< double > &theMinPnt, const NCollection_Vec3< double > &theMaxPnt, bool *theIsInside=nullptr) const |
| | Checks whether given AABB should be entirely culled or not.
|
| |
| const occ::handle< Graphic3d_Camera > & | Camera () const |
| | Return the camera definition.
|
| |
| const NCollection_Mat4< double > & | ProjectionMatrix () const |
| | Returns current projection matrix.
|
| |
| const NCollection_Mat4< double > & | WorldViewMatrix () const |
| | Returns current world view transformation matrix.
|
| |
| int | ViewportWidth () const |
| |
| int | ViewportHeight () const |
| |
| const Graphic3d_WorldViewProjState & | WorldViewProjState () const |
| | Returns state of current world view projection transformation matrices.
|
| |
| const NCollection_Vec3< double > & | CameraEye () const |
| | Returns camera eye position.
|
| |
| const NCollection_Vec3< double > & | CameraDirection () const |
| | Returns camera direction.
|
| |
| double | SignedPlanePointDistance (const NCollection_Vec4< double > &theNormal, const NCollection_Vec4< double > &thePnt) |
| | Calculates signed distance from plane to point.
|
| |
| bool | IsOutFrustum (const NCollection_Vec3< double > &theMinPnt, const NCollection_Vec3< double > &theMaxPnt, bool *theIsInside=nullptr) const |
| | Detects if AABB overlaps view volume using separating axis theorem (SAT).
|
| |
| bool | IsTooDistant (const CullingContext &theCtx, const NCollection_Vec3< double > &theMinPnt, const NCollection_Vec3< double > &theMaxPnt, bool *theIsInside=nullptr) const |
| | Returns TRUE if given AABB should be discarded by distance culling criterion.
|
| |
| bool | IsTooSmall (const CullingContext &theCtx, const NCollection_Vec3< double > &theMinPnt, const NCollection_Vec3< double > &theMaxPnt) const |
| | Returns TRUE if given AABB should be discarded by size culling criterion.
|
| |
Graphic3d_CullingTool class provides a possibility to store parameters of view volume, such as its vertices and equations, and contains methods detecting if given AABB overlaps view volume.
◆ anonymous enum
Enumerates planes of view volume.
| Enumerator |
|---|
| Plane_Left | |
| Plane_Right | |
| Plane_Bottom | |
| Plane_Top | |
| Plane_Near | |
| Plane_Far | |
| PlanesNB | |
◆ Graphic3d_CullingTool()
| Graphic3d_CullingTool::Graphic3d_CullingTool |
( |
| ) |
|
Creates an empty selector object with parallel projection type by default.
◆ CacheClipPtsProjections()
| void Graphic3d_CullingTool::CacheClipPtsProjections |
( |
| ) |
|
Caches view volume's vertices projections along its normals and AABBs dimensions. Must be called at the beginning of each BVH tree traverse loop.
◆ Camera()
Return the camera definition.
◆ CameraDirection()
Returns camera direction.
◆ CameraEye()
Returns camera eye position.
◆ IsCulled()
Checks whether given AABB should be entirely culled or not.
- Parameters
-
| [in] | theCtx | culling properties |
| [in] | theMinPnt | maximum point of AABB |
| [in] | theMaxPnt | minimum point of AABB |
| [out] | theIsInside | flag indicating if AABB is fully inside; initial value should be set to TRUE |
- Returns
- TRUE if AABB is completely outside of view frustum or culled by size/distance; FALSE in case of partial or complete overlap (use theIsInside to distinguish)
◆ IsOutFrustum()
Detects if AABB overlaps view volume using separating axis theorem (SAT).
- Parameters
-
| [in] | theMinPnt | maximum point of AABB |
| [in] | theMaxPnt | minimum point of AABB |
| [out] | theIsInside | flag indicating if AABB is fully inside; initial value should be set to TRUE |
- Returns
- TRUE if AABB is completely outside of view frustum; FALSE in case of partial or complete overlap (use theIsInside to distinguish)
- See also
- SelectMgr_Frustum::hasOverlap()
◆ IsTooDistant()
Returns TRUE if given AABB should be discarded by distance culling criterion.
- Parameters
-
| [in] | theMinPnt | maximum point of AABB |
| [in] | theMaxPnt | minimum point of AABB |
| [out] | theIsInside | flag indicating if AABB is fully inside; initial value should be set to TRUE |
- Returns
- TRUE if AABB is completely behind culling distance; FALSE in case of partial or complete overlap (use theIsInside to distinguish)
◆ IsTooSmall()
Returns TRUE if given AABB should be discarded by size culling criterion.
◆ ProjectionMatrix()
Returns current projection matrix.
◆ SetCullingDistance()
◆ SetCullingSize()
◆ SetViewportSize()
| void Graphic3d_CullingTool::SetViewportSize |
( |
int | theViewportWidth, |
|
|
int | theViewportHeight, |
|
|
double | theResolutionRatio ) |
◆ SetViewVolume()
Retrieves view volume's planes equations and its vertices from projection and world-view matrices.
- Parameters
-
| [in] | theCamera | camera definition |
| [in] | theModelWorld | optional object transformation for computing frustum in object local coordinate system |
◆ SignedPlanePointDistance()
Calculates signed distance from plane to point.
- Parameters
-
| [in] | theNormal | the plane's normal. |
| [in] | thePnt | |
◆ ViewportHeight()
| int Graphic3d_CullingTool::ViewportHeight |
( |
| ) |
const |
|
inline |
◆ ViewportWidth()
| int Graphic3d_CullingTool::ViewportWidth |
( |
| ) |
const |
|
inline |
◆ WorldViewMatrix()
Returns current world view transformation matrix.
◆ WorldViewProjState()
Returns state of current world view projection transformation matrices.
◆ myCamDir
camera direction for size culling
◆ myCamera
◆ myCamEye
camera eye position for distance culling
◆ myCamScale
| double Graphic3d_CullingTool::myCamScale |
|
protected |
camera scale for size culling
◆ myClipPlanes
◆ myClipVerts
◆ myIsProjectionParallel
| bool Graphic3d_CullingTool::myIsProjectionParallel |
|
protected |
◆ myMaxClipProjectionPts
Max view volume's vertices projections onto its normals.
◆ myMaxOrthoProjectionPts
| double Graphic3d_CullingTool::myMaxOrthoProjectionPts[3] |
|
protected |
Max view volume's vertices projections onto normalized dimensions of AABB.
◆ myMinClipProjectionPts
Min view volume's vertices projections onto its normals.
◆ myMinOrthoProjectionPts
| double Graphic3d_CullingTool::myMinOrthoProjectionPts[3] |
|
protected |
Min view volume's vertices projections onto normalized dimensions of AABB.
◆ myPixelSize
| double Graphic3d_CullingTool::myPixelSize |
|
protected |
pixel size for size culling
◆ myProjectionMat
◆ myViewportHeight
| int Graphic3d_CullingTool::myViewportHeight |
|
protected |
◆ myViewportWidth
| int Graphic3d_CullingTool::myViewportWidth |
|
protected |
◆ myWorldViewMat
◆ myWorldViewProjState
State of world view projection matrices.
The documentation for this class was generated from the following file: