User's Manual

Vector Classes
183
Use the append() method to add a value after the last value in an array.
Use the insert() method to insert a value at a specied index location.
Use the replace() method to replace one value with another.
Use the remove() method to remove the rst value it nds that matches its
argument.
Use the removeIndex() method to remove a specic value or a value located at a
specic index.
You can also remove array elements more quickly: fastRemove() removes the array
element, elt, and replaces it with the last element of the array, whereas remove() moves
all the remaining elements down one. Also, you can remove the array element, elt, by
passing in the index value, i, to fastRemoveIndex().
You can nd the index of a specic value in an array using the nd() method. You can
also write the contents of the array to the csOutput passed using the write() method.
Returning Array Data
To return a pointer directly to the array data, use the following method:
<type>* getArray() const;
Vector Classes
Cosmo 3D provides a wealth of vector math classes. Vectors of different dimensions
allow for data categorization according to need, for example, a color value could include
four component values. In this case, a four component vector would be used: csVec4f.
The following sections describe the vector classes and their transformation class.