Files
2026-06-01 12:46:52 +02:00

152 lines
5.4 KiB
C++

#pragma once
#include "KSeqForm.h"
#include "krenderobject.h"
#include "GameDefine.h"
using namespace GAME_DEFINE;
class KSeqAvatarEx : public KSeqForm
{
public:
KSeqAvatarEx( bool bClone=false );
virtual ~KSeqAvatarEx();
virtual void Initialize();
virtual void Clear();
virtual void ReSet();
virtual DWORD GetAniTime();
virtual void ClipTest( const K3DVector* pFrustrum);
virtual bool GetIsClip();
virtual void SetParentTransform( const K3DMatrix *pMatParent, const K3DMatrix *pMatAttach = NULL, BOOL bRotationLock = FALSE );
virtual void SetVisibility( float fVisibility );
virtual void SetSkinDiffuse( KColor & diffuse );
/// Bone에 붙는 Effect
bool AddBoneEffect( int nAniIndex, int nIndex, const char *bonename, const char *filename );
/// 타격 이펙트 위치 화일~, 하나만 설정 가능
bool AddEffectPos( int nAniIndex, int nAttachIndex, const char *filename );
/// 아바타 본 애니메이션들~
bool AddAnimation( int nAniIndex, const char *filename, bool bNowLoading = false );
/// 아바타 살들~
KSeqObject *GetMesh (int nAniIndex, int nMeshIndex);
void AddMesh( int nAniIndex, int nMeshIndex, KSeqObject *obj );
bool AddMesh( int nAniIndex, int nMeshIndex, const char *filename );
bool AddMesh( int nAniIndex, int nMeshIndex, const char *filename, std::string& texName );
void ClearMesh();
void ClearMesh( int nAniIndex );
int IsExistMesh( int nAniIndex, int nMeshIndex );
int IsExistDecoMesh( int nAniIndex, int nMeshIndex );
void ChangeTexture(int nAniIndex, int nMeshIndex, std::string& texName);
void ChangeDecoTexture(int nAniIndex, int nMeshIndex, std::string& texName);
bool AddDecoMesh( int nAniIndex, int nDecoMeshIndex, const char *filename );
bool AddDecoMesh( int nAniIndex, int nDecoMeshIndex, const char *filename, std::string& texName );
bool AddDecoMesh( int nAniIndex, int nDecoMeshIndex, KSeqObject *obj );
/// 아바타 무기 링크들~
void AddAttachItem( int nAniIndex, int nItemIndex, KSeqObject *obj );
void AddAttachItem( int nAniIndex, int nItemIndex, const char *filename );
void AddAttachItem( int nAniIndex, int nItemIndex, const char *filename, std::string& texName );
void AddMorphMesh( int nAniIndex, class KMsgSET_MORPHMESH* pMsg );
void SetFixTexture( int nAniIndex, class KMsgSET_FIXTEXTURE* pMsg );
/// 특수 효과 끄기
void SetItemRenderFlag( int nAniIndex, BOOL bRenderFlag );
void SetItemRenderFlag( int nAniIndex, int nIndex, BOOL bRenderFlag ); //
bool PlayAnimation( int nAniIndex, DWORD dwCurTime, const char *name, int nAniType = SEQTYPE_NORMAL, float fPlayRate = 4.8f );
/// sfreer 임시코드임. 인벤토리 창에 나오는 아바타에서 방패 장착시 표시 안되는 버그을 위해 추가한 함수. 2009.03.09
bool PlayAnimation_temp( int nAniIndex, DWORD dwCurTime, const char *name, int nAniType = SEQTYPE_NORMAL, float fPlayRate = 4.8f );
bool PlayOverride( int nAniIndex, DWORD dwCurTime, const char *name, float fPlayRate = 4.8f );
void SetAttach( int nAniIndex ); ///< 각각의 Animation에 Attach
void SetDeform( int nAniIndex ); ///< 각각의 채널과 Deform
void SetAttachEffectPos( int nAniIndex ); ///< 각각의 Animation에 EffectPos Attach
void SetAttachBone(); ///< 각각의 Animation을 합친다.
void SetAttachBone10(); ///< 각각의 Animation을 합친다.
void SetAttachBone11(); ///< 각각의 Animation을 합친다.
void SetAnimationPos(int nPosFlag);
void ChangeAnimationType(int nAniIndex, int nAniType);
void ClearAnimation();
void GetFrameInfo( int nAniIndex, const char * strKey, int &nBoneCount, DWORD &dwMinTime, DWORD &dwMaxTime );
const K3DVector &GetPosition()
{
return *((K3DVector*)&m_matTransform.m30);
}
virtual bool IsLoadCompleted() const;
void SetViewVector( const K3DVector &view );
void SetTransform( const K3DMatrix &mat );
K3DMatrix &GetTransform()
{
return m_matTransform;
}
KSeqObject *GetCurrentAnimation();
const char *GetCurrentAnimationName();
bool IsPlaying();
void SetTimeRate( float fTimeRate );
virtual void *Perform( KID id, KArg& msg );
void *Perform( int nAniIndex, KID id, KArg& msg );
void *Perform( int nAniIndex, int nMeshIndex, KID id, KArg& msg );
void *DecoPerform( int nAniIndex, int nMeshIndex, KID id, KArg& msg );
virtual KSeqObject* Clone();
virtual int Process( DWORD dwTime );
virtual void Render( KViewportObject *viewport, DWORD flag = RENDEREFX_NONE, const K3DMatrix * pAttachMat = NULL );
//완성 된 후 추가 한다.
// void SetViewVectorX( float x, float y, float z ); //좌우
// void SetViewVectorZ( float x, float y, float z ); //상하
// void SetBodyVector( float x, float y ) ; //몸통
//
// void SetViewVectorX( K3DVector &Vec, int nDelay );
//
float GetHeadZ();
// void GetHandPos( K3DVector &posLeft, K3DVector &posRight );
//
DWORD GetLength( int nAniPartIndex );
void SetMeshRenderFlag( int nAniPartIndex, int nIndex, BOOL bRenderFlag );
void SetDecoMeshRenderFlag( int nAniPartIndex, int nIndex, BOOL bRenderFlag );
/// 툴에서 쓰려고...
virtual void SetAniTime( DWORD dwTime );
//
/// m_pAvatarPart[partNo] 를 돌려준다
class KSeqAvatar *getAvatarPart(int partNo);
bool CheckPendingSeq();
protected:
protected:
class KSeqAvatar* m_pAvatarPart[ANIPART_MAX];
BOOL m_bRenderRotCube;
};
//각 본들의 부모, 자식 관계를 만들어야 한다.
//Ani 타입이 변경되면, 같은 Ani 로 모두 변경 되야 한다.
//Attach, Deform 지원