Open 0XDE57 opened 1 year ago
https://phet.colorado.edu/sims/html/bending-light/latest/bending-light_en.html
reflections and refractions! https://github.com/phetsims/bending-light/blob/main/js/prisms/model/PrismsModel.ts https://github.com/phetsims/bending-light/blob/main/js/common/model/DispersionFunction.ts
https://en.wikipedia.org/wiki/Refractive_index https://en.wikipedia.org/wiki/Sellmeier_equation
Slice: we get the entry point from the first raycast, but how do we get the exit point for the laser? Answer: perform another raycast! but flip the start and end point, so the ray is cast from the end point of the laser towards the caster. eg:
world.rayCast(callback,p1,p2); //entry point world.rayCast(callback,p2,p1); //exit point
Laser component: a raycast with reflection off objects.
Asteroid given a reflective index (albedo) from [0 to 1] Where 0 does not reflect, and 1 reflects 100% of the beam. 0.5 would reflect 50% of the beam, beam dims accordingly.
Asteroid heats up with laser exposure, based on % not reflected?