crystalspace.jbind.interfaces.iengine.rview
Interface iRenderView

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

public interface iRenderView
extends iBase

This interface represents all information needed to render some object in a current draw context.

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

Method Summary
 boolean addedFogInfo()
          Return true if fog info has been added
 void attachRenderContextData(iPointer key, iBase data)
          Attach data to the current render context
 void calculateFogMesh(csTransform tr_o2c, G3DPolygonMesh mesh)
           
 void calculateFogMesh(csTransform tr_o2c, G3DTriangleMesh mesh)
           
 void calculateFogPolygon(G3DPolygonDP poly)
           
 void calculateFogPolygon(G3DPolygonDPFX poly)
           
 boolean clipBBox(csBox2 sbox, csBox3 cbox, int clip_portal, int clip_plane, int clip_z_plane)
          Check if the screen bounding box of an object is visible in this render view.
 boolean clipBSphere(csReversibleTransform o2c, csSphere sphere, int clip_portal, int clip_plane, int clip_z_plane)
          Check if the given bounding sphere(in object space coordinates) is visibile in this render view.
 iCamera createNewCamera()
          Create a new camera in the current render context.
 void createRenderContext()
          Create a new render context.
 void deleteRenderContextData(iPointer key)
          Delete all data with the given key on the current render context.
 iBase findRenderContextData(iPointer key)
          Look for data on the current render context.
 iCamera getCamera()
          Get the current camerapublic
 iClipper2D getClipper()
          Get the 2D clipper for this view
 csPlane3 getClipPlane()
          Get the clip plane
 boolean getClipPlane(csPlane3 pl)
          Get the 3D clip plane that should be used to clip all geometry.
 iEngine getEngine()
          Get the engine
 csFogInfo getFirstFogInfo()
          Every fogged sector we encountered results in an extra structure in the following list.
 void getFrustum(float lx, float rx, float ty, float by)
          Get the frustum
 iGraphics2D getGraphics2D()
          Get the 2D graphics subsystem
 iGraphics3D getGraphics3D()
          Get the 3D graphics subsystem
 iPortal getLastPortal()
          Get the portal we last traversed through
 iCamera getOriginalCamera()
          Get the original camera for this render view.
 iSector getPreviousSector()
          Get previous sector
 csRenderContext getRenderContext()
          Get the current render context
 int getRenderRecursionLevel()
          Get render recursion level
 iSector getThisSector()
          Get current sector
 csRenderContextFrustum getTopFrustum()
          Get the top level frustum(corresponding with SetFrustum())
 boolean isClipperRequired()
          If true then we have to clip all objects to the portal frustum (returned with GetClipper()).
 void resetFogInfo()
          Reset fog info
 void restoreRenderContext(csRenderContext original)
          Restore a render context.
 void setClipper(iClipper2D clip)
          Set the 2D clipper for this view
 void setClipPlane(csPlane3 pl)
          Set the 3D clip plane that should be used to clip all geometry
 void setFirstFogInfo(csFogInfo fi)
          Set the first fog info
 void setFrustum(float lx, float rx, float ty, float by)
          Set the view frustum at z = 1.
 void setLastPortal(iPortal portal)
          Set the last portal
 void setPreviousSector(iSector s)
          Set the previous sector
 void setRenderRecursionLevel(int rec)
          Set render recursion level
 void setThisSector(iSector s)
          Set the current sector
 boolean testBSphere(csReversibleTransform o2c, csSphere sphere)
          Test if the given bounding sphere(in object space coordinates) is visibile in this render view.
 void useClipFrustum(boolean u)
          Enable the use of a clip frustum
 void useClipPlane(boolean u)
          Enable the use of a clip plane
 
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

addedFogInfo

public boolean addedFogInfo()
Return true if fog info has been added

Returns:

attachRenderContextData

public void attachRenderContextData(iPointer key,
                                    iBase data)
Attach data to the current render context

Parameters:
key -
data -

calculateFogMesh

public void calculateFogMesh(csTransform tr_o2c,
                             G3DPolygonMesh mesh)
Parameters:
tr_o2c -
mesh -

calculateFogMesh

public void calculateFogMesh(csTransform tr_o2c,
                             G3DTriangleMesh mesh)
Parameters:
tr_o2c -
mesh -

calculateFogPolygon

public void calculateFogPolygon(G3DPolygonDPFX poly)
Parameters:
poly -

calculateFogPolygon

public void calculateFogPolygon(G3DPolygonDP poly)
Parameters:
poly -

clipBBox

public boolean clipBBox(csBox2 sbox,
                        csBox3 cbox,
                        int clip_portal,
                        int clip_plane,
                        int clip_z_plane)
Check if the screen bounding box of an object is visible in this render view. If true is returned(visible) then clip_plane, clip_z_plane, and clip_portal will be set to the right value depending on wether or not clipping is wanted. This function also does far plane clipping.

Parameters:
sbox -
cbox -
clip_portal -
clip_plane -
clip_z_plane -
Returns:

clipBSphere

