Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

5
Anti-raycasting/boxcasting?
Post Body

RESOLVED (but not the way I initially intended)

Hey all, I want to perform a sort of anti-boxcast, where instead of dragging a box along until it hits something, it drags a box along until the box isn't hitting anything. What's a good way of achieving that?

I have to achieve this in a single frame, so my best idea so far (create a box collider, move it along a vector in a while loop until it has no collisions) isn't optimal. But I'm not sure what else will do the trick.

Thoughts?

Edit: For those interested, I did end up resolving this by creating what I'm calling a "greedy boxcast", which effectively works by 1. Casting a chain of rays 2. Casting a chain of boxes 3. Finding the last time in the chain a box hits something and there is never another time a box hits nothing, or else using the max length of the ray

This allows me to fire sort of a hammer-shape to detect the furthest distance I can project my box safely.

I'm sure there is room to improve it, I am a bit rusty. Just as I've been writing this I realized I probably don't need the raycasts at all, but they helped a lot for visualization. I'm going to take a look at optimization soon as I am almost done with the functionality that this is being designed for and have to do some code reorganization to keep it sane anyway.

Next step, messing with some masking division and figuring out how I'm going to ricochet the greedy boxcast!

Or hammercast. That's kinda cool sounding. Feel like Thor.

Author
Account Strength
100%
Account Age
8 years
Verified Email
Yes
Verified Flair
No
Total Karma
49,525
Link Karma
2,011
Comment Karma
47,169
Profile updated: 2 days ago
Posts updated: 4 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago