PixelLightAPI  .
Public Types | Public Member Functions | Protected Member Functions
PLScene::SNMesh Class Reference

An mesh is a special scene node that has a 3D mesh attached to it by default. More...

#include <SNMesh.h>

Inheritance diagram for PLScene::SNMesh:
Inheritance graph
[legend]

List of all members.

Public Types

enum  EFlags {
  NoAutomaticBoundingBox = 1<<10, LoadAtOnce = 1<<11, DynamicMesh = 1<<12, GenerateStrips = 1<<13,
  CalculateNormals = 1<<14, CalculateTSVs = 1<<15
}
 Scene node flags (SceneNode flags extension) More...

Public Member Functions

 pl_enum (EFlags) pl_enum_base(SceneNode
 Scene node debug flags (SceneNode debug flags extension)
PLS_API PLCore::String GetSkin () const
PLS_API void SetSkin (const PLCore::String &sValue)
virtual PLS_API void SetFlags (PLCore::uint32 nValue)
PLS_API SNMesh ()
 Default constructor.
virtual PLS_API ~SNMesh ()
 Destructor.
PLS_API bool LoadMesh (const PLCore::String &sFilename, const PLCore::String &sParams="", const PLCore::String &sMethod="")
 Loads a mesh.
PLS_API bool LoadSkin (const PLCore::String &sFilename, const PLCore::String &sParams="", const PLCore::String &sMethod="")
 Loads a skin.
PLS_API bool SaveSkin (const PLCore::String &sFilename, const PLCore::String &sParams="", const PLCore::String &sMethod="")
 Saves the skin.
PLS_API bool UnloadMesh ()
 Unloads the current mesh.
PLS_API bool GetSkeletonJointWorldPosition (const PLCore::String &sJointName, PLMath::Vector3 &vPosition)
virtual PLS_API
PLMesh::MeshHandler
GetMeshHandler () override
 Returns a pointer to the mesh handler.
virtual PLS_API void DrawDebug (PLRenderer::Renderer &cRenderer, const VisNode *pVisNode=nullptr) override
 This function is called when the debug parts of the scene are drawn.

Protected Member Functions

virtual PLS_API void MeshInitFunction ()
 This function is called after the mesh handler loads a mesh.
virtual PLS_API void MeshDeInitFunction ()
 This function is called after the mesh handler unloads a mesh.
virtual PLS_API void DeInitFunction () override
 This function is called when the scene node gets de-initialized.

Detailed Description

An mesh is a special scene node that has a 3D mesh attached to it by default.

Note:
  • If 'Skin' is not empty and not a skin file, all materials are replaced through the new one
  • By default, invisible scene nodes internally don't load in their mesh at once and delay this until the scene node becomes visible and/or 'GetMeshHandler()' is called (use 'LoadAtOnce'-flag do force loading at once)
  • For the debug visualization of normal vectors the config setting 'EngineDebugConfig->NormalScale' is used to scale the length

Member Enumeration Documentation

Scene node flags (SceneNode flags extension)

Enumerator:
NoAutomaticBoundingBox 

Do not create the bounding box of the scene node automatically using the bounding box of the used mesh

LoadAtOnce 

Load the mesh at once even if not used at the moment

DynamicMesh 

Hint that this is a dynamic mesh, may have an impact on the performance

GenerateStrips 

Generate triangle strips? (if possible, don't use this flag -> loading times...)

CalculateNormals 

Calculate normal vectors? (if not already there) (if possible, don't use this flag -> loading times...)

CalculateTSVs 

Calculate tangent space vectors? (if not already there) (if possible, don't use this flag -> loading times...)

Reimplemented from PLScene::SceneNode.


Constructor & Destructor Documentation

Default constructor.

virtual PLS_API PLScene::SNMesh::~SNMesh ( ) [virtual]

Destructor.


Member Function Documentation

Scene node debug flags (SceneNode debug flags extension)

< Draw wireframe

< Draw vertices

< Draw tangents (red = x/u)

< Draw binormals (green = y/v)

< Draw normals (blue = z/w)

< Draw vertex numbers

< Draw joints

< Draw joint names

< Draw skeleton

< Draw anchor points

Reimplemented from PLScene::SceneNode.

PLS_API void PLScene::SNMesh::SetSkin ( const PLCore::String sValue)
virtual PLS_API void PLScene::SNMesh::SetFlags ( PLCore::uint32  nValue) [virtual]

Reimplemented from PLScene::SceneNode.

PLS_API bool PLScene::SNMesh::LoadMesh ( const PLCore::String sFilename,
const PLCore::String sParams = "",
const PLCore::String sMethod = "" 
)

Loads a mesh.

Parameters:
[in]sFilenameMesh filename to load
[in]sParamsOptional load method parameters, can be an empty string
[in]sMethodOptional name of the load method to use, can be an empty string
Returns:
'true' if all went fine, else 'false'
Note:
  • If this entity is initialized the mesh defined in the entity variable m_sMesh is loaded automatically
PLS_API bool PLScene::SNMesh::LoadSkin ( const PLCore::String sFilename,
const PLCore::String sParams = "",
const PLCore::String sMethod = "" 
)

Loads a skin.

Parameters:
[in]sFilenameSkin filename to load, if empty, the default materials of the given mesh are used
[in]sParamsOptional load method parameters, can be an empty string
[in]sMethodOptional name of the load method to use, can be an empty string
Returns:
'true' if all went fine, else 'false'
PLS_API bool PLScene::SNMesh::SaveSkin ( const PLCore::String sFilename,
const PLCore::String sParams = "",
const PLCore::String sMethod = "" 
)

Saves the skin.

Parameters:
[in]sFilenameSkin filename
[in]sParamsOptional save method parameters, can be an empty string
[in]sMethodOptional name of the save method to use, can be an empty string
Returns:
'true' if all went fine, else 'false'
PLS_API bool PLScene::SNMesh::UnloadMesh ( )

Unloads the current mesh.

Returns:
'true' if all went fine, else 'false'
PLS_API bool PLScene::SNMesh::GetSkeletonJointWorldPosition ( const PLCore::String sJointName,
PLMath::Vector3 vPosition 
)
virtual PLS_API void PLScene::SNMesh::MeshInitFunction ( ) [protected, virtual]

This function is called after the mesh handler loads a mesh.

Note:
  • Use e.g. to get animation information
virtual PLS_API void PLScene::SNMesh::MeshDeInitFunction ( ) [protected, virtual]

This function is called after the mesh handler unloads a mesh.

Note:
  • The default implementation is empty
See also:
virtual PLS_API PLMesh::MeshHandler* PLScene::SNMesh::GetMeshHandler ( ) [override, virtual]

Returns a pointer to the mesh handler.

Returns:
Pointer to the mesh handler, a null pointer if there's no mesh handler
Note:
  • Returns a null pointer by default, function can be implemented in derived classes
See also:

Reimplemented from PLScene::SceneNode.

virtual PLS_API void PLScene::SNMesh::DrawDebug ( PLRenderer::Renderer cRenderer,
const VisNode pVisNode = nullptr 
) [override, virtual]

This function is called when the debug parts of the scene are drawn.

Parameters:
[in]cRendererThe used renderer
[in]pVisNodeThe current visibility node of this scene node, can be a null pointer
Note:
  • Should only be called if the 'UseDrawDebug' draw flag and the 'DebugEnabled' debug flag is set
  • Beside drawing scene node stuff, the default implementation emits the SignalDrawDebug signal
See also:

Reimplemented from PLScene::SceneNode.

Reimplemented in PLPhysics::SNRagdoll.

virtual PLS_API void PLScene::SNMesh::DeInitFunction ( ) [override, protected, virtual]

This function is called when the scene node gets de-initialized.

Reimplemented from PLScene::SceneNode.

Reimplemented in PLPhysics::SNRagdoll.


The documentation for this class was generated from the following file:


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:25
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported