PixelLightAPI
.
|
#include <Mesh.h>
Public Types | |
enum | EFlags { DrawVertices = 1<<0, DrawNormals = 1<<1, DrawOctree = 1<<2 } |
Mesh draw flags. More... | |
Public Member Functions | |
virtual PLMESH_API | ~Mesh () |
Destructor. | |
PLMESH_API MeshManager * | GetMeshManager () const |
Returns the owner mesh manager. | |
PLMESH_API SkeletonManager & | GetSkeletonManager () |
Returns the skeleton manager. | |
PLMESH_API PLRenderer::Renderer * | GetRenderer () const |
Returns the used renderer. | |
PLMESH_API PLCore::uint32 | GetMaxNumOfVertices () const |
Checks all LODs and returns the maximum number of vertices. | |
PLMESH_API PLCore::uint32 | GetMaxNumOfGeometries () const |
Checks all LODs and returns the maximum number of geometries. | |
PLMESH_API PLCore::uint32 | GetMaxNumOfTriangles () const |
Checks all LODs and returns the maximum number of triangles. | |
PLMESH_API void | Draw (const PLMath::Matrix4x4 &mWorldViewProjection, bool bBlend=false, PLCore::uint32 nFlags=0, PLCore::uint32 nLODLevel=0, PLCore::uint32 nMorphTarget=0, bool bUseMaterials=true) const |
Draws the mesh. | |
PLMESH_API Mesh & | operator= (const Mesh &cSource) |
Copy operator. | |
PLMESH_API AnchorPointManager & | GetAnchorPointManager () |
Returns the anchor point manager. | |
PLMESH_API void | ClearMorphTargets () |
Clears all morph targets. | |
PLMESH_API PLCore::uint32 | GetNumOfMorphTargets () const |
Returns the number of morph targets. | |
PLMESH_API MeshMorphTarget * | AddMorphTarget () |
Adds a new morph target. | |
PLMESH_API MeshMorphTarget * | GetMorphTarget (PLCore::uint32 nMorphTarget=0) const |
Gets one of the mesh's morph targets by index. | |
PLMESH_API MeshMorphTarget * | GetMorphTarget (const PLCore::String &sName) const |
Gets one of the mesh's morph targets by name. | |
PLMESH_API int | GetMorphTargetIndex (const PLCore::String &sName) const |
Returns the index of a given morph target. | |
PLMESH_API MorphTargetAniManager & | GetMorphTargetAnimationManager () |
Returns the morph target animation manager. | |
PLMESH_API bool | AddMorphTargetAnimation (const PLCore::String &sFilename) |
Adds a morph target animation. | |
PLMESH_API void | ClearLODLevels () |
Clears all LOD levels. | |
PLMESH_API PLCore::uint32 | GetNumOfLODLevels () const |
Returns the number of LOD levels. | |
PLMESH_API MeshLODLevel * | AddLODLevel () |
Adds a new LOD level. | |
PLMESH_API MeshLODLevel * | GetLODLevel (PLCore::uint32 nLODLevel=0) const |
Gets one of the mesh's LOD levels. | |
PLMESH_API void | ClearMaterials () |
Clears all materials. | |
PLMESH_API PLCore::uint32 | GetNumOfMaterials () const |
Returns the number of materials. | |
PLMESH_API PLRenderer::Material * | AddMaterial (PLRenderer::Material *pMaterial) |
Adds a new material. | |
PLMESH_API bool | DeleteMaterial (PLCore::uint32 nMaterial) |
Deletes a material. | |
PLMESH_API PLCore::uint32 | GetMaterialUsage (PLCore::uint32 nMaterial) const |
Returns the number of geometries using this material. | |
PLMESH_API PLRenderer::Material * | GetMaterial (PLCore::uint32 nMaterial=0) const |
Gets one of the mesh's materials. | |
PLMESH_API bool | SetMaterial (PLCore::uint32 nMaterial, PLRenderer::Material *pMaterial) |
Sets one of the mesh's materials. | |
PLMESH_API void | ClearSkeletonHandlers () |
Clears the list of skeleton handlers. | |
PLMESH_API PLCore::Array < SkeletonHandler * > & | GetSkeletonHandlers () |
Returns the list of skeleton handlers. | |
PLMESH_API PLCore::Array < Weight > & | GetWeights () |
Returns the weights array. | |
PLMESH_API PLCore::Array < VertexWeights > & | GetVertexWeights () |
Returns the vertex weights array. | |
PLMESH_API void | BuildConnectivity () |
Builds the connectivity information of all LOD levels. | |
PLMESH_API void | BuildTrianglePlaneList () |
Builds the current triangle planes of all morph targets. | |
PLMESH_API bool | BuildLOD (PLCore::uint32 nNumLODLevels) |
Builds the LOD levels automatically. | |
PLMESH_API bool | CalculateNormals () |
Calculate the vertex normals of all morph targets of the mesh. | |
PLMESH_API bool | CalculateTangentSpaceVectors (bool bTangent=true, bool bBinormal=true) |
Calculates all tangent space vectors of all morph targets of the mesh. | |
PLMESH_API void | GetBoundingBox (PLMath::Vector3 &vMin, PLMath::Vector3 &vMax) const |
Returns the mesh bounding box. | |
PLMESH_API void | SetBoundingBox (const PLMath::Vector3 &vMin, const PLMath::Vector3 &vMax) |
Set's the mesh bounding box. | |
PLMESH_API bool | CalculateBoundingBox (PLMath::Vector3 &vMin, PLMath::Vector3 &vMax) |
Calculates the mesh bounding box. | |
PLMESH_API bool | CalculateBoundingSphere (PLMath::Vector3 &vPos, float &fRadius) |
Calculates the mesh bounding sphere. | |
virtual PLMESH_API bool | Unload () override |
Unloads the loadable. | |
virtual PLMESH_API PLCore::String | GetLoadableTypeName () const override |
Returns the loadable type name. |
Mesh class.
enum PLMesh::Mesh::EFlags |
Mesh draw flags.
virtual PLMESH_API PLMesh::Mesh::~Mesh | ( | ) | [virtual] |
Destructor.
PLMESH_API MeshManager* PLMesh::Mesh::GetMeshManager | ( | ) | const |
Returns the owner mesh manager.
PLMESH_API SkeletonManager& PLMesh::Mesh::GetSkeletonManager | ( | ) |
Returns the skeleton manager.
PLMESH_API PLRenderer::Renderer* PLMesh::Mesh::GetRenderer | ( | ) | const |
Returns the used renderer.
PLMESH_API PLCore::uint32 PLMesh::Mesh::GetMaxNumOfVertices | ( | ) | const |
Checks all LODs and returns the maximum number of vertices.
PLMESH_API PLCore::uint32 PLMesh::Mesh::GetMaxNumOfGeometries | ( | ) | const |
Checks all LODs and returns the maximum number of geometries.
PLMESH_API PLCore::uint32 PLMesh::Mesh::GetMaxNumOfTriangles | ( | ) | const |
Checks all LODs and returns the maximum number of triangles.
PLMESH_API void PLMesh::Mesh::Draw | ( | const PLMath::Matrix4x4 & | mWorldViewProjection, |
bool | bBlend = false , |
||
PLCore::uint32 | nFlags = 0 , |
||
PLCore::uint32 | nLODLevel = 0 , |
||
PLCore::uint32 | nMorphTarget = 0 , |
||
bool | bUseMaterials = true |
||
) | const |
Draws the mesh.
[in] | mWorldViewProjection | World view projection matrix to use |
[in] | bBlend | Draw only mesh parts which use a blended material? |
[in] | nFlags | Draw flags (use EFlags) |
[in] | nLODLevel | Which LOD level to use |
[in] | nMorphTarget | Which morph target to use |
[in] | bUseMaterials | Use the mesh materials? If 'false' no material is bound. |
Copy operator.
[in] | cSource | Source to copy from |
PLMESH_API AnchorPointManager& PLMesh::Mesh::GetAnchorPointManager | ( | ) |
Returns the anchor point manager.
PLMESH_API void PLMesh::Mesh::ClearMorphTargets | ( | ) |
Clears all morph targets.
PLMESH_API PLCore::uint32 PLMesh::Mesh::GetNumOfMorphTargets | ( | ) | const |
Returns the number of morph targets.
PLMESH_API MeshMorphTarget* PLMesh::Mesh::AddMorphTarget | ( | ) |
Adds a new morph target.
PLMESH_API MeshMorphTarget* PLMesh::Mesh::GetMorphTarget | ( | PLCore::uint32 | nMorphTarget = 0 | ) | const |
Gets one of the mesh's morph targets by index.
[in] | nMorphTarget | Number of the morph target to get |
PLMESH_API MeshMorphTarget* PLMesh::Mesh::GetMorphTarget | ( | const PLCore::String & | sName | ) | const |
Gets one of the mesh's morph targets by name.
[in] | sName | Name of the morph target to get |
PLMESH_API int PLMesh::Mesh::GetMorphTargetIndex | ( | const PLCore::String & | sName | ) | const |
Returns the index of a given morph target.
[in] | sName | Name of the morph target the index should be returned |
PLMESH_API MorphTargetAniManager& PLMesh::Mesh::GetMorphTargetAnimationManager | ( | ) |
Returns the morph target animation manager.
PLMESH_API bool PLMesh::Mesh::AddMorphTargetAnimation | ( | const PLCore::String & | sFilename | ) |
Adds a morph target animation.
[in] | sFilename | Morph target animation filename |
PLMESH_API void PLMesh::Mesh::ClearLODLevels | ( | ) |
Clears all LOD levels.
PLMESH_API PLCore::uint32 PLMesh::Mesh::GetNumOfLODLevels | ( | ) | const |
Returns the number of LOD levels.
PLMESH_API MeshLODLevel* PLMesh::Mesh::AddLODLevel | ( | ) |
Adds a new LOD level.
PLMESH_API MeshLODLevel* PLMesh::Mesh::GetLODLevel | ( | PLCore::uint32 | nLODLevel = 0 | ) | const |
Gets one of the mesh's LOD levels.
[in] | nLODLevel | Number of the LOD level to get |
PLMESH_API void PLMesh::Mesh::ClearMaterials | ( | ) |
Clears all materials.
PLMESH_API PLCore::uint32 PLMesh::Mesh::GetNumOfMaterials | ( | ) | const |
Returns the number of materials.
PLMESH_API PLRenderer::Material* PLMesh::Mesh::AddMaterial | ( | PLRenderer::Material * | pMaterial | ) |
Adds a new material.
[in] | pMaterial | Material to add, if a null pointer, nothing happens |
PLMESH_API bool PLMesh::Mesh::DeleteMaterial | ( | PLCore::uint32 | nMaterial | ) |
Deletes a material.
[in] | nMaterial | Number of the material to delete |
PLMESH_API PLCore::uint32 PLMesh::Mesh::GetMaterialUsage | ( | PLCore::uint32 | nMaterial | ) | const |
Returns the number of geometries using this material.
[in] | nMaterial | Number of the material to check |
PLMESH_API PLRenderer::Material* PLMesh::Mesh::GetMaterial | ( | PLCore::uint32 | nMaterial = 0 | ) | const |
Gets one of the mesh's materials.
[in] | nMaterial | Number of the material to get |
PLMESH_API bool PLMesh::Mesh::SetMaterial | ( | PLCore::uint32 | nMaterial, |
PLRenderer::Material * | pMaterial | ||
) |
Sets one of the mesh's materials.
[in] | nMaterial | Number of the material to set |
[in] | pMaterial | Pointer to the material to set, can be a null pointer |
PLMESH_API void PLMesh::Mesh::ClearSkeletonHandlers | ( | ) |
Clears the list of skeleton handlers.
PLMESH_API PLCore::Array<SkeletonHandler*>& PLMesh::Mesh::GetSkeletonHandlers | ( | ) |
Returns the list of skeleton handlers.
PLMESH_API PLCore::Array<Weight>& PLMesh::Mesh::GetWeights | ( | ) |
Returns the weights array.
PLMESH_API PLCore::Array<VertexWeights>& PLMesh::Mesh::GetVertexWeights | ( | ) |
Returns the vertex weights array.
PLMESH_API void PLMesh::Mesh::BuildConnectivity | ( | ) |
Builds the connectivity information of all LOD levels.
PLMESH_API void PLMesh::Mesh::BuildTrianglePlaneList | ( | ) |
Builds the current triangle planes of all morph targets.
PLMESH_API bool PLMesh::Mesh::BuildLOD | ( | PLCore::uint32 | nNumLODLevels | ) |
Builds the LOD levels automatically.
[in] | nNumLODLevels | Number of LOD levels to create (including the original) |
PLMESH_API bool PLMesh::Mesh::CalculateNormals | ( | ) |
Calculate the vertex normals of all morph targets of the mesh.
PLMESH_API bool PLMesh::Mesh::CalculateTangentSpaceVectors | ( | bool | bTangent = true , |
bool | bBinormal = true |
||
) |
Calculates all tangent space vectors of all morph targets of the mesh.
[in] | bTangent | Create tangent vectors? |
[in] | bBinormal | Create binormal vectors? |
PLMESH_API void PLMesh::Mesh::GetBoundingBox | ( | PLMath::Vector3 & | vMin, |
PLMath::Vector3 & | vMax | ||
) | const |
Returns the mesh bounding box.
[out] | vMin | Will receive the minimum bounding box position |
[out] | vMax | Will receive the maximum bounding box position |
PLMESH_API void PLMesh::Mesh::SetBoundingBox | ( | const PLMath::Vector3 & | vMin, |
const PLMath::Vector3 & | vMax | ||
) |
Set's the mesh bounding box.
[in] | vMin | The minimum bounding box position |
[in] | vMax | The maximum bounding box position |
PLMESH_API bool PLMesh::Mesh::CalculateBoundingBox | ( | PLMath::Vector3 & | vMin, |
PLMath::Vector3 & | vMax | ||
) |
Calculates the mesh bounding box.
[out] | vMin | Will receive the minimum bounding box position |
[out] | vMax | Will receive the maximum bounding box position |
PLMESH_API bool PLMesh::Mesh::CalculateBoundingSphere | ( | PLMath::Vector3 & | vPos, |
float & | fRadius | ||
) |
Calculates the mesh bounding sphere.
[out] | vPos | Will receive the bounding sphere position |
[out] | fRadius | Will receive the bounding sphere radius |
virtual PLMESH_API bool PLMesh::Mesh::Unload | ( | ) | [override, virtual] |
Unloads the loadable.
Reimplemented from PLCore::Loadable.
virtual PLMESH_API PLCore::String PLMesh::Mesh::GetLoadableTypeName | ( | ) | const [override, virtual] |
|