In file include/csengine/thingtpl.h:

## class csPolygonTemplate

> A csPolygonTemplate is used by a ThingTemplate to describe a template for a polygon

### Public Methods

  void | AddVertex (int v)
  | csPolygonTemplate (csThingTemplate* parent, char* name, csTextureHandle* texture = NULL)
  csColor& | GetFlatColor () Get the flat color for this polygon.
  int | GetMaxVertices ()
  char* | GetName ()
  int | GetNumVertices ()
  csTextureHandle* | GetTexture ()
  csMatrix3& | GetTextureMatrix ()
  csVector3& | GetTextureVector ()
  csVector2* | GetUVCoords () Get the pointer to the vertex uv coordinates.
  int* | GetVerticesIdx ()
  int | IsLighted ()
  int | IsMipmapped ()
  void | PlaneNormal (float* A, float* B, float* C) Compute the plane normal of this polygon.
  void | ResetFlatColor () Reset flat color (i.e. use texturing again).
  void | ResetUV () Reset UV coordinate array.
  void | SetFlatColor (csColor& fc) Set the flat color for this polygon.
  void | SetFlatColor (float r, float g, float b) Set the flat color for this polygon.
  void | SetGouraud () Enable gouraud shading.
  void | SetLighting (int yes)
  void | SetMipmapping (int yes)
  void | SetTexture (csTextureHandle* texture)
  void | SetTextureSpace (csMatrix3& tx_matrix, csVector3& tx_vector) Set the transformation from object to texture space.
  void | SetUV (int i, float u, float v) Set UV coordinate for specified vertex.
  void | Transform (csMatrix3& m, csVector3& v) Transform the texture tranformation using the given matrix/vector.
  bool | UseFlatColor () Return true if flat color is used (instead of texture).
  bool | UseGouraud () Is gouraud shading used?
  virtual | ~csPolygonTemplate ()

### Private Fields

  csColor | flat_color Flat color to use instead of texture map.
  csMatrix3 | m_obj2tex The transformation from object space to texture space.
  int | max_vertices Maximum number of vertices.
  char | name [30]
  int | no_lighting Should this polygon be lighted?
  int | no_mipmap Should mipmapping be used for this polygon?
  int | num_vertices Number of vertices for this polygon.
  csThingTemplate* | parent
  csTextureHandle* | texture The texture used for this polygon.
  bool | use_flat_color True if flat_color should be used.
  bool | use_gouraud True if gouraud shading used.
  csVector2* | uv_coords Optional uv coordinates.
  csVector3 | v_obj2tex The transformation from object space to texture space.
  int* | vertices_idx A table of indices into the vertices of the parent Polygon

## Documentation

> A csPolygonTemplate is used by a ThingTemplate to describe a template for a polygon

`int* vertices_idx`
  A table of indices into the vertices of the parent Polygon

`int num_vertices`
  Number of vertices for this polygon.

`int max_vertices`
  Maximum number of vertices.

`char name[30]`

`int no_mipmap`
  Should mipmapping be used for this polygon?

`int no_lighting`
  Should this polygon be lighted?

`csTextureHandle* texture`
  The texture used for this polygon.

`csMatrix3 m_obj2tex`
  The transformation from object space to texture space.

`csVector3 v_obj2tex`
  The transformation from object space to texture space.

`csVector2* uv_coords`
  Optional uv coordinates.

`csThingTemplate* parent`

`csColor flat_color`
  Flat color to use instead of texture map.

`bool use_flat_color`
  True if flat_color should be used.

`bool use_gouraud`
  True if gouraud shading used.

`csPolygonTemplate(csThingTemplate* parent, char* name, csTextureHandle* texture = NULL)`

`virtual ~csPolygonTemplate()`

`int GetMaxVertices()`

`int GetNumVertices()`

`int* GetVerticesIdx()`

`void AddVertex(int v)`

`char* GetName()`

`void SetUV(int i, float u, float v)`
  Set UV coordinate for specified vertex.

`void ResetUV()`
  Reset UV coordinate array.

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

`bool UseFlatColor()`
  Return true if flat color is used (instead of texture).

`csColor& GetFlatColor()`
  Get the flat color for this polygon.

`void SetGouraud()`
  Enable gouraud shading.

`bool UseGouraud()`
  Is gouraud shading used?

`void SetFlatColor(float r, float g, float b)`
  Set the flat color for this polygon.

`void SetFlatColor(csColor& fc)`
  Set the flat color for this polygon.

`void ResetFlatColor()`
  Reset flat color (i.e. use texturing again).

`void PlaneNormal(float* A, float* B, float* C)`
  Compute the plane normal of this polygon.

`void SetTexture(csTextureHandle* texture)`

`void SetTextureSpace(csMatrix3& tx_matrix, csVector3& tx_vector)`
  Set the transformation from object to texture space.

`void Transform(csMatrix3& m, csVector3& v)`
  Transform the texture tranformation using the given matrix/vector.

`csTextureHandle* GetTexture()`

`csMatrix3& GetTextureMatrix()`

`csVector3& GetTextureVector()`

`void SetLighting(int yes)`

`void SetMipmapping(int yes)`

`int IsLighted()`

`int IsMipmapped()`

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