Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5082 in orxonox.OLD for trunk/src/lib/graphics/render2D/element_2d.h


Ignore:
Timestamp:
Aug 19, 2005, 1:29:18 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: implemented PNode-functionality in Element2D,
update and debugDraw still missing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/render2D/element_2d.h

    r5081 r5082  
    4040typedef enum
    4141{
    42   E2D_LOCAL_ROTATE          =   1,    //!< Rotates all the children around their centers.
    43   E2D_ROTATE_MOVEMENT       =   2,    //!< Moves all the children around the center of their parent, without the rotation around their own centers.
    44 
    45   E2D_MOVEMENT              =   4,    //!< Moves all children along with the parent.
     42  E2D_PARENT_LOCAL_ROTATE       =   1,    //!< Rotates all the children around their centers.
     43  E2D_PARENT_ROTATE_MOVEMENT    =   2,    //!< Moves all the children around the center of their parent, without the rotation around their own centers.
     44
     45  E2D_PARENT_MOVEMENT           =   4,    //!< Moves all children along with the parent.
    4646// special linkage modes
    47   E2D_ALL                   =   3,    //!< Moves all children around the center of their parent, and also rotates their centers
    48   E2D_ROTATE_AND_MOVE       =   5     //!< Rotates all children around their axis, and moves them as the Parent Moves, but does not rotate around the center of their parent.
     47  E2D_PARENT_ALL                =   3,    //!< Moves all children around the center of their parent, and also rotates their centers
     48  E2D_PARENT_ROTATE_AND_MOVE    =   5     //!< Rotates all children around their axis, and moves them as the Parent Moves, but does not rotate around the center of their parent.
    4949} E2D_PARENT_MODE;
    50 #define     E2D_DEFAULT_PARENTING_MODE  E2D_ALL
     50#define     E2D_DEFAULT_PARENTING_MODE  E2D_PARENT_ALL
    5151
    5252//! A Struct defining the Position of an Element in 2D-space
     
    137137    Element2D* getParent () const { return this->parent; };
    138138
    139     void softReparent(PNode* parentNode, float bias = 1.0);
    140     void softReparent(const char* parentName, float bias = 1.0);
     139    void softReparent2D(Element2D* parentNode, float bias = 1.0);
     140    void softReparent2D(const char* parentName, float bias = 1.0);
    141141
    142142    /** @param parentMode sets the parentingMode of this Node */
     
    152152
    153153    // helper functions //
    154     static const char* parentingModeToChar(int parentingMode);
    155     static E2D_PARENT_MODE charToParentingMode(const char* parentingMode);
     154    static const char* parentingModeToChar2D(int parentingMode);
     155    static E2D_PARENT_MODE charToParentingMode2D(const char* parentingMode);
    156156
    157157  private:
     
    213213};
    214214
     215//! The top joint of all Element2D's every Element2D is somehow connected to this one.
     216class NullElement2D : public Element2D {
     217
     218  public:
     219    /** @returns a Pointer to the only object of this Class */
     220    inline static NullElement2D* getInstance() { if (!singletonRef) singletonRef = new NullElement2D();  return singletonRef; };
     221    virtual ~NullElement2D ();
     222
     223  private:
     224    NullElement2D ();
     225    virtual void draw() const {};
     226
     227  private:
     228    static NullElement2D* singletonRef;        //!< A reference to the NullElement2D
     229
     230};
    215231
    216232#endif /* _ELEMENT_2D_H */
Note: See TracChangeset for help on using the changeset viewer.