#(JustinS) raycast in all directions

1 messages · Page 1 of 1 (latest)

valid oar
#

Trying to shoot n raycasts in every direction from a point (or very small sphere). Is there a function for this that already exists in denizen?
Only way I thought of doing this was equally distributing n points on a sphere (using quite a bit of math), then shooting the raycasts in those directions from the origin

thin thicketBOT
#

(JustinS) raycast in all directions

thin thicketBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

valid oar
#

I feel like there's a better way

valid oar
#

I wrote a little script for that can distribute n points equally on a sphere
Idk, might be useful for some people. It's some pretty basic math that I stole from stackoverflow https://paste.denizenscript.com/View/133998

#
        - define diameter:5
        - define samples:200
        - define phi:<element[5].sqrt.sub[1].mul[<util.pi>]>
        - repeat <[samples]> as:n:
            - define y:<[n].div[<element[<[samples]>]>].mul[2].sub[1]>
            - define radius:<element[1].sub[<[y].mul[<[y]>]>].sqrt>
            - define theta:<[phi].mul[<[n]>]>
            - define x:<[theta].cos.mul[<[radius]>]>
            - define z:<[theta].sin.mul[<[radius]>]>
            - define loc:<[origin].add[<location[<[x].mul[<[diameter]>]>,<[y].mul[<[diameter]>]>,<[z].mul[<[diameter]>]>,<[origin].world>]>]>
            - spawn shulker_bullet[gravity=false] <[loc]>```
#

But I feel like it's a little slow, but that's probably the spawn command

valid oar
#

By disabling debug it's actually pretty fast. Happy with this result