My Project
|
Specialized frustum shaped culling volume that has culling planes created from portals This isn't really a traditional "frustum", but more a collection of extra culling planes used by the Scene Manager for supplementing the camera culling by creating extra culling planes from visible portals. More...
#include <PortalFrustum.h>
Public Types | |
enum | Visibility { NONE, PARTIAL, FULL } |
Public Member Functions | |
void | setOrigin (const Vector3 &newOrigin) |
bool | isVisible (const CShapeAABB &bound) const |
bool | CanSeeObject (IViewClippingObject *pViewClippingObject) const |
bool | CanSeeObject_PortalOnly (IViewClippingObject *pViewClippingObject) const |
same as above, except that it will only test again portal planes and pass all camera frustum automatically. More... | |
bool | CanSeeObject_CompleteCull (IViewClippingObject *pViewClippingObject, int nFullCullIndex=-1) const |
this will test agains a special frustum used by GetObjectsByScreenRect. More... | |
bool | isVisible (const CShapeSphere &bound) const |
bool | isVisible (CPortalNode *portal, bool bIgnorePortalDirection=true) |
Visibility | getVisibility (const CShapeAABB &bound) |
int | AddPortalCullingPlanes (CPortalNode *portal, bool bAutoDirection=true) |
bool | AddCullingPlane (const Plane &plane, bool bAddToFront=true) |
add a standard culling plane More... | |
int | AddFrustum (CShapeFrustum *frustum, float fNearPlaneShiftDistance=0.f) |
add 6 planes from a standard camera frustum. More... | |
void | RemovePortalCullingPlanes (CPortalNode *portal) |
void | RemoveAllExtraCullingPlanes (void) |
PCPlane * | getUnusedCullingPlane (void) |
Specialized frustum shaped culling volume that has culling planes created from portals This isn't really a traditional "frustum", but more a collection of extra culling planes used by the Scene Manager for supplementing the camera culling by creating extra culling planes from visible portals.
Since portals are 4 sided, the extra culling planes tend to form frustums (pyramids) but nothing in the code really assumes that the culling planes are frustums. They are just treated as planes.
bool ParaEngine::CPortalFrustum::AddCullingPlane | ( | const Plane & | plane, |
bool | bAddToFront = true |
||
) |
add a standard culling plane
bAddToFront | whether add to front of the queue. the front culling planes will be tested first. |
int ParaEngine::CPortalFrustum::AddFrustum | ( | CShapeFrustum * | frustum, |
float | fNearPlaneShiftDistance = 0.f |
||
) |
add 6 planes from a standard camera frustum.
planes from the frustum will not be used during object culling. However, it will prevent redundant portal culling planes from being added.
fNearPlaneShiftDistance | the near plane to be shifted when added |
bool ParaEngine::CPortalFrustum::CanSeeObject_CompleteCull | ( | IViewClippingObject * | pViewClippingObject, |
int | nFullCullIndex = -1 |
||
) | const |
this will test agains a special frustum used by GetObjectsByScreenRect.
It is similar to CanSeeObject, except that all culling planes after the nIndex is tested with full culling. For example, we can test if all objects are completely in front of a given set of planes. In GetObjectsByScreenRect(), the near and far planes are inserted last, so that objects must be completely inside the near and far plane in order to pass the test.
nFullCullIndex | if -1, objects must be completely inside the culling planes |
bool ParaEngine::CPortalFrustum::CanSeeObject_PortalOnly | ( | IViewClippingObject * | pViewClippingObject | ) | const |
same as above, except that it will only test again portal planes and pass all camera frustum automatically.
this is used when you already know that the object is inside the camera frustum.