UFO: Alien Invasion
Loading...
Searching...
No Matches
r_entity.h File Reference
#include "r_light.h"
#include "r_lighting.h"
Include dependency graph for r_entity.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  animState_t
struct  transform_t
 entity transform matrix More...
struct  entity_t

Macros

#define MAX_ANIMLIST   8
#define MAX_ENTITY_LIGHTS   7
#define RF_NONE   0x00000000
#define RF_TRANSLUCENT   0x00000001
#define RF_BOX   0x00000002
#define RF_PATH   0x01000000
#define RF_ARROW   0x02000000
#define RF_NO_SHADOW   0x00000004
#define RF_BLOOD   0x00000008
#define RF_SELECTED   0x00000010
#define RF_MEMBER   0x00000020
#define RF_ALLIED   0x00000040
#define RF_ACTOR   0x00000080
#define RF_PULSE   0x00000100
#define RF_IRGOGGLES   0x00000200
#define RF_NEUTRAL   0x00000400
#define RF_SHADOW   0x00000800
#define RF_OPPONENT   0x00001000
#define RF_IRGOGGLESSHOT   0x00002000

Functions

int R_AddEntity (const entity_t *ent)
 Adds a copy of the specified entity to the list of all known render entities.
entity_tR_GetFreeEntity (void)
 Get the next free entry in the entity list (the last one).
entity_tR_GetEntity (int id)
 Returns a specific entity from the list.
void R_EntitySetOrigin (entity_t *ent, const vec3_t origin)
 setter for entity origin
void R_EntityAddToOrigin (entity_t *ent, const vec3_t offset)
 Translates the origin of the given entity by the given offset vector.
void R_TransformForEntity (const entity_t *e, const vec3_t in, vec3_t out)
void R_DrawEntityEffects (void)
 Draws shadow and highlight effects for the entities (actors).
void R_DrawMeshEntities (entity_t *ents)
 Draws the list of entities.
void R_DrawOpaqueMeshEntities (entity_t *ents)
void R_DrawBlendMeshEntities (entity_t *ents)
void R_DrawSpecialEntities (const entity_t *ents)
void R_DrawNullEntities (const entity_t *ents)
 Draw entities which models couldn't be loaded.

Variables

entity_tr_opaque_mesh_entities
entity_tr_blend_mesh_entities
entity_tr_null_entities
entity_tr_special_entities

Macro Definition Documentation

◆ MAX_ANIMLIST

#define MAX_ANIMLIST   8

Definition at line 27 of file r_entity.h.

Referenced by R_AnimGetName(), and R_AnimRun().

◆ MAX_ENTITY_LIGHTS

#define MAX_ENTITY_LIGHTS   7

Definition at line 28 of file r_entity.h.

Referenced by R_CvarCheckDynamicLights().

◆ RF_ACTOR

#define RF_ACTOR   0x00000080

this is an actor

Definition at line 46 of file r_entity.h.

Referenced by CL_AddActor(), CL_AddUGV(), R_DrawEntityEffects(), and R_UpdateLightList().

◆ RF_ALLIED

#define RF_ALLIED   0x00000040

actor in an allied team (controlled by another player)

Definition at line 45 of file r_entity.h.

Referenced by CL_AddActor(), CL_AddUGV(), and R_DrawEntityEffects().

◆ RF_ARROW

#define RF_ARROW   0x02000000

arrow, debugging only

Definition at line 38 of file r_entity.h.

Referenced by CL_AddArrow(), R_DrawSpecialEntities(), and R_GetEntityLists().

◆ RF_BLOOD

#define RF_BLOOD   0x00000008

blood (when dead) for this entity

Definition at line 42 of file r_entity.h.

Referenced by CL_AddActor(), and R_DrawEntityEffects().

◆ RF_BOX

#define RF_BOX   0x00000002

◆ RF_IRGOGGLES

#define RF_IRGOGGLES   0x00000200

this is visible if the actor uses ir goggles

Definition at line 48 of file r_entity.h.

Referenced by CL_AddActor(), and R_DrawAliasModel().

◆ RF_IRGOGGLESSHOT

#define RF_IRGOGGLESSHOT   0x00002000

this is the actor that used an irgoggle

Definition at line 52 of file r_entity.h.

Referenced by CL_ActorDoShoot(), and CL_ActorSelect().

◆ RF_MEMBER

#define RF_MEMBER   0x00000020

actor in the same team

Definition at line 44 of file r_entity.h.

Referenced by CL_AddActor(), CL_AddUGV(), and R_DrawEntityEffects().

◆ RF_NEUTRAL

#define RF_NEUTRAL   0x00000400

actor from a neutral team

Definition at line 49 of file r_entity.h.

Referenced by CL_AddActor(), CL_AddUGV(), and R_DrawEntityEffects().

◆ RF_NO_SHADOW

#define RF_NO_SHADOW   0x00000004

the following ent flags also draw entity effects shadow (when living) for this entity

Definition at line 41 of file r_entity.h.

Referenced by R_DrawMeshShadow().

◆ RF_NONE

#define RF_NONE   0x00000000

entity->flags (render flags) for initialization

Definition at line 34 of file r_entity.h.

Referenced by CL_AddActor(), CL_AddUGV(), entity_t::entity_s(), LE_AddToScene(), LM_AddToSceneOrder(), and SEQ_Render3D().

◆ RF_OPPONENT

#define RF_OPPONENT   0x00001000

opponent

Definition at line 51 of file r_entity.h.

Referenced by CL_AddActor(), and R_DrawEntityEffects().

◆ RF_PATH

#define RF_PATH   0x01000000

pathing marker, debugging only

Definition at line 37 of file r_entity.h.

