Is there not a C_Beam class?

In theory, if you create the beam in a client-side run function of an 
entity, then every player should get those beams drawn on every entity, 
without requiring the server to send it all over the network, resulting 
in lag-free beams.

I think.

Yorg Kuijs wrote:
> It's a server side beam, so a lot of network traffic is taking place if 
> you're moving a beam around I guess.
> Only way to get over that is make it clientside(if that's even possible) 
> or find some other solution I guess.
>
> I could be wrong though , but I remember seeing some other post about 
> Lasers somewhere and there was stated the same thing, there isn't much 
> you can do to make server side stuff like that less laggy.
>
> James Murray wrote:
>   
>> Hi I am making a LaserGun for my hl2dm mod and I am just trying to get the
>> beam working first so I edited the 375 weapon code and added a constant beam
>> that shows once the weapon is drawn,the problem I am having is that the beam
>> is laggy when I move,here is my code can you please help me out?
>>
>>
>>
>> void CWeapon357::ItemPostFrame( void )
>>
>> {
>>
>> CBasePlayer *pPlayer = ToBasePlayer( GetOwner() );
>>
>> // set up the vectors and traceline
>>
>> trace_t tr;
>>
>> Vector vecDir, attachpoint;
>>
>> QAngle vBeamAng;
>>
>> Vector vecSrc = pPlayer->EyePosition();
>>
>> // get our view model so we can find the attachment
>>
>> CBaseViewModel *pViewModel = pPlayer->GetViewModel();
>>
>> // get the attachment points position and angles
>>
>> pViewModel->GetAttachment(pViewModel->LookupAttachment("muzzle"),
>> attachpoint, vBeamAng );
>>
>> AngleVectors( vBeamAng, &vecDir);
>>
>> Vector vecStop = attachpoint + (vecDir * MAX_TRACE_LENGTH);
>>
>> // do the traceline
>>
>> UTIL_TraceLine( vecSrc, vecStop, MASK_ALL, pPlayer, COLLISION_GROUP_NPC, &tr
>> );
>>
>> //multiplayer needs this next line and the #endif that follows but for
>> singleplayer remove them
>>
>> #ifndef CLIENT_DLL
>>
>> //create the beam
>>
>> Vector vBeamPos = attachpoint;
>>
>> CBeam *pBeam = CBeam::BeamCreate( "sprites/laserbeam.vmt", 0.35 );
>>
>> pBeam->PointEntInit( vBeamPos, this );
>>
>> pBeam->SetAbsStartPos( tr.endpos );
>>
>> pBeam->SetEndAttachment( 1 );
>>
>> pBeam->SetColor( 20, 20, 250 );
>>
>> pBeam->SetScrollRate( 25.6 );
>>
>> pBeam->SetBrightness( 30 );
>>
>> pBeam->LiveForTime( 0.00001 );
>>
>> #endif
>>
>> BaseClass::ItemPostFrame();
>>
>> }
>>     
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please 
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
>   

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to