Like in the topic - could someone elaborate on trap_LinkEntity and trap_UnlinkEntity functions? What do they exactly do, where and why should they be used and stuff? Thanks in advance. 
Rookie One
Like in the topic - could someone elaborate on trap_LinkEntity and trap_UnlinkEntity functions? What do they exactly do, where and why should they be used and stuff? Thanks in advance. 
Rookie One
its my understanding that linking an entity makes it possible to do collision detection against the bsp tree?? at least thats what it seems like to me - i havent really looked at the quake3 engine code to see for sure - someone correct me if im wrong (which is entirely possible lol)
From the quake 3 engine source (code/server/server.h)
void SV_UnlinkEntity( sharedEntity_t *ent );
// call before removing an entity, and before trying to move one,
// so it doesn't clip against itself
void SV_LinkEntity( sharedEntity_t *ent );
// Needs to be called any time an entity changes origin, mins, maxs,
// or solid. Automatically unlinks if needed.
// sets ent->v.absmin and ent->v.absmax
// sets ent->leafnums[] for pvs determination even if the entity
// is not solid
if you just want to exclude an entity temporarily from collision detection (eg for traces), changing ent->r.linked is far less expensive than doing unlinkentity/linkentity. note that this wonβt work on quake3 or anything except ET.