Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
dcpp::scene::IColladaMeshWriterNames Class Referenceabstract

Callback interface to use custom names on collada writing. More...

#include <duckcpp/core/engine/IColladaMeshWriter.hpp>

Inheritance diagram for dcpp::scene::IColladaMeshWriterNames:
Inheritance graph
Collaboration diagram for dcpp::scene::IColladaMeshWriterNames:
Collaboration graph

Public Member Functions

virtual dcpp::nub::string nameForMesh (const dcpp::scene::IMesh *mesh, int instance)=0
 Return a unique name for the given mesh.
 
virtual dcpp::nub::string nameForNode (const dcpp::scene::ISceneNode *node)=0
 Return a unique name for the given node.
 
virtual dcpp::nub::string nameForMaterial (const dcpp::video::SMaterial &material, int materialId, const dcpp::scene::IMesh *mesh, const dcpp::scene::ISceneNode *node)=0
 Return a name for the material.
 
- Public Member Functions inherited from dcpp::IReferenceCounted
 IReferenceCounted ()
 Constructor.
 
virtual ~IReferenceCounted ()
 Destructor.
 
void grab () const
 Grabs the object. Increments the reference counter by one.
 
bool drop () const
 Drops the object. Decrements the reference counter by one.
 
dcpp::int32_kt getReferenceCount () const
 Get the reference count.
 
const dcpp::char_ktgetDebugName () const
 Returns the debug name of the object.
 

Additional Inherited Members

- Protected Member Functions inherited from dcpp::IReferenceCounted
void setDebugName (const dcpp::char_kt *newName)
 Sets the debug name of the object.
 

Detailed Description

Callback interface to use custom names on collada writing.

You can either modify names and id's written to collada or you can use this interface to just find out which names are used on writing. Names are often used later as xs:anyURI, so avoid whitespace, '#' and '' in the names.

Member Function Documentation

◆ nameForMaterial()

virtual dcpp::nub::string dcpp::scene::IColladaMeshWriterNames::nameForMaterial ( const dcpp::video::SMaterial material,
int  materialId,
const dcpp::scene::IMesh mesh,
const dcpp::scene::ISceneNode node 
)
pure virtual

Return a name for the material.

There is one material created in the writer for each unique name. So you can use this to control the number of materials which get written. For example Duckcpp does by default write one material for each material instanced by a node. So if you know that in your application material instances per node are identical between different nodes you can reduce the number of exported materials using that knowledge by using identical names for such shared materials. Names must follow the xs:NCName standard to be valid, you can run them through IColladaMeshWriter::toNCName to ensure that.

◆ nameForMesh()

virtual dcpp::nub::string dcpp::scene::IColladaMeshWriterNames::nameForMesh ( const dcpp::scene::IMesh mesh,
int  instance 
)
pure virtual

Return a unique name for the given mesh.

Note that names really must be unique here per mesh-pointer, so mostly it's a good idea to return the nameForMesh from IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow the xs:NCName standard to be valid, you can run them through IColladaMeshWriter::toNCName to ensure that.

Parameters
meshPointer to the mesh which needs a name
instanceWhen E_COLLADA_GEOMETRY_WRITING is not ECGI_PER_MESH then several instances of the same mesh can be written and this counts them.

◆ nameForNode()

virtual dcpp::nub::string dcpp::scene::IColladaMeshWriterNames::nameForNode ( const dcpp::scene::ISceneNode node)
pure virtual

Return a unique name for the given node.

Note that names really must be unique here per node-pointer, so mostly it's a good idea to return the nameForNode from IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow the xs:NCName standard to be valid, you can run them through IColladaMeshWriter::toNCName to ensure that.


The documentation for this class was generated from the following file:

Duckcpp    @cppfx.xyz