- Joined
- May 17, 2009
- Messages
- 60
- Reaction score
- 92
1. Check sure ur code have m_fScale property.
DxSkinPieceData.h
2. Check DxSkinPieceData::LOAD_Ver100 to get scale value from ABL file.
DxSkinPieceData.cpp
3. Edit render function like this.
DxSkinCharPiece.cpp
Lucky in dev. :
DxSkinPieceData.h
Code:
public:
DWORD m_dwRef;
BOOL m_bWorldObj;
float m_fScale; [COLOR=#FF0000]<<<<<<<<[/COLOR]
D3DXVECTOR3 m_vMax, m_vMin;
float m_fHeight;
float m_fRadius;
2. Check DxSkinPieceData::LOAD_Ver100 to get scale value from ABL file.
DxSkinPieceData.cpp
Code:
BOOL DxSkinPieceData::LOAD_Ver100( basestream &SFile, LPDIRECT3DDEVICEQ pd3dDevice )
{
DWORD dwPieceSize;
//SFile >> m_fScale;
SFile >> dwPieceSize;
if ( dwPieceSize > PIECE_SIZE ) return FALSE;
// Note : มถฐขต้ ทฮตๅ.
//
BOOL bExit;
for ( DWORD i=0; i<dwPieceSize; ++i )
{
SFile >> bExit;
if ( !bExit )
{
m_strPIECE[i].clear();
continue;
}
SFile >> m_strPIECE[i];
}
// Note : บปฦฤภฯ ภะฑโ.
//
SFile >> m_strSkeleton;
// Note :ฟกดฯธภฬผว ภะฑโ.
//
DWORD dwAniNum(0);
SFile >> dwAniNum;
m_vecANIFILE.clear();
m_vecANIFILE.reserve ( dwAniNum );
for ( DWORD i=0; i<dwAniNum; ++i )
{
//std::string strANIFILE;
//SFile >> strANIFILE;
// GForceFX 17-06-2013 Fix ABL read .cfg extension animation
std::string strTEMP ;
SFile >> strTEMP ;
CString strANIFILE;
bool bCFG;
bCFG = STRUTIL::ChangeExt ( strTEMP.c_str(), ".cfg", strANIFILE, ".x" );
if ( !bCFG )
{
strANIFILE = strTEMP.c_str();
}
m_vecANIFILE.push_back ( strANIFILE.GetString() );
}
SFile >> m_fScale; [COLOR=#FF0000]<<<<<<<<<<<<[/COLOR]
BOOL bExist = FALSE;
SFile >> bExist;
if( bExist )
{
SFile >> m_fHeight;
SFile >> m_fRadius;
}
else return TRUE;
SFile >> m_dwBONE;
if ( m_dwBONE > MAX_BONE ) return FALSE;
for ( i=0; i < m_dwBONE ; ++i )
{
SFile >> m_fBONE1[i];
SFile >> m_fBONE2[i];
SFile >> m_fBONE3[i];
SFile >> m_strBONE[i];
}
// Note : นูฟ๎ตๅ นฺฝบ มคบธ ทฮตๅ.
//
BOOL bBoundBox(FALSE);
SFile >> bBoundBox;
if ( bBoundBox )
{
SFile >> m_vMax;
SFile >> m_vMin;
}
else
{
m_vMax = D3DXVECTOR3(7.f,20.f,7.f);
m_vMin = D3DXVECTOR3(-7.f,0.f,-7.f);
}
bExist = FALSE;
SFile >> bExist;
if( bExist ) SFile >> m_bWorldObj;
else return TRUE;
// Note : ดวม
SFile >> bExist;
//CDebugSet::ToLogFile( "load version_0000 : %d asp okey" );
return TRUE;
}
3. Edit render function like this.
DxSkinCharPiece.cpp
Code:
HRESULT DxSkinCharPiece::Render ( const LPDIRECT3DDEVICEQ pd3dDevice, const D3DXMATRIX &matRot, const BOOL bShadow, const BOOL bEff, const BOOL bReverse )
{
if ( ISENDANIM() && ( m_dwType == PIECE_RHAND || m_dwType == PIECE_LHAND ) )
{
SELECTANI( AN_GUARD_N , AN_SUB_NONE );
}
D3DXMATRIXA16 matLocalRot, matScale;
D3DXMatrixIdentity( &matScale );
matScale._11 = m_fScale;
matScale._22 = m_fScale;
matScale._33 = m_fScale;
D3DXMatrixMultiply( &matLocalRot, &matScale, &matRot ); [COLOR="#FF0000"]<<<<<<< add this line (multiply scale to matLocalRot)[/COLOR]
if ( !m_bAttackLocal && ( m_dwType == PIECE_RHAND || m_dwType == PIECE_LHAND ) )
D3DXMatrixRotationYawPitchRoll( &matScale, m_fRotX_F, m_fRotY_F, m_fRotZ_F );
else
D3DXMatrixRotationYawPitchRoll( &matScale, m_fRotX, m_fRotY, m_fRotZ );
D3DXMatrixMultiply( &matLocalRot, &matScale, &matLocalRot ); [COLOR="#FF0000"]<<<<<<< edit this line (multiply position to matLocalRot again)[/COLOR]
D3DXVECTOR3 vVelocity;
if ( !m_bAttackLocal && ( m_dwType == PIECE_RHAND || m_dwType == PIECE_LHAND ) )
D3DXVec3TransformNormal ( &vVelocity, &m_vVelocityPiece_F, &matRot );
else
D3DXVec3TransformNormal ( &vVelocity, &m_vVelocityPiece, &matRot );
matLocalRot._41 += vVelocity.x;
matLocalRot._42 += vVelocity.y;
matLocalRot._43 += vVelocity.z;
Lucky in dev. :