CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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

void SetEngine (iEngine *engine)
 Set the engine. More...

void SetCamera (iCamera *camera)
 Set the camera. More...

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

virtual iCameraGetOriginalCamera () const
 Get the original camera. More...

virtual csRenderContextGetRenderContext ()
 Get the current render context. More...

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

virtual iGraphics2DGetGraphics2D ()
 Get the 2D graphics subsystem. More...

virtual iGraphics3DGetGraphics3D ()
 Get the 3D graphics subsystem. More...

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

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

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

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

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

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

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

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

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

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

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

virtual void ResetFogInfo ()
 Reset fog info. More...

virtual iCameraGetCamera ()
 Get the current camera. More...

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

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

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

virtual void CalculateFogMesh (const csTransform &tr_o2c, G3DPolygonMesh &mesh)
 @@OR@@ 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. More...

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

virtual iSectorGetPreviousSector ()
 Get previous sector. More...

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

virtual iPolygon3DGetPortalPolygon ()
 Get the portal polygon. More...

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

virtual int GetRenderRecursionLevel ()
 Get render recursion level. More...

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

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

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

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


Detailed Description

This structure represents all information needed for drawing a scene.

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

Definition at line 43 of file csengine/rview.h.


Member Function Documentation

virtual bool csRenderView::AddedFogInfo   [inline, virtual]
 

Return true if fog info has been added.

Implements iRenderView.

Definition at line 230 of file csengine/rview.h.

References csRenderContext::added_fog_info.

virtual void csRenderView::AttachRenderContextData void *    key,
iBase   data
[virtual]
 

Attach data to the current render context.

Implements iRenderView.

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

@@OR@@ 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.

Implements iRenderView.

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

@@OR@@ 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.

Implements iRenderView.

virtual void csRenderView::CalculateFogPolygon G3DPolygonDPFX   poly [virtual]
 

@@OR@@ Calculate the fog information in the given G3DPolygonDPFX structure.

Implements iRenderView.

virtual void csRenderView::CalculateFogPolygon G3DPolygonDP   poly [virtual]
 

@@OR@@ Calculate the fog information in the given G3DPolygonDP structure.

Implements iRenderView.

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

Implements iRenderView.

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

Implements iRenderView.

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

Implements iRenderView.

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

Implements iRenderView.

virtual void csRenderView::DeleteRenderContextData void *    key [virtual]
 

Delete all data with the given key on the current render context.

Implements iRenderView.

virtual iBase* csRenderView::FindRenderContextData void *    key [virtual]
 

Look for data on the current render context.

Implements iRenderView.

virtual iCamera* csRenderView::GetCamera   [inline, virtual]
 

Get the current camera.

Implements iRenderView.

Definition at line 239 of file csengine/rview.h.

References csRenderContext::icamera.

virtual iClipper2D* csRenderView::GetClipper   [inline, virtual]
 

Get the 2D clipper for this view.

Implements iRenderView.

Definition at line 178 of file csengine/rview.h.

References csRenderContext::iview.

virtual csPlane3& csRenderView::GetClipPlane   [inline, virtual]
 

Get the clip plane.

Implements iRenderView.

Definition at line 201 of file csengine/rview.h.

References csRenderContext::clip_plane.

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

Implements iRenderView.

Definition at line 195 of file csengine/rview.h.

References csRenderContext::clip_plane, and csRenderContext::do_clip_plane.

virtual iEngine* csRenderView::GetEngine   [inline, virtual]
 

Get the engine.

Implements iRenderView.

Definition at line 152 of file csengine/rview.h.

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

Implements iRenderView.

Definition at line 218 of file csengine/rview.h.

References csRenderContext::fog_info.

virtual void csRenderView::GetFrustum float &    lx,
float &    rx,
float &    ty,
float &    by
[inline, virtual]
 

Get the frustum.

Implements iRenderView.

Definition at line 160 of file csengine/rview.h.

virtual iGraphics2D* csRenderView::GetGraphics2D   [inline, virtual]
 

Get the 2D graphics subsystem.

Implements iRenderView.

Definition at line 154 of file csengine/rview.h.

virtual iGraphics3D* csRenderView::GetGraphics3D   [inline, virtual]
 

Get the 3D graphics subsystem.

Implements iRenderView.

Definition at line 156 of file csengine/rview.h.

