Skip to content

Commit

Permalink
Reformat: utils
Browse files Browse the repository at this point in the history
  • Loading branch information
invokr committed Jan 15, 2017
1 parent e79bc5e commit 3d01d0a
Show file tree
Hide file tree
Showing 110 changed files with 17,712 additions and 18,238 deletions.
64 changes: 33 additions & 31 deletions src/plugins/Max/Export/BoneDef.cpp
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;
}
Loading

0 comments on commit 3d01d0a

Please sign in to comment.