/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2006.12.13 * ³» ¿ë : Á¶¸í ÆíÁýÀÚ * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once class cSceneNode; class cLightSceneNode; class cLightTransformDialog; class cLightPropertyDialog; class cLightInfoDialog; /// Á¶¸í ÆíÁýÀÚ /// ¸Ê»óÀÇ Á¶¸íµéÀ» ÆíÁýÇÑ´Ù. class cLightEditor { static cLightEditor* mSingleton; friend class cMapEditorView; friend class cObjectEditor; public: cLightEditor(); ~cLightEditor(); /// Áö¿ò void Clear(); /// ·»´õ¸µ void Render(); /// ÃʱâÈ­ void Init(); /// ÀúÀå bool Save( cFileSaver& saver ); /// Á¶¸íÀ» »ý¼º bool CreateLight(); /// ÇÈÅ· bool Pick( CPoint point ); /// ¼±Åà void DeselectAll(); /// Á¶¸íÀ» ÁöÇü¿¡ ºÎÂø void AttachLightToTerrain( CPoint point ); /// Á¶¸íÀ» ¿ÀºêÁ§Æ®¿¡ ºÎÂø void AttachLightToObject( CPoint point ); /// Á¶¸íÀ» »èÁ¦ void DeleteLight(); /// Á¶¸íÀ» º¹»ç void CopyLight(); /// Á¤º¸ ´ÙÀ̾ó·Î±×¸¦ °»½Å void UpdateInfoDialog(); /// Á¶¸íÀÇ À̵¿ void SetLightTranslate( const NiPoint3& trans, bool updateDialog ); /// Á¶¸íÀÇ ¹ÝÁö¸§ void SetLightRadius( float scale, bool updateDialog ); /// Á¶¸íÀÇ »ö»ó void SetLightAmbient( COLORREF rgb ); void SetLightDiffuse0( COLORREF rgb ); void SetLightDiffuse1( COLORREF rgb ); void SetLightDiffuseAnimTime( float time ); void SetLightSpecular( COLORREF rgb ); /// Á¶¸íÀÇ °¨¼è °è¼ö void SetLightConstantAtten0( float value ); void SetLightConstantAtten1( float value ); void SetLightConstantAttenAnimTime( float value ); void SetLightLinearAtten( float value ); void SetLightQuadricAtten( float value ); /// ´ÙÀ̾ó·Î±× void SetTransformDialog( cLightTransformDialog* dlg ); void SetPropertyDialog( cLightPropertyDialog* dlg ); void SetInfoDialog( cLightInfoDialog* dlg ); /// Á¶¸í ¼ö unsigned int GetNumLights() const; private: /// ÇØ´ç Á¶¸íÀ» Á¦°Å bool Kill( cLightSceneNode* node ); /// ÇØ´ç Á¶¸íÀ» º¹Á¦ /// º¹Á¦µÈ »õ·Î¿î Á¶¸íÀ» ¸®ÅÏÇÑ´Ù. cLightSceneNode* Clone( cLightSceneNode* node ); /// ¸Þ½ÃÁö¸¦ ó¸® void OnMouseMove( CPoint point ); void OnLButtonDown_Transform( CPoint point ); void OnRButtonDown_Transform( CPoint point, bool ctrl ); void OnKeyDown( UINT c ); public: /// ´ÜÀÏü¸¦ ¸®ÅÏ static cLightEditor* GetSingleton(); protected: /// ¹èÄ¡ ´ÙÀ̾ó·Î±× cLightTransformDialog* mTransformDialog; /// ¼Ó¼º ´ÙÀ̾ó·Î±× cLightPropertyDialog* mPropertyDialog; /// Á¤º¸ ´ÙÀ̾ó·Î±× cLightInfoDialog* mInfoDialog; /// »ý¼ºµÈ Á¶¸í ™V typedef tHashSet cCreatedSet; cCreatedSet mCreatedSet; /// ÇÈÅ·µÈ ³ëµå ¹è¿­ typedef tArray cPickedArray; cPickedArray mPickedArray; /// ¼±ÅÃµÈ Á¶¸í cLightSceneNode* mSelectedNode; /// ÆíÁý ¿ø /// Á¶¸í ³ëµåµéÀ» Ç¥½ÃÇϴµ¥ »ç¿ëÇÑ´Ù. NiMeshPtr mCircleLines; //NiPoint3* mPosCoords; //NiBool* mFlags; NiMaterialPropertyPtr mMatProp; NiVertexColorPropertyPtr mVertColorProp; NiWireframePropertyPtr mWireProp; /// ¸¶¿ì½º ÁÂÇ¥ CPoint mMousePos; }; inline void cLightEditor::SetTransformDialog( cLightTransformDialog* dlg ) { assert( dlg && "null light transform dialog" ); mTransformDialog = dlg; } inline void cLightEditor::SetPropertyDialog( cLightPropertyDialog* dlg ) { assert( dlg && "null light property dialog" ); mPropertyDialog = dlg; } inline void cLightEditor::SetInfoDialog( cLightInfoDialog* dlg ) { assert( dlg && "null light info dialog" ); mInfoDialog = dlg; } inline unsigned int cLightEditor::GetNumLights() const { return mCreatedSet.GetSize(); } inline cLightEditor* cLightEditor::GetSingleton() { return mSingleton; } #define LIGHTEDIT cLightEditor::GetSingleton()