public boolean clipBSphere(csReversibleTransform o2c,
                           csSphere sphere,
                           int clip_portal,
                           int clip_plane,
                           int clip_z_plane)
Check if the given bounding sphere(in object space coordinates) is visibile in this render view. The given transformation should transform object to camera space. If the sphere is visible this function will also initialize the clip_plane, clip_z_plane, and clip_portal fields which can be used for DrawTriangleMesh or DrawPolygonMesh.

Parameters:
o2c -
sphere -
clip_portal -
clip_plane -
clip_z_plane -
Returns:

createNewCamera

public iCamera createNewCamera()
Create a new camera in the current render context. This function will create a new camera based on the current one. The new camera reference is returned.

Returns:

createRenderContext

public void createRenderContext()
Create a new render context. This is typically used when going through a portal. Note that you should remember the old render context if you want to restore it later. The render context will get all the values from the current context (with SCF references properly incremented).


deleteRenderContextData

public void deleteRenderContextData(iPointer key)
Delete all data with the given key on the current render context.

Parameters:
key -

findRenderContextData

public iBase findRenderContextData(iPointer key)
Look for data on the current render context.

Parameters:
key -
Returns:

getCamera

public iCamera getCamera()
Get the current camerapublic

Returns:

getClipper

public iClipper2D getClipper()
Get the 2D clipper for this view

Returns:

getClipPlane

public csPlane3 getClipPlane()
Get the clip plane

Returns:

getClipPlane

public boolean getClipPlane(csPlane3 pl)
Get the 3D clip plane that should be used to clip all geometry. If this function returns false then this plane is invalid and should not be used. Otherwise it must be used to clip the object before drawing

Parameters:
pl -
Returns:

getEngine

public iEngine getEngine()
Get the engine

Returns:

getFirstFogInfo

public csFogInfo getFirstFogInfo()
Every fogged sector we encountered results in an extra structure in the following list. This is only used if we are doing vertex based fog. This function will return the first csFogInfo instance

Returns:

getFrustum

public void getFrustum(float lx,
                       float rx,
                       float ty,
                       float by)
Get the frustum

Parameters:
lx -
rx -
ty -
by -

getGraphics2D

public iGraphics2D getGraphics2D()
Get the 2D graphics subsystem

Returns:

getGraphics3D

public iGraphics3D getGraphics3D()
Get the 3D graphics subsystem

Returns:

getLastPortal

public iPortal getLastPortal()
Get the portal we last traversed through

Returns:

getOriginalCamera

public iCamera getOriginalCamera()
Get the original camera for this render view. This is the camera before any space warping portals

Returns:

getPreviousSector

public iSector getPreviousSector()
Get previous sector

Returns:

getRenderContext

public csRenderContext getRenderContext()
Get the current render context

Returns:

getRenderRecursionLevel

public int getRenderRecursionLevel()
Get render recursion level

Returns:

getThisSector

public iSector getThisSector()
Get current sector

Returns:

getTopFrustum

public csRenderContextFrustum getTopFrustum()
Get the top level frustum(corresponding with SetFrustum())

Returns:

isClipperRequired

public boolean isClipperRequired()
If true then we have to clip all objects to the portal frustum (returned with GetClipper()). Normally this is not needed but some portals require this. If GetClipPlane(); returns true then the value of this function is also implied to be true.

Returns:

resetFogInfo

public void resetFogInfo()
Reset fog info


restoreRenderContext

public void restoreRenderContext(csRenderContext original)
Restore a render context. Use this to restore a previously overwritten render context. This function will take care of properly cleaning up the current render context.

Parameters:
original -

setClipper

public void setClipper(iClipper2D clip)
Set the 2D clipper for this view

Parameters:
clip -

setClipPlane

public void setClipPlane(csPlane3 pl)
Set the 3D clip plane that should be used to clip all geometry

Parameters:
pl -

setFirstFogInfo

public void setFirstFogInfo(csFogInfo fi)
Set the first fog info

Parameters:
fi -

setFrustum

public void setFrustum(float lx,
                       float rx,
                       float ty,
                       float by)
Set the view frustum at z = 1.

Parameters:
lx -
rx -
ty -
by -

setLastPortal

public void setLastPortal(iPortal portal)
Set the last portal

Parameters:
portal -

setPreviousSector

public void setPreviousSector(iSector s)
Set the previous sector

Parameters:
s -

setRenderRecursionLevel

public void setRenderRecursionLevel(int rec)
Set render recursion level

Parameters:
rec -

setThisSector

public void setThisSector(iSector s)
Set the current sector

Parameters:
s -

testBSphere

public boolean testBSphere(csReversibleTransform o2c,
                           csSphere sphere)
Test if the given bounding sphere(in object space coordinates) is visibile in this render view. The optional will transform object to camera space.

Parameters:
o2c -
sphere -
Returns:

useClipFrustum

public void useClipFrustum(boolean u)
Enable the use of a clip frustum

Parameters:
u -

useClipPlane

public void useClipPlane(boolean u)
Enable the use of a clip plane

Parameters:
u -