| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iRenderView Struct Reference
[Views & Cameras]

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

`#include <iengine/rview.h>`

Inheritance diagram for iRenderView:

[legend]
List of all members.

## Public Member Functions
virtual void | CalculateClipSettings (uint32 frustum_mask, int &clip_portal, int &clip_plane, int &clip_z_plane)=0
| Given a frustum_mask, calculate the clip settings.
virtual bool | ClipBBox (csPlane3 *planes, uint32 &frustum_mask, const csBox3 &obox, int &clip_portal, int &clip_plane, int &clip_z_plane)=0
| Check if the object space bounding box of an object is visible in this render view.
virtual bool | ClipBSphere (const csSphere &cam_sphere, const csSphere &world_sphere, int &clip_portal, int &clip_plane, int &clip_z_plane)=0
| Check if the given bounding sphere (in camera and world space coordinates) is visibile in this render view.
virtual iCamera * | GetCamera ()=0
| Get the current camera.
virtual iClipper2D * | GetClipper ()=0
| Get the 2D clipper for this view.
virtual uint | GetCurrentFrameNumber () const =0
| Get the number of the current frame.
virtual iEngine * | GetEngine ()=0
| Get the engine.
virtual void | GetFrustum (float &lx, float &rx, float &ty, float &by)=0
| Get the frustum.
virtual iGraphics2D * | GetGraphics2D ()=0
| Get the 2D graphics subsystem.
virtual iGraphics3D * | GetGraphics3D ()=0
| Get the 3D graphics subsystem.
virtual iPortal * | GetLastPortal ()=0
| Get the portal we last traversed through.
virtual iCamera * | GetOriginalCamera () const =0
| Get the original camera for this render view.
virtual iSector * | GetPreviousSector ()=0
| Get previous sector.
virtual csRenderContext * | GetRenderContext ()=0
| Get the current render context.
virtual iSector * | GetThisSector ()=0
| Get current sector.
virtual void | SetupClipPlanes (const csReversibleTransform &tr_o2c, csPlane3 *planes, uint32 &frustum_mask)=0
| Setup clipping planes in object space.
virtual bool | TestBSphere (const csReversibleTransform &w2c, const csSphere &sphere)=0
| Test if the given bounding sphere (in world space coordinates) is visible in this render view.

## Detailed Description

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

Main creators of instances implementing this interface:

- iEngine

Main users of this interface:

- meshes

Definition at line 181 of file rview.h.

## Member Function Documentation

virtual void iRenderView::CalculateClipSettings | ( | uint32 | frustum_mask,
|  | int & | clip_portal,
|  | int & | clip_plane,
|  | int & | clip_z_plane |
| ) |  |  | `[pure virtual]`

Given a frustum_mask, calculate the clip settings.

virtual bool iRenderView::ClipBBox | ( | csPlane3 * | planes,
|  | uint32 & | frustum_mask,
|  | const csBox3 & | obox,
|  | int & | clip_portal,
|  | int & | clip_plane,
|  | int & | clip_z_plane |
| ) |  |  | `[pure virtual]`

Check if the object space 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. Use SetupClipPlanes() to get the clipping planes for this function. The frustum_mask will be modified according to all clip planes that were relevant for the given box. That can be used to hierarchically cull smaller objects.

virtual bool iRenderView::ClipBSphere | ( | const csSphere & | cam_sphere,
|  | const csSphere & | world_sphere,
|  | int & | clip_portal,
|  | int & | clip_plane,
|  | int & | clip_z_plane |
| ) |  |  | `[pure virtual]`

Check if the given bounding sphere (in camera and world space coordinates) is visibile in this render view.

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.

virtual iCamera* iRenderView::GetCamera | ( |  | ) | `[pure virtual]`

Get the current camera.

virtual iClipper2D* iRenderView::GetClipper | ( |  | ) | `[pure virtual]`

Get the 2D clipper for this view.

virtual uint iRenderView::GetCurrentFrameNumber | ( |  | ) | const`[pure virtual]`

Get the number of the current frame.

virtual iEngine* iRenderView::GetEngine | ( |  | ) | `[pure virtual]`

Get the engine.

virtual void iRenderView::GetFrustum | ( | float & | lx,
|  | float & | rx,
|  | float & | ty,
|  | float & | by |
| ) |  |  | `[pure virtual]`

Get the frustum.

virtual iGraphics2D* iRenderView::GetGraphics2D | ( |  | ) | `[pure virtual]`

Get the 2D graphics subsystem.

virtual iGraphics3D* iRenderView::GetGraphics3D | ( |  | ) | `[pure virtual]`

Get the 3D graphics subsystem.

virtual iPortal* iRenderView::GetLastPortal | ( |  | ) | `[pure virtual]`

Get the portal we last traversed through.

virtual iCamera* iRenderView::GetOriginalCamera | ( |  | ) | const`[pure virtual]`

Get the original camera for this render view.

This is the camera before any space warping portals.

virtual iSector* iRenderView::GetPreviousSector | ( |  | ) | `[pure virtual]`

Get previous sector.

virtual csRenderContext* iRenderView::GetRenderContext | ( |  | ) | `[pure virtual]`

Get the current render context.

virtual iSector* iRenderView::GetThisSector | ( |  | ) | `[pure virtual]`

Get current sector.

virtual void iRenderView::SetupClipPlanes | ( | const csReversibleTransform & | tr_o2c,
|  | csPlane3 * | planes,
|  | uint32 & | frustum_mask |
| ) |  |  | `[pure virtual]`

Setup clipping planes in object space.

The input arrays for planes should each be able to hold 10 planes. Returns a mask that you can use for the csIntersect3::BoxFrustum() function.

virtual bool iRenderView::TestBSphere | ( | const csReversibleTransform & | w2c,
|  | const csSphere & | sphere |
| ) |  |  | `[pure virtual]`

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

The optional will transform world to camera space.

The documentation for this struct was generated from the following file:

- iengine/rview.h