Skip to main content

c_base_entity

Base entity class that all game entities inherit from. Provides fundamental entity properties and methods. Source: game/sdk/classes/c_base_entity.h:17 Inherits: i_client_entity

Network Variables

model_index
std::int32_t
Model index for the entity’s visual representationNetvar: CBaseEntity::m_nModelIndex
team_number
sdk::teams
Team number the entity belongs to (Terrorist, Counter-Terrorist, etc.)Netvar: CBaseEntity::m_iTeamNum
vector_origin
math::vec3
World position of the entityNetvar: CBaseEntity::m_vecOrigin
vector_angles
math::vec3
Rotation angles of the entity (pitch, yaw, roll)Netvar: CBaseEntity::m_vecAngles
owner_entity
std::uintptr_t
Handle to the entity’s ownerNetvar: CBaseEntity::m_hOwnerEntity
spotted
bool
Whether the entity has been spotted by the local playerNetvar: CBaseEntity::m_bSpotted
simulation_time
float
Server simulation time for the entityNetvar: CBaseEntity::m_flSimulationTime
effects
sdk::bit_flag_t<std::int32_t>
Entity effects bit flagsNetvar: CBaseEntity::m_fEffects

Methods

rgfl_coordinate_frame
math::matrix_3x4&
Returns the entity’s coordinate frame transformation matrixReturns: Reference to the 3x4 transformation matrix
auto& matrix = entity->rgfl_coordinate_frame();
is_player
bool
Checks if the entity is a playerReturns: true if entity is a player, false otherwiseVirtual Index: 158
if (entity->is_player()) {
    // Handle player-specific logic
}
data_description_map
data_map*
Retrieves the entity’s data description map for data-driven propertiesReturns: Pointer to the data mapVirtual Index: 15
prediction_description_map
data_map*
Retrieves the entity’s prediction data mapReturns: Pointer to the prediction data mapVirtual Index: 17
get_var_map
var_mapping*
Gets the entity’s variable mapping structureReturns: Pointer to variable mapping at offset 0x24

c_base_animating

Animated entity class that extends base entity with animation capabilities. Source: game/sdk/classes/c_base_animating.h:10 Inherits: c_base_entity

Network Variables

hitbox_set
std::int32_t
Index of the active hitbox setNetvar: CBaseAnimating::m_nHitboxSet
cycle
float
Animation cycle progress (0.0 to 1.0)Netvar: CBaseAnimating::m_flCycle

Methods

pose_parameter
std::array<float, 24>&
Returns the array of pose parameters for animation blendingReturns: Reference to array of 24 pose parameter values
auto& poses = entity->pose_parameter();
poses[0] = 0.5f; // Modify first pose parameter
is_jiggle_bones_enabled
bool&
Gets reference to the jiggle bones enabled flagReturns: Reference to boolean at offset 0x2930
entity->is_jiggle_bones_enabled() = false;
invalidate_bone_cache
void
Invalidates the entity’s bone cache, forcing recalculation on next access
entity->invalidate_bone_cache();
hitbox_position
math::vec3
Calculates the world position of a hitboxParameters:
  • index - Hitbox index
  • point_scale - Scale factor for point position (default: 0.5)
Returns: World position vector
math::vec3 head_pos = player->hitbox_position(sdk::hitgroup::HITGROUP_HEAD);

c_base_combat_character

Combat character class that adds weapon handling capabilities. Source: game/sdk/classes/c_base_combat_character.h:14 Inherits: c_base_animating

Network Variables

active_weapon
std::uintptr_t
Handle to the currently active weaponNetvar: CBaseCombatCharacter::m_hActiveWeapon
auto weapon_handle = character->active_weapon();
auto weapon = g_interfaces.entity_list->get_client_entity_from_handle<c_base_combat_weapon*>(weapon_handle);
next_attack
float
Time when the character can perform the next attackNetvar: CBaseCombatCharacter::m_hActiveWeapon
my_weapons
std::uintptr_t
Array handle to all weapons owned by this characterNetvar: CBaseCombatCharacter::m_hMyWeapons
my_wearables
std::uintptr_t
Array handle to wearable items (gloves, etc.)Netvar: CBaseCombatCharacter::m_hMyWearables

Usage Example

// Access active weapon
auto character = entity->as<c_base_combat_character*>();
auto weapon_handle = character->active_weapon();

if (weapon_handle) {
    auto weapon = g_interfaces.entity_list->get_client_entity_from_handle<c_base_combat_weapon*>(weapon_handle);
    if (weapon) {
        float next_shot = weapon->next_primary_attack();
    }
}

Inheritance Hierarchy

i_client_entity
    └── c_base_entity
            └── c_base_animating
                    └── c_base_combat_character
                            └── c_base_player
                                    └── c_cs_player
All entity classes use the NETVAR macro to define networked variables that are synchronized between client and server. The netvar system uses the table and property names from the Source Engine’s network property tables.

Build docs developers (and LLMs) love