virtual iCamera* csRenderView::GetOriginalCamera   const [inline, virtual]
 

Get the original camera.

Implements iRenderView.

Definition at line 121 of file csengine/rview.h.

virtual iPolygon3D* csRenderView::GetPortalPolygon   [inline, virtual]
 

Get the portal polygon.

Implements iRenderView.

Definition at line 323 of file csengine/rview.h.

References csRenderContext::portal_polygon.

virtual iSector* csRenderView::GetPreviousSector   [inline, virtual]
 

Get previous sector.

Implements iRenderView.

Definition at line 315 of file csengine/rview.h.

References csRenderContext::previous_sector.

virtual csRenderContext* csRenderView::GetRenderContext   [inline, virtual]
 

Get the current render context.

Implements iRenderView.

Definition at line 126 of file csengine/rview.h.

virtual int csRenderView::GetRenderRecursionLevel   [inline, virtual]
 

Get render recursion level.

Implements iRenderView.

Definition at line 331 of file csengine/rview.h.

References csRenderContext::draw_rec_level.

virtual iSector* csRenderView::GetThisSector   [inline, virtual]
 

Get current sector.

Implements iRenderView.

Definition at line 305 of file csengine/rview.h.

References csRenderContext::this_sector.

virtual csRenderContextFrustum* csRenderView::GetTopFrustum   [inline, virtual]
 

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

Implements iRenderView.

Definition at line 168 of file csengine/rview.h.

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

Implements iRenderView.

Definition at line 188 of file csengine/rview.h.

References csRenderContext::do_clip_frustum.

virtual void csRenderView::ResetFogInfo   [inline, virtual]
 

Reset fog info.

Implements iRenderView.

Definition at line 234 of file csengine/rview.h.

References csRenderContext::added_fog_info.

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

Implements iRenderView.

void csRenderView::SetCamera iCamera   camera
 

Set the camera.

virtual void csRenderView::SetClipper iClipper2D   clip [virtual]
 

Set the 2D clipper for this view.

Implements iRenderView.

virtual void csRenderView::SetClipPlane const csPlane3   p [inline, virtual]
 

Set the 3D clip plane that should be used to clip all geometry.

Implements iRenderView.

Definition at line 206 of file csengine/rview.h.

References csRenderContext::clip_plane.

void csRenderView::SetEngine iEngine   engine
 

Set the engine.

virtual void csRenderView::SetFirstFogInfo csFogInfo   fi [inline, virtual]
 

Set the first fog info.

Implements iRenderView.

Definition at line 222 of file csengine/rview.h.

References csRenderContext::added_fog_info, and csRenderContext::fog_info.

virtual void csRenderView::SetFrustum float    lx,
float    rx,
float    ty,
float    by
[virtual]
 

Set the view frustum at z=1.

Implements iRenderView.

void csRenderView::SetOriginalCamera iCamera   camera
 

Set the original camera.

virtual void csRenderView::SetPortalPolygon iPolygon3D   por [inline, virtual]
 

Set the portal polygon.

Implements iRenderView.

Definition at line 325 of file csengine/rview.h.

References csRenderContext::portal_polygon.

virtual void csRenderView::SetPreviousSector iSector   s [inline, virtual]
 

Set the previous sector.

Implements iRenderView.

Definition at line 320 of file csengine/rview.h.

References csRenderContext::previous_sector.

virtual void csRenderView::SetRenderRecursionLevel int    rec [inline, virtual]
 

Set render recursion level.

Implements iRenderView.

Definition at line 335 of file csengine/rview.h.

References csRenderContext::draw_rec_level.

virtual void csRenderView::SetThisSector iSector   s [inline, virtual]
 

Set the current sector.

Implements iRenderView.

Definition at line 310 of file csengine/rview.h.

References csRenderContext::this_sector.

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

Implements iRenderView.

virtual void csRenderView::UseClipFrustum bool    u [inline, virtual]
 

Enable the use of a clip frustum.

Implements iRenderView.

Definition at line 210 of file csengine/rview.h.

References csRenderContext::do_clip_frustum.

virtual void csRenderView::UseClipPlane bool    u [inline, virtual]
 

Enable the use of a clip plane.

Implements iRenderView.

Definition at line 208 of file csengine/rview.h.

References csRenderContext::do_clip_plane.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14