CS::RenderViewClipper Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Static Public Member Functions
CS::RenderViewClipper Class Reference

Helper to clip in the context of a render view. More...

`#include <cstool/rviewclipper.h>`

List of all members.

## Static Public Member Functions
static void | CalculateClipSettings (csRenderContext *ctxt, uint32 frustum_mask, int &clip_portal, int &clip_plane, int &clip_z_plane)
| Given a frustum_mask, calculate the clip settings.
static bool | CullBBox (const csRenderContext *ctxt, const csPlane3 *planes, uint32 &frustum_mask, const csBox3 &obox, int &clip_portal, int &clip_plane, int &clip_z_plane)
| Check if the object space bounding box of an object is visible in this render view.
static bool | CullBSphere (csRenderContext *ctxt, const csSphere &cam_sphere, const csSphere &world_sphere, int &clip_portal, int &clip_plane, int &clip_z_plane)
| Check if the given bounding sphere (in camera and world space coordinates) is visibile for the render context.
static void | SetupClipPlanes (csRenderContext *ctxt, const csReversibleTransform &tr_o2c, csPlane3 *planes, uint32 &frustum_mask)
| Setup clipping planes in object space.
static void | SetupClipPlanes (csRenderContext *ctxt)
| Setup the clip planes for the current context and camera (in world space).
static bool | TestBSphere (csRenderContext *ctxt, const csReversibleTransform &w2c, const csSphere &sphere)
| Test if the given bounding sphere (in world space coordinates) is visible for the render context.

## Detailed Description

Helper to clip in the context of a render view.

This class is mostly useful for mesh object implementors.

Definition at line 35 of file rviewclipper.h.

## Member Function Documentation

static void CS::RenderViewClipper::CalculateClipSettings | ( | csRenderContext * | ctxt,
|  | uint32 | frustum_mask,
|  | int & | clip_portal,
|  | int & | clip_plane,
|  | int & | clip_z_plane
| ) |  | `[static]`

Given a frustum_mask, calculate the clip settings.

static bool CS::RenderViewClipper::CullBBox | ( | const csRenderContext * | ctxt,
|  | const csPlane3 * | planes,
|  | uint32 & | frustum_mask,
|  | const csBox3 & | obox,
|  | int & | clip_portal,
|  | int & | clip_plane,
|  | int & | clip_z_plane
| ) |  | `[static]`

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.

static bool CS::RenderViewClipper::CullBSphere | ( | csRenderContext * | ctxt,
|  | const csSphere & | cam_sphere,
|  | const csSphere & | world_sphere,
|  | int & | clip_portal,
|  | int & | clip_plane,
|  | int & | clip_z_plane
| ) |  | `[static]`

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

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 the renderer.

static void CS::RenderViewClipper::SetupClipPlanes | ( | csRenderContext * | ctxt,
|  | const csReversibleTransform & | tr_o2c,
|  | csPlane3 * | planes,
|  | uint32 & | frustum_mask
| ) |  | `[static]`

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.

Deprecated:
  Use CS::RenderViewClipper::SetupClipPlanes() instead.

static void CS::RenderViewClipper::SetupClipPlanes | ( | csRenderContext * | ctxt | ) | `[static]`

Setup the clip planes for the current context and camera (in world space).

static bool CS::RenderViewClipper::TestBSphere | ( | csRenderContext * | ctxt,
|  | const csReversibleTransform & | w2c,
|  | const csSphere & | sphere
| ) |  | `[static]`

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

The optional will transform world to camera space.

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

- cstool/rviewclipper.h