[Code] Raytest Util
-
Another way of thinking about it is that Arrays are actually Hash tables using a really simple hashing algorithm that is:
hash(N) => N
Have a good weekend!
-
@adamb said:
The wavelength of light is small so mostly you can ignore diffraction effects and treat light as moving in straight lines. Audio wavelengths are much longer and have significant diffraction around corners (hence you can hear round corners!), so how does using (straight line) raytracing help here?
Good observation! Raytracing is essentially just an approximation of how sound travels. Diffraction can't be modeled that way. As far as I know, simulating diffraction is still a hot topic in the field of acoustics and there's no catch-all automatic solution yet. (I'm not an expert in acoustics, I'm just a Computer Science student doing some coding at an acoustics chair/institute)
-
I've been playing with raytest a bit. From my understanding, it works like this:
- It checks ALL entities in the model root context
- If something is hit and it's a face/edge/etc, the raytest returns the entity
- If the hit entity is a group or component, it again checks ALL entities in that group/comp
- And so forth until it hits a face/edge/etc
So if you have a lot of loose geometry in one of the hit contexts, it will be damn slow. But you can have a shitload of geometry in a group/comp not on the path of the ray, and you'll have decent performances.
To check if a group/comp is hit, the raytest doesn't look at the geometry inside it, but rather at its bounding box.
This is really important because you could have a lot of geometry away from the ray, but if the bounding box of the containing group is on the ray path, all of that geometry will be checked. Resulting in a slow raytest.I hope it's clear?
Advertisement