|
1 |
| -#include "stdafx.h" |
2 | 1 | #include "plugins/Shared/BoneDef.h"
|
3 | 2 | #include "Exporter.h"
|
4 | 3 | #include "MeshExpUtility.h"
|
| 4 | +#include "stdafx.h" |
5 | 5 |
|
6 |
| -CBoneDef::CBoneDef(INode* pNode) |
| 6 | +CBoneDef::CBoneDef(INode* pNode) |
7 | 7 | {
|
8 |
| - parent = 0; |
9 |
| - pBone = pNode; |
10 |
| - name = Helper::ConvertSpace(string(pBone->GetName())); |
| 8 | + parent = 0; |
| 9 | + pBone = pNode; |
| 10 | + name = Helper::ConvertSpace(string(pBone->GetName())); |
11 | 11 |
|
12 |
| - matInit.identity(); |
13 |
| - matOffset.identity(); |
| 12 | + matInit.identity(); |
| 13 | + matOffset.identity(); |
14 | 14 | }
|
15 | 15 | LPCSTR CBoneDef::GetParentName()
|
16 | 16 | {
|
17 |
| - INode* node=pBone->GetParentNode(); |
18 |
| - if (Helper::IsBone(node,U.m_SkinAllowDummy)) return node->GetName(); |
19 |
| - return 0; |
| 17 | + INode* node = pBone->GetParentNode(); |
| 18 | + if (Helper::IsBone(node, U.m_SkinAllowDummy)) return node->GetName(); |
| 19 | + return 0; |
20 | 20 | }
|
21 | 21 | BOOL CBoneDef::SetInitTM(IPhysiqueExport* pExport, const Matrix3& matMesh)
|
22 | 22 | {
|
23 |
| - BOOL bErr = false; |
24 |
| - R_ASSERT(pBone); |
25 |
| - R_ASSERT(Helper::IsBone(pBone,U.m_SkinAllowDummy)); |
26 |
| - Matrix3 tmp; |
27 |
| - //Log("SetInitTM:",pBone->GetName()); |
28 |
| - if(Helper::IsBipedBone(pBone)) { |
29 |
| - Helper::SetBipedUniform(pBone, TRUE, TRUE); |
30 |
| - bErr = CGINTM(pBone,pExport->GetInitNodeTM(pBone, tmp)); |
31 |
| - if (bErr) tmp.IdentityMatrix(); |
32 |
| - Helper::SetBipedUniform(pBone, FALSE, FALSE); |
33 |
| - } else { |
34 |
| - bErr = CGINTM(pBone,pExport->GetInitNodeTM(pBone, tmp)); |
35 |
| - if (bErr) tmp.IdentityMatrix(); |
36 |
| - } |
| 23 | + BOOL bErr = false; |
| 24 | + R_ASSERT(pBone); |
| 25 | + R_ASSERT(Helper::IsBone(pBone, U.m_SkinAllowDummy)); |
| 26 | + Matrix3 tmp; |
| 27 | + // Log("SetInitTM:",pBone->GetName()); |
| 28 | + if (Helper::IsBipedBone(pBone)) { |
| 29 | + Helper::SetBipedUniform(pBone, TRUE, TRUE); |
| 30 | + bErr = CGINTM(pBone, pExport->GetInitNodeTM(pBone, tmp)); |
| 31 | + if (bErr) tmp.IdentityMatrix(); |
| 32 | + Helper::SetBipedUniform(pBone, FALSE, FALSE); |
| 33 | + } |
| 34 | + else |
| 35 | + { |
| 36 | + bErr = CGINTM(pBone, pExport->GetInitNodeTM(pBone, tmp)); |
| 37 | + if (bErr) tmp.IdentityMatrix(); |
| 38 | + } |
37 | 39 |
|
38 |
| - if (1){//!bErr){ |
39 |
| - Helper::ConvertMatrix(tmp,matInit); |
40 |
| - matOffset.invert(matInit); |
41 |
| - //S matMesh |
42 |
| -// pBone->matOffset = matMesh * Inverse(pBone->matInit); |
43 |
| - } |
| 40 | + if (1) { //! bErr){ |
| 41 | + Helper::ConvertMatrix(tmp, matInit); |
| 42 | + matOffset.invert(matInit); |
| 43 | + // S matMesh |
| 44 | + // pBone->matOffset = matMesh * Inverse(pBone->matInit); |
| 45 | + } |
44 | 46 |
|
45 |
| - return 1;//!bErr; |
| 47 | + return 1; //! bErr; |
46 | 48 | }
|
0 commit comments