#include <curve.h>
Inheritance diagram for csCurve:
Public Methods | |
csCurve (csCurveTemplate *parent_tmpl) | |
Constructor. | |
virtual | ~csCurve () |
Destructor. | |
unsigned long | GetCurveID () const |
Get the ID of this curve. | |
iVertexBuffer* | GetVertexBuffer () const |
Get the vertex buffer for this curve. | |
iMaterialHandle* | GetMaterialHandle () const |
Return the material handle for this curve. | |
iMaterialWrapper* | GetMaterial () const |
Return the material wrapper for this curve. | |
void | SetMaterial (iMaterialWrapper *h) |
Set the material wrapper for this curve. | |
csCurveTemplate* | GetParentTemplate () 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 csReversibleTransform* | GetObject2World () const |
Return the current object to world space transformation. | |
void | SetParentThing (csThing *p) |
Set the parent thing for this curve. | |
csThing* | GetParentThing () const |
Return the parent thing for this curve. | |
csLightMap* | GetLightMap () 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 (int id) |
Read lighting from cache. | |
bool | WriteToCache (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 csCurveTesselated* | Tesselate (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 | |
csThing* | ParentThing |
The polygon set parent. | |
csLightMap* | LightMap |
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 |
|
@. @ |
|
Get a bounding box in camera space. This function uses the object bounding box so it will exagerate the real bounding box a little. |
|
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. |
|
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. |
|
@. @ |
|
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. |