ui_node_model.c 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 "../ui_main.h"
#include "../ui_internal.h"
#include "../ui_nodes.h"
#include "../ui_parse.h"
#include "../ui_input.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 dependency graph for ui_node_model.c:

Go to the source code of this file.

Defines

#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.
static void UI_ListUIModels_f (void)
static void UI_ModelNodeDraw (uiNode_t *node)
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)
static void UI_ModelNodeCapturedMouseMove (uiNode_t *node, int x, int y)
static void UI_ModelNodeMouseDown (uiNode_t *node, int x, int y, int button)
static void UI_ModelNodeMouseUp (uiNode_t *node, int x, int y, int button)
static void UI_ModelNodeLoading (uiNode_t *node)
 Called before loading. Used to set default attribute values.
static void UI_ModelNodeClone (const uiNode_t *source, uiNode_t *clone)
 Call to update a cloned node.
static void UI_ModelNodeNew (uiNode_t *node)
static void UI_ModelNodeDelete (uiNode_t *node)
static void UI_ModelNodeLoaded (uiNode_t *node)
void UI_RegisterModelNode (uiBehaviour_t *behaviour)

Variables

static const uiBehaviour_t const * localBehaviour
static vec3_t nullVector = {0, 0, 0}
static int oldMousePosX = 0
static int oldMousePosY = 0
static const value_t properties []
 valid properties for model

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.c.


Define Documentation

#define EXTRADATA ( node   )     UI_EXTRADATA(node, EXTRADATA_TYPE)

Definition at line 45 of file ui_node_model.c.

#define EXTRADATA_TYPE   modelExtraData_t

Definition at line 44 of file ui_node_model.c.

#define MAX_OLDREFVALUE   MAX_VAR
#define ROTATE_SPEED   0.5

Definition at line 47 of file ui_node_model.c.


Function Documentation

void UI_DrawModelNode ( uiNode_t node,
const char *  source 
)
static void UI_DrawModelNodeWithUIModel ( uiNode_t node,
const char *  source,
modelInfo_t mi,
uiModel_t model 
) [static]
uiModel_t* UI_GetUIModel ( const char *  modelName  ) 

Returns pointer to UI model.

Parameters:
[in] modelName model id from script files
Returns:
uiModel_t pointer

Definition at line 57 of file ui_node_model.c.

References i, uiModel_s::id, m, MAX_VAR, uiGlobal_s::models, uiGlobal_s::numModels, 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 
) [inline, static]

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

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

Definition at line 97 of file ui_node_model.c.

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

Referenced by UI_DrawModelNodeWithUIModel().

static void UI_ListUIModels_f ( void   )  [static]
static void UI_ModelNodeCapturedMouseMove ( uiNode_t node,
int  x,
int  y 
) [static]

Definition at line 417 of file ui_node_model.c.

References EXTRADATA, oldMousePosX, oldMousePosY, ROLL, ROTATE_SPEED, and YAW.

Referenced by UI_RegisterModelNode().

static void UI_ModelNodeClone ( const uiNode_t source,
uiNode_t clone 
) [static]

Call to update a cloned node.

Definition at line 473 of file ui_node_model.c.

References uiBehaviour_s::clone, uiNode_s::dynamic, EXTRADATA, MAX_OLDREFVALUE, uiBehaviour_s::super, and UI_AllocStaticString().

Referenced by UI_RegisterModelNode().

static void UI_ModelNodeDelete ( uiNode_t node  )  [static]

Definition at line 486 of file ui_node_model.c.

References EXTRADATA, and Mem_Free.

Referenced by UI_RegisterModelNode().

static void UI_ModelNodeDraw ( uiNode_t node  )  [static]

Definition at line 80 of file ui_node_model.c.

References EXTRADATA, MAX_VAR, Q_strncpyz(), UI_DrawModelNode(), and UI_GetReferenceString().

Referenced by UI_RegisterModelNode().

static void UI_ModelNodeLoaded ( uiNode_t node  )  [static]
static void UI_ModelNodeLoading ( uiNode_t node  )  [static]

Called before loading. Used to set default attribute values.

Definition at line 463 of file ui_node_model.c.

References uiNode_s::color, EXTRADATA, qtrue, scale, Vector4Set, and VectorSet.

Referenced by UI_RegisterModelNode().

static void UI_ModelNodeMouseDown ( uiNode_t node,
int  x,
int  y,
int  button 
) [static]

Definition at line 440 of file ui_node_model.c.

References EXTRADATA, K_MOUSE1, oldMousePosX, oldMousePosY, and UI_SetMouseCapture().

Referenced by UI_RegisterModelNode().

static void UI_ModelNodeMouseUp ( uiNode_t node,
int  x,
int  y,
int  button 
) [static]

Definition at line 451 of file ui_node_model.c.

References K_MOUSE1, UI_GetMouseCapture(), and UI_MouseRelease().

Referenced by UI_RegisterModelNode().

static void UI_ModelNodeNew ( uiNode_t node  )  [static]

Definition at line 480 of file ui_node_model.c.

References EXTRADATA, MAX_OLDREFVALUE, Mem_PoolAlloc, and ui_dynPool.

Referenced by UI_RegisterModelNode().

void UI_RegisterModelNode ( uiBehaviour_t behaviour  ) 

Variable Documentation

const uiBehaviour_t const* localBehaviour [static]

Definition at line 50 of file ui_node_model.c.

vec3_t nullVector = {0, 0, 0} [static]

Definition at line 91 of file ui_node_model.c.

Referenced by UI_DrawModelNode(), and UI_InitModelInfoView().

int oldMousePosX = 0 [static]

Definition at line 414 of file ui_node_model.c.

Referenced by UI_ModelNodeCapturedMouseMove(), and UI_ModelNodeMouseDown().

int oldMousePosY = 0 [static]

Definition at line 415 of file ui_node_model.c.

Referenced by UI_ModelNodeCapturedMouseMove(), and UI_ModelNodeMouseDown().

const value_t properties[] [static]

Generated by  doxygen 1.6.2