PixelLightAPI
.
|
#include <MeshLODLevel.h>
Public Member Functions | |
PLMESH_API | MeshLODLevel (Mesh *pMesh=nullptr) |
Constructor. | |
PLMESH_API | ~MeshLODLevel () |
Destructor. | |
PLMESH_API Mesh * | GetMesh () const |
Returns the mesh the LOD level belongs to. | |
PLMESH_API void | SetMesh (Mesh *pMesh=nullptr) |
Sets the mesh the LOD level belongs to. | |
PLMESH_API float | GetLODDistance () const |
Returns the distance for using this LOD level. | |
PLMESH_API void | SetLODDistance (float fDistance=0.0f) |
Sets the distance for using this LOD level. | |
PLMESH_API MeshLODLevel & | operator= (const MeshLODLevel &cSource) |
Copy operator. | |
PLMESH_API void | ClearIndexBuffer () |
Clears the index buffer for this LOD level. | |
PLMESH_API void | CreateIndexBuffer () |
Creates the index buffer for this LOD level. | |
PLMESH_API PLRenderer::IndexBuffer * | GetIndexBuffer () const |
Returns the index buffer for this LOD level. | |
PLMESH_API PLCore::uint32 | GetNumOfTriangles () const |
Returns the total number of LOD level triangles. | |
PLMESH_API void | ClearGeometries () |
Clears the geometries for this LOD level. | |
PLMESH_API void | CreateGeometries () |
Creates the geometries for this LOD level. | |
PLMESH_API PLCore::Array < Geometry > * | GetGeometries () const |
Gets the geometries of this LOD level. | |
PLMESH_API bool | CreateOctree (PLCore::uint32 nSubdivide=1, PLCore::uint32 nMinGeometries=10, PLCore::Array< PLCore::Array< PLCore::uint32 > * > *plstOctreeIDList=nullptr) |
Creates the LOD level octree. | |
PLMESH_API void | DestroyOctree () |
Destroys the LOD level octree. | |
PLMESH_API MeshOctree * | GetOctree () const |
Returns the LOD level octree. | |
PLMESH_API void | BuildConnectivity () |
Builds the connectivity information. | |
PLMESH_API void | BuildTriangleList () |
Builds the current triangle list. | |
PLMESH_API PLCore::Array < MeshTriangle > & | GetTriangleList () |
Gets the triangle list. | |
PLMESH_API void | BuildEdgeList () |
Builds the current edge list. | |
PLMESH_API PLCore::Array < MeshEdge > & | GetEdgeList () |
Gets the edge list. | |
PLMESH_API bool | GetTriangle (PLCore::uint32 nGeometry, PLCore::uint32 nIndex, PLCore::uint32 &nVertex1, PLCore::uint32 &nVertex2, PLCore::uint32 &nVertex3) const |
Gets a triangle of a geometry. | |
PLMESH_API bool | SplitGeometries (bool bSingleGeometries=false, PLCore::uint32 *pSplit=nullptr, PLCore::uint32 nSplitNumber=0) |
Splits up geometries to geometries of single triangles. | |
PLMESH_API bool | JoinGeometries (PLCore::uint32 *pJoin=nullptr, PLCore::uint32 nJoinNumber=0) |
Joins geometries with the same properties to one single geometry. | |
PLMESH_API bool | GenerateOctreeGeometries (PLCore::uint32 nSubdivide=1, PLCore::uint32 nMinGeometries=10) |
Optimizes the geometries for an octree. | |
PLMESH_API bool | GenerateStrips (PLCore::uint32 nVertexCacheSize=18, PLCore::uint32 nMinStripLength=3) |
Optimizes the geometries using triangle strips. | |
PLMESH_API bool | CalculateBoundingBox (const PLCore::Array< const Geometry * > &lstGeometries, PLRenderer::VertexBuffer &cVertexBuffer, PLMath::Vector3 &vMinPos, PLMath::Vector3 &vMaxPos) const |
Calculates the LOD level bounding box. | |
PLMESH_API bool | CalculateBoundingSphere (const PLCore::Array< const Geometry * > &lstGeometries, PLRenderer::VertexBuffer &cVertexBuffer, PLMath::Vector3 &vPos, float &fRadius) const |
Calculates the LOD level bounding sphere. |
Mesh LOD level.
PLMESH_API PLMesh::MeshLODLevel::MeshLODLevel | ( | Mesh * | pMesh = nullptr | ) |
Constructor.
[in] | pMesh | Pointer to the owner mesh, can be a null pointer |
PLMESH_API PLMesh::MeshLODLevel::~MeshLODLevel | ( | ) |
Destructor.
PLMESH_API Mesh* PLMesh::MeshLODLevel::GetMesh | ( | ) | const |
Returns the mesh the LOD level belongs to.
PLMESH_API void PLMesh::MeshLODLevel::SetMesh | ( | Mesh * | pMesh = nullptr | ) |
Sets the mesh the LOD level belongs to.
[in] | pMesh | Pointer to the owner mesh, can be a null pointer |
PLMESH_API float PLMesh::MeshLODLevel::GetLODDistance | ( | ) | const |
Returns the distance for using this LOD level.
PLMESH_API void PLMesh::MeshLODLevel::SetLODDistance | ( | float | fDistance = 0.0f | ) |
Sets the distance for using this LOD level.
[in] | fDistance | Distance for the LOD level |
PLMESH_API MeshLODLevel& PLMesh::MeshLODLevel::operator= | ( | const MeshLODLevel & | cSource | ) |
Copy operator.
[in] | cSource | Source to copy from |
PLMESH_API void PLMesh::MeshLODLevel::ClearIndexBuffer | ( | ) |
Clears the index buffer for this LOD level.
PLMESH_API void PLMesh::MeshLODLevel::CreateIndexBuffer | ( | ) |
Creates the index buffer for this LOD level.
PLMESH_API PLRenderer::IndexBuffer* PLMesh::MeshLODLevel::GetIndexBuffer | ( | ) | const |
Returns the index buffer for this LOD level.
PLMESH_API PLCore::uint32 PLMesh::MeshLODLevel::GetNumOfTriangles | ( | ) | const |
Returns the total number of LOD level triangles.
PLMESH_API void PLMesh::MeshLODLevel::ClearGeometries | ( | ) |
Clears the geometries for this LOD level.
PLMESH_API void PLMesh::MeshLODLevel::CreateGeometries | ( | ) |
Creates the geometries for this LOD level.
PLMESH_API PLCore::Array<Geometry>* PLMesh::MeshLODLevel::GetGeometries | ( | ) | const |
Gets the geometries of this LOD level.
PLMESH_API bool PLMesh::MeshLODLevel::CreateOctree | ( | PLCore::uint32 | nSubdivide = 1 , |
PLCore::uint32 | nMinGeometries = 10 , |
||
PLCore::Array< PLCore::Array< PLCore::uint32 > * > * | plstOctreeIDList = nullptr |
||
) |
Creates the LOD level octree.
[in] | nSubdivide | Octree subdivide |
[in] | nMinGeometries | Minimum number of geometries per octree |
[out] | plstOctreeIDList | Will optionally store a list of octrees each geometry is on, can be a null pointer |
PLMESH_API void PLMesh::MeshLODLevel::DestroyOctree | ( | ) |
Destroys the LOD level octree.
PLMESH_API MeshOctree* PLMesh::MeshLODLevel::GetOctree | ( | ) | const |
Returns the LOD level octree.
PLMESH_API void PLMesh::MeshLODLevel::BuildConnectivity | ( | ) |
Builds the connectivity information.
PLMESH_API void PLMesh::MeshLODLevel::BuildTriangleList | ( | ) |
Builds the current triangle list.
PLMESH_API PLCore::Array<MeshTriangle>& PLMesh::MeshLODLevel::GetTriangleList | ( | ) |
PLMESH_API void PLMesh::MeshLODLevel::BuildEdgeList | ( | ) |
Builds the current edge list.
PLMESH_API PLCore::Array<MeshEdge>& PLMesh::MeshLODLevel::GetEdgeList | ( | ) |
PLMESH_API bool PLMesh::MeshLODLevel::GetTriangle | ( | PLCore::uint32 | nGeometry, |
PLCore::uint32 | nIndex, | ||
PLCore::uint32 & | nVertex1, | ||
PLCore::uint32 & | nVertex2, | ||
PLCore::uint32 & | nVertex3 | ||
) | const |
Gets a triangle of a geometry.
[in] | nGeometry | Geometry ID |
[in] | nIndex | Triangle index |
[out] | nVertex1 | Will receive the first triangle vertex index |
[out] | nVertex2 | Will receive the second triangle vertex index |
[out] | nVertex3 | Will receive the third triangle vertex index |
PLMESH_API bool PLMesh::MeshLODLevel::SplitGeometries | ( | bool | bSingleGeometries = false , |
PLCore::uint32 * | pSplit = nullptr , |
||
PLCore::uint32 | nSplitNumber = 0 |
||
) |
Splits up geometries to geometries of single triangles.
[in] | bSingleGeometries | One geometry per triangle? Recommended if octrees should be build but not good when preparing the mesh for optimize! |
[in] | pSplit | Optional index list of the geometries to split, if a null pointer all geometries will be split |
[in] | nSplitNumber | If pSplit isn't a null pointer this indicates the number of geometries to split |
PLMESH_API bool PLMesh::MeshLODLevel::JoinGeometries | ( | PLCore::uint32 * | pJoin = nullptr , |
PLCore::uint32 | nJoinNumber = 0 |
||
) |
Joins geometries with the same properties to one single geometry.
[in] | pJoin | Optional index list of the geometries to join, if a null pointer all geometries will be joined |
[in] | nJoinNumber | If pJoin isn't a null pointer, this indicates the number of geometries to join |
PLMESH_API bool PLMesh::MeshLODLevel::GenerateOctreeGeometries | ( | PLCore::uint32 | nSubdivide = 1 , |
PLCore::uint32 | nMinGeometries = 10 |
||
) |
Optimizes the geometries for an octree.
[in] | nSubdivide | Octree subdivide |
[in] | nMinGeometries | Minimum number of geometries per octree |
PLMESH_API bool PLMesh::MeshLODLevel::GenerateStrips | ( | PLCore::uint32 | nVertexCacheSize = 18 , |
PLCore::uint32 | nMinStripLength = 3 |
||
) |
Optimizes the geometries using triangle strips.
[in] | nVertexCacheSize | Sets the cache size which the stripfier uses to optimize the data. Controls the length of the generated individual strips. CacheSize should be 0 to disable the cache optimizer, 10 for a GeForce 256 or a GeForce 2, 16 or 18 for a GeForce 3 or a GeForce 4. Play a bit with this setting to find the best value for your 3D card. |
[in] | nMinStripLength | Sets the minimum acceptable size for a strip, in triangles. All strips generated which are shorter than this will be thrown into one big, separate list. |
PLMESH_API bool PLMesh::MeshLODLevel::CalculateBoundingBox | ( | const PLCore::Array< const Geometry * > & | lstGeometries, |
PLRenderer::VertexBuffer & | cVertexBuffer, | ||
PLMath::Vector3 & | vMinPos, | ||
PLMath::Vector3 & | vMaxPos | ||
) | const |
Calculates the LOD level bounding box.
[in] | lstGeometries | The LOD level geometries to use |
[in] | cVertexBuffer | Vertex buffer to use |
[out] | vMinPos | Will receive the minimum bounding box position |
[out] | vMaxPos | Will receive the maximum bounding box position |
PLMESH_API bool PLMesh::MeshLODLevel::CalculateBoundingSphere | ( | const PLCore::Array< const Geometry * > & | lstGeometries, |
PLRenderer::VertexBuffer & | cVertexBuffer, | ||
PLMath::Vector3 & | vPos, | ||
float & | fRadius | ||
) | const |
Calculates the LOD level bounding sphere.
[in] | lstGeometries | The LOD level geometries to use |
[in] | cVertexBuffer | Vertex buffer to use |
[out] | vPos | Will receive the bounding sphere position |
[out] | fRadius | Will receive the bounding sphere radius |
|