Given a vector, reflects that vector off of a mirror vector Useful for specular and other reflective surfaces
| 511 | // Given a vector, reflects that vector off of a mirror vector |
| 512 | // Useful for specular and other reflective surfaces |
| 513 | void ReflectRay(vector *dest, vector *src, vector *mirror_norm) { |
| 514 | *dest = *src; |
| 515 | float d = *dest * *mirror_norm; |
| 516 | vector upvec = d * *mirror_norm; |
| 517 | *dest -= (2.0f * upvec); |
| 518 | } |
| 519 | |
| 520 | // This is needed for small view cameras |
| 521 | // It clears the facing array so that it is recomputed |
no outgoing calls
no test coverage detected