CrystalSpace

Public API Reference

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

csModelDataTools Struct Reference

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

#include <cstool/mdltool.h>

List of all members.

Static Public Member Functions

static void BuildVertexArray (iModelDataPolygon *poly, csDirtyAccessArray< int > *SpriteVertices, csDirtyAccessArray< int > *SpriteNormals, csDirtyAccessArray< int > *SpriteColors, csDirtyAccessArray< int > *SpriteTexels, csDirtyAccessArray< int > *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.
static void CompressVertices (iModelData *Scene)
 Merge duplicate vertices, normals, colors and texels in all objects of a model data scene.
static void CompressVertices (iModelDataObject *Object)
 Merge duplicate vertices, normals, colors and texels in an object.
static void CopyVerticesMapped (iModelDataObject *dest, iModelDataObject *src, const csModelDataVertexMap *map)
 Copy the default vertices and actions of one object into another one.
static void Describe (iObject *obj, csString &s)
 Print a description of an object into a string.
static void MergeCopyObject (iModelDataObject *dest, iModelDataObject *src)
 Copy the contents of one object into antoher one.
static void MergeObjects (iModelData *Scene, bool MultiTexture)
 Merge all contained mesh objects in a scene into a single one.
static void SplitObjectsByMaterial (iModelData *Scene)
 Split objects in a scene using more than one material into objects with only a single material.


Detailed Description

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

Definition at line 102 of file mdltool.h.


Member Function Documentation

static void csModelDataTools::BuildVertexArray iModelDataPolygon poly,
csDirtyAccessArray< int > *  SpriteVertices,
csDirtyAccessArray< int > *  SpriteNormals,
csDirtyAccessArray< int > *  SpriteColors,
csDirtyAccessArray< int > *  SpriteTexels,
csDirtyAccessArray< int > *  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 0 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.

static void csModelDataTools::CompressVertices iModelData Scene  )  [static]
 

Merge duplicate vertices, normals, colors and texels in all objects of a model data scene.

static void csModelDataTools::CompressVertices iModelDataObject Object  )  [static]
 

Merge duplicate vertices, normals, colors and texels in an object.

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

static void csModelDataTools::Describe iObject obj,
csString s
[static]
 

Print a description of an object into a string.

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

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

static void csModelDataTools::SplitObjectsByMaterial iModelData Scene  )  [static]
 

Split objects in a scene using more than one material into objects with only a single material.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.4.4