In file include/csengine/polygon.h:

class csGouraudShaded : public csPolygonTextureType

Lighting class for gouraud shaded polygons

Inheritance:


Public Methods

void AddColor(int i, float r, float g, float b)
Add a color to a static array color entry
void AddDynamicColor(int i, float r, float g, float b)
Add a color to a dynamic array color entry
void Clear()
Clear all (u,v) and color information
void EnableGouraud(bool g)
Enable/disable gouraud
csColor* GetColors()
Get the pointer to the vertex color table.
csColor* GetStaticColors()
Get the pointer to the static vertex color table.
virtual int GetTextureType()
Return a type for the kind of texturing used.
csVector2* GetUVCoords()
Get the pointer to the vertex uv coordinates.
void ResetDynamicColor(int i)
Reset a dynamic color to the static values
void SetColor(int i, csColor& c)
Set a color in the static array
void SetColor(int i, float r, float g, float b)
Set a color in the static array
void SetDynamicColor(int i, float r, float g, float b)
Set a color in the dynamic array
void SetDynamicColor(int i, csColor& c)
Set a color in the dynamic array
void Setup(int num_vertices)
Setup this lighting structure with the rignt number of vertices
void SetUV(int i, float u, float v)
Set an (u,v) texture coordinate for the specified vertex of this polygon

Private Fields

csColor* colors
If uv_coords is given then this can be an optional array of vertex colors
int num_vertices
Number of vertices.
csColor* static_colors
This array contains the static colors
csVector2* uv_coords
If the following arrays is non-NULL then this polygon is drawn using a different technique (all previous mipmap and lightmap stuff is ignored)

Private Methods

csGouraudShaded()
Constructor.
virtual ~csGouraudShaded()
Destructor.

Inherited from csPolygonTextureType:


Documentation

Lighting class for gouraud shaded polygons
csVector2* uv_coords
If the following arrays is non-NULL then this polygon is drawn using a different technique (all previous mipmap and lightmap stuff is ignored). The polygon will be drawn with perspective incorrect texture mapping and (in the future) Gouroud shading. The following array specifies the u,v coordinates for every vertex of the polygon.

csColor* colors
If uv_coords is given then this can be an optional array of vertex colors. If this array is given then gouraud shading is used. Otherwise flatshading.

csColor* static_colors
This array contains the static colors. It is used in combination with 'colors'. 'colors=static_colors+dynamic_lights'.

int num_vertices
Number of vertices.

csGouraudShaded()
Constructor.

virtual ~csGouraudShaded()
Destructor.

virtual int GetTextureType()
Return a type for the kind of texturing used.

void Setup(int num_vertices)
Setup this lighting structure with the rignt number of vertices. If use_gouraud is true we will also use gouraud shading. This function is guaranteed not to do anything if the number of vertices is already correct.

void EnableGouraud(bool g)
Enable/disable gouraud. This function is guaranteed not to do anything if gouraud shading was already enabled and it is enabled again.

void SetUV(int i, float u, float v)
Set an (u,v) texture coordinate for the specified vertex of this polygon. This function may only be called after all vertices have been added. As soon as this function is used this polygon will be rendered using a different technique (perspective incorrect texture mapping and Gouroud shading). This is useful for triangulated objects for which the triangles are very small and also for drawing very far away polygons for which perspective correctness is not needed (sky polygons for example).

void Clear()
Clear all (u,v) and color information

csVector2* GetUVCoords()
Get the pointer to the vertex uv coordinates.

csColor* GetColors()
Get the pointer to the vertex color table.

csColor* GetStaticColors()
Get the pointer to the static vertex color table.

void AddColor(int i, float r, float g, float b)
Add a color to a static array color entry

void AddDynamicColor(int i, float r, float g, float b)
Add a color to a dynamic array color entry

void SetDynamicColor(int i, float r, float g, float b)
Set a color in the dynamic array

void ResetDynamicColor(int i)
Reset a dynamic color to the static values

void SetDynamicColor(int i, csColor& c)
Set a color in the dynamic array

void SetColor(int i, float r, float g, float b)
Set a color in the static array

void SetColor(int i, csColor& c)
Set a color in the static array


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de