Radium Engine
1.5.20
|
The SkinningComponent class is responsible for applying Geometric Skinning Methods on an animated object's mesh. More...
#include <Engine/Scene/SkinningComponent.hpp>
Public Types | |
enum | SkinningType { LBS = 0 , DQS , COR } |
The Geometric Skinning Method. More... | |
enum | NormalSkinning { APPROX = 0 , GEOMETRIC } |
How to skin the normal, tangent and binormal vectors. More... | |
enum | WeightType { STANDARD = 0 } |
The skinning weight type. More... | |
Public Member Functions | |
SkinningComponent (const std::string &name, SkinningType type, Entity *entity) | |
void | setPerBoneWeight (std::map< std::string, std::vector< std::pair< uint, Scalar > > > &&w) |
void | setPerBoneMatrix (std::map< std::string, Core::Transform > &&m) |
Component Communication (CC) | |
virtual void | initialize () override |
Pure virtual method to be overridden by any component. When this method is called you are guaranteed that all other startup systems have been loaded. | |
Build from fileData | |
void | handleSkinDataLoading (const Core::Asset::HandleData *data, const std::string &meshName) |
Skinning Process | |
void | skin () |
Apply the Skinning Method and update the SkinningFrameData. | |
void | endSkinning () |
Update internal data and update the skinned mesh. | |
void | setSkinningType (SkinningType type) |
Sets the Skinning method to use. | |
SkinningType | getSkinningType () const |
Returns the current skinning method. | |
void | setNormalSkinning (NormalSkinning normalSkinning) |
Sets the method to use to skin the normal, tangent and binormal vectors. | |
NormalSkinning | getNormalSkinning () const |
Returns the current method used to skin the normal, tangent and binormal vectors. | |
Skinning Data | |
const std::string & | getMeshName () const |
Returns the name of the skinned mesh. | |
void | setMeshName (const std::string &name) |
const std::string & | getSkeletonName () const |
Returns the name of the skeleton skinning the mesh. | |
const Core::Animation::SkinningRefData * | getSkinningRefData () const |
Returns the reference skinning data. | |
const Core::Animation::SkinningFrameData * | getSkinningFrameData () const |
Returns the current Pose data. | |
Skinning Weights Display | |
void | showWeights (bool on) |
Toggles display of skinning weights. | |
bool | isShowingWeights () |
Returns whether the skinning weights are displayed or not. | |
void | showWeightsType (WeightType type) |
Set the type of skinning weight to display. | |
WeightType | getWeightsType () |
Returns the type of skinning weights displayed. | |
void | setWeightBone (uint bone) |
Set the bone to show the weights of. | |
Public Member Functions inherited from Ra::Engine::Scene::Component | |
Component (const std::string &name, Entity *entity) | |
CONSTRUCTOR. | |
virtual | ~Component () |
DESTRUCTOR. | |
virtual void | setEntity (Entity *entity) |
Set entity the component is part of. This method is called by the entity. | |
virtual Entity * | getEntity () const |
Return the entity the component belongs to. | |
virtual const std::string & | getName () const |
Return the component's name. | |
virtual void | setSystem (System *system) |
Set the system to which the component belongs. | |
virtual System * | getSystem () const |
Returns the system to which the component belongs. | |
Core::Utils::Index | addRenderObject (Rendering::RenderObject *renderObject) |
Add a new render object to the component. This adds the RO to the manager for drawing. | |
void | removeRenderObject (const Core::Utils::Index &roIdx) |
Remove the render object from the component. | |
virtual bool | canEdit (const Core::Utils::Index &) const |
Returns true if a transform can be edited with the render object index given as a key. | |
virtual Core::Transform | getTransform (const Core::Utils::Index &) const |
Get the transform associated with the given RO index key. | |
virtual void | setTransform (const Core::Utils::Index &, const Core::Transform &) |
Set the new transform associated with the RO index key. | |
void | notifyRenderObjectExpired (const Core::Utils::Index &idx) |
virtual Core::Aabb | computeAabb () |
void | invalidateAabb () |
const std::vector< Core::Utils::Index > & | getRenderObjects () |
Additional Inherited Members | |
Public Attributes inherited from Ra::Engine::Scene::Component | |
std::vector< Core::Utils::Index > | m_renderObjects |
Static Protected Member Functions inherited from Ra::Engine::Scene::Component | |
static Rendering::RenderObjectManager * | getRoMgr () |
Shortcut to access the render object manager. | |
Protected Attributes inherited from Ra::Engine::Scene::Component | |
std::string | m_name {} |
Entity * | m_entity { nullptr } |
System * | m_system { nullptr } |
The SkinningComponent class is responsible for applying Geometric Skinning Methods on an animated object's mesh.
Regarding Component Communication, a SkinningComponent gives access to the following data from the skinned mesh's name:
Definition at line 34 of file SkinningComponent.hpp.
How to skin the normal, tangent and binormal vectors.
Enumerator | |
---|---|
APPROX | Use the standard approximation method. |
GEOMETRIC | Recompute from scratch from the skinned positions. |
Definition at line 45 of file SkinningComponent.hpp.
The Geometric Skinning Method.
Enumerator | |
---|---|
LBS | Linear Blend Skinning. |
DQS | Dual Quaternion Skinning. |
COR | Center of Rotation skinning. |
Definition at line 38 of file SkinningComponent.hpp.
The skinning weight type.
Enumerator | |
---|---|
STANDARD | Standard geometric skinning weights. |
Definition at line 51 of file SkinningComponent.hpp.
|
inline |
Definition at line 55 of file SkinningComponent.hpp.
|
inlineoverride |
Definition at line 65 of file SkinningComponent.hpp.
void Ra::Engine::Scene::SkinningComponent::endSkinning | ( | ) |
Update internal data and update the skinned mesh.
Definition at line 258 of file SkinningComponent.cpp.
const std::string & Ra::Engine::Scene::SkinningComponent::getMeshName | ( | ) | const |
Returns the name of the skinned mesh.
Definition at line 359 of file SkinningComponent.cpp.
|
inline |
Returns the current method used to skin the normal, tangent and binormal vectors.
Definition at line 100 of file SkinningComponent.hpp.
const std::string & Ra::Engine::Scene::SkinningComponent::getSkeletonName | ( | ) | const |
Returns the name of the skeleton skinning the mesh.
Definition at line 363 of file SkinningComponent.cpp.
|
inline |
Returns the current Pose data.
Definition at line 120 of file SkinningComponent.hpp.
|
inline |
Returns the reference skinning data.
Definition at line 117 of file SkinningComponent.hpp.
|
inline |
Returns the current skinning method.
Definition at line 94 of file SkinningComponent.hpp.
SkinningComponent::WeightType Ra::Engine::Scene::SkinningComponent::getWeightsType | ( | ) |
Returns the type of skinning weights displayed.
Definition at line 422 of file SkinningComponent.cpp.
void Ra::Engine::Scene::SkinningComponent::handleSkinDataLoading | ( | const Core::Asset::HandleData * | data, |
const std::string & | meshName ) |
Loads the skinning data from the given Handledata.
Definition at line 283 of file SkinningComponent.cpp.
|
overridevirtual |
Pure virtual method to be overridden by any component. When this method is called you are guaranteed that all other startup systems have been loaded.
TODO : use the tangent computation algorithms from Core as soon as it is available.
Implements Ra::Engine::Scene::Component.
Definition at line 86 of file SkinningComponent.cpp.
bool Ra::Engine::Scene::SkinningComponent::isShowingWeights | ( | ) |
Returns whether the skinning weights are displayed or not.
Definition at line 413 of file SkinningComponent.cpp.
|
inline |
Set the associated mesh name, usefull if component setup is not done using handleSkinDataLoading
Definition at line 111 of file SkinningComponent.hpp.
void Ra::Engine::Scene::SkinningComponent::setNormalSkinning | ( | NormalSkinning | normalSkinning | ) |
Sets the method to use to skin the normal, tangent and binormal vectors.
Definition at line 354 of file SkinningComponent.cpp.
|
inline |
Set the associated bind matrix of named bones. A bind matrix is used to transform a vertex from object space to rest pose bone space. Typical value is obtained from skeleton getTransform( boneId, Skeleton::SpaceType::MODEL ).inverse();
Definition at line 152 of file SkinningComponent.hpp.
|
inline |
Set the associated weight for named bones. Each pair is a vertex index from the skinned mesh (uint) and a weight (Scalar).
Definition at line 144 of file SkinningComponent.hpp.
void Ra::Engine::Scene::SkinningComponent::setSkinningType | ( | SkinningType | type | ) |
Sets the Skinning method to use.
Definition at line 344 of file SkinningComponent.cpp.
void Ra::Engine::Scene::SkinningComponent::setWeightBone | ( | uint | bone | ) |
Set the bone to show the weights of.
Definition at line 426 of file SkinningComponent.cpp.
void Ra::Engine::Scene::SkinningComponent::showWeights | ( | bool | on | ) |
Toggles display of skinning weights.
Definition at line 367 of file SkinningComponent.cpp.
void Ra::Engine::Scene::SkinningComponent::showWeightsType | ( | WeightType | type | ) |
Set the type of skinning weight to display.
Definition at line 417 of file SkinningComponent.cpp.
void Ra::Engine::Scene::SkinningComponent::skin | ( | ) |
Apply the Skinning Method and update the SkinningFrameData.
Definition at line 202 of file SkinningComponent.cpp.