Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csModelDataTools Struct Reference

A set of utility functions to deal with model data components. More...

#include <mdltool.h>

List of all members.

Static Public Methods

void MergeCopyObject (iModelDataObject *dest, iModelDataObject *src)
 Copy the contents of one object into antoher one. More...

void CopyVerticesMapped (iModelDataObject *dest, iModelDataObject *src, const csModelDataVertexMap *map)
 Copy the default vertices and actions of one object into another one. More...

void MergeObjects (iModelData *Scene, bool MultiTexture)
 Merge all contained mesh objects in a scene into a single one. More...

void SplitObjectsByMaterial (iModelData *Scene)
 Split objects in a scene using more than one material into objects with only a single material.

void Describe (iObject *obj, csString &s)
 Print a description of an object into a string.

void CompressVertices (iModelDataObject *Object)
 Merge duplicate vertices, normals, colors and texels in an object.

void CompressVertices (iModelData *Scene)
 Merge duplicate vertices, normals, colors and texels in all objects of a model data scene.

void BuildVertexArray (iModelDataPolygon *poly, csIntArray *SpriteVertices, csIntArray *SpriteNormals, csIntArray *SpriteColors, csIntArray *SpriteTexels, csIntArray *PolyVertices)
 This functions helps to build structures that use a single index per vertex for position, normal, color and texel instead of one index for each list. More...


Detailed Description

A set of utility functions to deal with model data components.


Member Function Documentation

void csModelDataTools::BuildVertexArray ( iModelDataPolygon * poly,
csIntArray * SpriteVertices,
csIntArray * SpriteNormals,
csIntArray * SpriteColors,
csIntArray * SpriteTexels,
csIntArray * PolyVertices ) [static]
 

This functions helps to build structures that use a single index per vertex for position, normal, color and texel instead of one index for each list.

CS's 3d sprites are an example for this.

The 'poly' parameter is expected to be a valid polygon. The Sprite... lists should contain the (so far known) mapping of new indices to old indices. In other words, these lists are adressed with the 'single index' from the 3d sprite and return the 'multiple indices' used in the model data components. In the process of converting several polygons with this function, you should pass the same lists again and again. The lists will (probably) be empty for the first polygon and be filled a bit more for each polygon. Finally, after converting all polygons, the lists can be used to convert the vertex frames. Finally, the 'PolyVertices' parameter should be an empty list that will be filled with the 'single indices'.

You can omit those lists you do not need. For example, if you don't care about vertex colors, pass NULL for 'SpriteColors'. This has the effect that (obviously) you don't get a list of mapped vertex colors. It also tells this function that vertices with different colors may be merged.

void csModelDataTools::CopyVerticesMapped ( iModelDataObject * dest,
iModelDataObject * src,
const csModelDataVertexMap * map ) [static]
 

Copy the default vertices and actions of one object into another one.

All vertex, normal, color and texel indices are mapped as described in the given mapping table.

void csModelDataTools::MergeCopyObject ( iModelDataObject * dest,
iModelDataObject * src ) [static]
 

Copy the contents of one object into antoher one.

Both objects may contain something. Note that overlapping vertices are NOT merged by this function. There are two reasons: Firstly, vertex merging is also useful without object merging and should therefore be done separately. Secondly, vertex merging is a very complex task (as the vertices to merge have to share position in every frame of every action) and is thus done separately anyway. @@ vertex merging is not yet implemented.

void csModelDataTools::MergeObjects ( iModelData * Scene,
bool MultiTexture ) [static]
 

Merge all contained mesh objects in a scene into a single one.

If 'MultiTexture' is true then objects with different textures may be merged.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000