Client side TraceRay issue
Posted: 2012-05-07, 04:19
I have a problem with the client side TraceRay() in existing weapons ClientSide_HandlePrimaryFireEvent() methods, they do not return the same information as the TraceRay in the ServerSide_Think(). I do see it work very very intermittently. I began wondering why when I fire at a CompanyBot, it appears to miss and show the miss particle on the wall. Since the CompanyBot can take damage, I'm assuming it should also be able to be hit on the client side. If that is wrong, I'll stop doing that... Do I need to kick the PhysicsWorld or something?
I'v recorded the TraceRay() inputs and outputs from a clean cw_357.cpp:
Server player ID[15] heading[46846] pitch[4020]
Origin=9641.873853,3849.323978,2541.630559,
View=-0.904089,-0.203202,-0.375942
Server RayResult Hit entity 61,
rfw=9.641874,3.849324,2.541631,
rtw=-9031.247070,-2028.171143,-3756.873779,
hnw=1.000000,0.000000,0.000000,
hpw=8.703486,3.638413,2.151427
Client player ID[15] heading[46846] pitch[4020]
Origin=9641.874023,3849.323975,2541.630615,
View=-0.904089,-0.203202,-0.375942
Client RayResult Hit entity 0,
rfw=9.641874,3.849324,2.541631,
rtw=-9031.247070,-2028.171143,-3756.873779,
hnw=0.000000,0.000000,1.000000,
hpw=5.484269,2.914865,0.812800
rfw = RayResultT.m_rayFromWorld
rtw = RayResultT.m_rayToWorld;
hnw = RayResultT.m_hitNormalWorld;
hpw = RayResultT.m_hitPointWorld;
I'v recorded the TraceRay() inputs and outputs from a clean cw_357.cpp:
Server player ID[15] heading[46846] pitch[4020]
Origin=9641.873853,3849.323978,2541.630559,
View=-0.904089,-0.203202,-0.375942
Server RayResult Hit entity 61,
rfw=9.641874,3.849324,2.541631,
rtw=-9031.247070,-2028.171143,-3756.873779,
hnw=1.000000,0.000000,0.000000,
hpw=8.703486,3.638413,2.151427
Client player ID[15] heading[46846] pitch[4020]
Origin=9641.874023,3849.323975,2541.630615,
View=-0.904089,-0.203202,-0.375942
Client RayResult Hit entity 0,
rfw=9.641874,3.849324,2.541631,
rtw=-9031.247070,-2028.171143,-3756.873779,
hnw=0.000000,0.000000,1.000000,
hpw=5.484269,2.914865,0.812800
rfw = RayResultT.m_rayFromWorld
rtw = RayResultT.m_rayToWorld;
hnw = RayResultT.m_hitNormalWorld;
hpw = RayResultT.m_hitPointWorld;