Collision Detection

The player has, like any entity in the Quake2 world, a bounding box. This box is spanned by the mins and maxs vectors in the edict_t structure. These two vetors are relative to the entity's origin in entity_state_t's origin. There are also two vectors, absmin and absmax, which span the same box but are relative to world origin. Finally, the size value in edict_t is the euclidean length of the vetor reaching from mins to maxs.

To aid collision detection there is also a couple of bounding box attributes in edict_t, which tells what type of bounding box this is and how a collision is to be defined. The solid attribute tells if collisions are defined as inside the box or outside. A clipmask tells what type of material the collision is defined for. You can find these clipmasks in chapter 12.11.

Collision detection is performed in the engine but is conveyed to the game DLL in the ClientThink function. The Pmove function of the game_import_t API, which the game DLL calls, sets the touchents attribute in the pmove_t structure. The game DLL can iterate through that array of entities and call their respective touch function. I presume that the engine also prevents the player from moving through objects by affecting the origin of the pmove_state_t. After all, the engine always has the last say about the players origin due to the call to Pmove.