Ccluster

C++Python
Cmaxwell::CclusterCcluster

Provides functionality to group triangles.

Friend classes

Cmaxwell and CobjectIterator.

Inherits from

Cpointer.

Sub-classes

Citerator, Cobject, and CobjectIterator.

methods

NameDescription
getNameGets cluster name.
addObjectAdds a triangle array of an object to the cluster.
setMaterialSets cluster's material.

addObject

Adds a triangle array of an object to the cluster.

LanguageSyntax
C++byte addObject( Cmaxwell::Cobject object, dword* pTriangles, dword nTriangles )
Pythonint addObject( CmaxwellObject object, int[] pTriangles )

Parameters

TypeNameIn/OutDescription
Cmaxwell::CobjectobjectinObject that contains the triangles.
dword*pTrianglesinArray containing the triangle indexes to add to the cluster.
dwordnTrianglesinNumber of triangles in pTriangles.

Return values

0 = Error adding triangles to the cluster.

1 = Success.

Examples

C++
Cmaxwell::Cobject object = scene.getObject( "objectname" );
Cmaxwell::Cluster cluster = scene.addCluster( "clustername" );

dword triangles[5] = {1, 2, 3, 4, 5};

cluster.addObject( object, triangles, 5 );   
Python
obj = scene.getObject( 'objectname' );
cluster = scene.addCluster( 'clustername' );

triangles = [1, 2, 3, 4, 5];

cluster.addObject( obj, triangles );    

setMaterial

Sets cluster's material.

LanguageSyntax
C++byte setMaterial( Cmaxwell::Cmaterial material )
Pythonint setMaterial( CmaxwellMaterial material )

Return value

0 = Error setting material.

1 = Success.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Â