-
-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
110 changed files
with
17,712 additions
and
18,238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,48 @@ | ||
#include "stdafx.h" | ||
#include "plugins/Shared/BoneDef.h" | ||
#include "Exporter.h" | ||
#include "MeshExpUtility.h" | ||
#include "stdafx.h" | ||
|
||
CBoneDef::CBoneDef(INode* pNode) | ||
CBoneDef::CBoneDef(INode* pNode) | ||
{ | ||
parent = 0; | ||
pBone = pNode; | ||
name = Helper::ConvertSpace(string(pBone->GetName())); | ||
parent = 0; | ||
pBone = pNode; | ||
name = Helper::ConvertSpace(string(pBone->GetName())); | ||
|
||
matInit.identity(); | ||
matOffset.identity(); | ||
matInit.identity(); | ||
matOffset.identity(); | ||
} | ||
LPCSTR CBoneDef::GetParentName() | ||
{ | ||
INode* node=pBone->GetParentNode(); | ||
if (Helper::IsBone(node,U.m_SkinAllowDummy)) return node->GetName(); | ||
return 0; | ||
INode* node = pBone->GetParentNode(); | ||
if (Helper::IsBone(node, U.m_SkinAllowDummy)) return node->GetName(); | ||
return 0; | ||
} | ||
BOOL CBoneDef::SetInitTM(IPhysiqueExport* pExport, const Matrix3& matMesh) | ||
{ | ||
BOOL bErr = false; | ||
R_ASSERT(pBone); | ||
R_ASSERT(Helper::IsBone(pBone,U.m_SkinAllowDummy)); | ||
Matrix3 tmp; | ||
//Log("SetInitTM:",pBone->GetName()); | ||
if(Helper::IsBipedBone(pBone)) { | ||
Helper::SetBipedUniform(pBone, TRUE, TRUE); | ||
bErr = CGINTM(pBone,pExport->GetInitNodeTM(pBone, tmp)); | ||
if (bErr) tmp.IdentityMatrix(); | ||
Helper::SetBipedUniform(pBone, FALSE, FALSE); | ||
} else { | ||
bErr = CGINTM(pBone,pExport->GetInitNodeTM(pBone, tmp)); | ||
if (bErr) tmp.IdentityMatrix(); | ||
} | ||
BOOL bErr = false; | ||
R_ASSERT(pBone); | ||
R_ASSERT(Helper::IsBone(pBone, U.m_SkinAllowDummy)); | ||
Matrix3 tmp; | ||
// Log("SetInitTM:",pBone->GetName()); | ||
if (Helper::IsBipedBone(pBone)) { | ||
Helper::SetBipedUniform(pBone, TRUE, TRUE); | ||
bErr = CGINTM(pBone, pExport->GetInitNodeTM(pBone, tmp)); | ||
if (bErr) tmp.IdentityMatrix(); | ||
Helper::SetBipedUniform(pBone, FALSE, FALSE); | ||
} | ||
else | ||
{ | ||
bErr = CGINTM(pBone, pExport->GetInitNodeTM(pBone, tmp)); | ||
if (bErr) tmp.IdentityMatrix(); | ||
} | ||
|
||
if (1){//!bErr){ | ||
Helper::ConvertMatrix(tmp,matInit); | ||
matOffset.invert(matInit); | ||
//S matMesh | ||
// pBone->matOffset = matMesh * Inverse(pBone->matInit); | ||
} | ||
if (1) { //! bErr){ | ||
Helper::ConvertMatrix(tmp, matInit); | ||
matOffset.invert(matInit); | ||
// S matMesh | ||
// pBone->matOffset = matMesh * Inverse(pBone->matInit); | ||
} | ||
|
||
return 1;//!bErr; | ||
return 1; //! bErr; | ||
} |
Oops, something went wrong.