crystalspace.jbind.impl.engine.sector
Class csSector

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.engine.sector.csSector
All Implemented Interfaces:
iBase, iPointer, iSector

public class csSector
extends csBase
implements iSector

Author:
qan To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csSector(iPointer nPointer)
           
 
Method Summary
 void calculateSectorBBox(csBox3 bbox, boolean do_meshes)
          Calculate the bounding box of all objects in this sector.
 void checkFrustum(iFrustumView lview)
          Used for portal traversal.
 void decRecLevel()
          Remove one draw recursion level.
 void disableFog()
          Disable fog in this sector.
 void draw(iRenderView rview)
          Draw the sector with the given render view.
 iSector followSegment(csReversibleTransform t, csVector3 new_position, boolean mirror)
          Follow a segment starting at this sector.
 iSector followSegment(csReversibleTransform t, csVector3 new_position, boolean mirror, boolean only_portals)
          Follow a segment starting at this sector.
 csColor getDynamicAmbientLight()
          Get the last set dynamic ambient light for this sector.
 csFog getFog()
          Return the fog structure (even if fog is disabled);.
static java.lang.Class getInterfaceClass()
           
static java.lang.String getInterfaceName()
           
static int getInterfaceVersion()
           
 iLightList getLights()
          Get the list of static and pseudo-dynamic lights in this sector.
 iMeshList getMeshes()
          Get the list of meshes in this sector.
 java.lang.String getName()
          Return the name of the interface
 csSet_iMeshWrapper getPortalMeshes()
          Get the set of meshes containing portals that leave from this sector.
 int getRecLevel()
          Get the current draw recursion level.
 iSectorCallback getSectorCallback(int idx)
          Get the specified sector callback.
 int getSectorCallbackCount()
          Get the number of sector callbacks.
 int getVersion()
          Return the version of the interface
 iVisibilityCuller getVisibilityCuller()
          Get the visibility culler that is used for this sector.
 csRenderMeshList getVisibleMeshes(iRenderView rview)
          Get a set of visible meshes for given camera.
 boolean hasFog()
          Has this sector fog?
 iMeshWrapper hitBeam(csVector3 start, csVector3 end, csVector3 intersect, int polygon_idx)
          Follow a beam from start to end and return the first object that is hit.
 iMeshWrapper hitBeam(csVector3 start, csVector3 end, csVector3 intersect, int polygon_idx, boolean accurate)
          Follow a beam from start to end and return the first object that is hit.
 iMeshWrapper hitBeamPortals(csVector3 start, csVector3 end, csVector3 isect, int polygon_idx)
          Follow a beam from start to end and return the first polygon that is hit.
 void incRecLevel()
          Add one draw recursion level.
static void initSCF()
           
protected  boolean isNativePointerValidSafe()
           
 void prepareDraw(iRenderView rview)
          Prepare the sector to draw.
 iObject queryObject()
          Get the iObject for this sector.
 void registerPortalMesh(iMeshWrapper mesh)
          Register a mesh with a portal.
 void removeSectorCallback(iSectorCallback cb)
          Remove a sector callback.
 void setDynamicAmbientLight(csColor color)
          Sets dynamic ambient light for all things in the sector.
 void setFog(float density, csColor color)
          Fill the fog structure with the given values.
 void setSectorCallback(iSectorCallback cb)
          Set the sector callback.
 boolean setVisibilityCullerPlugin(java.lang.String Name)
          Use the specified plugin as the visibility culler for this sector.
 void shineLights()
          Calculate lighting for all objects in this sector.
 void shineLights(iMeshWrapper mesh)
          Version of ShineLights(); which only affects one mesh object.
 void unregisterPortalMesh(iMeshWrapper mesh)
          Unregister a mesh with a portal.
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, isNativePointerValidSafe, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csSector

public csSector(iPointer nPointer)
Parameters:
nPointer -
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase

getName

public java.lang.String getName()
Description copied from interface: iBase
Return the name of the interface

Specified by:
getName in interface iBase
Specified by:
getName in class csBase

initSCF

public static void initSCF()

getLights

