csVertexCompressor Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Static Public Member Functions
csVertexCompressor Class Reference

A vertex compressor. More...

`#include <cstool/vertexcompress.h>`

List of all members.

## Static Public Member Functions
static csCompressVertexInfo * | Compress (csVector3 *vertices, csVector2 *texels, csVector3 *normals, csColor4 *colors, size_t num_vertices, csVector3 *&new_vertices, csVector2 *&new_texels, csVector3 *&new_normals, csColor4 *&new_colors, size_t &new_count)
| Compress an array of vertices (i.e.
static csCompressVertexInfo * | Compress (csArray< csVector3 > &vertices, csArray< csVector2 > &texels, csArray< csVector3 > &normals, csArray< csColor4 > &colors)
| Compress an array of vertices (i.e.
static size_t * | Compress (csRef< iRenderBuffer > *buffers, size_t numBuffers, size_t &newCount)
| Compress an array of vertices (i.e.

## Detailed Description

A vertex compressor.

Definition at line 51 of file vertexcompress.h.

## Member Function Documentation

static csCompressVertexInfo* csVertexCompressor::Compress | ( | csVector3 * | vertices,
|  | csVector2 * | texels,
|  | csVector3 * | normals,
|  | csColor4 * | colors,
|  | size_t | num_vertices,
|  | csVector3 *& | new_vertices,
|  | csVector2 *& | new_texels,
|  | csVector3 *& | new_normals,
|  | csColor4 *& | new_colors,
|  | size_t & | new_count
| ) |  | `[static]`

Compress an array of vertices (i.e.

remove all duplicated vertices). Returns an array of csCompressVertex which can be used to map from the old index to the new one. 'new_count' will be set to the new number of unique vertices (and 'new_vertices' will be the new vertex table with that size). The size of the returned array is 'num_vertices' though since it has to be indexed with the original vertex array. If this function returns 0 there is nothing to do (i.e. no duplicate vertices). Otherwise you have to 'delete[]' the returned array.

static csCompressVertexInfo* csVertexCompressor::Compress | ( | csArray< csVector3 > & | vertices,
|  | csArray< csVector2 > & | texels,
|  | csArray< csVector3 > & | normals,
|  | csArray< csColor4 > & | colors
| ) |  | `[static]`

Compress an array of vertices (i.e.

remove all duplicated vertices). Returns an array of csCompressVertex which can be used to map from the old index to the new one. The 'vertices' table will be modified with the new compressed vertices. If this function returns 0 there is nothing to do (i.e. no duplicate vertices). Otherwise you have to 'delete[]' the returned array.

static size_t* csVertexCompressor::Compress | ( | csRef< iRenderBuffer > * | buffers,
|  | size_t | numBuffers,
|  | size_t & | newCount
| ) |  | `[static]`

Compress an array of vertices (i.e.

remove all duplicated vertices).

Parameters:

  buffers | Array of render buffers to compress. All buffers must have the same amount of elements. The pointed-to references will be replaced with the compressed buffers.
  numBuffers | Number of render buffers in buffers.
  newCount | Receives the new vertex count.

Returns:
  An array of indices to map from an old index to a new one. The array size will be equal to old the number of vertices. It must be freed with delete[] after use.

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

- cstool/vertexcompress.h