CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

iVisibilityCuller Struct Reference
[Visibility]

This interface represents a visibility culling system. More...

#include <viscull.h>

Inheritance diagram for iVisibilityCuller:

iBase List of all members.

Public Methods

virtual void Setup (const char *name)=0
 Setup all data for this visibility culler. More...

virtual void RegisterVisObject (iVisibilityObject *visobj)=0
 Register a visibility object with this culler. More...

virtual void UnregisterVisObject (iVisibilityObject *visobj)=0
 Unregister a visibility object with this culler. More...

virtual bool VisTest (iRenderView *irview)=0
 Do the visibility test from a given viewpoint. More...

virtual csPtr< iVisibilityObjectIteratorVisTest (const csBox3 &box)=0
 Mark all objects as visible that intersect with the given bounding box. More...

virtual csPtr< iVisibilityObjectIteratorVisTest (const csSphere &sphere)=0
 Mark all objects as visible that intersect with the given bounding sphere. More...

virtual csPtr< iVisibilityObjectIteratorVisTest (csPlane3 *plane, int num_planes)=0
 Mark all objects as visible that are in the volume formed by the set of planes. More...

virtual csPtr< iVisibilityObjectIteratorIntersectSegment (const csVector3 &start, const csVector3 &end, bool accurate=false)=0
 Intersect a segment with all objects in the visibility culler and return them all in an iterator. More...

virtual bool IntersectSegment (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr=NULL, iMeshWrapper **p_mesh=NULL, iPolygon3D **poly=NULL, bool accurate=false)=0
 Intersect a beam using this culler and return the intersection point, the mesh and optional polygon. More...

virtual void CastShadows (iFrustumView *fview)=0
 Start casting shadows from a given point in space. More...

virtual uint32 GetCurrentVisibilityNumber () const=0
 Get the current visibility number. More...


Detailed Description

This interface represents a visibility culling system.

To use it you first register visibility objects (which are all the objects for which you want to test visibility) to this culler. A visibility culler can usually also support shadow calculation.

Definition at line 73 of file viscull.h.


Member Function Documentation

virtual void iVisibilityCuller::CastShadows iFrustumView   fview [pure virtual]
 

Start casting shadows from a given point in space.

What this will do is traverse all objects registered to the visibility culler. If some object implements iShadowCaster then this function will use the shadows casted by that object and put them in the frustum view. This function will then also call the object function which is assigned to iFrustumView. That object function will (for example) call iShadowReceiver->CastShadows() to cast the collected shadows on the shadow receiver.

virtual uint32 iVisibilityCuller::GetCurrentVisibilityNumber   const [pure virtual]
 

Get the current visibility number.

You can compare this number to the visibility number as returned by iVisibilityObject->GetVisibilityNumber(). If equal then the object was visible.

virtual bool iVisibilityCuller::IntersectSegment const csVector3   start,
const csVector3   end,
csVector3   isect,
float *    pr = NULL,
iMeshWrapper **    p_mesh = NULL,
iPolygon3D **    poly = NULL,
bool    accurate = false
[pure virtual]
 

Intersect a beam using this culler and return the intersection point, the mesh and optional polygon.

If the returned mesh is NULL then this means that the object belonging to the culler itself was hit. This function will also detect hits with non-thing objects. In that case the returned polygon will always be NULL. If accurate is true then a more accurate (and slower) method is used.

virtual csPtr<iVisibilityObjectIterator> iVisibilityCuller::IntersectSegment const csVector3   start,
const csVector3   end,
bool    accurate = false
[pure virtual]
 

Intersect a segment with all objects in the visibility culler and return them all in an iterator.

If accurate is true then a more accurate (and slower) method is used.

virtual void iVisibilityCuller::RegisterVisObject iVisibilityObject   visobj [pure virtual]
 

Register a visibility object with this culler.

If this visibility object also supports iShadowCaster and this visibility culler supports shadow casting then it will automatically get registered as a shadow caster as well. Same for iShadowReceiver.

virtual void iVisibilityCuller::Setup const char *    name [pure virtual]
 

Setup all data for this visibility culler.

This needs to be called before the culler is used for the first time. The given name will be used to cache the data.

virtual void iVisibilityCuller::UnregisterVisObject iVisibilityObject   visobj [pure virtual]
 

Unregister a visibility object with this culler.

virtual csPtr<iVisibilityObjectIterator> iVisibilityCuller::VisTest csPlane3   plane,
int    num_planes
[pure virtual]
 

Mark all objects as visible that are in the volume formed by the set of planes.

Can be used for frustum intersection, box intersection, .... Warning! This function can only use up to 32 planes.

virtual csPtr<iVisibilityObjectIterator> iVisibilityCuller::VisTest const csSphere   sphere [pure virtual]
 

Mark all objects as visible that intersect with the given bounding sphere.

virtual csPtr<iVisibilityObjectIterator> iVisibilityCuller::VisTest const csBox3   box [pure virtual]
 

Mark all objects as visible that intersect with the given bounding box.

virtual bool iVisibilityCuller::VisTest iRenderView   irview [pure virtual]
 

Do the visibility test from a given viewpoint.

This will first clear the visible flag on all registered objects and then it will mark all visible objects. If this function returns false then all objects are visible.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14