mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-17 04:51:48 +00:00
Crashfix Physique export
This commit is contained in:
parent
b74a24a312
commit
1c1d7a2e4a
1 changed files with 29 additions and 26 deletions
|
@ -961,40 +961,43 @@ INode* CExportNel::getSkeletonRootBone (INode& node)
|
|||
// Get a vertex interface
|
||||
IPhyVertexExport *vertexInterface=localData->GetVertexInterface (vtx);
|
||||
|
||||
// Check if it is a rigid vertex or a blended vertex
|
||||
int type=vertexInterface->GetVertexType ();
|
||||
if (type==RIGID_TYPE)
|
||||
if (vertexInterface)
|
||||
{
|
||||
// this is a rigid vertex
|
||||
IPhyRigidVertex *rigidInterface=(IPhyRigidVertex*)vertexInterface;
|
||||
|
||||
// Get the bone
|
||||
INode *newBone=rigidInterface->GetNode();
|
||||
|
||||
// Get the root of the hierarchy
|
||||
ret=getRoot (newBone);
|
||||
found=true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// It must be a blendable vertex
|
||||
nlassert (type==RIGID_BLENDED_TYPE);
|
||||
IPhyBlendedRigidVertex *blendedInterface=(IPhyBlendedRigidVertex*)vertexInterface;
|
||||
|
||||
// For each bones
|
||||
uint bone;
|
||||
uint count=(uint)blendedInterface->GetNumberNodes ();
|
||||
for (bone=0; bone<count; bone++)
|
||||
// Check if it is a rigid vertex or a blended vertex
|
||||
int type=vertexInterface->GetVertexType ();
|
||||
if (type==RIGID_TYPE)
|
||||
{
|
||||
// Get the bone pointer
|
||||
INode *newBone=blendedInterface->GetNode(bone);
|
||||
// this is a rigid vertex
|
||||
IPhyRigidVertex *rigidInterface=(IPhyRigidVertex*)vertexInterface;
|
||||
|
||||
// Get the bone
|
||||
INode *newBone=rigidInterface->GetNode();
|
||||
|
||||
// Get the root of the hierarchy
|
||||
ret=getRoot (newBone);
|
||||
found=true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// It must be a blendable vertex
|
||||
nlassert (type==RIGID_BLENDED_TYPE);
|
||||
IPhyBlendedRigidVertex *blendedInterface=(IPhyBlendedRigidVertex*)vertexInterface;
|
||||
|
||||
// For each bones
|
||||
uint bone;
|
||||
uint count=(uint)blendedInterface->GetNumberNodes ();
|
||||
for (bone=0; bone<count; bone++)
|
||||
{
|
||||
// Get the bone pointer
|
||||
INode *newBone=blendedInterface->GetNode(bone);
|
||||
|
||||
// Get the root of the hierarchy
|
||||
ret=getRoot (newBone);
|
||||
found=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Release vertex interfaces
|
||||
|
|
Loading…
Reference in a new issue