crystalspace.jbind.interfaces.iengine.viscul
Interface iVisibilityCuller

All Superinterfaces:
iBase, iPointer
All Known Implementing Classes:
csVisibilityCuller

public interface iVisibilityCuller
extends iBase

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.

Author:
Java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/devapi/structiVisibilityCuller.php

Method Summary
 void castShadows(iFrustumView fview)
          Start casting shadows from a given point in space.
 iVisibilityObjectIterator intersectSegment(csVector3 start, csVector3 end)
          Intersect a segment with all objects in the visibility culler and return them all in an iterator.
 iVisibilityObjectIterator intersectSegment(csVector3 start, csVector3 end, boolean accurate)
          Intersect a segment with all objects in the visibility culler and return them all in an iterator.
 boolean intersectSegment(csVector3 start, csVector3 end, csVector3 isect)
          Intersect a beam using this culler and return the intersection point, the mesh and optional polygon index.
 boolean intersectSegment(csVector3 start, csVector3 end, csVector3 isect, float pr)
          Intersect a beam using this culler and return the intersection point, the mesh and optional polygon index.
 boolean intersectSegment(csVector3 start, csVector3 end, csVector3 isect, float pr, iMeshWrapper p_mesh)
          Intersect a beam using this culler and return the intersection point, the mesh and optional polygon index.
 boolean intersectSegment(csVector3 start, csVector3 end, csVector3 isect, float pr, iMeshWrapper p_mesh, int poly_idx)
          Intersect a beam using this culler and return the intersection point, the mesh and optional polygon index.
 boolean intersectSegment(csVector3 start, csVector3 end, csVector3 isect, float pr, iMeshWrapper p_mesh, int poly_idx, boolean accurate)
          Intersect a beam using this culler and return the intersection point, the mesh and optional polygon index.
 void registerVisObject(iVisibilityObject visobj)
          Register a visibility object with this culler.
 void setup(java.lang.String name)
          Setup all data for this visibility culler.
 void unregisterVisObject(iVisibilityObject visobj)
          Unregister a visibility object with this culler.
 iVisibilityObjectIterator visTest(csBox3 box)
          Mark all objects as visible that intersect with the given bounding box.
 iVisibilityObjectIterator visTest(csPlane3 plane, int num_planes)
          Mark all objects as visible that are in the volume formed by the set of planes.
 void visTest(csPlane3 plane, int num_planes, iVisibilityCullerListener viscallback)
          Notify the visibility callback of all objects that are in the volume formed by the set of planes.
 iVisibilityObjectIterator visTest(csSphere sphere)
          Mark all objects as visible that intersect with the given bounding sphere.
 void visTest(csSphere sphere, iVisibilityCullerListener viscallback)
          Notify the visibility callback of all objects that intersect with the given bounding sphere.
 boolean visTest(iRenderView irview, iVisibilityCullerListener viscallback)
          Do the visibility test from a given viewpoint.
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

castShadows

public void castShadows(iFrustumView fview)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
fview -

intersectSegment

public boolean intersectSegment(csVector3 start,
                                csVector3 end,
                                csVector3 isect)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
start -
end -
isect -
Returns:

intersectSegment

public boolean intersectSegment(csVector3 start,
                                csVector3 end,
                                csVector3 isect,
                                float pr)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
start -
end -
isect -
pr -
Returns:

intersectSegment

public boolean intersectSegment(csVector3 start,
                                csVector3 end,
                                csVector3 isect,
                                float pr,
                                iMeshWrapper p_mesh)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
start -
end -
isect -
pr -
p_mesh -
Returns:

intersectSegment

public boolean intersectSegment(csVector3 start,
                                csVector3 end,
                                csVector3 isect,
                                float pr,
                                iMeshWrapper p_mesh,
                                int poly_idx)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
start -
end -
isect -
pr -
p_mesh -
poly_idx -
Returns:

intersectSegment

public boolean intersectSegment(csVector3 start,
                                csVector3 end,
                                csVector3 isect,
                                float pr,
                                iMeshWrapper p_mesh,
                                int poly_idx,
                                boolean accurate)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
start -
end -
isect -
pr -
p_mesh -
poly_idx -
accurate -
Returns:

intersectSegment

public iVisibilityObjectIterator intersectSegment(csVector3 start,
                                                  csVector3 end)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
start -
end -
Returns:

intersectSegment

public iVisibilityObjectIterator intersectSegment(csVector3 start,
                                                  csVector3 end,
                                                  boolean accurate)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
start -
end -
accurate -
Returns:

registerVisObject

public void registerVisObject(iVisibilityObject visobj)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
visobj -

setup

public void setup(java.lang.String name)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
name -

unregisterVisObject

public void unregisterVisObject(iVisibilityObject visobj)
Unregister a visibility object with this culler. Implemented in csDynaVis, and csFrustumVis.

Parameters:
visobj -

visTest

public void visTest(csPlane3 plane,
                    int num_planes,
                    iVisibilityCullerListener viscallback)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
plane -
num_planes -
viscallback -

visTest

public iVisibilityObjectIterator visTest(csPlane3 plane,
                                         int num_planes)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
plane -
num_planes -
Returns:

visTest

public void visTest(csSphere sphere,
                    iVisibilityCullerListener viscallback)
Notify the visibility callback of all objects that intersect with the given bounding sphere. Implemented in csDynaVis, and csFrustumVis.

Parameters:
sphere -
viscallback -

visTest

public iVisibilityObjectIterator visTest(csSphere sphere)
Mark all objects as visible that intersect with the given bounding sphere. Implemented in csDynaVis, and csFrustumVis.

Parameters:
sphere -
Returns:

visTest

public iVisibilityObjectIterator visTest(csBox3 box)
Mark all objects as visible that intersect with the given bounding box. Implemented in csDynaVis, and csFrustumVis.

Parameters:
box -
Returns:

visTest

public boolean visTest(iRenderView irview,
                       iVisibilityCullerListener viscallback)
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. Implemented in csDynaVis, and csFrustumVis.

Parameters:
irview -
viscallback -
Returns: