Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csRenderView Class Reference

This structure represents all information needed for drawing a scene. More...

#include <rview.h>

Inheritance diagram for csRenderView:

iRenderView iBase List of all members.

Public Methods

 csRenderView ()
 csRenderView (iCamera *c)
 csRenderView (iCamera *c, iClipper2D *v, iGraphics3D *ig3d, iGraphics2D *ig2d)
virtual ~csRenderView ()
void SetEngine (iEngine *engine)
 Set the engine.

void SetCamera (iCamera *camera)
 Set the camera.

void SetOriginalCamera (iCamera *camera)
 Set the original camera.

virtual iCameraGetOriginalCamera () const
 Get the original camera.

virtual void SetCallback (iDrawFuncCallback *cb)
 Set a callback that will be called instead of drawing something. More...

virtual iDrawFuncCallbackGetCallback ()
 Get the callback.

virtual void CallCallback (int type, void *data)
 Call callback.

virtual csRenderContextGetRenderContext ()
 Get the current render context.

virtual void CreateRenderContext ()
 Create a new render context. More...

virtual void RestoreRenderContext (csRenderContext *original)
 Restore a render context. More...

virtual iCameraCreateNewCamera ()
 Create a new camera in the current render context. More...

virtual iEngineGetEngine ()
 Get the engine.

virtual iGraphics2DGetGraphics2D ()
 Get the 2D graphics subsystem.

virtual iGraphics3DGetGraphics3D ()
 Get the 3D graphics subsystem.

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

virtual void GetFrustum (float &lx, float &rx, float &ty, float &by)
 Get the frustum.

virtual csRenderContextFrustumGetTopFrustum ()
 Get the top level frustum (corresponding with SetFrustum()).

virtual iClipper2DGetClipper ()
 Get the 2D clipper for this view.

virtual void SetClipper (iClipper2D *clip)
 Set the 2D clipper for this view.

virtual bool IsClipperRequired ()
 If true then we have to clip all objects to the portal frustum (returned with GetClipper()). More...

virtual bool GetClipPlane (csPlane3 &pl)
 Get the 3D clip plane that should be used to clip all geometry. More...

virtual csPlane3GetClipPlane ()
 Get the clip plane.

virtual void SetClipPlane (const csPlane3 &p)
 Set the 3D clip plane that should be used to clip all geometry.

virtual void UseClipPlane (bool u)
 Enable the use of a clip plane.

virtual void UseClipFrustum (bool u)
 Enable the use of a clip frustum.

virtual csFogInfoGetFirstFogInfo ()
 Every fogged sector we encountered results in an extra structure in the following list. More...

virtual void SetFirstFogInfo (csFogInfo *fi)
 Set the first fog info.

virtual bool AddedFogInfo ()
 Return true if fog info has been added.

virtual void ResetFogInfo ()
 Reset fog info.

virtual iCameraGetCamera ()
 Get the current camera.

virtual void CalculateFogPolygon (G3DPolygonDP &poly)
 Calculate the fog information in the given G3DPolygonDP structure.

virtual void CalculateFogPolygon (G3DPolygonDPFX &poly)
 Calculate the fog information in the given G3DPolygonDPFX structure.

virtual void CalculateFogMesh (const csTransform &tr_o2c, G3DTriangleMesh &mesh)
 Calculate the fog information in the given G3DTriangleMesh structure. More...

virtual void CalculateFogMesh (const csTransform &tr_o2c, G3DPolygonMesh &mesh)
 Calculate the fog information in the given G3DPolygonMesh structure. More...

virtual bool TestBSphere (const csReversibleTransform &o2c, const csSphere &sphere)
 Test if the given bounding sphere (in object space coordinates) is visibile in this render view. More...

virtual bool ClipBSphere (const csReversibleTransform &o2c, const 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. More...

virtual bool ClipBBox (const csBox2 &sbox, const 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. More...

virtual iSectorGetThisSector ()
 Get current sector.

virtual void SetThisSector (iSector *s)
 Set the current sector.

virtual iSectorGetPreviousSector ()
 Get previous sector.

virtual void SetPreviousSector (iSector *s)
 Set the previous sector.

virtual iPolygon3DGetPortalPolygon ()
 Get the portal polygon.

virtual void SetPortalPolygon (iPolygon3D *por)
 Set the portal polygon.

virtual int GetRenderRecursionLevel ()
 Get render recursion level.

virtual void SetRenderRecursionLevel (int rec)
 Set render recursion level.

virtual void AttachRenderContextData (void *key, iBase *data)
 Attach data to the current render context.

virtual iBaseFindRenderContextData (void *key)
 Look for data on the current render context.

virtual void DeleteRenderContextData (void *key)
 Delete all data with the given key on the current render context.


Public Attributes

 SCF_DECLARE_IBASE

Detailed Description

This structure represents all information needed for drawing a scene.

It is modified while rendering according to portals/warping portals and such.


Member Function Documentation

void csRenderView::CalculateFogMesh ( const csTransform & tr_o2c,
G3DPolygonMesh & mesh ) [virtual]
 

Calculate the fog information in the given G3DPolygonMesh structure.

This function assumes the fog array is already preallocated and the rest of the structure should be filled in. This function will take care of correctly enabling/disabling fog.

Reimplemented from iRenderView.

void csRenderView::CalculateFogMesh ( const csTransform & tr_o2c,
G3DTriangleMesh & mesh ) [virtual]
 

Calculate the fog information in the given G3DTriangleMesh structure.

This function assumes the fog array is already preallocated and the rest of the structure should be filled in. This function will take care of correctly enabling/disabling fog.

Reimplemented from iRenderView.

bool csRenderView::ClipBBox ( const csBox2 & sbox,
const csBox3 & cbox,
int & clip_portal,
int & clip_plane,
int & clip_z_plane ) [virtual]
 

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.

Reimplemented from iRenderView.

bool csRenderView::ClipBSphere ( const csReversibleTransform & o2c,
const csSphere & sphere,
int & clip_portal,
int & clip_plane,
int & clip_z_plane ) [virtual]
 

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.

Reimplemented from iRenderView.

iCamera * csRenderView::CreateNewCamera ( ) [virtual]
 

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.

Reimplemented from iRenderView.

void csRenderView::CreateRenderContext ( ) [virtual]
 

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).

Reimplemented from iRenderView.

bool csRenderView::GetClipPlane ( csPlane3 & pl ) [inline, virtual]
 

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.

Reimplemented from iRenderView.

csFogInfo * csRenderView::GetFirstFogInfo ( ) [inline, virtual]
 

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.

Reimplemented from iRenderView.

bool csRenderView::IsClipperRequired ( ) [inline, virtual]
 

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.

Reimplemented from iRenderView.

void csRenderView::RestoreRenderContext ( csRenderContext * original ) [virtual]
 

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.

Reimplemented from iRenderView.

void csRenderView::SetCallback ( iDrawFuncCallback * cb ) [inline, virtual]
 

Set a callback that will be called instead of drawing something.

This will be used by iEngine::DrawFunc().

Reimplemented from iRenderView.

bool csRenderView::TestBSphere ( const csReversibleTransform & o2c,
const csSphere & sphere ) [virtual]
 

Test if the given bounding sphere (in object space coordinates) is visibile in this render view.

The transformation will transform object to camera space.

Reimplemented from iRenderView.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000