crystalspace.jbind.interfaces.iengine.portal
Interface iPortal

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

public interface iPortal
extends iBase

This is the interface to the Portal objects. Polygons that are really `openings' to different areas have a portal associated with them. The portal object defines where the opening leads, how exactly the geometry behind portal is to be handled and so on.

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

Method Summary
 void checkFrustum(iFrustumView lview, csReversibleTransform t, int alpha)
          Check frustum visibility of all polygons reachable through this portal.
 boolean completeSector(iBase context)
          Check if the destination sector is 0 and if so call the callback.
 void computeCameraPlane(csReversibleTransform t, csPlane3 camplane)
          Calculate the camera space plane for this portal.
 float[] getColorFilter()
          Get the current color filter.
 csFlags getFlags()
          Set portal flags (see CS_PORTAL_XXX values).
 int getMaximumSectorVisit()
          Get the maximum sector visit.
 iPortalCallback getMissingSectorCallback(int idx)
          Get the specified missing sector callback.
 int getMissingSectorCallbackCount()
          Get the number of missing sector callbacks.Implemented in csPortal.
 java.lang.String getName()
          Get the name of this portal.Implemented in csPortal.
 csPlane3 getObjectPlane()
          Get the object space plane of this portal.Implemented in csPortal.
 iPortalCallback getPortalCallback(int idx)
          Get the specified portal callback.Implemented in csPortal.
 int getPortalCallbackCount()
          Get the number of portal callbacks.Implemented in csPortal.
 iSector getSector()
          Return the sector that this portal points too.Implemented in csPortal.
 iTextureHandle getTextureFilter()
          Get the filter texture.Implemented in csPortal.
 int[] getVertexIndices()
          Get an array of vertex indices (indices in the array returned by GetVertices()).
 int getVertexIndicesCount()
          Get the number of vertex indices.Implemented in csPortal.
 csVector3[] getVertices()
          Get an array of object space vertices.
 csReversibleTransform getWarp()
          Get the warping transformation.Implemented in csPortal.
 csPlane3 getWorldPlane()
          Get the world space plane of this portal.
 csPlane3 getWorldPlane(iMovable movable)
          Get the world space plane of this portal.
 void hardTransform(csReversibleTransform t)
          Hard transform the warp matrix.Implemented in csPortal.
 iMeshWrapper hitBeamPortals(csReversibleTransform t, csVector3 start, csVector3 end, csVector3 isect, int[] polygon_idx)
          Follow a beam through this portal and return the mesh and polygon index that it hits with (0 incase no hit).
 void objectToWorld(csReversibleTransform t, csReversibleTransform warp_wor)
          Transform the warp matrix from object space to world space.
 boolean pointOnPolygon(csVector3 point)
          Test if a point is on the polygon represented by this portal.
 boolean pointOnPolygon(csVector3 point, iMovable movable)
          Test if a point is on the polygon represented by this portal.
 iObject queryObject()
          Get the iObject for this portal. @ OBSOLETE!!!
 void removeMissingSectorCallback(iPortalCallback cb)
          Remove a missing sector callback.Implemented in csPortal.
 void removePortalCallback(iPortalCallback cb)
          Remove a portal callback.Implemented in csPortal.
 void setFilter(float r, float g, float b)
          Set a color filter (instead of the texture).Implemented in csPortal.
 void setFilter(iTextureHandle ft)
          Set the filter texture.Implemented in csPortal.
 void setMaximumSectorVisit(int msv)
          Set the number of times that this portal will allow for watching the same portal.
 void setMirror(csPlane3 plane)
          Set warping transformation to mirror around the given plane.
 void setMissingSectorCallback(iPortalCallback cb)
          Set the missing sector callback.
 void setName(java.lang.String name)
          Set the name of this portal.Implemented in csPortal.
 void setPortalCallback(iPortalCallback cb)
          Set the portal callback.
 void setSector(iSector s)
          Set the sector that this portal points too.
 void setWarp(csMatrix3 m_w, csVector3 v_w_before, csVector3 v_w_after)
          Set the warping transformation for this portal in object space and world space.
 void setWarp(csTransform t)
          Set the warping transformation for this portal in object space and world space.
 csVector3 warp(csReversibleTransform t, csVector3 pos)
          Warp a position in world space given a object space to world space transform (this==object, other==world).
 void warpSpace(csReversibleTransform warp_wor, csReversibleTransform t, boolean mirror)
          Warp space using the given world->camera transformation.
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

checkFrustum

public void checkFrustum(iFrustumView lview,
                         csReversibleTransform t,
                         int alpha)
Check frustum visibility of all polygons reachable through this portal. Alpha is the alpha value you'd like to use to pass through this portal (0 is no completely transparent, 100 is complete opaque). 't' is the transform from object to world (this2other). Implemented in csPortal.

Parameters:
lview -
t -
alpha -

completeSector

public boolean completeSector(iBase context)
Check if the destination sector is 0 and if so call the callback. This function returns false if the portal should not be traversed. Implemented in csPortal.

Parameters:
context -
Returns:

computeCameraPlane

public void computeCameraPlane(csReversibleTransform t,
                               csPlane3 camplane)
Calculate the camera space plane for this portal. Implemented in csPortal.

Parameters:
t -
camplane -

getColorFilter

public float[] getColorFilter()
Get the current color filter. Implemented in csPortal.

Returns:

getFlags

public csFlags getFlags()
Set portal flags (see CS_PORTAL_XXX values). Implemented in csPortal.

Returns:

getMaximumSectorVisit

public int getMaximumSectorVisit()
Get the maximum sector visit. Implemented in csPortal.

Returns:

getMissingSectorCallback

public iPortalCallback getMissingSectorCallback(int idx)
Get the specified missing sector callback. Implemented in csPortal.

Parameters:
idx -
Returns:

getMissingSectorCallbackCount

public int getMissingSectorCallbackCount()
Get the number of missing sector callbacks.Implemented in csPortal.

Returns:

getName

public java.lang.String getName()
Get the name of this portal.Implemented in csPortal.

Specified by:
getName in interface iBase
Returns:
See Also:
iBase.getName()

getObjectPlane

public csPlane3 getObjectPlane()
Get the object space plane of this portal.Implemented in csPortal.

Returns:

getPortalCallback

public iPortalCallback getPortalCallback(int idx)
Get the specified portal callback.Implemented in csPortal.

Parameters:
idx -
Returns:

getPortalCallbackCount

public int getPortalCallbackCount()
Get the number of portal callbacks.Implemented in csPortal.

Returns:

getSector

public iSector getSector()
Return the sector that this portal points too.Implemented in csPortal.

Returns:

getTextureFilter

public iTextureHandle getTextureFilter()
Get the filter texture.Implemented in csPortal.

Returns:

getVertexIndices

public int[] getVertexIndices()
Get an array of vertex indices (indices in the array returned by GetVertices()). Implemented in csPortal.

Returns:

getVertexIndicesCount

public int getVertexIndicesCount()
Get the number of vertex indices.Implemented in csPortal.

Returns:

getVertices

public csVector3[] getVertices()
Get an array of object space vertices. Use this in combination with GetVertexIndices() to find out where the portal is.Implemented in csPortal.

Returns:

getWarp

public csReversibleTransform getWarp()
Get the warping transformation.Implemented in csPortal.

Returns:

getWorldPlane

public csPlane3 getWorldPlane()
Get the world space plane of this portal. Note! This function assumes the mesh containing this portal has previously been transformed to world space! The optional movable parameter can be used to recalculate the world plane if that is needed. If the movable parameter is not given then the last calculated world plane is used.Implemented in csPortal.

Returns:

getWorldPlane

public csPlane3 getWorldPlane(iMovable movable)
Get the world space plane of this portal. Note! This function assumes the mesh containing this portal has previously been transformed to world space! The optional movable parameter can be used to recalculate the world plane if that is needed. If the movable parameter is not given then the last calculated world plane is used.Implemented in csPortal.

Parameters:
movable -
Returns:

hardTransform

public void hardTransform(csReversibleTransform t)
Hard transform the warp matrix.Implemented in csPortal.

Parameters:
t -

hitBeamPortals

public iMeshWrapper hitBeamPortals(csReversibleTransform t,
                                   csVector3 start,
                                   csVector3 end,
                                   csVector3 isect,
                                   int[] polygon_idx)
Follow a beam through this portal and return the mesh and polygon index that it hits with (0 incase no hit). This function properly acounts for space warping portals and also checks for infinite recursion (does not allow traversing the same sector more than five times). Returns the intersection point with the polygon in 'isect'. The given transform 't' is used to transform the warping matrix in the portal from object to world space (this==object, other==world). Implemented in csPortal.

Parameters:
t -
start -
end -
isect -
polygon_idx -
Returns:

objectToWorld

public void objectToWorld(csReversibleTransform t,
                          csReversibleTransform warp_wor)
Transform the warp matrix from object space to world space. The transform 't' is object to world (this==object, other==world). Implemented in csPortal.

Parameters:
t -
warp_wor -

pointOnPolygon

public boolean pointOnPolygon(csVector3 point)
Test if a point is on the polygon represented by this portal. This test happens in world space. The optional movable is used to update the world space vertices if needed. Otherwise the last calculated vertices are used.Implemented in csPortal.

Parameters:
point -
Returns:

pointOnPolygon

public boolean pointOnPolygon(csVector3 point,
                              iMovable movable)
Test if a point is on the polygon represented by this portal. This test happens in world space. The optional movable is used to update the world space vertices if needed. Otherwise the last calculated vertices are used.Implemented in csPortal.

Parameters:
point -
movable -
Returns:

queryObject

public iObject queryObject()
Get the iObject for this portal. @ OBSOLETE!!! Implemented in csPortal.

Returns:

removeMissingSectorCallback

public void removeMissingSectorCallback(iPortalCallback cb)
Remove a missing sector callback.Implemented in csPortal.

Parameters:
cb -

removePortalCallback

public void removePortalCallback(iPortalCallback cb)
Remove a portal callback.Implemented in csPortal.

Parameters:
cb -

setFilter

public void setFilter(float r,
                      float g,
                      float b)
Set a color filter (instead of the texture).Implemented in csPortal.

Parameters:
r -
g -
b -

setFilter

public void setFilter(iTextureHandle ft)
Set the filter texture.Implemented in csPortal.

Parameters:
ft -

setMaximumSectorVisit

public void setMaximumSectorVisit(int msv)
Set the number of times that this portal will allow for watching the same portal. By default this is 5 which means that in one recursion level this portal will visit every sector at maximum 5 times. Implemented in csPortal.

Parameters:
msv -

setMirror

public void setMirror(csPlane3 plane)
Set warping transformation to mirror around the given plane. Implemented in csPortal.

Parameters:
plane -

setMissingSectorCallback

public void setMissingSectorCallback(iPortalCallback cb)
Set the missing sector callback. This will call IncRef() on the callback So make sure you call DecRef() to release your own reference. Note that as soon as one of these callbacks creates the missing sector, the loop to call these callbacks will stop. Implemented in csPortal.

Parameters:
cb -

setName

public void setName(java.lang.String name)
Set the name of this portal.Implemented in csPortal.

Parameters:
name -

setPortalCallback

public void setPortalCallback(iPortalCallback cb)
Set the portal callback. This will call IncRef() on the callback So make sure you call DecRef() to release your own reference. Note that ALL portal callbacks have to return true before the portal is traversed. Implemented in csPortal.

Parameters:
cb -

setSector

public void setSector(iSector s)
Set the sector that this portal points too. To avoid circular references, the sector is not IncRef'ed! Implemented in csPortal.

Parameters:
s -

setWarp

public void setWarp(csTransform t)
Set the warping transformation for this portal in object space and world space. Implemented in csPortal.

Parameters:
t -

setWarp

public void setWarp(csMatrix3 m_w,
                    csVector3 v_w_before,
                    csVector3 v_w_after)
Set the warping transformation for this portal in object space and world space. Implemented in csPortal.

Parameters:
m_w -
v_w_before -
v_w_after -

warp

public csVector3 warp(csReversibleTransform t,
                      csVector3 pos)
Warp a position in world space given a object space to world space transform (this==object, other==world). Implemented in csPortal.

Parameters:
t -
pos -
Returns:

warpSpace

public void warpSpace(csReversibleTransform warp_wor,
                      csReversibleTransform t,
                      boolean mirror)
Warp space using the given world->camera transformation. This function modifies the given camera transformation to reflect the warping change. 'warp_wor' is the warp transformation in world space. 't' is the transformation from world to camera space. 'mirror' is true if the camera transformation transforms all polygons so that the vertices are ordered anti-clockwise. 'mirror' will be modified by warp_space if needed. Implemented in csPortal.

Parameters:
warp_wor -
t -
mirror -