My Project
|
Some 3d object may contain some head on display objects. More...
#include <IHeadOn3D.h>
Public Member Functions | |
void | SetHeadOnText (const char *sText, int nIndex=0) |
set the text to be displayed on head on display | |
const char * | GetHeadOnText (int nIndex=0) |
Get the text to be displayed on head on display. | |
void | SetHeadOnUITemplateName (const char *sUIName, int nIndex=0) |
set which UI control the head on display will be used as a template for drawing the text it can be a single CGUIText Object or it can be a container with a direct children called "text" if this is "" or empty, the default UI template will be used. More... | |
const char * | GetHeadOnUITemplateName (int nIndex=0) |
get which UI control the head on display will be used as a template for drawing the text it can be a single CGUIText Object or it can be a container with a direct children called "text" if this is "" or empty, the default UI template will be used. More... | |
const std::string & | GetHeadOnUITemplateNameS (int nIndex=0) |
virtual CGUIBase * | GetHeadOnUIObject (int nIndex=0) |
void | SetHeadOnTextColor (DWORD color, int nIndex=0) |
set the text to be displayed on head on display | |
DWORD | GetHeadOnTextColor (int nIndex=0) |
Get the text to be displayed on head on display. | |
void | SetHeadOnOffest (const Vector3 &vOffset, int nIndex=0) |
set the offset where head on display should be rendered relative to the origin or head of the host 3d object | |
void | GetHeadOnOffset (Vector3 *pOut, int nIndex=0) |
Get the offset where head on display should be rendered relative to the origin or head of the host 3d object. | |
void | ShowHeadOnDisplay (bool bShow, int nIndex=0) |
show or hide object's head on display | |
bool | IsHeadOnDisplayShown (int nIndex=0) |
whether the object head on display shall be visible | |
bool | IsHeadOnZEnabled (int nIndex=0) |
whether z buffer test is enabled for Head On display. More... | |
void | SetHeadOnZEnabled (bool bZnabled, int nIndex=0) |
set if z buffer test is enabled for Head On display. More... | |
virtual bool | HasHeadOnDisplay (int nIndex=0) |
whether the object contains head on display at given index | |
bool | IsHeadOn3DScalingEnabled (int nIndex=0) |
Enable 3d scaling. More... | |
void | SetHeadOn3DScalingEnabled (bool bZnabled, int nIndex=0) |
Enable 3d scaling. | |
bool | IsHeadOnUseGlobal3DScaling (int nIndex=0) |
this is only used when m_bEnable3DScaling. More... | |
void | SetHeadOnUseGlobal3DScaling (bool bZnabled, int nIndex=0) |
this is only used when m_bEnable3DScaling. More... | |
void | SetHeadOnNearZoomDist (float fValue, int nIndex=0) |
float | GetHeadOnNearZoomDist (int nIndex=0) |
void | SetHeadOnFarZoomDist (float fValue, int nIndex=0) |
float | GetHeadOnFarZoomDist (int nIndex=0) |
void | SetHeadOnMinUIScaling (float fValue, int nIndex=0) |
float | GetHeadOnMinUIScaling (int nIndex=0) |
void | SetHeadOnMaxUIScaling (float fValue, int nIndex=0) |
float | GetHeadOnMaxUIScaling (int nIndex=0) |
void | SetHeadOnAlphaFadePercentage (float fValue, int nIndex=0) |
float | GetHeadOnAlphaFadePercentage (int nIndex=0) |
void | SetHeadOn3DFacing (float fValue, int nIndex=0) |
turn on 3d facing when this function is called | |
float | GetHeadOn3DFacing (int nIndex=0) |
Static Public Member Functions | |
static bool | DrawHeadOnUI (CBaseObject *pObj, int &nCounter, SceneState *pSceneState=NULL, CGUIText **ppObjUITextDefault=NULL, bool bZEnablePass=true, bool b3DTextPass=false) |
draw the headon UI of a specified object. More... | |
static bool | BeginPaint (SceneState *pSceneState, bool b3DTextPass, bool bZEnablePass) |
HeadOn UI needs to be drawn between BeginPaint and EndPaint, which is usually automatically when the first and last head on UI is called. More... | |
static void | EndPaint (SceneState *pSceneState, bool b3DTextPass) |
Some 3d object may contain some head on display objects.
May it be text, icons, or 3D mark, this class provides common interface for such objects. The default implementation is very light-weighted. It only has a pointer and size member storage for object that does not have head on display. each object can have specify multiple head on UI at different index. by default it is index 0.
|
static |
HeadOn UI needs to be drawn between BeginPaint and EndPaint, which is usually automatically when the first and last head on UI is called.
Hence, one usually do not need to call this method.
|
static |
draw the headon UI of a specified object.
call this function in a loop like below { CGUIText* pObjUITextDefault = NULL; int nCounter = 0; for each obj in a render frame { if(IHeadOn3D::DrawHeadOnUI(&obj, nCounter, &sceneState, &pObjUITextDefault) == false) break; } IHeadOn3D::DrawHeadOnUI(NULL, nCounter); }
pObj | : if this is NULL, it means the last object. it will stop batch rendering by calling EndPaint() |
nCounter | both in and out parameter. if this is 0, it means the start of the character and BeginPaint() is called automatically. this function will automatically increase this value if object is drawn |
pSceneState | pointer to a scene state. it can be NULL. |
pObjUITextDefault | see the example above for how to use this. It is the default UI template to use if the object does not provide one. |
bZEnablePass | if true, we will only draw UI objects with z buffer test enabled. The pipeline will first draw z enabled pass and then non-Z-enabled pass. |
b3DTextPass | whether to pass 3d text |
const char * ParaEngine::IHeadOn3D::GetHeadOnUITemplateName | ( | int | nIndex = 0 | ) |
get which UI control the head on display will be used as a template for drawing the text it can be a single CGUIText Object or it can be a container with a direct children called "text" if this is "" or empty, the default UI template will be used.
The default UI template is an invisible CGUIText control called "_HeadOnDisplayText_" By default, "_HeadOnDisplayText_" uses horizontal text alignment and system font.
bool ParaEngine::IHeadOn3D::IsHeadOn3DScalingEnabled | ( | int | nIndex = 0 | ) |
Enable 3d scaling.
the text are scaled according to camera to object distance fScaling = g_fMaxUIScaling - (fDist - g_fNearZoomDist) / (g_fFarZoomDist - g_fNearZoomDist) * (g_fMaxUIScaling-g_fMinUIScaling);
bool ParaEngine::IHeadOn3D::IsHeadOnUseGlobal3DScaling | ( | int | nIndex = 0 | ) |
this is only used when m_bEnable3DScaling.
if true, we will use parent SceneObject's paramter for 3d scaling, otherwise the local settings are employed
bool ParaEngine::IHeadOn3D::IsHeadOnZEnabled | ( | int | nIndex = 0 | ) |
whether z buffer test is enabled for Head On display.
default to true.
void ParaEngine::IHeadOn3D::SetHeadOnUITemplateName | ( | const char * | sUIName, |
int | nIndex = 0 |
||
) |
set which UI control the head on display will be used as a template for drawing the text it can be a single CGUIText Object or it can be a container with a direct children called "text" if this is "" or empty, the default UI template will be used.
The default UI template is an invisible CGUIText control called "_HeadOnDisplayText_" By default, "_HeadOnDisplayText_" uses horizontal text alignment and system font.
nIndex | there can be several UI template at position 0,1,2,.. so that position 0 may be used for character name, index 1 for group name, index 2 for question mark icon,etc. |
void ParaEngine::IHeadOn3D::SetHeadOnUseGlobal3DScaling | ( | bool | bZnabled, |
int | nIndex = 0 |
||
) |
this is only used when m_bEnable3DScaling.
if true, we will use parent SceneObject's paramter for 3d scaling, otherwise the local settings are employed
void ParaEngine::IHeadOn3D::SetHeadOnZEnabled | ( | bool | bZnabled, |
int | nIndex = 0 |
||
) |
set if z buffer test is enabled for Head On display.
default to true.