#include <StdMesh.h>
Classes | |
class | AttachedMesh |
class | SerializableValueProvider |
Public Types | |
enum | AttachMeshFlags { AM_None = 0 , AM_DrawBefore = 1 << 0 , AM_MatchSkeleton = 1 << 1 } |
typedef StdMeshInstanceAnimationNode | AnimationNode |
typedef StdSubMeshInstance::FaceOrdering | FaceOrdering |
typedef StdMeshInstanceValueProvider | ValueProvider |
typedef std::vector< AttachedMesh * > | AttachedMeshList |
typedef AttachedMeshList::const_iterator | AttachedMeshIter |
Protected Types | |
typedef std::vector< AnimationNode * > | AnimationNodeList |
Protected Member Functions | |
void | UpdateIBO () |
AttachedMesh * | AttachMeshImpl (StdMeshInstance &instance, AttachedMesh::Denumerator *denumerator, const StdStrBuf &parent_bone, const StdStrBuf &child_bone, const StdMeshMatrix &transformation, uint32_t flags, bool own_child, unsigned int new_attach_number) |
AnimationNodeList::iterator | GetStackIterForSlot (int slot, bool create) |
void | InsertAnimationNode (AnimationNode *node, int slot, AnimationNode *sibling, ValueProvider *weight, bool stop_previous_animation) |
bool | ExecuteAnimationNode (AnimationNode *node) |
void | ApplyBoneTransformToVertices (const std::vector< StdSubMesh::Vertex > &mesh_vertices, std::vector< StdMeshVertex > &instance_vertices) |
void | SetBoneTransformsDirty (bool value) |
Static Protected Member Functions | |
template<typename IteratorType , typename FuncObj > | |
static bool | ScanAttachTree (IteratorType begin, IteratorType end, const FuncObj &obj) |
Protected Attributes | |
const StdMesh * | Mesh |
float | Completion |
AnimationNodeList | AnimationNodes |
AnimationNodeList | AnimationStack |
std::vector< StdMeshMatrix > | BoneTransforms |
std::vector< StdSubMeshInstance * > | SubMeshInstances |
std::vector< StdSubMeshInstance * > | SubMeshInstancesOrdered |
std::vector< AttachedMesh * > | AttachChildren |
AttachedMesh * | AttachParent |
bool | BoneTransformsDirty |
GLuint | ibo |
unsigned int | vaoid |
Friends | |
class | StdMeshMaterialUpdate |
class | StdMeshAnimationUpdate |
class | StdMeshUpdate |
|
protected |
typedef AttachedMeshList::const_iterator StdMeshInstance::AttachedMeshIter |
typedef std::vector<AttachedMesh*> StdMeshInstance::AttachedMeshList |
StdMeshInstance::StdMeshInstance | ( | const StdMesh & | mesh, |
float | completion = 1.0f |
||
) |
Definition at line 1072 of file StdMesh.cpp.
References StdMesh::GetNumSubMeshes(), StdMesh::GetSubMesh(), Mesh, SubMeshInstances, and SubMeshInstancesOrdered.
Referenced by AttachMesh().
StdMeshInstance::~StdMeshInstance | ( | ) |
Definition at line 1092 of file StdMesh.cpp.
References AnimationNodes, AnimationStack, AttachChildren, AttachParent, DetachMesh(), CStdGL::FreeVAOID(), ibo, StdMeshInstance::AttachedMesh::Number, StdMeshInstance::AttachedMesh::Parent, pGL, StopAnimation(), SubMeshInstances, and vaoid.
|
protected |
|
inline |
Definition at line 584 of file StdMesh.h.
References AttachChildren.
Referenced by StdMeshUpdate::Update().
|
inline |
Definition at line 585 of file StdMesh.h.
References AttachChildren.
Referenced by StdMeshUpdate::Update().
StdMeshInstance::AttachedMesh * StdMeshInstance::AttachMesh | ( | const StdMesh & | mesh, |
AttachedMesh::Denumerator * | denumerator, | ||
const StdStrBuf & | parent_bone, | ||
const StdStrBuf & | child_bone, | ||
const StdMeshMatrix & | transformation = StdMeshMatrix::Identity() , |
||
uint32_t | flags = AM_None , |
||
unsigned int | attach_number = 0 |
||
) |
Definition at line 1333 of file StdMesh.cpp.
References StdMeshInstance().
StdMeshInstance::AttachedMesh * StdMeshInstance::AttachMesh | ( | StdMeshInstance & | instance, |
AttachedMesh::Denumerator * | denumerator, | ||
const StdStrBuf & | parent_bone, | ||
const StdStrBuf & | child_bone, | ||
const StdMeshMatrix & | transformation = StdMeshMatrix::Identity() , |
||
uint32_t | flags = AM_None , |
||
bool | own_child = false , |
||
unsigned int | attach_number = 0 |
||
) |
Definition at line 1343 of file StdMesh.cpp.
References AttachChildren, AttachMeshImpl(), AttachParent, StdMeshInstance::AttachedMesh::Child, GetAttachedMeshByNumber(), StdMeshInstance::AttachedMesh::OwnChild, and ScanAttachTree().
|
protected |
Definition at line 1367 of file StdMesh.cpp.
References AM_DrawBefore, AttachChildren, AttachParent, StdMeshSkeleton::GetBoneByName(), StdMesh::GetSkeleton(), StdMeshBone::Index, Mesh, and StdMeshInstance::AttachedMesh::Parent.
Referenced by AttachMesh().
void StdMeshInstance::ClearPointers | ( | class C4Object * | pObj | ) |
Definition at line 1686 of file StdMesh.cpp.
References AnimationNodes, AttachChildren, StdMeshInstanceAnimationNode::ClearPointers(), and DetachMesh().
Referenced by C4Object::ClearPointers().
void StdMeshInstance::CompileFunc | ( | StdCompiler * | pComp, |
AttachedMesh::DenumeratorFactoryFunc | Factory | ||
) |
Definition at line 1578 of file StdMesh.cpp.
References AnimationNodes, AnimationStack, AttachChildren, AttachParent, StdCompiler::excCorrupt(), GetStackIterForSlot(), StdCompiler::isDeserializer(), StdMeshInstanceAnimationNode::LinearInterpolationNode, Mesh, mkNamingAdapt(), mkNamingCountAdapt(), mkNamingPtrAdapt(), mkParAdapt(), StdMeshInstanceAnimationNode::Number, StdMeshInstance::AttachedMesh::Parent, SetBoneTransformsDirty(), StdMeshInstanceAnimationNode::Slot, SubMeshInstances, SubMeshInstancesOrdered, StdMeshInstanceAnimationNode::Type, and StdCompiler::Value().
void StdMeshInstance::DenumeratePointers | ( | ) |
Definition at line 1674 of file StdMesh.cpp.
References AnimationNodes, AttachChildren, and StdMeshInstanceAnimationNode::DenumeratePointers().
Referenced by C4Object::Denumerate().
bool StdMeshInstance::DetachMesh | ( | unsigned int | number | ) |
Definition at line 1395 of file StdMesh.cpp.
References AttachChildren, and ScanAttachTree().
Referenced by ClearPointers(), StdMeshUpdate::Update(), C4Object::UpdateGraphics(), and ~StdMeshInstance().
void StdMeshInstance::ExecuteAnimation | ( | float | dt | ) |
Definition at line 1288 of file StdMesh.cpp.
References AnimationStack, AttachChildren, StdMeshMaterial::BestTechniqueIndex, StdMeshMaterialTextureUnit::Duration, ExecuteAnimationNode(), StdSubMeshInstance::GetMaterial(), StdMeshMaterialTextureUnit::GetNumTextures(), StdMeshMaterialTextureUnit::HasFrameAnimation(), StdMeshMaterialTextureUnit::HasTexCoordAnimation(), StdSubMeshInstance::PassData, StdMeshMaterialTechnique::Passes, StdSubMeshInstance::TexUnit::Phase, StdSubMeshInstance::TexUnit::PhaseDelay, StdSubMeshInstance::TexUnit::Position, StopAnimation(), SubMeshInstances, StdMeshMaterial::Techniques, and StdSubMeshInstance::Pass::TexUnits.
Referenced by C4Object::Execute().
|
protected |
Definition at line 1816 of file StdMesh.cpp.
References Clamp(), StdMeshInstanceAnimationNode::CustomNode, StdMeshInstanceValueProvider::Execute(), Fix0, ftofix(), StdMeshInstanceAnimationNode::GetAnimation(), StdMeshInstanceAnimationNode::GetLeftChild(), StdMeshInstanceAnimationNode::GetPositionProvider(), StdMeshInstanceAnimationNode::GetRightChild(), StdMeshInstanceAnimationNode::GetType(), StdMeshInstanceAnimationNode::GetWeight(), StdMeshInstanceAnimationNode::GetWeightProvider(), itofix(), StdMeshInstanceAnimationNode::LeafNode, StdMeshAnimation::Length, StdMeshInstanceAnimationNode::LinearInterpolationNode, SetBoneTransformsDirty(), StopAnimation(), and StdMeshInstanceValueProvider::Value.
Referenced by ExecuteAnimation().
StdMeshInstance::AnimationNode * StdMeshInstance::GetAnimationNodeByNumber | ( | unsigned int | number | ) |
StdMeshInstance::AttachedMesh * StdMeshInstance::GetAttachedMeshByNumber | ( | unsigned int | number | ) | const |
Definition at line 1419 of file StdMesh.cpp.
References AttachChildren, and ScanAttachTree().
Referenced by AttachMesh().
|
inline |
Definition at line 586 of file StdMesh.h.
References AttachParent.
Referenced by C4Object::Execute(), and C4Object::UpdateGraphics().
size_t StdMeshInstance::GetBoneCount | ( | ) | const |
Definition at line 1463 of file StdMesh.cpp.
References AM_MatchSkeleton, AttachParent, BoneTransforms, and StdMeshInstance::AttachedMesh::GetFlags().
const StdMeshMatrix & StdMeshInstance::GetBoneTransform | ( | size_t | i | ) | const |
Definition at line 1446 of file StdMesh.cpp.
References AM_MatchSkeleton, AttachParent, BoneTransforms, StdMeshInstance::AttachedMesh::GetFlags(), and StdMeshInstance::AttachedMesh::Parent.
Referenced by UpdateBoneTransforms().
|
inline |
Definition at line 554 of file StdMesh.h.
References Completion.
Referenced by StdSubMeshInstance::SetFaceOrdering(), and StdMeshUpdate::Update().
|
inline |
Definition at line 625 of file StdMesh.h.
References StdMesh::GetIBO(), ibo, and Mesh.
|
inline |
Definition at line 622 of file StdMesh.h.
References Mesh.
Referenced by StdMeshInstance::AttachedMesh::AttachedMesh(), C4Object::DrawFaceImpl(), CStdGL::PerformMesh(), StdMeshMaterialUpdate::Update(), StdMeshUpdate::Update(), and C4Object::UpdateGraphics().
|
inline |
Definition at line 550 of file StdMesh.h.
References GetSharedVertices().
|
inline |
StdMeshInstance::AnimationNode * StdMeshInstance::GetRootAnimationForSlot | ( | int | slot | ) |
Definition at line 1253 of file StdMesh.cpp.
References AnimationStack, and GetStackIterForSlot().
Referenced by C4Object::CompileFunc(), and InsertAnimationNode().
|
inline |
Definition at line 549 of file StdMesh.h.
References StdMesh::GetSharedVertices(), and Mesh.
Referenced by GetNumSharedVertices(), StdSubMeshInstance::LoadFacesForCompletion(), and ReorderFaces().
|
protected |
Definition at line 1718 of file StdMesh.cpp.
References AnimationStack.
Referenced by CompileFunc(), GetRootAnimationForSlot(), InsertAnimationNode(), and StopAnimation().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 626 of file StdMesh.h.
References StdMesh::GetVAOID(), Mesh, and vaoid.
|
protected |
Definition at line 1742 of file StdMesh.cpp.
References AnimationNodes, AnimationStack, Clamp(), Fix0, GetRootAnimationForSlot(), GetStackIterForSlot(), itofix(), StdMeshInstanceAnimationNode::Number, StdMeshInstanceAnimationNode::Parent, SetBoneTransformsDirty(), StdMeshInstanceAnimationNode::Slot, StopAnimation(), and StdMeshInstanceValueProvider::Value.
Referenced by PlayAnimation().
StdMeshInstance::AnimationNode * StdMeshInstance::PlayAnimation | ( | const StdMeshAnimation & | animation, |
int | slot, | ||
AnimationNode * | sibling, | ||
ValueProvider * | position, | ||
ValueProvider * | weight, | ||
bool | stop_previous_animation | ||
) |
Definition at line 1175 of file StdMesh.cpp.
References Clamp(), Fix0, ftofix(), InsertAnimationNode(), StdMeshAnimation::Length, and StdMeshInstanceValueProvider::Value.
StdMeshInstance::AnimationNode * StdMeshInstance::PlayAnimation | ( | const StdMeshBone * | bone, |
const StdMeshTransformation & | trans, | ||
int | slot, | ||
AnimationNode * | sibling, | ||
ValueProvider * | weight, | ||
bool | stop_previous_animation | ||
) |
Definition at line 1183 of file StdMesh.cpp.
References InsertAnimationNode().
StdMeshInstance::AnimationNode * StdMeshInstance::PlayAnimation | ( | const StdStrBuf & | animation_name, |
int | slot, | ||
AnimationNode * | sibling, | ||
ValueProvider * | position, | ||
ValueProvider * | weight, | ||
bool | stop_previous_animation | ||
) |
Definition at line 1167 of file StdMesh.cpp.
References StdMeshSkeleton::GetAnimationByName(), StdMesh::GetSkeleton(), and Mesh.
Referenced by C4Object::SetAction(), and C4GraphicsOverlay::UpdateFacet().
void StdMeshInstance::ReorderFaces | ( | StdMeshMatrix * | global_trans | ) |
Definition at line 1552 of file StdMesh.cpp.
References StdSubMeshInstance::CurrentFaceOrdering, StdSubMeshInstance::Faces, StdSubMeshInstance::FO_Fixed, StdSubMesh::GetNumVertices(), GetSharedVertices(), StdSubMeshInstance::GetSubMesh(), StdSubMesh::GetVertices(), StdMeshMatrix::Identity(), SubMeshInstances, and UpdateIBO().
Referenced by C4Draw::RenderMesh().
|
staticprotected |
Definition at line 1702 of file StdMesh.cpp.
Referenced by AttachMesh(), DetachMesh(), and GetAttachedMeshByNumber().
void StdMeshInstance::SetAnimationBoneTransform | ( | AnimationNode * | node, |
const StdMeshTransformation & | trans | ||
) |
Definition at line 1271 of file StdMesh.cpp.
References StdMeshInstanceAnimationNode::CustomNode, StdMeshInstanceAnimationNode::GetType(), and SetBoneTransformsDirty().
void StdMeshInstance::SetAnimationPosition | ( | AnimationNode * | node, |
ValueProvider * | position | ||
) |
Definition at line 1260 of file StdMesh.cpp.
References Clamp(), Fix0, ftofix(), StdMeshInstanceAnimationNode::GetType(), StdMeshInstanceAnimationNode::LeafNode, SetBoneTransformsDirty(), and StdMeshInstanceValueProvider::Value.
void StdMeshInstance::SetAnimationWeight | ( | AnimationNode * | node, |
ValueProvider * | weight | ||
) |
Definition at line 1278 of file StdMesh.cpp.
References Clamp(), Fix0, StdMeshInstanceAnimationNode::GetType(), itofix(), StdMeshInstanceAnimationNode::LinearInterpolationNode, SetBoneTransformsDirty(), and StdMeshInstanceValueProvider::Value.
|
protected |
Definition at line 1893 of file StdMesh.cpp.
References AM_MatchSkeleton, AttachChildren, and BoneTransformsDirty.
Referenced by CompileFunc(), ExecuteAnimationNode(), InsertAnimationNode(), SetAnimationBoneTransform(), SetAnimationPosition(), SetAnimationWeight(), StopAnimation(), and UpdateBoneTransforms().
void StdMeshInstance::SetCompletion | ( | float | completion | ) |
Definition at line 1152 of file StdMesh.cpp.
References Completion, StdMesh::GetNumSubMeshes(), StdMesh::GetSubMesh(), Mesh, SubMeshInstances, and UpdateIBO().
Referenced by C4Object::DoCon().
void StdMeshInstance::SetFaceOrdering | ( | FaceOrdering | ordering | ) |
Definition at line 1118 of file StdMesh.cpp.
References AttachChildren, StdMesh::GetNumSubMeshes(), StdMesh::GetSubMesh(), Mesh, SubMeshInstances, and UpdateIBO().
Referenced by C4EditCursor::DrawObject().
void StdMeshInstance::SetFaceOrderingForClrModulation | ( | uint32_t | clrmod | ) |
Definition at line 1135 of file StdMesh.cpp.
References AttachChildren, StdMesh::GetNumSubMeshes(), StdMesh::GetSubMesh(), Mesh, SubMeshInstances, and UpdateIBO().
Referenced by C4Object::CompileFunc(), C4GraphicsOverlay::Draw(), C4EditCursor::DrawObject(), C4GraphicsOverlay::DrawPicture(), C4Object::Init(), and C4Object::UpdateGraphics().
void StdMeshInstance::SetMaterial | ( | size_t | i, |
const StdMeshMaterial & | material | ||
) |
Definition at line 1437 of file StdMesh.cpp.
References SubMeshInstances, and SubMeshInstancesOrdered.
void StdMeshInstance::StopAnimation | ( | AnimationNode * | node | ) |
Definition at line 1190 of file StdMesh.cpp.
References AnimationNodes, AnimationStack, GetStackIterForSlot(), StdMeshInstanceAnimationNode::LinearInterpolationNode, StdMeshInstanceAnimationNode::Number, StdMeshInstanceAnimationNode::Parent, SetBoneTransformsDirty(), StdMeshInstanceAnimationNode::Slot, and StdMeshInstanceAnimationNode::Type.
Referenced by ExecuteAnimation(), ExecuteAnimationNode(), InsertAnimationNode(), C4Object::SetAction(), StdMeshAnimationUpdate::Update(), StdMeshUpdate::Update(), and ~StdMeshInstance().
bool StdMeshInstance::UpdateBoneTransforms | ( | ) |
Definition at line 1471 of file StdMesh.cpp.
References AnimationStack, AttachChildren, BoneTransforms, BoneTransformsDirty, StdMeshSkeleton::GetBone(), GetBoneTransform(), StdMeshBone::GetParent(), StdMesh::GetSkeleton(), StdMeshMatrix::Identity(), StdMeshBone::Index, StdMeshMatrix::Inverse(), StdMeshBone::InverseTransformation, Mesh, StdMeshTransformation::Nlerp(), SetBoneTransformsDirty(), StdMeshMatrix::Transform(), and StdMeshBone::Transformation.
Referenced by C4Draw::RenderMesh().
|
protected |
Definition at line 1912 of file StdMesh.cpp.
References StdSubMeshInstance::FO_Fixed, CStdGL::FreeVAOID(), CStdGL::GenVAOID(), StdSubMesh::GetNumFaces(), StdMesh::GetNumSubMeshes(), StdMesh::GetSubMesh(), ibo, Mesh, pGL, SubMeshInstances, and vaoid.
Referenced by ReorderFaces(), SetCompletion(), SetFaceOrdering(), and SetFaceOrderingForClrModulation().
|
friend |
|
friend |
|
friend |
|
protected |
Definition at line 651 of file StdMesh.h.
Referenced by ClearPointers(), CompileFunc(), DenumeratePointers(), GetAnimationNodeByNumber(), InsertAnimationNode(), StopAnimation(), and ~StdMeshInstance().
|
protected |
Definition at line 652 of file StdMesh.h.
Referenced by CompileFunc(), ExecuteAnimation(), GetRootAnimationForSlot(), GetStackIterForSlot(), InsertAnimationNode(), StopAnimation(), StdMeshAnimationUpdate::Update(), StdMeshUpdate::Update(), UpdateBoneTransforms(), and ~StdMeshInstance().
|
protected |
Definition at line 660 of file StdMesh.h.
Referenced by AttachedMeshesBegin(), AttachedMeshesEnd(), AttachMesh(), AttachMeshImpl(), ClearPointers(), CompileFunc(), DenumeratePointers(), DetachMesh(), ExecuteAnimation(), GetAttachedMeshByNumber(), SetBoneTransformsDirty(), SetFaceOrdering(), SetFaceOrderingForClrModulation(), UpdateBoneTransforms(), and ~StdMeshInstance().
|
protected |
Definition at line 661 of file StdMesh.h.
Referenced by AttachMesh(), AttachMeshImpl(), CompileFunc(), GetAttachParent(), GetBoneCount(), GetBoneTransform(), StdMeshUpdate::Update(), and ~StdMeshInstance().
|
protected |
Definition at line 653 of file StdMesh.h.
Referenced by GetBoneCount(), GetBoneTransform(), StdMeshUpdate::Update(), and UpdateBoneTransforms().
|
protected |
Definition at line 663 of file StdMesh.h.
Referenced by SetBoneTransformsDirty(), StdMeshUpdate::Update(), and UpdateBoneTransforms().
|
protected |
Definition at line 649 of file StdMesh.h.
Referenced by GetCompletion(), and SetCompletion().
|
protected |
Definition at line 670 of file StdMesh.h.
Referenced by GetIBO(), UpdateIBO(), and ~StdMeshInstance().
|
protected |
Definition at line 647 of file StdMesh.h.
Referenced by AttachMeshImpl(), CompileFunc(), GetIBO(), GetMesh(), GetSharedVertices(), GetVAOID(), PlayAnimation(), SetCompletion(), SetFaceOrdering(), SetFaceOrderingForClrModulation(), StdMeshInstance(), StdMeshUpdate::Update(), UpdateBoneTransforms(), and UpdateIBO().
|
protected |
Definition at line 655 of file StdMesh.h.
Referenced by CompileFunc(), ExecuteAnimation(), GetNumSubMeshes(), GetSubMesh(), ReorderFaces(), SetCompletion(), SetFaceOrdering(), SetFaceOrderingForClrModulation(), SetMaterial(), StdMeshInstance(), StdMeshMaterialUpdate::Update(), StdMeshUpdate::Update(), UpdateIBO(), and ~StdMeshInstance().
|
protected |
Definition at line 656 of file StdMesh.h.
Referenced by CompileFunc(), GetSubMeshOrdered(), SetMaterial(), StdMeshInstance(), and StdMeshUpdate::Update().
|
protected |
Definition at line 671 of file StdMesh.h.
Referenced by GetVAOID(), UpdateIBO(), and ~StdMeshInstance().