PixelLightAPI
.
|
#include <MeshHandler.h>
Public Member Functions | |
PLMESH_API | MeshHandler () |
Constructor. | |
virtual PLMESH_API | ~MeshHandler () |
Destructor. | |
PLMESH_API PLRenderer::Renderer * | GetRenderer () const |
Returns the used renderer. | |
PLMESH_API void | MeshUpdateRequired () |
Whenever you manipulated mesh data "from outside" you need to call this function to set a "dirty"-flag. | |
PLMESH_API Mesh * | GetMesh () const |
Returns the used mesh. | |
PLMESH_API bool | SetMesh (Mesh *pMesh=nullptr) |
Sets the used mesh. | |
PLMESH_API void | Update (float fTimeDifference, PLCore::uint32 nLODLevel=0) |
Updates the mesh handler. | |
PLMESH_API void | Draw (bool bBlend=false, bool bUseMaterials=true) const |
Draws the mesh. | |
PLMESH_API void | DrawVertices (const PLGraphics::Color4 &cColor) const |
Draws the vertices of the mesh (for debugging) | |
PLMESH_API void | DrawNormals (const PLGraphics::Color4 &cColor, const PLMath::Matrix4x4 &mWorldViewProjection, float fScale=1.0f, float fLineWidth=1.0f) const |
Draws the normals of the mesh (for debugging) | |
PLMESH_API void | DrawTangents (const PLGraphics::Color4 &cColor, const PLMath::Matrix4x4 &mWorldViewProjection, float fScale=1.0f, float fLineWidth=1.0f) const |
Draws the tangents of the mesh (for debugging) | |
PLMESH_API void | DrawBinormals (const PLGraphics::Color4 &cColor, const PLMath::Matrix4x4 &mWorldViewProjection, float fScale=1.0f, float fLineWidth=1.0f) const |
Draws the binormals of the mesh (for debugging) | |
PLMESH_API void | DrawVertexNumbers (PLRenderer::Font &cFont, const PLGraphics::Color4 &cColor, const PLMath::Matrix4x4 &mWorldViewProjection) const |
Draws the vertex numbers of the mesh (for debugging) | |
PLMESH_API void | DrawAnchorPoints (PLRenderer::Font &cFont, const PLGraphics::Color4 &cColor, const PLMath::Matrix4x4 &mWorldViewProjection) const |
Draws the anchor points of the mesh (for debugging) | |
PLMESH_API PLCore::uint32 | GetNumOfMaterials () const |
Returns the number of materials. | |
PLMESH_API PLRenderer::Material * | GetMaterial (PLCore::uint32 nMaterial=0) const |
Gets one of the mesh handler's materials. | |
PLMESH_API bool | SetMaterial (PLCore::uint32 nMaterial, PLRenderer::Material *pMaterial) |
Sets one of the mesh handler's materials. | |
PLMESH_API PLCore::Array< float > & | GetBaseMorphTargetWeights () |
Returns an array holding the the base weight of each morph target. | |
PLMESH_API const PLCore::Array < float > & | GetBaseMorphTargetWeights () const |
PLMESH_API PLCore::Array< float > & | GetMorphTargetWeights () |
Returns an array holding the the current weight of each morph target. | |
PLMESH_API const PLCore::Array < float > & | GetMorphTargetWeights () const |
PLMESH_API SkeletonHandler * | GetSkeletonHandler () const |
Returns the skeleton handler. | |
PLMESH_API MeshAnimationManager * | GetMeshAnimationManager () const |
Returns the mesh animation manager. | |
PLMESH_API MeshAnimationManager * | CreateMeshAnimationManager (const PLCore::String &sName="PLMesh::MeshAnimationManagerSoftware") |
Creates the mesh animation manager. | |
PLMESH_API void | GetAnimationsList (PLCore::Array< PLCore::String > &lstAnimations) const |
Returns a list of all currently available animations. | |
PLMESH_API PLRenderer::AnimationInfo * | GetAnimationInfo (const PLCore::String &sName, int nLogMessage=1) const |
Returns a pointer to the requested animation information. | |
PLMESH_API JointHandler * | GetJointHandler (const PLCore::String &sJointName) const |
Returns a current joint handler. | |
PLMESH_API JointHandler * | GetBaseJointHandler (const PLCore::String &sJointName) const |
Returns a base joint handler. | |
PLMESH_API void | UpdateVisibility (const PLMath::PlaneSet &cPlaneSet, bool bFirst=true) |
Updates the mesh visibility. | |
PLMESH_API PLCore::Bitset & | GetGeometryVisibility () |
Returns the bit set holding the geometry visibility state. | |
PLMESH_API PLCore::uint32 | GetNumOfLODLevels () const |
Returns the number of mesh LOD levels. | |
PLMESH_API PLCore::uint32 | GetLODLevelIndex () const |
Returns the current used mesh LOD level index. | |
PLMESH_API MeshLODLevel * | GetLODLevel () const |
Returns the current used mesh LOD level. | |
PLMESH_API bool | CalculateJointBoundingBox (PLMath::AABoundingBox &cAAB) const |
Calculates the current axis aligned joint bounding box. | |
PLMESH_API PLRenderer::VertexBuffer * | GetVertexBuffer () const |
Returns the current used vertex buffer of the mesh. | |
PLMESH_API PLCore::uint32 | GetNumOfTriangles () const |
Returns the total number of current triangles. | |
PLMESH_API bool | FindTriangle (const PLMath::Vector3 &vLineStartPos, const PLMath::Vector3 &vLineEndPos, PLCore::uint32 &nTriangle, PLCore::uint32 *pnGeometry=nullptr, PLMath::Vector3 *pvCollisionPoint=nullptr, PLCore::Array< PLCore::uint32 > *plstGeometries=nullptr) const |
Returns the first mesh triangle intersecting the line. | |
PLMESH_API PLCore::uint32 | FindGeometries (const PLMath::PlaneSet &cPlaneSet, PLCore::uint32 **ppnGeometries=nullptr, PLMath::Vector3 *pvCamDir=nullptr) const |
Returns a list of mesh geometries intersecting the plane set. | |
PLMESH_API PLCore::Array < MeshTriangle > * | GetTriangleList () |
Gets the triangle list. | |
PLMESH_API PLCore::Array < MeshEdge > * | GetEdgeList () |
Gets the edge list. | |
PLMESH_API void | BuildTrianglePlaneList () |
Builds the current triangle planes. | |
PLMESH_API PLCore::Array < PLMath::Plane > * | GetTrianglePlaneList () |
Gets the triangle plane list. |
Mesh handler.
PLMESH_API PLMesh::MeshHandler::MeshHandler | ( | ) |
Constructor.
virtual PLMESH_API PLMesh::MeshHandler::~MeshHandler | ( | ) | [virtual] |
Destructor.
PLMESH_API PLRenderer::Renderer* PLMesh::MeshHandler::GetRenderer | ( | ) | const |
Returns the used renderer.
PLMESH_API void PLMesh::MeshHandler::MeshUpdateRequired | ( | ) |
Whenever you manipulated mesh data "from outside" you need to call this function to set a "dirty"-flag.
PLMESH_API Mesh* PLMesh::MeshHandler::GetMesh | ( | ) | const |
Returns the used mesh.
PLMESH_API bool PLMesh::MeshHandler::SetMesh | ( | Mesh * | pMesh = nullptr | ) |
Sets the used mesh.
[in] | pMesh | Pointer to the mesh which should be used, can be a null pointer |
PLMESH_API void PLMesh::MeshHandler::Update | ( | float | fTimeDifference, |
PLCore::uint32 | nLODLevel = 0 |
||
) |
Updates the mesh handler.
[in] | fTimeDifference | Past time since last frame (use e.g. PLCore::Timing::GetInstance()->GetTimeDifference()) |
[in] | nLODLevel | LOD level to use |
PLMESH_API void PLMesh::MeshHandler::Draw | ( | bool | bBlend = false , |
bool | bUseMaterials = true |
||
) | const |
Draws the mesh.
[in] | bBlend | Draw only mesh parts which use a blended material? |
[in] | bUseMaterials | Use the mesh materials? If 'false' no material is bound. |
PLMESH_API void PLMesh::MeshHandler::DrawVertices | ( | const PLGraphics::Color4 & | cColor | ) | const |
Draws the vertices of the mesh (for debugging)
[in] | cColor | Color to use |
PLMESH_API void PLMesh::MeshHandler::DrawNormals | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Matrix4x4 & | mWorldViewProjection, | ||
float | fScale = 1.0f , |
||
float | fLineWidth = 1.0f |
||
) | const |
Draws the normals of the mesh (for debugging)
[in] | cColor | Color to use |
[in] | mWorldViewProjection | World view projection matrix to use |
[in] | fScale | Normal scale |
[in] | fLineWidth | Line width |
PLMESH_API void PLMesh::MeshHandler::DrawTangents | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Matrix4x4 & | mWorldViewProjection, | ||
float | fScale = 1.0f , |
||
float | fLineWidth = 1.0f |
||
) | const |
Draws the tangents of the mesh (for debugging)
[in] | cColor | Color to use |
[in] | mWorldViewProjection | World view projection matrix to use |
[in] | fScale | Tangent scale |
[in] | fLineWidth | Line width |
PLMESH_API void PLMesh::MeshHandler::DrawBinormals | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Matrix4x4 & | mWorldViewProjection, | ||
float | fScale = 1.0f , |
||
float | fLineWidth = 1.0f |
||
) | const |
Draws the binormals of the mesh (for debugging)
[in] | cColor | Color to use |
[in] | mWorldViewProjection | World view projection matrix to use |
[in] | fScale | Binormals scale |
[in] | fLineWidth | Line width |
PLMESH_API void PLMesh::MeshHandler::DrawVertexNumbers | ( | PLRenderer::Font & | cFont, |
const PLGraphics::Color4 & | cColor, | ||
const PLMath::Matrix4x4 & | mWorldViewProjection | ||
) | const |
Draws the vertex numbers of the mesh (for debugging)
[in] | cFont | Font to use |
[in] | cColor | Color to use |
[in] | mWorldViewProjection | World view projection matrix to use |
PLMESH_API void PLMesh::MeshHandler::DrawAnchorPoints | ( | PLRenderer::Font & | cFont, |
const PLGraphics::Color4 & | cColor, | ||
const PLMath::Matrix4x4 & | mWorldViewProjection | ||
) | const |
Draws the anchor points of the mesh (for debugging)
[in] | cFont | Font to use |
[in] | cColor | Color to use |
[in] | mWorldViewProjection | World view projection matrix to use |
PLMESH_API PLCore::uint32 PLMesh::MeshHandler::GetNumOfMaterials | ( | ) | const |
Returns the number of materials.
PLMESH_API PLRenderer::Material* PLMesh::MeshHandler::GetMaterial | ( | PLCore::uint32 | nMaterial = 0 | ) | const |
Gets one of the mesh handler's materials.
[in] | nMaterial | Number of the material to get |
PLMESH_API bool PLMesh::MeshHandler::SetMaterial | ( | PLCore::uint32 | nMaterial, |
PLRenderer::Material * | pMaterial | ||
) |
Sets one of the mesh handler'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 PLCore::Array<float>& PLMesh::MeshHandler::GetBaseMorphTargetWeights | ( | ) |
Returns an array holding the the base weight of each morph target.
PLMESH_API const PLCore::Array<float>& PLMesh::MeshHandler::GetBaseMorphTargetWeights | ( | ) | const |
PLMESH_API PLCore::Array<float>& PLMesh::MeshHandler::GetMorphTargetWeights | ( | ) |
Returns an array holding the the current weight of each morph target.
PLMESH_API const PLCore::Array<float>& PLMesh::MeshHandler::GetMorphTargetWeights | ( | ) | const |
PLMESH_API SkeletonHandler* PLMesh::MeshHandler::GetSkeletonHandler | ( | ) | const |
Returns the skeleton handler.
PLMESH_API MeshAnimationManager* PLMesh::MeshHandler::GetMeshAnimationManager | ( | ) | const |
Returns the mesh animation manager.
PLMESH_API MeshAnimationManager* PLMesh::MeshHandler::CreateMeshAnimationManager | ( | const PLCore::String & | sName = "PLMesh::MeshAnimationManagerSoftware" | ) |
Creates the mesh animation manager.
[in] | sName | Name of the mesh animation manager class to use, empty to destroy the actual manager without creating a new one |
PLMESH_API void PLMesh::MeshHandler::GetAnimationsList | ( | PLCore::Array< PLCore::String > & | lstAnimations | ) | const |
Returns a list of all currently available animations.
[out] | lstAnimations | Receives a list of all currently available animations (list is cleared automatically before it's filled) |
PLMESH_API PLRenderer::AnimationInfo* PLMesh::MeshHandler::GetAnimationInfo | ( | const PLCore::String & | sName, |
int | nLogMessage = 1 |
||
) | const |
Returns a pointer to the requested animation information.
[in] | sName | Name of the animation information |
[in] | nLogMessage | Should a warning message be written into the log if the requested animation information wasn't found? If < 0, write no log message, else the integer indicates the debug mode where the message should be written. |
PLMESH_API JointHandler* PLMesh::MeshHandler::GetJointHandler | ( | const PLCore::String & | sJointName | ) | const |
Returns a current joint handler.
[in] | sJointName | Name of the joint |
PLMESH_API JointHandler* PLMesh::MeshHandler::GetBaseJointHandler | ( | const PLCore::String & | sJointName | ) | const |
Returns a base joint handler.
[in] | sJointName | Name of the joint |
PLMESH_API void PLMesh::MeshHandler::UpdateVisibility | ( | const PLMath::PlaneSet & | cPlaneSet, |
bool | bFirst = true |
||
) |
Updates the mesh visibility.
[in] | cPlaneSet | Plane set we want to check against - the planes must be in the object space |
[in] | bFirst | First visibility determination or add visible things? |
PLMESH_API PLCore::Bitset& PLMesh::MeshHandler::GetGeometryVisibility | ( | ) |
Returns the bit set holding the geometry visibility state.
PLMESH_API PLCore::uint32 PLMesh::MeshHandler::GetNumOfLODLevels | ( | ) | const |
PLMESH_API PLCore::uint32 PLMesh::MeshHandler::GetLODLevelIndex | ( | ) | const |
Returns the current used mesh LOD level index.
PLMESH_API MeshLODLevel* PLMesh::MeshHandler::GetLODLevel | ( | ) | const |
Returns the current used mesh LOD level.
PLMESH_API bool PLMesh::MeshHandler::CalculateJointBoundingBox | ( | PLMath::AABoundingBox & | cAAB | ) | const |
Calculates the current axis aligned joint bounding box.
[out] | cAAB | Will receive the current axis aligned joint bounding box |
PLMESH_API PLRenderer::VertexBuffer* PLMesh::MeshHandler::GetVertexBuffer | ( | ) | const |
Returns the current used vertex buffer of the mesh.
PLMESH_API PLCore::uint32 PLMesh::MeshHandler::GetNumOfTriangles | ( | ) | const |
Returns the total number of current triangles.
PLMESH_API bool PLMesh::MeshHandler::FindTriangle | ( | const PLMath::Vector3 & | vLineStartPos, |
const PLMath::Vector3 & | vLineEndPos, | ||
PLCore::uint32 & | nTriangle, | ||
PLCore::uint32 * | pnGeometry = nullptr , |
||
PLMath::Vector3 * | pvCollisionPoint = nullptr , |
||
PLCore::Array< PLCore::uint32 > * | plstGeometries = nullptr |
||
) | const |
Returns the first mesh triangle intersecting the line.
[in] | vLineStartPos | Line start position |
[in] | vLineEndPos | Line end position |
[out] | nTriangle | Will receive the ID of the found triangle |
[out] | pnGeometry | Receives the owner geometry ID of the found triangle if not a null pointer |
[out] | pvCollisionPoint | Will receive the collision point if not a null pointer |
[in] | plstGeometries | List of geometry indices to use, if a null pointer all geometries are used |
PLMESH_API PLCore::uint32 PLMesh::MeshHandler::FindGeometries | ( | const PLMath::PlaneSet & | cPlaneSet, |
PLCore::uint32 ** | ppnGeometries = nullptr , |
||
PLMath::Vector3 * | pvCamDir = nullptr |
||
) | const |
Returns a list of mesh geometries intersecting the plane set.
[in] | cPlaneSet | Plane set we want to check against |
[out] | ppnGeometries | If not a null pointer, receives the geometries intersecting the plane set. You have to delete this list by self after usage! (delete [] ...) |
[in] | pvCamDir | Camera direction vector, if not null faces where the normal is facing away from the given camera direction are ignored |
PLMESH_API PLCore::Array<MeshTriangle>* PLMesh::MeshHandler::GetTriangleList | ( | ) |
Gets the triangle list.
PLMESH_API PLCore::Array<MeshEdge>* PLMesh::MeshHandler::GetEdgeList | ( | ) |
Gets the edge list.
PLMESH_API void PLMesh::MeshHandler::BuildTrianglePlaneList | ( | ) |
Builds the current triangle planes.
PLMESH_API PLCore::Array<PLMath::Plane>* PLMesh::MeshHandler::GetTrianglePlaneList | ( | ) |
Gets the triangle plane list.
|