| ## Public API Reference

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

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csVector3Array Class Reference
[Geometry utilities]

This is actually the same class as csPoly3D. More...

`#include <csgeom/poly3d.h>`

Inheritance diagram for csVector3Array:

[legend]
List of all members.

## Public Member Functions
size_t | AddVertexSmart (float x, float y, float z)
| Add a vertex but first check if it isn't already present in the array.
size_t | AddVertexSmart (const csVector3 &v)
| Add a vertex but first check if it isn't already present in the array.
| csVector3Array (size_t start_size=10)
## Static Public Member Functions
static csCompressVertex * | CompressVertices (csArray< csVector3 > &vertices)
| Compress an array of vertices (i.e.
static csCompressVertex * | CompressVertices (csVector3 *vertices, size_t num_vertices, csVector3 *&new_vertices, size_t &new_count)
| Compress an array of vertices (i.e.

## Detailed Description

This is actually the same class as csPoly3D.

But it has been renamed to make it clear that it is for other uses. It also adds some functionality specific to that use. In particular this class is more used to hold an unordered collection of 3D vectors.

Definition at line 362 of file poly3d.h.

## Member Function Documentation

size_t csVector3Array::AddVertexSmart | ( | float | x,
|  | float | y,
|  | float | z |
| ) |  |  |

Add a vertex but first check if it isn't already present in the array.

Return the index that the vertex was added too.

size_t csVector3Array::AddVertexSmart | ( | const csVector3 & | v | ) | `[inline]`

Add a vertex but first check if it isn't already present in the array.

Return the index that the vertex was added too.

Definition at line 371 of file poly3d.h.

References csVector3::x, csVector3::y, and csVector3::z.

static csCompressVertex* csVector3Array::CompressVertices | ( | csArray< csVector3 > & | vertices | ) | `[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 csCompressVertex* csVector3Array::CompressVertices | ( | csVector3 * | vertices,
|  | size_t | num_vertices,
|  | csVector3 *& | new_vertices,
|  | 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.

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

- csgeom/poly3d.h