iGeneralFactoryState Struct Reference
[Mesh plugins, Mesh plugins]
This interface describes the API for the general mesh factory.
More...
#include <imesh/genmesh.h>
Inheritance diagram for iGeneralFactoryState:

Public Member Functions | |
virtual void | AddTriangle (const csTriangle &tri)=0 |
Add a triangle. | |
virtual void | AddVertex (const csVector3 &v, const csVector2 &uv, const csVector3 &normal, const csColor4 &color)=0 |
Add a vertex. | |
virtual void | CalculateNormals (bool compress=true)=0 |
Automatically calculate normals based on the current mesh. | |
virtual void | Compress ()=0 |
Compress the vertex table. | |
virtual void | GenerateBox (const csBox3 &box)=0 |
Automatically generate a box. | |
virtual void | GenerateSphere (const csEllipsoid &ellips, int rim_vertices, bool cyl_mapping=false, bool toponly=false, bool reversed=false)=0 |
Automatically generate a sphere. | |
virtual iGenMeshAnimationControlFactory * | GetAnimationControlFactory () const =0 |
Get the current animation control factory for this factory. | |
virtual csColor4 * | GetColors ()=0 |
Get the array of colors. | |
virtual csVector3 * | GetNormals ()=0 |
Get the array of normals. | |
virtual csVector2 * | GetTexels ()=0 |
Get the array of texels. | |
virtual int | GetTriangleCount () const =0 |
Get the number of triangles for this mesh. | |
virtual csTriangle * | GetTriangles ()=0 |
Get the array of triangles. | |
virtual int | GetVertexCount () const =0 |
Get the number of vertices for this mesh. | |
virtual csVector3 * | GetVertices ()=0 |
Get the array of vertices. | |
virtual void | Invalidate ()=0 |
After making a significant change to the vertices or triangles you probably want to let this object recalculate the bounding boxes and such. | |
virtual bool | IsAutoNormals () const =0 |
Returns whether normals were autogenerated or manual. | |
virtual bool | IsBack2Front () const =0 |
Get the value of the back2front flag. | |
virtual void | SetAnimationControlFactory (iGenMeshAnimationControlFactory *anim_ctrl)=0 |
Set the animation control factory to use for this factory. | |
virtual void | SetBack2Front (bool b2f)=0 |
Enable back to front rendering for the triangles of this genmesh. | |
virtual void | SetTriangleCount (int n)=0 |
Set the number of triangles to use for this mesh. | |
virtual void | SetVertexCount (int n)=0 |
Set the number of vertices to use for this mesh. |
Detailed Description
This interface describes the API for the general mesh factory.iGeneralFactoryState inherits from iGeneralMeshState. All methods from iGeneralMeshState as set on the factory will serve as defaults for mesh objects that are created from this factory AFTER the default value is set. So changing such a value on the factory will have no effect on meshes already created. The material wrapper is an exception to this rule. Setting that on the factory will have an effect immediatelly on all mesh objects created from that factory except for those mesh objects that have their own material set.
Main creators of instances implementing this interface:
- Genmesh mesh object plugin (crystalspace.mesh.object.genmesh)
- iMeshObjectType::NewFactory()
Main ways to get pointers to this interface:
Main users of this interface:
- Genmesh Factory Loader plugin (crystalspace.mesh.loader.factory.genmesh)
Definition at line 201 of file genmesh.h.
Member Function Documentation
|
Add a triangle. This is one way to fill the triangle table. The other way is to use SetTriangleCount() and then fill the table manually. |
|
Add a vertex. This is one way to fill the vertex and other tables. The other way is to use SetVertexCount() and then fill the tables manually. |
|
Automatically calculate normals based on the current mesh. /param compress if true (default) then calculate the normals based on compressed vertices. |
|
Compress the vertex table. This should be called after setting up the geometry. |
|
Automatically generate a box. This will set the number of vertices to eight and generate vertices, texels, normals, and triangles. The vertex colors are set to black. |
|
Automatically generate a sphere. This will set the apropriate number of vertices and generate vertices, texels, normals, and triangles. The vertex colors are set to black.
|
|
Get the current animation control factory for this factory.
|
|
Get the array of colors. It is legal to modify the colors in this array (but don't forget to call Invalidate()). The number of colors in this array will be equal to the number of vertices set. Note that modifying the colors will not do a lot if manual colors is not enabled (SetManualColors). |
|
Get the array of normals. It is legal to modify the normals in this array (but don't forget to call Invalidate()). The number of normals in this array will be equal to the number of vertices set. Note that modifying the normals is only useful when manual colors are not enabled and lighting is enabled because the normals are used for lighting. |
|
Get the array of texels. It is legal to modify the texels in this array (but don't forget to call Invalidate()). The number of texels in this array will be equal to the number of vertices set. |
|
Get the number of triangles for this mesh.
|
|
Get the array of triangles. It is legal to modify the triangles in this array (but don't forget to call Invalidate()). The number of triangles in this array will be equal to the number of triangles set. |
|
Get the number of vertices for this mesh.
|
|
Get the array of vertices. It is legal to modify the vertices in this array (but don't forget to call Invalidate()). The number of vertices in this array will be equal to the number of vertices set. |
|
After making a significant change to the vertices or triangles you probably want to let this object recalculate the bounding boxes and such. This function will invalidate the internal data structures so that they are recomputed. |
|
Returns whether normals were autogenerated or manual.
|
|
Get the value of the back2front flag.
|
|
Set the animation control factory to use for this factory. See iGenMeshAnimationControlFactory for more information. |
|
Enable back to front rendering for the triangles of this genmesh. This is useful if this factory represents a transparent genmesh or the material that is being used is itself transparent. |
|
Set the number of triangles to use for this mesh. The easiest way to set the triangle data is to just use AddTriangle(). However, you can also call SetTriangleCount() and then call GetTriangles() to set the data that way. Note that you have to call Invalidate() after modifying the triangle data this way. |
|
Set the number of vertices to use for this mesh. The easiest way to set the mesh data is to just use AddVertex(). However, you can also call SetVertexCount() and then call GetVertices(), GetTexels(), ... to set the data that way. Note that you have to call Invalidate() after modifying the vertex data this way. |
The documentation for this struct was generated from the following file:
- imesh/genmesh.h
Generated for Crystal Space by doxygen 1.4.6