I'm trying to create a script that shoots a beam into a mirror using raycasting. The beam is then deflected by the mirror, based on the direction the beam is coming from, where it hit the mirror, and the rotation of the mirror. However, I don't know how to piece that all together to calculate the direction the beam will be deflected in. If anyone has any ideas, algorithms, or helpful links, please let me know. Thanks.
The mirror will always be rectangular, so the algorithm doesn't have to work universally for every shape.

2 comments
Thanks, I'm assuming this works on all shapes then?
It works on all shapes, but it's based on their physical shape. E.g., Cylinders will act like spheres, and meshes are ignored.