public iLightList getLights()
Description copied from interface: iSector
Get the list of static and pseudo-dynamic lights in this sector. Do NOT add dynamic lights to this list. For a dynamic light you only have to call SetSector(); on those dynamic lights.

Specified by:
getLights in interface iSector
Returns:

getInterfaceVersion

public static int getInterfaceVersion()

getInterfaceName

public static java.lang.String getInterfaceName()

getInterfaceClass

public static java.lang.Class getInterfaceClass()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe()

calculateSectorBBox

public void calculateSectorBBox(csBox3 bbox,
                                boolean do_meshes)
Description copied from interface: iSector
Calculate the bounding box of all objects in this sector. This function is not very efficient as it will traverse all objects in the sector one by one and compute a bounding box from that.

Specified by:
calculateSectorBBox in interface iSector
Parameters:
bbox -
do_meshes -
See Also:
iSector.calculateSectorBBox(crystalspace.jbind.impl.csgeom.box.csBox3, boolean)

checkFrustum

public void checkFrustum(iFrustumView lview)
Description copied from interface: iSector
Used for portal traversal.

Specified by:
checkFrustum in interface iSector
Parameters:
lview -
See Also:
iSector.checkFrustum(crystalspace.jbind.interfaces.iengine.fview.iFrustumView)

decRecLevel

public void decRecLevel()
Description copied from interface: iSector
Remove one draw recursion level.

Specified by:
decRecLevel in interface iSector
See Also:
iSector.decRecLevel()

disableFog

public void disableFog()
Description copied from interface: iSector
Disable fog in this sector.

Specified by:
disableFog in interface iSector
See Also:
iSector.disableFog()

draw

public void draw(iRenderView rview)
Description copied from interface: iSector
Draw the sector with the given render view.

Specified by:
draw in interface iSector
Parameters:
rview -
See Also:
iSector.draw(crystalspace.jbind.interfaces.iengine.rview.iRenderView)

followSegment

public iSector followSegment(csReversibleTransform t,
                             csVector3 new_position,
                             boolean mirror,
                             boolean only_portals)
Description copied from interface: iSector
Follow a segment starting at this sector. If the segment intersects with a polygon it will stop there unless the polygon is a portal in which case it will recursively go to that sector (possibly applying warping transformations); and continue there. This routine will modify all the given parameters to reflect space warping. These should be used as the new camera transformation when you decide to really go to the new position. This function returns the resulting sector and new_position will be set to the last position that you can go to before hitting a wall. If only_portals is true then only portals will be checked. This means that intersection with normal polygons is not checked. This is a lot faster but it does mean that you need to use another collision detection system to test with walls.

Specified by:
followSegment in interface iSector
Parameters:
t -
new_position -
mirror -
only_portals -
Returns:
See Also:
iSector.followSegment(crystalspace.jbind.impl.csgeom.transfrm.csReversibleTransform, crystalspace.jbind.impl.csgeom.vector3.csVector3, boolean, boolean)

followSegment

public iSector followSegment(csReversibleTransform t,
                             csVector3 new_position,
                             boolean mirror)
Description copied from interface: iSector
Follow a segment starting at this sector. If the segment intersects with a polygon it will stop there unless the polygon is a portal in which case it will recursively go to that sector (possibly applying warping transformations); and continue there. This routine will modify all the given parameters to reflect space warping. These should be used as the new camera transformation when you decide to really go to the new position. This function returns the resulting sector and new_position will be set to the last position that you can go to before hitting a wall. If only_portals is true then only portals will be checked. This means that intersection with normal polygons is not checked. This is a lot faster but it does mean that you need to use another collision detection system to test with walls.

Specified by:
followSegment in interface iSector
Parameters:
t -
new_position -
mirror -
Returns:
See Also:
iSector.followSegment(crystalspace.jbind.impl.csgeom.transfrm.csReversibleTransform, crystalspace.jbind.impl.csgeom.vector3.csVector3, boolean)

getDynamicAmbientLight

public csColor getDynamicAmbientLight()
Description copied from interface: iSector
Get the last set dynamic ambient light for this sector.

Specified by:
getDynamicAmbientLight in interface iSector
Returns:
See Also:
iSector.getDynamicAmbientLight()

