 |
Irrlicht 3D Engine
|
|
Go to the documentation of this file.
5 #ifndef __IRR_I_COLLADA_MESH_WRITER_H_INCLUDED__
6 #define __IRR_I_COLLADA_MESH_WRITER_H_INCLUDED__
206 : Properties(0), DefaultProperties(0), NameGenerator(0), DefaultNameGenerator(0)
207 , WriteTextures(true), WriteDefaultScene(true), ExportSMaterialOnce(true)
208 , AmbientLight(0.f, 0.f, 0.f, 1.f)
218 if ( DefaultProperties )
219 DefaultProperties->
drop();
221 NameGenerator->
drop();
222 if ( DefaultNameGenerator )
223 DefaultNameGenerator->
drop();
233 WriteTextures = write;
239 return WriteTextures;
249 WriteDefaultScene = write;
255 return WriteDefaultScene;
261 AmbientLight = ambientColor;
280 GeometryWriting = writeStyle;
286 return GeometryWriting;
299 ExportSMaterialOnce = exportOnce;
304 return ExportSMaterialOnce;
312 if ( p == Properties )
331 return DefaultProperties;
337 if ( nameGenerator == NameGenerator )
340 nameGenerator->
grab();
342 NameGenerator->
drop();
343 NameGenerator = nameGenerator;
349 return NameGenerator;
356 return DefaultNameGenerator;
368 if ( p == DefaultProperties )
372 if ( DefaultProperties )
373 DefaultProperties->
drop();
374 DefaultProperties = p;
380 if ( p == DefaultNameGenerator )
384 if ( DefaultNameGenerator )
385 DefaultNameGenerator->
drop();
386 DefaultNameGenerator = p;
395 bool WriteDefaultScene;
396 bool ExportSMaterialOnce;
virtual ~IColladaMeshWriterProperties()
void grab() const
Grabs the object. Increments the reference counter by one.
E_COLLADA_GEOMETRY_WRITING
Control when geometry elements are created.
E_COLLADA_IRR_COLOR
Irrlicht colors which can be mapped to E_COLLADA_COLOR_SAMPLER values.
virtual bool getWriteDefaultScene() const
Get if a default scene should be written.
@ ECOF_A_ONE
default - only alpha channel of color or texture is used.
@ ECOF_RGB_ZERO
Alpha values for each RGB channel of color or texture are used.
@ ECIC_NONE
Don't write this element at all.
virtual irr::core::stringw nameForMesh(const scene::IMesh *mesh, int instance)=0
Return a unique name for the given mesh.
IColladaMeshWriterNames * getDefaultNameGenerator() const
Return the original default name generator of the writer.
virtual void setDefaultNameGenerator(IColladaMeshWriterNames *p)
virtual bool getExportSMaterialsOnlyOnce() const
bool drop() const
Drops the object. Decrements the reference counter by one.
@ ECIC_AMBIENT
Use SMaterial::AmbientColor.
virtual void setProperties(IColladaMeshWriterProperties *p)
Set properties to use by the meshwriter instead of it's default properties.
virtual irr::core::stringw toNCName(const irr::core::stringw &oldString, const irr::core::stringw &prefix=irr::core::stringw(L"_NC_")) const =0
Restrict the characters of oldString a set of allowed characters in xs::NCName and add the prefix.
virtual E_COLLADA_TRANSPARENT_FX getTransparentFx(const video::SMaterial &material) const =0
Return the transparence color interpretation.
@ ECIC_SPECULAR
Use SMaterial::SpecularColor.
@ ECIC_CUSTOM
Check IColladaMeshWriterProperties for custom color.
virtual f32 getIndexOfRefraction(const video::SMaterial &material) const =0
Return index of refraction for that material.
Callback interface to use custom names on collada writing.
virtual IColladaMeshWriterProperties * getProperties() const
Get properties which are currently used.
signed int s32
32 bit signed variable.
E_COLLADA_TECHNIQUE_FX
Lighting models - more or less the way Collada categorizes materials.
Interface for writing meshes.
Class representing a color with four floats.
virtual E_COLLADA_GEOMETRY_WRITING getGeometryWriting() const
Get the current style of geometry writing.
virtual bool getWriteTextures() const
Get if texture information should be written.
Base class of most objects of the Irrlicht Engine.
virtual video::SColor getCustomColor(const video::SMaterial &material, E_COLLADA_COLOR_SAMPLER cs) const =0
Return custom colors for certain color types requested by collada.
Interface providing write access to a file.
float f32
32 bit floating point variable.
virtual IColladaMeshWriterNames * getNameGenerator() const
Get currently used name generator.
virtual s32 getTextureIdx(const video::SMaterial &material, E_COLLADA_COLOR_SAMPLER cs) const =0
Which texture index should be used when writing the texture of the given sampler color.
virtual void setWriteDefaultScene(bool write)
Set if a default scene should be written when writing meshes.
virtual ~IColladaMeshWriter()
Destructor.
virtual irr::core::stringw nameForNode(const scene::ISceneNode *node)=0
Return a unique name for the given node.
@ ECGI_PER_MESH
Default - write each mesh exactly once to collada. Optimal but will not work with many tools.
@ ECGI_PER_MESH_AND_MATERIAL
@ ECIC_EMISSIVE
Use SMaterial::EmissiveColor.
Class which holds the geometry of an object.
virtual void setDefaultProperties(IColladaMeshWriterProperties *p)
E_COLLADA_TRANSPARENT_FX
How to interpret the opacity in collada.
virtual bool useNodeMaterial(const scene::ISceneNode *node) const =0
Return if the node has it's own material overwriting the mesh-materials.
virtual E_COLLADA_IRR_COLOR getColorMapping(const video::SMaterial &material, E_COLLADA_COLOR_SAMPLER cs) const =0
Return which color from Irrlicht should be used for the color requested by collada.
@ ECIC_DIFFUSE
Use SMaterial::DiffuseColor.
Everything in the Irrlicht Engine can be found in this namespace.
E_COLLADA_COLOR_SAMPLER
Color names collada uses in it's color samplers.
virtual f32 getReflectivity(const video::SMaterial &material) const =0
Reflectivity value for that material.
Interface for writing meshes.
virtual bool isExportable(const irr::scene::ISceneNode *node) const =0
Callback interface for properties which can be used to influence collada writing.
virtual void setAmbientLight(const video::SColorf &ambientColor)
Sets ambient color of the scene to write.
virtual ~IColladaMeshWriterNames()
virtual void setGeometryWriting(E_COLLADA_GEOMETRY_WRITING writeStyle)
Control when and how often a mesh is written.
@ ECTF_PHONG
Phong shading, default in many external renderers.
virtual IMesh * getMesh(irr::scene::ISceneNode *node)=0
virtual E_COLLADA_TECHNIQUE_FX getTechniqueFx(const video::SMaterial &material) const =0
Which lighting model should be used in the technique (FX) section when exporting effects (materials)
virtual void setWriteTextures(bool write)
Set if texture information should be written.
Struct for holding parameters for a material renderer.
virtual bool writeScene(io::IWriteFile *file, scene::ISceneNode *root)=0
writes a scene starting with the given node
virtual f32 getTransparency(const video::SMaterial &material) const =0
Transparency value for that material.
virtual video::SColorf getAmbientLight() const
Return ambient light of the scene which is written.
IColladaMeshWriterProperties * getDefaultProperties() const
Return the original default properties of the writer.
Class representing a 32 bit ARGB color.
virtual void setExportSMaterialsOnlyOnce(bool exportOnce)
Make certain there is only one collada material generated per Irrlicht material.
virtual irr::core::stringw nameForMaterial(const video::SMaterial &material, int materialId, const scene::IMesh *mesh, const scene::ISceneNode *node)=0
Return a name for the material.
@ ECTF_LAMBERT
diffuse shaded surface that is independent of lighting.
virtual void setNameGenerator(IColladaMeshWriterNames *nameGenerator)
Install a generator to create custom names on export.