UFO: Alien Invasion
Loading...
Searching...
No Matches
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...

Include dependency graph for ui_node_model.cpp:

Go to the source code of this file.

Macros

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

Functions

uiModel_tUI_GetUIModel (const char *modelName)
 Returns pointer to UI model.
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.
static void UI_DrawModelNodeWithUIModel (uiNode_t *node, const char *source, modelInfo_t *mi, uiModel_t *model)
 Draw a model using UI model definition.
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

◆ EXTRADATA

#define EXTRADATA ( node)
Value:
#define EXTRADATA_TYPE
#define UI_EXTRADATA(NODE, TYPE)
Definition ui_nodes.h:185

Definition at line 49 of file ui_node_model.cpp.

Referenced by UI_DrawModelNode(), UI_DrawModelNodeWithUIModel(), and UI_InitModelInfoView().

◆ EXTRADATA_TYPE

#define EXTRADATA_TYPE   modelExtraData_t

Definition at line 48 of file ui_node_model.cpp.

◆ MAX_OLDREFVALUE

#define MAX_OLDREFVALUE   MAX_VAR

◆ ROTATE_SPEED

#define ROTATE_SPEED   0.5

Function Documentation

◆ UI_DrawModelNode()

◆ UI_DrawModelNodeWithUIModel()

◆ UI_GetUIModel()

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, m, Q_streq, and ui_global.

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

◆ UI_InitModelInfoView()

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().

◆ UI_ListUIModels_f()

void UI_ListUIModels_f ( void )
static

Definition at line 71 of file ui_node_model.cpp.

References Com_Printf(), i, m, and ui_global.

Referenced by UI_RegisterModelNode().

◆ UI_Model_SetAnimationSource()

void UI_Model_SetAnimationSource ( uiNode_t * node,
const char * animName )

◆ UI_Model_SetModelSource()

void UI_Model_SetModelSource ( uiNode_t * node,
const char * modelName )

◆ UI_Model_SetSkinSource()

void UI_Model_SetSkinSource ( uiNode_t * node,
const char * skinName )

◆ UI_Model_SetTagSource()

void UI_Model_SetTagSource ( uiNode_t * node,
const char * tagName )

◆ UI_RegisterModelNode()

Variable Documentation

◆ localBehaviour

const uiBehaviour_t* localBehaviour
static

◆ nullVector

vec3_t nullVector = {0, 0, 0}
static

Definition at line 130 of file ui_node_model.cpp.

Referenced by UI_DrawModelNode(), and UI_InitModelInfoView().

◆ oldMousePosX

int oldMousePosX = 0
static

Definition at line 447 of file ui_node_model.cpp.

◆ oldMousePosY

int oldMousePosY = 0
static

Definition at line 448 of file ui_node_model.cpp.