UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_model.cpp File Reference

This node allow to include a 3D-model into the GUI. It provide a way to create composite models, check [[How to script UI::How to create a composite model]]. We call it "main model" when a model is a child node of a non model node, and "submodel" when the node is a child node of a model node. More...

Go to the source code of this file.

Macros

#define EXTRADATA_TYPE   modelExtraData_t
 
#define EXTRADATA(node)   UI_EXTRADATA(node, EXTRADATA_TYPE)
 
#define ROTATE_SPEED   0.5
 
#define MAX_OLDREFVALUE   MAX_VAR
 

Functions

uiModel_tUI_GetUIModel (const char *modelName)
 Returns pointer to UI model. More...
 
static void UI_ListUIModels_f (void)
 
void UI_Model_SetModelSource (uiNode_t *node, const char *modelName)
 
void UI_Model_SetSkinSource (uiNode_t *node, const char *skinName)
 
void UI_Model_SetAnimationSource (uiNode_t *node, const char *animName)
 
void UI_Model_SetTagSource (uiNode_t *node, const char *tagName)
 
static void UI_InitModelInfoView (uiNode_t *node, modelInfo_t *mi, uiModel_t *model)
 Set the Model info view (angle, origin, scale) according to the node definition. More...
 
static void UI_DrawModelNodeWithUIModel (uiNode_t *node, const char *source, modelInfo_t *mi, uiModel_t *model)
 Draw a model using UI model definition. More...
 
void UI_DrawModelNode (uiNode_t *node, const char *source)
 
void UI_RegisterModelNode (uiBehaviour_t *behaviour)
 

Variables

static const uiBehaviour_tlocalBehaviour
 
static vec3_t nullVector = {0, 0, 0}
 
static int oldMousePosX = 0
 
static int oldMousePosY = 0
 

Detailed Description

This node allow to include a 3D-model into the GUI. It provide a way to create composite models, check [[How to script UI::How to create a composite model]]. We call it "main model" when a model is a child node of a non model node, and "submodel" when the node is a child node of a model node.

Definition in file ui_node_model.cpp.

Macro Definition Documentation

#define EXTRADATA_TYPE   modelExtraData_t

Definition at line 48 of file ui_node_model.cpp.

Referenced by UI_RegisterModelNode().

#define MAX_OLDREFVALUE   MAX_VAR
#define ROTATE_SPEED   0.5

Definition at line 51 of file ui_node_model.cpp.

Referenced by uiModelNode::onCapturedMouseMove().

Function Documentation

uiModel_t* UI_GetUIModel ( const char *  modelName)

Returns pointer to UI model.

Parameters
[in]modelNamemodel id from script files
Returns
uiModel_t pointer

Definition at line 61 of file ui_node_model.cpp.

References i, uiModel_s::id, m, uiGlobal_s::models, uiGlobal_s::numModels, Q_streq, and ui_global.

Referenced by GAME_GetModelForItem(), UI_DrawModelNode(), UI_DrawModelNodeWithUIModel(), and UI_ParseUIModel().

static void UI_InitModelInfoView ( uiNode_t node,
modelInfo_t mi,
uiModel_t model 
)
inlinestatic

Set the Model info view (angle, origin, scale) according to the node definition.

Todo:
the param "model" is not used !?

Definition at line 136 of file ui_node_model.cpp.

References modelInfo_t::angles, uiNode_t::box, modelInfo_t::center, EXTRADATA, nullVector, modelInfo_t::origin, modelInfo_t::scale, scale, uiBox_t::size, UI_GetNodeAbsPos(), and VectorCopy.

Referenced by UI_DrawModelNodeWithUIModel().

static void UI_ListUIModels_f ( void  )
static
void UI_Model_SetAnimationSource ( uiNode_t node,
const char *  animName 
)
void UI_Model_SetModelSource ( uiNode_t node,
const char *  modelName 
)
void UI_Model_SetSkinSource ( uiNode_t node,
const char *  skinName 
)
void UI_Model_SetTagSource ( uiNode_t node,
const char *  tagName 
)

Variable Documentation

const uiBehaviour_t* localBehaviour
static

Definition at line 54 of file ui_node_model.cpp.

vec3_t nullVector = {0, 0, 0}
static

Definition at line 130 of file ui_node_model.cpp.

Referenced by UI_DrawModelNode(), and UI_InitModelInfoView().

int oldMousePosX = 0
static
int oldMousePosY = 0
static