Referenced by CL_AddPathingBox(), LE_BrushModelAction(), R_DrawSpecialEntities(), and R_GetEntityLists().

◆ RF_PULSE

#define RF_PULSE   0x00000100

glowing entity

Definition at line 47 of file r_entity.h.

Referenced by R_DrawAliasModel(), and SP_misc_model().

◆ RF_SELECTED

#define RF_SELECTED   0x00000010

selected actor

Definition at line 43 of file r_entity.h.

Referenced by CL_AddActor(), CL_AddUGV(), and R_DrawEntityEffects().

◆ RF_SHADOW

#define RF_SHADOW   0x00000800

shadow (when living) for this entity

Definition at line 50 of file r_entity.h.

Referenced by CL_AddActor(), CL_AddUGV(), and R_DrawEntityEffects().

◆ RF_TRANSLUCENT

#define RF_TRANSLUCENT   0x00000001

Definition at line 35 of file r_entity.h.

Referenced by R_DrawMeshShadow(), and R_GetEntityLists().

Function Documentation

◆ R_AddEntity()

int R_AddEntity ( const entity_t * ent)

Adds a copy of the specified entity to the list of all known render entities.

See also
R_GetFreeEntity
Returns
The position of the entity in the render entity array or -1 in case the entity wasn't added.

Definition at line 706 of file r_entity.cpp.

References Com_Error(), ERR_DROP, MAX_ENTITIES, mod_bsp, entity_t::model, r_entities, and refdef.

Referenced by CL_AddActor(), CL_AddArrow(), CL_AddPathingBox(), CL_AddTargetingBox(), CL_AddUGV(), LE_AddEdictHighlight(), LE_AddToScene(), LE_BrushModelAction(), LM_AddToSceneOrder(), and SEQ_Render3D().

◆ R_DrawBlendMeshEntities()

void R_DrawBlendMeshEntities ( entity_t * ents)

◆ R_DrawEntityEffects()

void R_DrawEntityEffects ( void )

◆ R_DrawMeshEntities()

void R_DrawMeshEntities ( entity_t * ents)

Draws the list of entities.

Parameters
[in,out]entsThe list of entities that are going to get rendered
See also
R_GetEntityLists

Definition at line 316 of file r_entity.cpp.

References mod_alias_md2, mod_alias_md3, mod_obj, entity_t::model, entity_t::next, and R_DrawAliasModel().

Referenced by R_DrawBlendMeshEntities(), and R_DrawOpaqueMeshEntities().

◆ R_DrawNullEntities()

void R_DrawNullEntities ( const entity_t * ents)

Draw entities which models couldn't be loaded.

Definition at line 503 of file r_entity.cpp.

References entity_t::next, and R_DrawNullModel().

Referenced by R_RenderFrame().

◆ R_DrawOpaqueMeshEntities()

void R_DrawOpaqueMeshEntities ( entity_t * ents)

◆ R_DrawSpecialEntities()

void R_DrawSpecialEntities ( const entity_t * ents)

◆ R_EntityAddToOrigin()

void R_EntityAddToOrigin ( entity_t * ent,
const vec3_t offset )

Translates the origin of the given entity by the given offset vector.

Parameters
[in,out]entThe entity to translate
[in]offsetThe translation vector

Definition at line 57 of file r_entity.cpp.

References entity_t::origin, and VectorAdd.

◆ R_EntitySetOrigin()

void R_EntitySetOrigin ( entity_t * ent,
const vec3_t origin )

setter for entity origin

Parameters
[out]entThe entity to set the origin for
[in]originThe new origin for the given entity

Definition at line 47 of file r_entity.cpp.

References entity_t::origin, and VectorCopy.

Referenced by CL_AddEdictFunc(), LE_AddToScene(), LM_AddToSceneOrder(), and SEQ_Render3D().

◆ R_GetEntity()

entity_t * R_GetEntity ( int id)

Returns a specific entity from the list.

Definition at line 694 of file r_entity.cpp.

References id, r_entities, and refdef.

Referenced by LM_AddToSceneOrder(), and R_Trace().

◆ R_GetFreeEntity()

entity_t * R_GetFreeEntity ( void )

Get the next free entry in the entity list (the last one).

Note
This can't overflow, because R_AddEntity checks the bounds
See also
R_AddEntity

Definition at line 684 of file r_entity.cpp.

References Com_Error(), ERR_DROP, MAX_ENTITIES, r_entities, and refdef.

Referenced by CL_AddActor(), CL_AddUGV(), and SEQ_Render3D().

◆ R_TransformForEntity()

void R_TransformForEntity ( const entity_t * e,
const vec3_t in,
vec3_t out )

Transforms a point by the inverse of the world-model matrix for the specified entity.

Definition at line 522 of file r_entity.cpp.

References entity_t::angles, entity_t::getScaleX(), Matrix4x4_CreateFromQuakeEntity(), Matrix4x4_Invert_Simple(), Matrix4x4_Transform(), and entity_t::origin.

Referenced by R_RotateForMeshShadow().

Variable Documentation

◆ r_blend_mesh_entities

entity_t* r_blend_mesh_entities
extern

Definition at line 38 of file r_entity.cpp.

Referenced by R_GetEntityLists(), and R_RenderFrame().

◆ r_null_entities

entity_t* r_null_entities
extern

Definition at line 39 of file r_entity.cpp.

Referenced by R_GetEntityLists(), and R_RenderFrame().

◆ r_opaque_mesh_entities

entity_t* r_opaque_mesh_entities
extern

Definition at line 37 of file r_entity.cpp.

Referenced by R_GetEntityLists(), and R_RenderFrame().

◆ r_special_entities

entity_t* r_special_entities
extern

Definition at line 40 of file r_entity.cpp.

Referenced by R_GetEntityLists(), and R_RenderFrame().