Sign in to follow this  

Distance to the nearest wall

This topic is 409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

Currently, I am comparing the distance by using a raycast from the object to the static mesh.

which isn't quite correct, since the static mesh can have a hollow body, so the ray won't hit anything,

or get hit at a far distance, the wall at the very far end.

 

So I try to compare against the bounding boxes of each frame in the hierarchy which will lead to

a performance hit if the hierarchy is very huge.

 

Is it possible to form a large irregular tight bounding volume of the static geometry.

So that a ray can be casted on it?

 

Thanks

Jack

 

 

Share this post


Link to post
Share on other sites
Is it possible? Sure. You can design a system that uses a coarse mesh and a fine mesh for testing, often called narrow-phase and broad-phase tests.


Generally the solution is to start with smaller objects and use a spatial tree. After that another solution is to tag items with a specific attribute, which can help if you need to further reduce your search. Combining them, you would have your spatial grid look in concentric rings for objects with the tag.

Share this post


Link to post
Share on other sites

This topic is 409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this