Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csCurve Class Reference

This is an abstract class for all curves in Crystal Space. More...

#include <curve.h>

Inheritance diagram for csCurve:

csObject iObject iBase csBezierCurve List of all members.

Public Methods

 csCurve (csCurveTemplate *parent_tmpl)
 Constructor.

virtual ~csCurve ()
 Destructor.

unsigned long GetCurveID () const
 Get the ID of this curve.

iVertexBufferGetVertexBuffer () const
 Get the vertex buffer for this curve.

iMaterialHandleGetMaterialHandle () const
 Return the material handle for this curve.

iMaterialWrapperGetMaterial () const
 Return the material wrapper for this curve.

void SetMaterial (iMaterialWrapper *h)
 Set the material wrapper for this curve.

csCurveTemplateGetParentTemplate () const
 Get the parent template used for this curve.

void MakeDirtyDynamicLights ()
 @. More...

void AddLightPatch (csLightPatch *lp)
 Add a lightpatch to this curves list of light patches.

void UnlinkLightPatch (csLightPatch *lp)
 Remove a lightpatch from this curves list.

bool RecalculateDynamicLights ()
 update the real lightmap with all light info.

void ShineDynLight (csLightPatch *lp)
 update the real lightmap with info from the lightpatch.

void SetObject2World (const csReversibleTransform *o2w)
 Set the current object to world space transformation.

const csReversibleTransformGetObject2World () const
 Return the current object to world space transformation.

void SetParentThing (csThing *p)
 Set the parent thing for this curve.

csThingGetParentThing () const
 Return the parent thing for this curve.

csLightMapGetLightMap () const
 Get the lightmap.

void CalculateLightingStatic (csFrustumView *lview, bool vis)
 Calculate the lighting for this curve (static).

void CalculateLightingDynamic (csFrustumView *lview)
 Calculate the lighting for this curve (dynamic).

void InitializeDefaultLighting ()
 Initialize default lighting.

bool ReadFromCache (iCacheManager *cache_mgr, int id)
 Read lighting from cache.

bool WriteToCache (iCacheManager *cache_mgr, int id)
 Cache the curve lightmaps.

void PrepareLighting ()
 Prepare lighting.

void GetCoverageMatrix (csFrustumView &lview, csCoverageMatrix &cm) const
 Populate a coverage matrix which relates shadow information for this curve's lightmap.

float GetArea ()
 return an approximation of the area of this curve.

void CalcUVBuffers ()
 @. More...

virtual csCurveTesselatedTesselate (int res)=0
 Tesselate this curve with the given resolution. More...

virtual void SetControlPoint (int index, int control_id)=0
 set control index for a control point (referring to the controls in the parent csThing).

virtual void GetObjectBoundingBox (csBox3 &bbox)=0
 Return a bounding box in object space for this curve.

void GetCameraBoundingBox (const csTransform &obj2cam, csBox3 &cbox)
 Get a bounding box in camera space. More...

float GetScreenBoundingBox (const csTransform &obj2cam, iCamera *camera, csBox3 &cameraBox, csBox2 &boundingBox)
 Get a bounding box in screen space and camera space. More...

virtual bool IsLightable ()
 Lighting support. More...

virtual void PosInSpace (csVector3 &vec, double u, double v)
 Helper function for lighting. Override for different types of curves.

virtual void Normal (csVector3 &vec, double u, double v)
 Helper function for lighting. Override for different types of curves.

virtual void HardTransform (const csReversibleTransform &trans)
 Do a hard transform on this curve.

 SCF_DECLARE_IBASE_EXT (csObject)

Public Attributes

csThingParentThing
 The polygon set parent.

csLightMapLightMap
 This is the lightmap to be placed on the curve.

bool LightmapUpToDate
 This flag indicates whether the lightmap is up-to-date.

csCurve::Curve  scfiCurve

Friends

class  csRadCurve
class  eiVertexBufferManagerClient
class  Curve

Detailed Description

This is an abstract class for all curves in Crystal Space.


Member Function Documentation

void csCurve::CalcUVBuffers ( )
 

@.

@

void csCurve::GetCameraBoundingBox ( const csTransform & obj2cam,
csBox3 & cbox )
 

Get a bounding box in camera space.

This function uses the object bounding box so it will exagerate the real bounding box a little.

float csCurve::GetScreenBoundingBox ( const csTransform & obj2cam,
iCamera * camera,
csBox3 & cameraBox,
csBox2 & boundingBox )
 

Get a bounding box in screen space and camera space.

This function will use GetCameraBoundingBox(). It will fill in the boundingBox with the X and Y locations of the curve. Returns the max Z location of the curve, or -1 if the curve is not on-screen. If the curve is not on-screen, the X and Y values are not valid.

bool csCurve::IsLightable ( ) [virtual]
 

Lighting support.

If IsLightable returns true, PosInSpace and Normal should calculate accurate positions and normals for the beziers, regardless of the approximating tesselation method. These are used for lighting. Default behaviour is to allow for unlighted curves. Derive these if you do want them lighted.

Reimplemented in csBezierCurve.

void csCurve::MakeDirtyDynamicLights ( )
 

@.

@

csCurveTesselated * csCurve::Tesselate ( int res ) [pure virtual]
 

Tesselate this curve with the given resolution.

This function will allocated and return a csCurveTesselated object. the curve is responsible for clamping res to allowed values itself.

Reimplemented in csBezierCurve.


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