172 lines
5.1 KiB
C++
172 lines
5.1 KiB
C++
#pragma once
|
|
|
|
#include "KViewport.h"
|
|
#include "KSeqModel.h"
|
|
|
|
#include "GameDefine.h"
|
|
|
|
class SParticleRecycling
|
|
{
|
|
private:
|
|
class KSeqModel* m_pParticle;
|
|
K3DVector m_vStartPosition;
|
|
K3DVector m_vEndPosition;
|
|
bool m_bAlive; ///< 살아있나
|
|
DWORD m_dwLifeTime; ///< 생명력 0이면 Start부터 End까지의 이동이 끝나면 자동으로 사라진다 0이 아니라면 지정된 시간이 경과하면 사라진다.
|
|
float m_fMoveSpeed; ///< 이동 속도
|
|
float m_fStartSize; ///< 처음 시작크기
|
|
float m_fEndSize; ///< 마지막 크기
|
|
K3DVector m_vEmitRadius; ///< 방출 범위
|
|
K3DVector m_vDirection;
|
|
DWORD m_dwStartTime;
|
|
DWORD m_dwIncreaseTime;
|
|
bool m_bIsEnd;
|
|
public:
|
|
void PlayAnimation();
|
|
void CreateSeqForm( const char* szFileName );
|
|
bool ProcessParticleMove( DWORD dwTime, const K3DMatrix* pSMatrix, const K3DMatrix* pEMatrix );
|
|
bool ProcessParticleDirMove( DWORD dwTime, const K3DMatrix* pMatEp, const K3DMatrix* pMatAttch, const K3DMatrix* pMatParent );
|
|
float Visiblity( float fS );
|
|
float floatLinear( float v0, float v1, float t );
|
|
void SetRenderFlagOff();
|
|
void Render( KViewportObject* ppViewportList );
|
|
public:
|
|
void SetLifeTime( DWORD dwLifeTime );
|
|
void SetResetTime( DWORD dwTime );
|
|
void SetMoveSpeed( float fMoveSpeed );
|
|
void SetAlpha( float fAlpha );
|
|
void SetStartSize( float fSize );
|
|
void SetEndSize( float fSize );
|
|
void SetEmitRadius( K3DVector* vEmitRadius );
|
|
void SetLive( bool bAlive );
|
|
void SetDirection( K3DVector* vMinDirection, K3DVector* vMaxDirection );
|
|
void SetStartRandomPosition( K3DVector* vMinStartPositon, K3DVector* vMaxStartPositon);
|
|
void SetStartPosition( K3DVector* vStartPositon );
|
|
void SetEnd( bool bEnd );
|
|
public:
|
|
bool IsLive() { return m_bAlive; }
|
|
bool IsEnd() { return m_bIsEnd; }
|
|
public:
|
|
SParticleRecycling();
|
|
virtual ~SParticleRecycling();
|
|
};
|
|
|
|
class SEnhanceFxType;
|
|
class SGameEnhanceFx
|
|
{
|
|
protected:
|
|
SEnhanceFxType* m_pEnhanceType;
|
|
struct EnhanceFX* m_pEnhanceFx;
|
|
int m_nEnhanceFxID;
|
|
|
|
class SGameAvatarEx* m_pPlayer;
|
|
int m_nWpEffectPos;
|
|
|
|
bool m_bIsEnd;
|
|
bool m_bRender;
|
|
public:
|
|
void SetEnhanceFxID( int nEnhanceFxID ) { m_nEnhanceFxID = nEnhanceFxID; }
|
|
void SetEnd( bool bEnd ) { m_bIsEnd = bEnd; }
|
|
void SetRenderFlag( bool bRender ) { m_bRender = bRender; }
|
|
void SetMatrix( class SGameAvatarEx* pAvatar, int nWeaponEffectPos );
|
|
|
|
int GetEnhanceFxID() { return m_nEnhanceFxID; }
|
|
|
|
bool IsEnd() { return m_bIsEnd; }
|
|
public:
|
|
virtual void Init( SGameAvatarEx* pAvatar, int nWeaponEffectPos, int nItemClass );
|
|
virtual void Destroy();
|
|
|
|
virtual void Process( DWORD dwTime );
|
|
virtual void Render( unsigned long uRenderBitVector, KViewportObject** ppViewportList, int nViewportCount );
|
|
public: //파티클 전용 치트
|
|
void SetParticleQuality( int nQuality );
|
|
void SetEnhanceFxType( int nType );
|
|
void SetLifeTime( DWORD nLifeTime );
|
|
void SetMoveSpeed( float fSpeed );
|
|
void SetSize( float fStartSize, float fEndSize );
|
|
void SetEmitRadius( K3DVector vEmitRadius );
|
|
void SetEmitRate( float fMin, float fMax );
|
|
void SetCreateInterval( float fInterval );
|
|
void SetMinDirection( K3DVector vMinDirection );
|
|
void SetMaxDirection( K3DVector vMaxDirection );
|
|
public:
|
|
SGameEnhanceFx();
|
|
virtual ~SGameEnhanceFx();
|
|
};
|
|
|
|
//
|
|
class SEnhanceFxType
|
|
{
|
|
protected:
|
|
SParticleRecycling* m_pParticleRecycling;
|
|
class KSeqModel* m_pMeshFx;
|
|
|
|
//struct EnhaceFx_Info* m_pEnhanceFxInfo;
|
|
|
|
const K3DMatrix* m_pmatEPParent[EFFECT_POS_WEAPON_EP_MAX];
|
|
const K3DMatrix* m_pmatEpAttach[EFFECT_POS_WEAPON_EP_MAX];
|
|
const K3DMatrix* m_pmatEpPoint[EFFECT_POS_WEAPON_EP_MAX];
|
|
|
|
K3DMatrix m_matTransform[EFFECT_POS_WEAPON_EP_MAX];
|
|
|
|
unsigned short m_nMaxParticleSize;
|
|
|
|
float m_fEmitRate;
|
|
float m_fNumNewPartsExcess;
|
|
|
|
DWORD m_dwTime;
|
|
protected:
|
|
bool ParticleResurrection( int nCount );
|
|
bool ProcessMatrix( EFFECT_POS_WEAPON_EP nEffectPosEp );
|
|
public:
|
|
void Init( );
|
|
virtual void CreateSequence(){}
|
|
void CreateParticleSequence();
|
|
void CreateMeshSequence();
|
|
virtual void Process( DWORD dwTime );
|
|
virtual void Render( KViewportObject* ppViewportList );
|
|
|
|
void SetMatrix( SGameAvatarEx* pAvatar, int nWeaponEffectPos );
|
|
void SetEmitRate();
|
|
public:
|
|
SEnhanceFxType();
|
|
virtual ~SEnhanceFxType();
|
|
};
|
|
|
|
|
|
class SEnhanceParticleMoveFx : public SEnhanceFxType
|
|
{
|
|
public:
|
|
void Process( DWORD dwTime );
|
|
void Render( KViewportObject* ppViewportList );
|
|
|
|
void CreateSequence();
|
|
public:
|
|
SEnhanceParticleMoveFx() {}
|
|
~SEnhanceParticleMoveFx(){}
|
|
};
|
|
|
|
class SEnhanceParticleDirMoveFx : public SEnhanceFxType
|
|
{
|
|
public:
|
|
void Process( DWORD dwTime );
|
|
void Render( KViewportObject* ppViewportList );
|
|
|
|
void CreateSequence();
|
|
public:
|
|
SEnhanceParticleDirMoveFx() {}
|
|
~SEnhanceParticleDirMoveFx(){}
|
|
};
|
|
|
|
class SEnhanceMeshFx : public SEnhanceFxType
|
|
{
|
|
public:
|
|
void Process( DWORD dwTime );
|
|
void Render( KViewportObject* ppViewportList );
|
|
|
|
void CreateSequence();
|
|
public:
|
|
SEnhanceMeshFx() {}
|
|
~SEnhanceMeshFx(){}
|
|
}; |