Jump to content

processLineOfSight resource usage


Drakath

Recommended Posts

onClientRender, it uses processLineOfSight for each player to calculate where the ray hits. I create a laser dot in that spot. There is no other way around unless removing the laser dot and making dxDrawLine3D very long. So I will ask again, is it worth removing this feature (laser dot) just to remove processLineOfSight from my script?

Link to comment

Its wiki page mentions that it's expensive, you're also calling it on each render which is A LOT. Most of these calls are useless since the player doesn't always change position/rotation each render. You can try different things to get over this. Maybe using getTickCount to limit the call to 3 seconds? Perhaps use the less expensive isLineOfSightClear before using processLineOfSight?

Link to comment
Its wiki page mentions that it's expensive, you're also calling it on each render which is A LOT. Most of these calls are useless since the player doesn't always change position/rotation each render. You can try different things to get over this. Maybe using getTickCount to limit the call to 3 seconds? Perhaps use the less expensive isLineOfSightClear before using processLineOfSight?

Nah, it just won't be as smooth and nice as it is with onClientRender. Maybe I shouldn't try to apply it for all players? What if it was for localPlayer only?

@arezu

I did try it a long time ago, here's what I got: http://i43.tinypic.com/2eo8qhw.jpg

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...