|
vtlib library
|
Public Member Functions | |
| vtGeomFactory (vtGeode *pGeode, vtMesh::PrimType ePrimType, int iVertType, int iMaxVertsPerMesh, int iMatIndex, int iExpectedVerts=-1) | |
| vtGeomFactory (vtMesh *pMesh) | |
| void | PrimStart () |
| void | AddVertex (const FPoint3 &p) |
| void | PrimEnd () |
The vtGeomFactory class makes it easy to create geometry with a lot of vertices. You simply provide vertices, and it will create as many geometries as necessary to contain them all.
{
vtGeode *pLineGeom = new vtGeode;
vtGeomFactory mf(pLineGeom, osg::PrimitiveSet::LINE_STRIP, 0, 3000, 1);
mf.PrimStart();
for (int i = 0; i < 10000; i++)
mf.AddVertex(FPoint3(i,i,i));
mf.PrimEnd();
}
| vtGeomFactory::vtGeomFactory | ( | vtGeode * | pGeode, |
| vtMesh::PrimType | ePrimType, | ||
| int | iVertType, | ||
| int | iMaxVertsPerMesh, | ||
| int | iMatIndex, | ||
| int | iExpectedVerts = -1 |
||
| ) |
Constructor.
| pGeode | The geometry node which will receive the mesh object(s) that this factory will produce. |
| ePrimType | The type of mesh to produce. |
| iVertType | The vertex attributes for the meshes to produce. |
| iMaxVertsPerMesh | The largest number of vertices to allow in a single mesh. When this number is exceeded, the current mesh will be finished and another mesh begun. |
| iMatIndex | The material index of the mesh when it is added to the geometry node. |
| iExpectedVerts | If you know how many vertices will be mesh ahead of time, you can save a little time and memory by passing the number. |
| vtGeomFactory::vtGeomFactory | ( | vtMesh * | pMesh | ) |
Alternate, simpler constructor.
| pMesh | The mesh which will receive all the vertices that this factory produces. |
| void vtGeomFactory::AddVertex | ( | const FPoint3 & | p | ) |
Tell the factory to add a vertex to the current primitive.
| void vtGeomFactory::PrimEnd | ( | ) |
Tell the factory to end a primitive.
| void vtGeomFactory::PrimStart | ( | ) |
Tell the factory to start a primitive.
1.7.4