CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csVector3Array Class Reference
[Geometry utilities]

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

#include <poly3d.h>

Inheritance diagram for csVector3Array:

csPoly3D List of all members.

Public Methods

int AddVertexSmart (const csVector3 &v)
 Add a vertex but first check if it isn't already present in the array.

int AddVertexSmart (float x, float y, float z)
 Add a vertex but first check if it isn't already present in the array.


Static Public Methods

csCompressVertexCompressVertices (csVector3 *vertices, int num_vertices, csVector3 *&new_vertices, int &new_count)
 Compress an array of vertices (i.e.

csCompressVertexCompressVertices (csArray< csVector3 > &vertices)
 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 299 of file poly3d.h.


Member Function Documentation

int 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.

int 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 308 of file poly3d.h.

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

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.

csCompressVertex* csVector3Array::CompressVertices csVector3   vertices,
int    num_vertices,
csVector3 *&    new_vertices,
int &    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:
Generated for Crystal Space by doxygen 1.2.18