Whay is Raycast()?
-
I was messing with trying to make a 3D renderer when I tried to create a custom function called raycast(). However it appears this is already a function in FUZE. I can't find anything about it in the help page so I was wondering if anyone has already made a demo.
If you could link the post or give the ID that would be great thanks! -
It appears to be undocumented
-
Oh...
Then why does it turn blue when I type it in the code editor like other functions? -
@ben-2-0 I mean it is in the language but it is an experimental feature that may or may not be eventually made official. I will see if I can find out what the parameters are if you want to try it
-
Parameters are currently a position and direction in the form of a vector. The only output is a very large number that starts with 34. Thanks for looking into it @pianofire.
-
I can't remember right now if this was officially implemented. It was intended to return a distance value from a 3D intersect. For example, if you wanted to measure the distance from four wheels of a vehicle on a sloped surface you would then be able to rotate the vehicle to match the slope. So the position is the point you want to check from. The vector is a 'ray' cast out in the direction given. The return 'should' be the distance from the point the Ray intersects with another 3D object.
Again however, I can't recall if it was fully implemented so it could do with some testing to be certain.
-
I was using it in a 2d area so that would be why I got a strange output.
-
@jonboy Would that be collision with the actual object or with the object's collision box?
-
watched this a while back, would be great to have this fully implemented -
@vinicity Collision box only - at least I think so! (so sorry..)
-
-
Very cool, if anyone wants to see what I made, let me know.
-
@ben-2-0 said in Whay is Raycast()?:
Very cool, if anyone wants to see what I made, let me know.
Show us!
-
Just because it's relevant here: https://fuzearena.com/forum/topic/1909/undocumented-function-raycastobject-is-functional-and-can-be-used