105 lines
2.3 KiB
C++
105 lines
2.3 KiB
C++
#pragma once
|
|
|
|
#include "KPrimitive.h"
|
|
|
|
|
|
struct PfxPathVertex
|
|
{
|
|
K3DVector vPos;
|
|
float fLength; ///< 누적된 길이 - 마지막 점의 fLength는 PatheEffect의 m_fTotalVertVectorLength와 같아야 한다. 실제 게임상의 좌표 단위.
|
|
};
|
|
|
|
struct PfxPrVertex
|
|
{
|
|
D3DXVECTOR3 pos;
|
|
DWORD color;
|
|
};
|
|
|
|
struct PfxPlPrVertex
|
|
{
|
|
D3DXVECTOR3 pos;
|
|
DWORD color;
|
|
float u, v;
|
|
};
|
|
|
|
|
|
class KLinePrimitive : public K3DPrimitive
|
|
{
|
|
public:
|
|
//struct SVertex
|
|
//{
|
|
// D3DXVECTOR3 pos;
|
|
// DWORD color;
|
|
//};
|
|
|
|
KLinePrimitive();
|
|
~KLinePrimitive();
|
|
void Clear();
|
|
void Update(PfxPrVertex* pVerts, int numVerts);
|
|
virtual void Render( KViewportObject *viewport, class K3DRenderDevice *dev, bool bUseAccum = true );
|
|
//void SetPrDrawMode(bool bDrawPr);
|
|
|
|
protected:
|
|
PfxPrVertex* m_pVerts;
|
|
int m_numVerts;
|
|
//bool m_bDrawPr;
|
|
};
|
|
|
|
class KQuadPrimitive : public K3DPrimitive
|
|
{
|
|
public:
|
|
//struct SVertex
|
|
//{
|
|
// D3DXVECTOR3 pos;
|
|
// DWORD color;
|
|
//};
|
|
|
|
KQuadPrimitive();
|
|
~KQuadPrimitive();
|
|
void Clear();
|
|
void Update(PfxPrVertex* pVerts, int numVerts);
|
|
virtual void Render( KViewportObject *viewport, class K3DRenderDevice *dev, bool bUseAccum = true );
|
|
//void SetRadius(float fRadius);
|
|
void SetSize(float fSize);
|
|
|
|
protected:
|
|
PfxPrVertex* m_pVerts;
|
|
int m_numVerts;
|
|
//float m_fRadius;
|
|
float m_fSize;
|
|
};
|
|
|
|
class KPolyLinePrimitive : public K3DPrimitive
|
|
{
|
|
public:
|
|
KPolyLinePrimitive();
|
|
~KPolyLinePrimitive();
|
|
void Clear();
|
|
void AddPathVert(K3DVertex vPos);
|
|
void AddPathNormal(K3DVertex vNormal);
|
|
void Update();
|
|
void Update(float fStart, float fEnd);
|
|
void UpdateUV(float fStart, float fEnd);
|
|
int GetPathVert(float fPos, K3DVertex& vRes);
|
|
virtual void Render(KViewportObject* viewport, class K3DRenderDevice* dev, bool bUseAccum = true);
|
|
void SetWidth(float fWidth);
|
|
void SetColor(DWORD dwColor);
|
|
void SetTexture(K3DTexture* pTexture);
|
|
|
|
protected:
|
|
std::vector<PfxPathVertex> m_vPathVerts;
|
|
std::vector<K3DVector> m_vPathNormals;
|
|
PfxPlPrVertex* m_pPrVerts;
|
|
//int m_numPrVerts; // (m_numPathVerts - 1) * 4
|
|
PfxPlPrVertex m_FirstPrVerts[4];
|
|
PfxPlPrVertex m_LastPrVerts[4];
|
|
float m_fWidth;
|
|
BOOL m_bOverrideFirstPrVerts;
|
|
BOOL m_bOverrideLastPrVerts;
|
|
DWORD m_dwColor;
|
|
int m_nFirstDrawQuad;
|
|
int m_nLastDrawQuad;
|
|
float m_fTotalPathLength;
|
|
K3DTextureSPtr m_spTexture;
|
|
};
|