gui3DProjectionCtrl.h
Engine/source/gui/controls/gui3DProjectionCtrl.h
Classes:
class
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Gui3DProjectionCtrl 4// Doppelganger Inc 5// Orion Elenzil 200701 6// 7// 8//----------------------------------------------------------------------------- 9 10#ifndef _GUI3DPROJECTIONCTRL_H_ 11#define _GUI3DPROJECTIONCTRL_H_ 12 13#include "gui/core/guiTypes.h" 14#include "gui/core/guiControl.h" 15#include "gui/3d/guiTSControl.h" 16#include "scene/sceneObject.h" 17#include "T3D/player.h" 18 19class Gui3DProjectionCtrl : public GuiControl 20{ 21 22//----------------------------------------------------------------------------- 23// stock stuff 24public: 25 Gui3DProjectionCtrl(); 26 typedef GuiControl Parent; 27 28 DECLARE_CONOBJECT(Gui3DProjectionCtrl); 29 30 static void initPersistFields (); 31 32//----------------------------------------------------------------------------- 33// more interesting stuff 34 35 GuiTSCtrl* mTSCtrl; /// must be a child of one of these. 36 SimObjectPtr<SceneObject> mAttachedTo; /// optional object we're attached to. 37 SimObjectPtr<Player> mAttachedToPlayer; /// same pointer as mAttachedTo, but conveniently casted to player. 38 39 Point3F mPtWorld; /// the worldspace point which we're projecting 40 Point2I mPtProj; /// the screenspace projected point. - note there are further modifiers before 41 Point2I mPtScreen; 42 43 Point3F mOffsetObject; /// object-space offset applied first to the attached point to obtain mPtWorld. 44 Point3F mOffsetWorld; /// world-space offset applied second to the attached point to obtain mPtWorld. 45 Point2I mOffsetScreen; /// screen-space offset applied to mPtProj. note we still have centering, etc. 46 47 enum alignment 48 { 49 min = 0, 50 center = 1, 51 max = 2 52 }; 53 54 alignment mHAlign; /// horizontal alignment 55 alignment mVAlign; /// horizontal alignment 56 57 bool mAutoDelete; /// optionally self-delete when mAttachedTo is deleted. 58 Point2I mUseEyePoint; /// optionally use the eye point. x != 0 -> horiz. y != 0 -> vert. 59 60 61 virtual void onRender (Point2I offset, const RectI &updateRect); 62 virtual void resizeDuringRender (); 63 64 virtual bool onWake (); 65 virtual void onSleep (); 66 virtual void onDeleteNotify (SimObject *object); 67 68 void doPositioning (); 69 void doProjection (); 70 void doAlignment (); 71 72 void setAttachedTo (SceneObject* obj); 73 SceneObject* getAttachedTo () { return mAttachedTo; } 74 void setWorldPt (Point3F& pt) { mPtWorld = pt; } 75 Point3F getWorldPt () { return mPtWorld; } 76}; 77 78#endif //_GUI3DPROJECTIONCTRL_H_ 79