CrystalSpace

Public API Reference

csPen3D Class Reference

A pen implementation with which you can do various kinds of 3D line rendering. More...

#include <cstool/pen.h>

List of all members.

Public Member Functions

void DrawArc (const csVector3 &c1, const csVector3 &c2, int axis, float start_angle=0, float end_angle=6.2831853)
 Draws an elliptical arc from start angle to end angle.
void DrawBox (const csBox3 &box)
 Draw a box.
void DrawCylinder (const csBox3 &box, int axis)
 Draw a cylinder.
void DrawLine (const csVector3 &v1, const csVector3 &v2)
 Draws a single line.
void DrawLines (const csArray< csPen3DCoordinatePair > &pairs)
 Draws a series of lines.
const csReversibleTransformGetLocal2ObjectTransform () const
 Get the local to object transform.
void SetActiveCache (csPenCache *cache)
 Set an active pen cache.
void SetColor (float r, float g, float b, float a)
 Sets the current color.
void SetLocal2ObjectTransform (const csReversibleTransform &trans)
 Set the local to object transform.
void SetMixMode (uint mode)
 Sets the given mix (blending) mode.
void SetTransform (const csReversibleTransform &trans)
 Set object to world transform.

Protected Member Functions

void AddVertex (const csVector3 &v)
 Adds a vertex.
void DrawMesh (csRenderMeshType mesh_type)
 Worker, draws the mesh.
void SetupMesh ()
 Worker, sets up the mesh with the vertices, color and other information.
void Start ()
 Initializes our working objects.

Detailed Description

A pen implementation with which you can do various kinds of 3D line rendering.

Definition at line 510 of file pen.h.


Member Function Documentation

void csPen3D::AddVertex ( const csVector3 v  )  [protected]

Adds a vertex.

Parameters:
v is the vertex
void csPen3D::DrawArc ( const csVector3 c1,
const csVector3 c2,
int  axis,
float  start_angle = 0,
float  end_angle = 6.2831853 
)

Draws an elliptical arc from start angle to end angle.

Angle must be specified in radians. The arc will be made to fit in the given plane as defined by c1-c2 and on the specific axis. c1 and c2 must be on the same plane as defined by axis. If you want a circular arc, make sure the box is a square. If you want a full circle or ellipse, specify 0 as the start angle and 2*PI as the end angle.

void csPen3D::DrawBox ( const csBox3 box  ) 

Draw a box.

void csPen3D::DrawCylinder ( const csBox3 box,
int  axis 
)

Draw a cylinder.

The axis specifies the top and bottom of the cylinder.

void csPen3D::DrawLine ( const csVector3 v1,
const csVector3 v2 
)

Draws a single line.

void csPen3D::DrawLines ( const csArray< csPen3DCoordinatePair > &  pairs  ) 

Draws a series of lines.

void csPen3D::DrawMesh ( csRenderMeshType  mesh_type  )  [protected]

Worker, draws the mesh.

const csReversibleTransform& csPen3D::GetLocal2ObjectTransform (  )  const [inline]

Get the local to object transform.

Definition at line 613 of file pen.h.

void csPen3D::SetActiveCache ( csPenCache cache  )  [inline]

Set an active pen cache.

After this call all drawing calls to this pen will be cached on the cache until you clear the pen cache again. At that point the pen cache can be used to do cached drawings. Note that the pen cache does not work for text. Also note that the pen cache can be updated later with new commands if you set it again onto a pen. It is also safe to use the same pencache with different pens.

Definition at line 579 of file pen.h.

void csPen3D::SetColor ( float  r,
float  g,
float  b,
float  a 
)

Sets the current color.

Parameters:
r The red component.
g The green component.
b The blue component.
a The alpha component.
void csPen3D::SetLocal2ObjectTransform ( const csReversibleTransform trans  )  [inline]

Set the local to object transform.

This is used at the time the primitives are rendered.

Definition at line 607 of file pen.h.

void csPen3D::SetMixMode ( uint  mode  ) 

Sets the given mix (blending) mode.

Parameters:
mode The mixmode to set.
void csPen3D::SetTransform ( const csReversibleTransform trans  ) 

Set object to world transform.

This is used only when actually drawing.

void csPen3D::SetupMesh (  )  [protected]

Worker, sets up the mesh with the vertices, color and other information.

void csPen3D::Start (  )  [protected]

Initializes our working objects.


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

Generated for Crystal Space 2.1 by doxygen 1.6.1