getFog

public csFog getFog()
Description copied from interface: iSector
Return the fog structure (even if fog is disabled);.

Specified by:
getFog in interface iSector
Returns:
See Also:
iSector.getFog()

getMeshes

public iMeshList getMeshes()
Description copied from interface: iSector
Get the list of meshes in this sector.

Specified by:
getMeshes in interface iSector
Returns:
See Also:
iSector.getMeshes()

getPortalMeshes

public csSet_iMeshWrapper getPortalMeshes()
Description copied from interface: iSector
Get the set of meshes containing portals that leave from this sector. Note that portals are uni-directional. The portals represented by this list are portals that are on some mesh object that is actually located in this sector.

Specified by:
getPortalMeshes in interface iSector
Returns:
See Also:
iSector.getPortalMeshes()

getRecLevel

public int getRecLevel()
Description copied from interface: iSector
Get the current draw recursion level.

Specified by:
getRecLevel in interface iSector
Returns:
See Also:
iSector.getRecLevel()

getSectorCallback

public iSectorCallback getSectorCallback(int idx)
Description copied from interface: iSector
Get the specified sector callback.

Specified by:
getSectorCallback in interface iSector
Parameters:
idx -
Returns:
See Also:
iSector.getSectorCallback(int)

getSectorCallbackCount

public int getSectorCallbackCount()
Description copied from interface: iSector
Get the number of sector callbacks.

Specified by:
getSectorCallbackCount in interface iSector
Returns:
See Also:
iSector.getSectorCallbackCount()

getVisibilityCuller

public iVisibilityCuller getVisibilityCuller()
Description copied from interface: iSector
Get the visibility culler that is used for this sector. If there is no culler yet a culler of type 'crystalspace.culling.frustvis' will be created and used for this sector.

Specified by:
getVisibilityCuller in interface iSector
Returns:
See Also:
iSector.getVisibilityCuller()

getVisibleMeshes

public csRenderMeshList getVisibleMeshes(iRenderView rview)
Description copied from interface: iSector
Get a set of visible meshes for given camera. These will be cached for a given frame and camera, but if the cached result isn't enough it will be reculled. The returned pointer is valid as long as the sector exsist (the sector will delete it);

Specified by:
getVisibleMeshes in interface iSector
Parameters:
rview -
Returns:
See Also:
iSector.getVisibleMeshes(crystalspace.jbind.interfaces.iengine.rview.iRenderView)

hasFog

public boolean hasFog()
Description copied from interface: iSector
Has this sector fog?

Specified by:
hasFog in interface iSector
Returns:
See Also:
iSector.hasFog()

hitBeam

public iMeshWrapper hitBeam(csVector3 start,
                            csVector3 end,
                            csVector3 intersect,
                            int polygon_idx,
                            boolean accurate)
Description copied from interface: iSector
Follow a beam from start to end and return the first object that is hit. In case it is a thing the polygon_idx field will be filled with the indices of the polygon that was hit. If polygon_idx is null then the polygon will not be filled in. This function doesn't support portals.

Specified by:
hitBeam in interface iSector
Parameters:
start -
end -
intersect -
polygon_idx -
accurate -
Returns:
See Also:
iSector.hitBeam(crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, int, boolean)

hitBeam

public iMeshWrapper hitBeam(csVector3 start,
                            csVector3 end,
                            csVector3 intersect,
                            int polygon_idx)
Description copied from interface: iSector
Follow a beam from start to end and return the first object that is hit. In case it is a thing the polygon_idx field will be filled with the indices of the polygon that was hit. If polygon_idx is null then the polygon will not be filled in. This function doesn't support portals.

Specified by:
hitBeam in interface iSector
Parameters:
start -
end -
intersect -
polygon_idx -
Returns:
See Also:
iSector.hitBeam(crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, int)

hitBeamPortals

public iMeshWrapper hitBeamPortals(csVector3 start,
                                   csVector3 end,
                                   csVector3 isect,
                                   int polygon_idx)
Description copied from interface: iSector
Follow a beam from start to end and return the first polygon that is hit. This function correctly traverse portals and space warping portals. Normally the sector you call this on should be the sector containing the 'start' point. 'isect' will be the intersection point if a polygon is returned. This function returns -1 if no polygon was hit or the polygon index otherwise.

