Quote:
Originally Posted by FaTony
Visibility... I've been thinking on it. The bullet-proof method is to determine 3 visible sides ofa player's bounding box and trace rays to a 1x1 grid on all sides... That will probably lag much. However, by testing, I've found that tracing about 4000 rays OnGameFrame caused only slight lag when you are running both dedicated server and client on the same machine. Start with TR_TraceRay. Dunno about glows, haven't scripted for L4D1/2 much.
EDIT: I forgot to mention that on Heroboy server, they glow only show up when the player is very far. They've somehow set a starting distance of a glow. So you technically can set starting distance of 64000 units... I wonder if it's player specific.
|
pradon me, but i've always thought that TR_TraceRay always trace in a straight line, it also can be used to trace visible corners in the player's sight? wow, then it must be real hard... i don't know much about the traceray part, so can this code be used to trace?
PHP Code:
stock SetTeleportEndPoint(client)
{
decl Float:vAngles[3], Float:vOrigin[3], Float:vBuffer[3], Float:vStart[3], Float:Distance, Handle:trace;
GetClientEyePosition(client,vOrigin);
GetClientEyeAngles(client, vAngles);
trace = TR_TraceRayFilterEx(vOrigin, vAngles, MASK_SHOT, RayType_Infinite, TraceEntityFilterPlayer);
if(TR_DidHit(trace))
{
TR_GetEndPosition(vStart, trace);
GetVectorDistance(vOrigin, vStart, false);
Distance = -35.0;
GetAngleVectors(vAngles, vBuffer, NULL_VECTOR, NULL_VECTOR);
g_pos[0] = vStart[0] + (vBuffer[0]*Distance);
g_pos[1] = vStart[1] + (vBuffer[1]*Distance);
g_pos[2] = vStart[2] + (vBuffer[2]*Distance);
}
CloseHandle(trace);
return true;
}
public bool:TraceEntityFilterPlayer(entity, contentsMask)
{
return entity > MaxClients || !entity;
}