home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 March / Gamestar_82_2006-03_dvd.iso / DVDStar / Editace / quake4_sdkv10.exe / source / game / GameEdit.h < prev    next >
C/C++ Source or Header  |  2005-11-14  |  3KB  |  97 lines

  1.  
  2. #ifndef __GAME_EDIT_H__
  3. #define __GAME_EDIT_H__
  4.  
  5.  
  6. /*
  7. ===============================================================================
  8.  
  9.     Ingame cursor.
  10.  
  11. ===============================================================================
  12. */
  13.  
  14. class idCursor3D : public idEntity {
  15. public:
  16.     CLASS_PROTOTYPE( idCursor3D );
  17.  
  18.                             idCursor3D( void );
  19.                             ~idCursor3D( void );
  20.  
  21.     void                    Spawn( void );
  22.     void                    Present( void );
  23.     void                    Think( void );
  24.  
  25.     idForce_Drag            drag;
  26.     idVec3                    draggedPosition;
  27. };
  28.  
  29.  
  30. /*
  31. ===============================================================================
  32.  
  33.     Allows entities to be dragged through the world with physics.
  34.  
  35. ===============================================================================
  36. */
  37.  
  38. class idDragEntity {
  39. public:
  40.                             idDragEntity( void );
  41.                             ~idDragEntity( void );
  42.  
  43.     void                    Clear();
  44.     void                    Update( idPlayer *player );
  45.     void                    SetSelected( idEntity *ent );
  46.     idEntity *                GetSelected( void ) const { return selected.GetEntity(); }
  47.     void                    DeleteSelected( void );
  48.     void                    BindSelected( void );
  49.     void                    UnbindSelected( void );
  50.  
  51. private:
  52.     idEntityPtr<idEntity>    dragEnt;            // entity being dragged
  53.     jointHandle_t            joint;                // joint being dragged
  54.     int                        id;                    // id of body being dragged
  55.     idVec3                    localEntityPoint;    // dragged point in entity space
  56.     idVec3                    localPlayerPoint;    // dragged point in player space
  57.     idStr                    bodyName;            // name of the body being dragged
  58.     idCursor3D *            cursor;                // cursor entity
  59.     idEntityPtr<idEntity>    selected;            // last dragged entity
  60.  
  61.     void                    StopDrag( void );
  62. };
  63.  
  64.  
  65. /*
  66. ===============================================================================
  67.  
  68.     Handles ingame entity editing.
  69.  
  70. ===============================================================================
  71. */
  72. typedef struct selectedTypeInfo_s {
  73.     idTypeInfo *typeInfo;
  74.     idStr        textKey;
  75. } selectedTypeInfo_t;
  76.  
  77. class idEditEntities {
  78. public:
  79.                             idEditEntities( void );
  80.     bool                    SelectEntity( const idVec3 &origin, const idVec3 &dir, const idEntity *skip );
  81.     void                    AddSelectedEntity( idEntity *ent );
  82.     void                    RemoveSelectedEntity( idEntity *ent );
  83.     void                    ClearSelectedEntities( void );
  84.     void                    DisplayEntities( void );
  85.     bool                    EntityIsSelectable( idEntity *ent, idVec4 *color = NULL, idStr *text = NULL );
  86. // RAVEN BEGIN
  87. // bdube: added
  88.     idEntity*                FindTraceEntity( idVec3 start, idVec3 end, const idEntity *skip );
  89. // RAVEN END
  90. private:
  91.     int                        nextSelectTime;
  92.     idList<selectedTypeInfo_t> selectableEntityClasses;
  93.     idList<idEntity *>        selectedEntities;
  94. };
  95.  
  96. #endif /* !__GAME_EDIT_H__ */
  97.