UFO: Alien Invasion
|
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 "../ui_main.h"
#include "../ui_internal.h"
#include "../ui_nodes.h"
#include "../ui_parse.h"
#include "../ui_input.h"
#include "../ui_render.h"
#include "ui_node_model.h"
#include "ui_node_abstractnode.h"
#include "../../client.h"
#include "../../renderer/r_draw.h"
#include "../../renderer/r_mesh.h"
#include "../../renderer/r_mesh_anim.h"
#include "../../renderer/r_model.h"
#include "../../../common/scripts_lua.h"
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_t * | UI_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_t * | localBehaviour |
static vec3_t | nullVector = {0, 0, 0} |
static int | oldMousePosX = 0 |
static int | oldMousePosY = 0 |
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.
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, EXTRADATA_TYPE) |
Definition at line 49 of file ui_node_model.cpp.
Referenced by uiModelNode::clone(), uiModelNode::deleteNode(), uiModelNode::doLayout(), uiModelNode::draw(), uiModelNode::initNodeDynamic(), uiModelNode::onCapturedMouseMove(), uiModelNode::onLoading(), uiModelNode::onMouseDown(), UI_DrawModelNode(), UI_DrawModelNodeWithUIModel(), and UI_InitModelInfoView().
#define EXTRADATA_TYPE modelExtraData_t |
Definition at line 48 of file ui_node_model.cpp.
Referenced by UI_RegisterModelNode().
#define MAX_OLDREFVALUE MAX_VAR |
Definition at line 52 of file ui_node_model.cpp.
Referenced by uiModelNode::clone(), uiModelNode::doLayout(), uiModelNode::initNodeDynamic(), and UI_DrawModelNode().
#define ROTATE_SPEED 0.5 |
Definition at line 51 of file ui_node_model.cpp.
Referenced by uiModelNode::onCapturedMouseMove().
< We use model extradata
Definition at line 285 of file ui_node_model.cpp.
References modelInfo_t::angles, animState_s::backlerp, modelInfo_t::backlerp, uiNode_t::behaviour, uiNode_t::box, modelInfo_t::center, cl_genericPool, cls, modelInfo_t::color, uiNode_t::color, Com_Error(), Com_Printf(), ERR_DROP, EXTRADATA, uiNode_t::firstChild, animState_s::frame, modelInfo_t::frame, client_static_s::frametime, MAX_OLDREFVALUE, MAX_VAR, Mem_Free, Mem_PoolAllocType, modelInfo_t::mesh, modelInfo_t::model, modelInfo_t::name, uiNode_t::next, nullVector, OBJZERO, animState_s::oldframe, modelInfo_t::oldframe, modelInfo_t::origin, uiNode_t::padding, Q_streq, Q_strncpyz(), Q_strnull(), R_AnimChange(), R_AnimGetName(), R_AnimRun(), R_CleanupDepthBuffer(), R_DrawModelDirect(), R_FindModel(), R_ModelAutoScale(), modelInfo_t::scale, uiBox_t::size, modelInfo_t::skin, UI_CheckVisibility(), UI_DrawModelNodeWithUIModel(), UI_GetNodeAbsPos(), UI_GetNodeScreenPos(), UI_GetReferenceString(), UI_GetUIModel(), UI_NodeInstanceOf(), UI_PopClipRect(), UI_PushClipRect(), and VectorMA().
Referenced by uiItemNode::draw(), uiModelNode::draw(), GAME_DisplayItemInfo(), and UI_DrawItem().
|
static |
Draw a model using UI model definition.
Definition at line 154 of file ui_node_model.cpp.
References uiModel_s::angles, modelInfo_t::angles, uiModel_s::anim, uiModel_s::animState, animState_s::backlerp, modelInfo_t::backlerp, uiNode_t::box, uiModel_s::center, modelInfo_t::center, cls, uiModel_s::color, modelInfo_t::color, uiNode_t::color, Com_Printf(), EXTRADATA, animState_s::frame, modelInfo_t::frame, client_static_s::frametime, uiModel_s::model, modelInfo_t::model, modelInfo_t::name, uiModel_s::next, animState_s::oldframe, modelInfo_t::oldframe, uiModel_s::origin, modelInfo_t::origin, uiNode_t::padding, uiModel_s::parent, uiBox_t::pos, Q_streq, R_AnimChange(), R_AnimGetName(), R_AnimRun(), R_DrawModelDirect(), R_FindModel(), R_ModelAutoScale(), uiNode_t::root, uiModel_s::scale, modelInfo_t::scale, uiBox_t::size, uiModel_s::skin, modelInfo_t::skin, Sys_Error(), uiModel_s::tag, UI_GetReferenceString(), UI_GetUIModel(), UI_InitModelInfoView(), and Vector4Copy.
Referenced by UI_DrawModelNode().
uiModel_t* UI_GetUIModel | ( | const char * | modelName | ) |
Returns pointer to UI model.
[in] | modelName | model id from script files |
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().
|
inlinestatic |
Set the Model info view (angle, origin, scale) according to the node definition.
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().
Definition at line 71 of file ui_node_model.cpp.
References Com_Printf(), i, uiModel_s::id, m, uiModel_s::model, uiGlobal_s::models, uiModel_s::next, uiGlobal_s::numModels, and ui_global.
Referenced by UI_RegisterModelNode().
Definition at line 92 of file ui_node_model.cpp.
References Mem_PoolStrDup, ui_dynStringPool, UI_EXTRADATA, and UI_FreeStringProperty().
Referenced by uiModelNode_t_set_animation().
Definition at line 82 of file ui_node_model.cpp.
References Mem_PoolStrDup, ui_dynStringPool, UI_EXTRADATA, and UI_FreeStringProperty().
Referenced by uiModelNode_t_set_model().
Definition at line 87 of file ui_node_model.cpp.
References Mem_PoolStrDup, ui_dynStringPool, UI_EXTRADATA, and UI_FreeStringProperty().
Referenced by uiModelNode_t_set_skin().
Definition at line 97 of file ui_node_model.cpp.
References Mem_PoolStrDup, ui_dynStringPool, UI_EXTRADATA, and UI_FreeStringProperty().
Referenced by uiModelNode_t_set_tag().
void UI_RegisterModelNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 528 of file ui_node_model.cpp.
References Cmd_AddCommand(), uiBehaviour_t::drawItselfChild, EXTRADATA_TYPE, uiBehaviour_t::extraDataSize, uiBehaviour_t::lua_SWIG_typeinfo, uiBehaviour_t::manager, uiBehaviour_t::name, scale, UI_ListUIModels_f(), UI_RegisterExtradataNodeProperty, UI_SWIG_TypeQuery(), V_BOOL, V_CVAR_OR_STRING, and V_VECTOR.
|
static |
Definition at line 54 of file ui_node_model.cpp.
|
static |
Definition at line 130 of file ui_node_model.cpp.
Referenced by UI_DrawModelNode(), and UI_InitModelInfoView().
|
static |
Definition at line 447 of file ui_node_model.cpp.
Referenced by uiModelNode::onCapturedMouseMove(), and uiModelNode::onMouseDown().
|
static |
Definition at line 448 of file ui_node_model.cpp.
Referenced by uiModelNode::onCapturedMouseMove(), and uiModelNode::onMouseDown().