UFO: Alien Invasion
|
Go to the source code of this file.
Functions | |
void | R_DrawModelDirect (modelInfo_t *mi, modelInfo_t *pmi, const char *tagname) |
Draws a model in 2d mode (for rendering model data from the ui) More... | |
void | R_ModelAutoScale (const vec2_t boxSize, modelInfo_t *mi, vec3_t scale, vec3_t center) |
Compute scale and center for a model info data structure. More... | |
int | R_GetTagIndexByName (const model_t *mod, const char *tagName) |
Searches the tag data for the given name. More... | |
void | R_GetTags (const model_t *mod, const char *tagName, int currentFrame, int oldFrame, const mAliasTagOrientation_t **current, const mAliasTagOrientation_t **old) |
bool | R_GetTagMatrix (const model_t *mod, const char *tagName, int frame, float matrix[16]) |
void R_DrawModelDirect | ( | modelInfo_t * | mi, |
modelInfo_t * | pmi, | ||
const char * | tagname | ||
) |
Draws a model in 2d mode (for rendering model data from the ui)
[in,out] | mi | All the needed model information to render the model |
[in,out] | pmi | The model information of the parent model. This is used in those cases, where the model that should get rendered here is placed relativly to an already existing model in the world. |
[in] | tagname | If a parent model is given, a tagname is given in most cases, too. It's used to transform the model location relative to the parent model location again. E.g. a tagname of tag_rweapon will transform the location to the right hand of an actor. |
Definition at line 306 of file r_mesh.cpp.
References model_s::alias, rendererData_t::aliasCount, modelInfo_t::backlerp, modelInfo_t::color, Com_Printf(), mAliasFrame_s::fBox, modelInfo_t::frame, mAliasModel_s::frames, cvar_s::integer, model_s::loaded, modelInfo_t::mesh, mAliasModel_s::meshes, modelInfo_t::model, modelInfo_t::name, mAliasModel_s::num_frames, mAliasMesh_s::num_tris, modelInfo_t::oldframe, Q_strnull(), R_AliasModelState(), R_BindTexture, R_CheckError, R_Color(), R_DrawAliasFrameLerp(), R_DrawAliasStaticWithReset(), R_DrawBoundingBox(), R_FindModel(), R_GetTags(), R_InterpolateTransform(), r_showbox, R_TransformModelDirect(), refdef, viddef_t::rx, viddef_t::ry, modelInfo_t::skin, image_s::texnum, vec4_origin, and viddef.
Referenced by R_Draw2DMapMarkers(), R_Draw3DMapMarkers(), UI_DrawItem(), UI_DrawModelNode(), and UI_DrawModelNodeWithUIModel().
Searches the tag data for the given name.
[in] | mod | The model to search the tag data. Can be nullptr |
[in] | tagName | The name of the tag to get the matrix for. Might not be nullptr |
-1
if no tag with the given name was found Definition at line 247 of file r_mesh.cpp.
References model_s::alias, i, mAliasTag_s::name, mAliasModel_s::num_tags, Q_streq, and mAliasModel_s::tags.
Referenced by CL_ActorGetMuzzle(), CL_AddActor(), R_GetTagMatrix(), and R_GetTags().
[in] | mod | The model to get the tag transformation matrix for |
[in] | tagName | The name of the tag to get the transformation matrix for |
[in] | frame | The frame of the tag to get the transformation matrix for |
[out] | matrix | The transformation matrix |
false
if the tag name for the given model wasn't found, true
if the matrix was filled. Definition at line 189 of file r_mesh.cpp.
References Com_Printf(), index, model_s::name, R_ComputeGLMatrixFromTag(), R_GetTagIndexByName(), and R_GetTagOrientByFrame.
Referenced by CL_ActorGetMuzzle().
void R_GetTags | ( | const model_t * | mod, |
const char * | tagName, | ||
int | currentFrame, | ||
int | oldFrame, | ||
const mAliasTagOrientation_t ** | current, | ||
const mAliasTagOrientation_t ** | old | ||
) |
Definition at line 168 of file r_mesh.cpp.
References Com_Printf(), index, model_s::name, R_GetTagIndexByName(), and R_GetTagOrientByFrame.
Referenced by R_CalcTransform(), and R_DrawModelDirect().
void R_ModelAutoScale | ( | const vec2_t | boxSize, |
modelInfo_t * | mi, | ||
vec3_t | scale, | ||
vec3_t | center | ||
) |
Compute scale and center for a model info data structure.
[in] | boxSize | The size the model should fit into |
[in,out] | mi | The model info that contains the model that should be scaled |
[out] | scale | The scale vector |
[out] | center | The center of the model (center of the model's bounding box) |
modelInfo_t
struct only holds pointers to the vectors. modelInfo_t
into account Definition at line 278 of file r_mesh.cpp.
References modelInfo_t::center, AABB::getCenter(), AABB::getWidthX(), AABB::getWidthZ(), model_s::modBox, modelInfo_t::model, modelInfo_t::scale, scale, VectorNegate, and VectorSet.
Referenced by R_Draw2DMapMarkers(), R_Draw3DMapMarkers(), UI_DrawModelNode(), and UI_DrawModelNodeWithUIModel().