Understanding CastStrengthRay
As I understand it, the general idea of CastStrengthRay is to look around for any terrain pieces that are stronger than a specified value and to then return true or not.
According to the Wiki, CastStrengthRay is used as such:
Arguments:
- The starting position.
- The vector to trace along.
- The strength value of screen any found to be equal or more than will terminate the ray.
- A
reference to the
vector screen will be filled out with the absolute location of the found terrain pixel of less than or equal to above strength.
- For every pixel checked along the line, how many to skip between them for optimization reasons. 0 = every pixel is checked.
- A material ID to ignore, IN ADDITION to Air.
- Whether the ray should wrap around the scene if it crosses a seam.
Return value:
- Whether a material of equal or more strength was found along the ray. If not, the fourth parameter have been set to last position of the ray.
So it's really the fourth point that I'm confused about.
What would a reference be, and what is a vector screen?
I also found an example although I still don't quite understand why the fourth value is Vector (0,0) (or what will happen if I change it)
Code:
local terrainRaycast = SceneMan:CastStrengthRay(self.Pos,Vector(self.Vel.X,self.Vel.Y),10,Vector(0,0),0,0,SceneMan.SceneWrapsX)
Any help would be appreciated!