UFO: Alien Invasion
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. More...
 
entity_tR_GetFreeEntity (void)
 Get the next free entry in the entity list (the last one) More...
 
entity_tR_GetEntity (int id)
 Returns a specific entity from the list. More...
 
void R_EntitySetOrigin (entity_t *ent, const vec3_t origin)
 setter for entity origin More...
 
void R_EntityAddToOrigin (entity_t *ent, const vec3_t offset)
 Translates the origin of the given entity by the given offset vector. More...
 
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) More...
 
void R_DrawMeshEntities (entity_t *ents)
 Draws the list of entities. More...
 
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. More...
 

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.

◆ MAX_ENTITY_LIGHTS

#define MAX_ENTITY_LIGHTS   7

Definition at line 28 of file r_entity.h.

◆ RF_ACTOR

#define RF_ACTOR   0x00000080

this is an actor

Definition at line 46 of file r_entity.h.

◆ RF_ALLIED

#define RF_ALLIED   0x00000040

actor in an allied team (controlled by another player)

Definition at line 45 of file r_entity.h.

◆ RF_ARROW

#define RF_ARROW   0x02000000

arrow, debugging only

Definition at line 38 of file r_entity.h.

◆ RF_BLOOD

#define RF_BLOOD   0x00000008

blood (when dead) for this entity

Definition at line 42 of file r_entity.h.

◆ RF_BOX

#define RF_BOX   0x00000002

actor selection box

Definition at line 36 of file r_entity.h.

◆ RF_IRGOGGLES

#define RF_IRGOGGLES   0x00000200

this is visible if the actor uses ir goggles

Definition at line 48 of file r_entity.h.

◆ RF_IRGOGGLESSHOT

#define RF_IRGOGGLESSHOT   0x00002000

this is the actor that used an irgoggle

Definition at line 52 of file r_entity.h.

◆ RF_MEMBER

#define RF_MEMBER   0x00000020

actor in the same team

Definition at line 44 of file r_entity.h.

◆ RF_NEUTRAL

#define RF_NEUTRAL   0x00000400

actor from a neutral team

Definition at line 49 of file r_entity.h.

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

◆ RF_NONE

#define RF_NONE   0x00000000

entity->flags (render flags) for initialization

Definition at line 34 of file r_entity.h.

◆ RF_OPPONENT

#define RF_OPPONENT   0x00001000

opponent

Definition at line 51 of file r_entity.h.

◆ RF_PATH

#define RF_PATH   0x01000000

pathing marker, debugging only

Definition at line 37 of file r_entity.h.

◆ RF_PULSE

#define RF_PULSE   0x00000100

glowing entity

Definition at line 47 of file r_entity.h.

◆ RF_SELECTED

#define RF_SELECTED   0x00000010

selected actor

Definition at line 43 of file r_entity.h.

◆ RF_SHADOW

#define RF_SHADOW   0x00000800

shadow (when living) for this entity

Definition at line 50 of file r_entity.h.

◆ RF_TRANSLUCENT

#define RF_TRANSLUCENT   0x00000001

Definition at line 35 of file r_entity.h.

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, rendererData_t::numEntities, 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()

◆ R_DrawEntityEffects()

◆ 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()

◆ 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, rendererData_t::numEntities, 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, rendererData_t::numEntities, 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().