/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2006.12.04 * ³» ¿ë : ³×ºñ¸Þ½Ã ³ëµå * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "Box.h" class cRay; class cNaviMeshBranchNode; class cNaviMeshLeafNode; /// ³×ºñ¸Þ½Ã ³ëµå class cNaviMeshNode { public: cNaviMeshNode( unsigned int xi, unsigned int yi, unsigned int cellCount ); virtual ~cNaviMeshNode(); /// ·Îµù virtual bool Load( cFileLoader& loader ) = 0; virtual void AddToLoadArray( cNaviMeshNode** loadArray, unsigned int& count ) = 0; /// Ãæµ¹ °Ë»ç virtual bool CollideRay() = 0; /// °æ°è »óÀÚ const cBox& GetBoundBox() const; public: /// °æ°è »óÀÚ cBox mBoundBox; NiPoint3 mCenter; float mRadius; protected: /// Ãæµ¹ °Ë»ç¿ë static const cRay* mRay; static float mMaxDistance; static float* mDistance; static NiPoint3* mContact; }; inline const cBox& cNaviMeshNode::GetBoundBox() const { return mBoundBox; } /// ³×ºñ¸Þ½Ã °¡Áö ³ëµå class cNaviMeshBranchNode : public cNaviMeshNode { public: cNaviMeshBranchNode( unsigned int xi, unsigned int yi, unsigned int cellCount ); ~cNaviMeshBranchNode(); /// ·Îµù bool Load( cFileLoader& loader ); void AddToLoadArray( cNaviMeshNode** loadArray, unsigned int& count ); /// Ãæµ¹ °Ë»ç bool CollideRay(); public: /// ÀÚ½Ä ¹è¿­ cNaviMeshNode* mChild[4]; }; /// ³×ºñ¸Þ½Ã ¸®ÇÁ ³ëµå class cNaviMeshLeafNode : public cNaviMeshNode { friend class cNaviMesh; friend class cNaviMeshBranchNode; public: cNaviMeshLeafNode( unsigned int xi, unsigned int yi, unsigned int cellCount ); ~cNaviMeshLeafNode(); /// ·Îµù bool Load( cFileLoader& loader ); void AddToLoadArray( cNaviMeshNode** loadArray, unsigned int& count ); /// Ãæµ¹ °Ë»ç bool CollideRay(); private: /// ÁÂÇ¥ (³×ºñ¸Þ½Ã ±×¸®µå »óÀÇ À§Ä¡) unsigned int mXIndex; unsigned int mYIndex; private: /// ¹öÀü static unsigned int mVersion; /// ¸®ÇÁ ³ëµåÀÇ ±×¸®µå Å©±â static unsigned int mCellCount; static unsigned int mLineCount; };