CrystalSpace

Public API Reference

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

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.

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

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

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

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

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

virtual void VisTest (const csSphere &sphere, iVisibilityCullerListener *viscallback)=0
 Notify the visibility callback of all objects that intersect with the given bounding sphere.

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.

virtual void VisTest (csPlane3 *plane, int num_planes, iVisibilityCullerListener *viscallback)=0
 Notify the visibility callback of all objects that are in the volume formed by the set of planes.

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.

virtual bool IntersectSegment (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr=0, iMeshWrapper **p_mesh=0, int *poly_idx=0, bool accurate=true)=0
 Intersect a beam using this culler and return the intersection point, the mesh and optional polygon index.

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


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.

Main creators of instances implementing this interface:

Main ways to get pointers to this interface: Main users of this interface:

Definition at line 105 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 bool iVisibilityCuller::IntersectSegment const csVector3   start,
const csVector3   end,
csVector3   isect,
float *    pr = 0,
iMeshWrapper **    p_mesh = 0,
int *    poly_idx = 0,
bool    accurate = true
[pure virtual]
 

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

If the returned mesh is 0 then this means that the object belonging to the culler itself was hit. Some meshes don't support returning polygon indices in which case that field will always be -1. If accurate is false then a less accurate (and faster) method is used. In that case the polygon index will never be filled.

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 void iVisibilityCuller::VisTest csPlane3   plane,
int    num_planes,
iVisibilityCullerListener   viscallback
[pure virtual]
 

Notify the visibility callback of all objects that are in the volume formed by the set of planes.

Can be used for frustum intersection, box intersection, ....

Remarks:
Warning! This function can only use up to 32 planes.

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 void iVisibilityCuller::VisTest const csSphere   sphere,
iVisibilityCullerListener   viscallback
[pure virtual]
 

Notify the visibility callback of all objects that intersect with the given bounding sphere.

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,
iVisibilityCullerListener   viscallback
[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.18