Specified by:
hitBeamPortals in interface iSector
Parameters:
start -
end -
isect -
polygon_idx -
Returns:
See Also:
iSector.hitBeamPortals(crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, int)

incRecLevel

public void incRecLevel()
Description copied from interface: iSector
Add one draw recursion level.

Specified by:
incRecLevel in interface iSector
See Also:
iSector.incRecLevel()

prepareDraw

public void prepareDraw(iRenderView rview)
Description copied from interface: iSector
Prepare the sector to draw. Must be called before any rendermesh is requested.

Specified by:
prepareDraw in interface iSector
Parameters:
rview -
See Also:
iSector.prepareDraw(crystalspace.jbind.interfaces.iengine.rview.iRenderView)

queryObject

public iObject queryObject()
Description copied from interface: iSector
Get the iObject for this sector.

Specified by:
queryObject in interface iSector
Returns:
See Also:
iSector.queryObject()

registerPortalMesh

public void registerPortalMesh(iMeshWrapper mesh)
Description copied from interface: iSector
Register a mesh with a portal.

Specified by:
registerPortalMesh in interface iSector
Parameters:
mesh -
See Also:
iSector.registerPortalMesh(crystalspace.jbind.interfaces.iengine.mesh.iMeshWrapper)

removeSectorCallback

public void removeSectorCallback(iSectorCallback cb)
Description copied from interface: iSector
Remove a sector callback.

Specified by:
removeSectorCallback in interface iSector
Parameters:
cb -
See Also:
iSector.removeSectorCallback(crystalspace.jbind.interfaces.iengine.sector.iSectorCallback)

setDynamicAmbientLight

public void setDynamicAmbientLight(csColor color)
Description copied from interface: iSector
Sets dynamic ambient light for all things in the sector.

Specified by:
setDynamicAmbientLight in interface iSector
Parameters:
color -
See Also:
iSector.setDynamicAmbientLight(crystalspace.jbind.impl.csutil.cscolor.csColor)

setFog

public void setFog(float density,
                   csColor color)
Description copied from interface: iSector
Fill the fog structure with the given values.

Specified by:
setFog in interface iSector
Parameters:
density -
color -
See Also:
iSector.setFog(float, crystalspace.jbind.impl.csutil.cscolor.csColor)

setSectorCallback

public void setSectorCallback(iSectorCallback cb)
Description copied from interface: iSector
Set the sector callback. This will call IncRef(); on the callback So make sure you call DecRef(); to release your own reference.

Specified by:
setSectorCallback in interface iSector
Parameters:
cb -
See Also:
iSector.setSectorCallback(crystalspace.jbind.interfaces.iengine.sector.iSectorCallback)

setVisibilityCullerPlugin

public boolean setVisibilityCullerPlugin(java.lang.String Name)
Description copied from interface: iSector
Use the specified plugin as the visibility culler for this sector. Returns false if the culler could not be loaded for some reason.

Specified by:
setVisibilityCullerPlugin in interface iSector
Parameters:
Name -
Returns:
See Also:
iSector.setVisibilityCullerPlugin(java.lang.String)

shineLights

public void shineLights()
Description copied from interface: iSector
Calculate lighting for all objects in this sector.

Specified by:
shineLights in interface iSector
See Also:
iSector.shineLights()

shineLights

public void shineLights(iMeshWrapper mesh)
Description copied from interface: iSector
Version of ShineLights(); which only affects one mesh object.

Specified by:
shineLights in interface iSector
Parameters:
mesh -
See Also:
iSector.shineLights(crystalspace.jbind.interfaces.iengine.mesh.iMeshWrapper)

unregisterPortalMesh

public void unregisterPortalMesh(iMeshWrapper mesh)
Description copied from interface: iSector
Unregister a mesh with a portal.

Specified by:
unregisterPortalMesh in interface iSector
Parameters:
mesh -
See Also:
iSector.unregisterPortalMesh(crystalspace.jbind.interfaces.iengine.mesh.iMeshWrapper)