#pragma once #include "ObjectAttachment.h" #include "EventInfo.h" struct RENDER_PART_OPTION { BOOL bSpecularVariation; BOOL bCustomDiffuse; WzColor CustomDiffuseColor; void Initialize() { bSpecularVariation = FALSE; bCustomDiffuse = FALSE; } }; struct OBJECT_ATTACHMENT { int iBoneIndex; // ºÙÀº º»¹øÈ£ RESOURCECODE codeResource; // ¸®¼Ò½º ¾ÆÀ̵ð int iSubType; BOOL bSpecularVariation; CWzUnitDraw * pUnitDraw; WzID animID; BOOL bAnimate; BOOL bUseOffsetMatrix; WzMatrix offsetMatrix; eATTACHTYPE eAttachType; WzVector wvInterpolateOffsetAttachment; int iInterpolateTick; WzVector vOldPos; float fAccelerate; }; struct APPEARANCEINFO; class ObjectData { public: ObjectData(); void Initialize(); void Release(); void InitializeRender( size_t MaxPartNum, size_t BasePart, APPEARANCEINFO* pAppearInfo, size_t iAttachmentCount); //void RefreshRender( APPEARANCEINFO* pAppearInfo, BOOL bRefreshBone); void ReleaseRender(); void StartRenderType( ENUM_ALTERNATIVE_RENDER eRenderType); // °¢ ºÎÂø¹°¿¡ È¿°ú¸¦ Àû¿ë ÇÑ´Ù. void EndRenderType(); // °¢ ºÎÂø¹°¿¡ ¿¹Àü È¿°ú¸¦ º¹¿øÇÑ´Ù. // ·£´õ ¼³Á¤ void EnableCustomLight(BOOL bFlag); void SetShadowDraw(BOOL bShow); void SetRefractionRate(float fRefractionRate); void SetRefractionAlpha(float fRefractionAlpha); void SetInflationRange(float fRange); void SetRenderPartOption(size_t index, const RENDER_PART_OPTION& Option); void DetachLightmap(); BOOL RenderBasicParts( St_RenderCommand* pCommand /* = NULL */ ); BOOL RenderParts( St_RenderCommand* pCommand /* = NULL */ ); BOOL RenderParts( St_RenderCommand* pCommand, int PartIndex ); BOOL RenderOutline( const WzColor& Color, float fThickness ); BOOL RenderPartsForCostume(); BOOL RenderOutlineForCostume( const WzColor& Color, float fThickness ); void RenderAttachment(); void RefreshAniRefDraw(); // °¢ ÆÄÆ®ÀÇ ¿¡´Ï¸ÞÀ̼ÇÀ» °øÀ¯ ÇÑ´Ù. BOOL IsCompletelyLoaded(); BOOL IsCompletelyFullLoaded(); void SetSubTypeEffectShow(BOOL bShow); private: // size_t m_BasePart; size_t m_MaxPartNum; //int m_iAttachmentCount; CWzUnitDraw** m_ppRenderPart; RENDER_PART_OPTION* m_pRenderPartVariation; // ºÎÂø¹° std::vector m_AttachmentArray; // ·£´õ °ü·Ã BOOL m_bCustomLight; BOOL m_bShadowDraw; BOOL m_bHideAttachment; ENUM_ALTERNATIVE_RENDER m_renderType; ENUM_ALTERNATIVE_RENDER m_oldRenderType; WzColor m_wzColor; // ·£´õ·¯¿¡ ¼³Á¤ÇÒ Ä®¶ó bool m_bResourceForceRemove; public: std::vector& GetAttachmentArray() { return m_AttachmentArray; } const std::vector& GetAttachmentArray() const { return m_AttachmentArray; } void SetAttachmentArray(const std::vector& value) { m_AttachmentArray = value; } const ObjectAttachment& GetAttachment( size_t Index ) { return m_AttachmentArray[Index]; } size_t GetAttachmentCount() { return m_AttachmentArray.size(); } CWzUnitDraw* GetBasePart() { if( m_ppRenderPart ) return m_ppRenderPart[m_BasePart]; else return NULL; } CWzUnitDraw* GetPart( size_t Index ) { if(m_ppRenderPart && (Index < m_MaxPartNum)) return m_ppRenderPart[Index]; else return NULL; } CWzUnitDraw** GetRenderParts() const { return m_ppRenderPart; } size_t GetBasePartIndex() const { return m_BasePart; } void SetBasePartIndex(size_t value) { m_BasePart = value; } size_t GetPartCount() const { return m_MaxPartNum; } //void SetPartCount(size_t value) { m_MaxPartNum = value; } BOOL IsCustomLight() const { return m_bCustomLight; } void SetCustomLight(BOOL value) { m_bCustomLight = value; } BOOL IsShadowDraw() const { return m_bShadowDraw; } BOOL IsHideAttachment() const { return m_bHideAttachment; } void SetHideAttachment(BOOL value) { m_bHideAttachment = value; } void SetColor(WzColor wzColor); void SetColor(int r, int g, int b, int a); WzColor GetColor() {return m_wzColor;} WzBoundingVolume* GetBoundingVolume(); size_t GetNumPickingBoundingVolume(); WzBoundingVolume* GetPickingBoundingVolume( size_t index); void SetAttachmentAnimation(size_t nIndex, WzID animID,BOOL bLoop); void ApplyInterpolateAccesory(); BOOL ProcessInterpolationAttachment( DWORD dwTick ); private: // ±æÃ£±â CPathExplorer* m_pPathExplorer; WzVector m_wvVisiblePos; // Ãâ·ÂÇÒ À§Ä¡ float m_fAngleZ; // ¿ÀºêÁ§Æ®ÀÇ ÇöÀç Z °¢µµ float m_fAngleX; public: CPathExplorer* GetPathExplorer() { return m_pPathExplorer; } void SetScale(float fScale); void SetScale(const WzVector& vScale); void GetScale(WzVector* pScale); WzVector GetScale(); float GetAngle() { return m_fAngleZ; }; float GetAngleX(){ return m_fAngleX; }; virtual void SetAngleX(float fAngle ) { m_fAngleX = fAngle; } virtual void SetAngle(float fAngle, BOOL bSetVisibleAngle = FALSE); virtual void SetAngle(float fAngleX, float fAngleY, float fAngleZ); virtual void Rotate(float fAngle, BOOL bSetVisibleAngle = FALSE); void SetRandomAngle(); void SetVisiblePos(const WzVector& vPos) { m_wvVisiblePos = vPos; } void SetVisiblePos( float x, float y, float z ) { m_wvVisiblePos.x = x; m_wvVisiblePos.y = y; m_wvVisiblePos.z = z; } WzVector GetVisiblePos(); WzVector GetPosition(); virtual BOOL SetPosition( const WzVector& wvPos, int iTileIndex = -1); virtual BOOL SetPosition( const HONGPOS& pPos ); void SetDirection( const WzVector& TargetPosition, BOOL bVisibleAngle = FALSE ); void SetDirection( const WzVector& TargetPosition, const WzVector& SrcPosition, BOOL bVisibleAngle = FALSE ); WzVector GetDirection(); private: void _ClampAngle(float* pAngle); };