Changing laser direction in onHitByLaser
Posted: Thu Jan 11, 2018 12:58 am
I'm new to Thyme and Algodoo, and finding it pretty hard to get around without proper documentation or even a console / error messages. (unless I'm missing something obvious?)
Nevertheless, my goal is to create a perfect thin lens. I figured I could use the onHitByLaser event and redirect the laser in the direction I want it to go. So I figured out I can get the hit position in e.pos and the normal of the surface the laser hit in e.normal. But how do I get the hit angle? And how do I tell the engine which direction I want it to go?
Assuming the angle issue has a solution, if there's no way to control refraction I can always just absorb the laser and shoot out a new one in the desired direction. How would I go about doing that? (ideally the new laser "body" should not be visible)
Nevertheless, my goal is to create a perfect thin lens. I figured I could use the onHitByLaser event and redirect the laser in the direction I want it to go. So I figured out I can get the hit position in e.pos and the normal of the surface the laser hit in e.normal. But how do I get the hit angle? And how do I tell the engine which direction I want it to go?
Assuming the angle issue has a solution, if there's no way to control refraction I can always just absorb the laser and shoot out a new one in the desired direction. How would I go about doing that? (ideally the new laser "body" should not be visible)