#include "r_local.h"
#include "r_matrix.h"
#include "r_entity.h"
#include "r_mesh.h"
#include "r_mesh_anim.h"
#include "r_draw.h"
Go to the source code of this file.
Defines | |
#define | MAX_ENTITIES 2048 |
Functions | |
const vec3_t * | R_EntityGetOrigin (const entity_t *ent) |
void | R_EntitySetOrigin (entity_t *ent, const vec3_t ovec) |
void | R_EntityCopyOrigin (entity_t *ent, const entity_t *other) |
void | R_EntityAddToOrigin (entity_t *ent, const vec3_t offs) |
void | R_EntitySubtractFromOrigin (entity_t *ent, const vec3_t offs) |
static void | R_DrawBox (const entity_t *e) |
Draws the field marker entity is specified in cl_actor.c CL_AddTargeting. | |
static void | R_DrawFloor (const entity_t *e) |
Draws a marker on the ground to indicate pathing CL_AddPathingBox. | |
static void | R_DrawArrow (const entity_t *e) |
Draws an arrow between two points. | |
static void | R_DrawEntityEffects (void) |
Draws shadow and highlight effects for the entities (actors). | |
static void | R_DrawBspEntities (const entity_t *ents) |
static void | R_DrawMeshEntities (entity_t *ents) |
static void | R_DrawOpaqueMeshEntities (entity_t *ents) |
static void | R_DrawBlendMeshEntities (entity_t *ents) |
static void | R_DrawNullModel (const entity_t *e) |
Draw replacement model (e.g. when model wasn't found). | |
static void | R_DrawSpecialEntities (const entity_t *ents) |
static void | R_DrawNullEntities (const entity_t *ents) |
Draw entities which models couldn't be loaded. | |
static float * | R_CalcTransform (entity_t *e) |
Calculates transformation matrix for the model and its tags. | |
static qboolean | R_CullEntity (entity_t *e) |
Perform a frustum cull check for a given entity. | |
void | R_DrawEntities (void) |
Primary entry point for drawing all entities. | |
entity_t * | R_GetFreeEntity (void) |
Get the next free entry in the entity list (the last one). | |
entity_t * | R_GetEntity (int id) |
Returns a specific entity from the list. | |
int | R_AddEntity (const entity_t *ent) |
Adds a copy of the specified entity to the list of all known render entities. | |
Variables | |
static entity_t | r_entities [MAX_ENTITIES] |
Definition in file r_entity.c.
#define MAX_ENTITIES 2048 |
Definition at line 32 of file r_entity.c.
Referenced by R_AddEntity(), and R_GetFreeEntity().
int R_AddEntity | ( | const entity_t * | ent | ) |
Adds a copy of the specified entity to the list of all known render entities.
-1
in case the entity wasn't added. Definition at line 630 of file r_entity.c.
References Com_Error(), ERR_DROP, MAX_ENTITIES, mod_bsp, rendererData_t::numEntities, entity_t::origin, refdef, VectorDist, and rendererData_t::viewOrigin.
Referenced by CL_AddActor(), CL_AddArrow(), CL_AddPathingBox(), CL_AddTargetingBox(), CL_AddUGV(), LE_AddToScene(), LM_AddToSceneOrder(), and SEQ_Render3D().
static float* R_CalcTransform | ( | entity_t * | e | ) | [static] |
Calculates transformation matrix for the model and its tags.
Definition at line 437 of file r_entity.c.
References Com_Error(), transform_t::done, ERR_DROP, GLMatrixAssemble(), GLMatrixMultiply(), transform_t::matrix, dMD2tag_t::num_frames, entity_t::origin, transform_t::processing, qfalse, qtrue, R_GetTagMatrix(), and R_InterpolateTransform().
Referenced by R_DrawEntities().
Perform a frustum cull check for a given entity.
[in,out] | e | The entity to perform the frustum cull check for |
false
if visible, true
is the origin of the entity is outside the current frustum view Definition at line 497 of file r_entity.c.
References cvar_s::integer, mod_bsp_submodel, qfalse, R_CullBspModel(), R_CullMeshModel(), r_nocull, RDF_NOWORLDMODEL, refdef, and rendererData_t::rendererFlags.
Referenced by R_DrawEntities().
static void R_DrawArrow | ( | const entity_t * | e | ) | [static] |
Draws an arrow between two points.
Definition at line 168 of file r_entity.c.
References entity_t::origin, R_Color(), and VectorCopy.
Referenced by R_DrawSpecialEntities().
static void R_DrawBlendMeshEntities | ( | entity_t * | ents | ) | [static] |
Definition at line 344 of file r_entity.c.
References qfalse, qtrue, R_DrawMeshEntities(), R_EnableBlend(), R_EnableLighting(), r_state, RDF_NOWORLDMODEL, refdef, rendererData_t::rendererFlags, and rstate_t::world_program.
Referenced by R_DrawEntities().
static void R_DrawBox | ( | const entity_t * | e | ) | [static] |
Draws the field marker entity is specified in cl_actor.c CL_AddTargeting.
Definition at line 48 of file r_entity.c.
References f, entity_t::origin, R_Color(), R_DrawBoundingBox(), VectorCopy, and VectorNotEmpty.
Referenced by R_DrawSpecialEntities().
static void R_DrawBspEntities | ( | const entity_t * | ents | ) | [static] |
Definition at line 285 of file r_entity.c.
References R_DrawBrushModel().
Referenced by R_DrawEntities().
void R_DrawEntities | ( | void | ) |
Primary entry point for drawing all entities.
Definition at line 534 of file r_entity.c.
References Com_Error(), ERR_DROP, image_s::has_alpha, i, cvar_s::integer, mod_alias_dpm, mod_alias_md2, mod_alias_md3, mod_bsp_submodel, mod_obj, rendererData_t::numEntities, R_AliasModelState(), R_CalcTransform(), R_Color(), R_CullEntity(), R_DrawBlendMeshEntities(), R_DrawBspEntities(), r_drawentities, R_DrawEntityEffects(), R_DrawNullEntities(), R_DrawOpaqueMeshEntities(), R_DrawSpecialEntities(), refdef, RF_ARROW, RF_BOX, RF_PATH, RF_TRANSLUCENT, and image_s::texnum.
Referenced by R_RenderFrame().
static void R_DrawEntityEffects | ( | void | ) | [static] |
Draws shadow and highlight effects for the entities (actors).
Definition at line 204 of file r_entity.c.
References i, cvar_s::integer, rendererData_t::numEntities, qtrue, R_BindTexture, R_Color(), R_EnableBlend(), r_shadows, refdef, RF_ALLIED, RF_BLOOD, RF_BOX, RF_MEMBER, RF_SELECTED, RF_SHADOW, shadow, image_s::texnum, and Vector4Set.
Referenced by R_DrawEntities().
static void R_DrawFloor | ( | const entity_t * | e | ) | [static] |
Draws a marker on the ground to indicate pathing CL_AddPathingBox.
Definition at line 105 of file r_entity.c.
References entity_t::origin, PLAYER_WIDTH, R_Color(), and VectorCopy.
Referenced by R_DrawSpecialEntities().
static void R_DrawMeshEntities | ( | entity_t * | ents | ) | [static] |
Definition at line 303 of file r_entity.c.
References mod_alias_dpm, mod_alias_md2, mod_alias_md3, mod_obj, and R_DrawAliasModel().
Referenced by R_DrawBlendMeshEntities(), and R_DrawOpaqueMeshEntities().
static void R_DrawNullEntities | ( | const entity_t * | ents | ) | [static] |
Draw entities which models couldn't be loaded.
Definition at line 418 of file r_entity.c.
References R_DrawNullModel().
Referenced by R_DrawEntities().
static void R_DrawNullModel | ( | const entity_t * | e | ) | [static] |
Draw replacement model (e.g. when model wasn't found).
Definition at line 364 of file r_entity.c.
References i, qfalse, qtrue, R_EnableTexture(), and texunit_diffuse.
Referenced by R_DrawNullEntities().
static void R_DrawOpaqueMeshEntities | ( | entity_t * | ents | ) | [static] |
Definition at line 327 of file r_entity.c.
References qfalse, qtrue, R_DrawMeshEntities(), R_EnableLighting(), r_state, RDF_NOWORLDMODEL, refdef, rendererData_t::rendererFlags, and rstate_t::world_program.
Referenced by R_DrawEntities().
static void R_DrawSpecialEntities | ( | const entity_t * | ents | ) | [static] |
Definition at line 390 of file r_entity.c.
References qfalse, qtrue, R_DrawArrow(), R_DrawBox(), R_DrawFloor(), R_EnableBlend(), RF_ARROW, RF_BOX, and RF_PATH.
Referenced by R_DrawEntities().
Definition at line 40 of file r_entity.c.
References entity_t::origin, and VectorAdd.
Referenced by LE_AddToScene().
Definition at line 39 of file r_entity.c.
References entity_t::origin, and VectorCopy.
Definition at line 37 of file r_entity.c.
References entity_t::origin.
Referenced by LE_BrushModelAction(), R_CullBspModel(), and R_DrawBrushModel().
Definition at line 38 of file r_entity.c.
References entity_t::origin, and VectorCopy.
Referenced by CL_AddEdictFunc(), LE_AddToScene(), LM_AddToSceneOrder(), and SEQ_Render3D().
Definition at line 41 of file r_entity.c.
References entity_t::origin, and VectorSubtract.
entity_t* R_GetEntity | ( | int | id | ) |
Returns a specific entity from the list.
Definition at line 618 of file r_entity.c.
References rendererData_t::numEntities, and refdef.
Referenced by LM_AddToSceneOrder(), and R_Trace().
entity_t* R_GetFreeEntity | ( | void | ) |
Get the next free entry in the entity list (the last one).
Definition at line 608 of file r_entity.c.
References Com_Error(), ERR_DROP, MAX_ENTITIES, rendererData_t::numEntities, and refdef.
Referenced by CL_AddActor(), CL_AddUGV(), and SEQ_Render3D().
entity_t r_entities[MAX_ENTITIES] [static] |
Definition at line 34 of file r_entity.c.