Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
void Cobject::setParent (Cmaxwell::Cobject object)

Cmaxwell::Cobject getParent(void)

to set the scene hierarchy. This is very useful when the user wants to open the scene in Maxwell Studio, because the scene hierarchy is kept.

...

This method returns a Cobject which is an instance (not a mesh). It is only needed to create it with a name, the reference object and a transformation matrix. Then a material can be applied to the Cobject returned with setMaterial (if setMaterial is not used it gets the material of the reference object even if it is different in each triangle, but if setMaterial is used for the instance in the instance, it only supports a material for the whole instance). Other Cobject methods as setHide(), setHideToCamera(), etc are also supported in instances.


Triangle Groups

Triangle groups are very useful to export sub-object info, so the user can recover triangle selections inside Studio. It is only needed to add new triangle groups to the scene using this method:

Code Block

Cmaxwell::Ccluster newCluster = pScene->addCluster (name);

Then the object that owns this triangle group, the number of triangles and the indexes of these triangles should be specified.

Code Block

Cmaxwell::Ccluster::addObject (Cmaxwell::Cobject, pTriangles, nTriangles);

To set a material to the whole triangle group at the same time, the following function is used:

Code Block

Cmaxwell::Ccluster::setMaterial (Cmaxwell::Cmaterial)

which is equivalent to call setTriangleMaterial for each triangle of the group.