View Full Version : Ray Casting

10-24-2011, 11:30 AM
Is it possible to cast a ray using LScript? I'm guessing "no" based on my review of the tragically still terribly broken LScript documentation, but it is hard to be certain.

I see that this is possible via nodes, and I have seen a lot of mention of DP Kit's additional node editors. If this plays nice with 10, perhaps this is my best bet.

10-24-2011, 12:35 PM
You can't write node or shader in Lscript, AFAIK. So, what for you would need ray casting.. ?

10-24-2011, 12:42 PM
I am writing a motion plugin. I would like to intersect a ray with a mesh to find the contact point if one exists. Basically, I need the equivalent functionality of the RayCast node; get the distance to the nearest geometry along a given vector.

10-24-2011, 12:44 PM
Ray cast function which is available for shaders and nodes, is not available for motion plugins. Optimization structures such as kd-tree has not been initialized at that early stage.

You must use C/C++ LWSDK, and write your own scene mesh setting up routines, and your own ray cast function, if you're really serious about this plugin.

10-24-2011, 06:47 PM
I see. I have tried the DP Kit along with the Item Motion Node Editor. This gives me just what I need; no need for any scripting. I can't wait for all these node editors to go native.