Vector2Refract method
Compute the direction of a refracted ray v: normalized direction of the incoming ray n: normalized normal vector of the interface of two optical media r: ratio of the refractive index of the medium from where the ray comes to the refractive index of the medium on the other side of the surface
Implementation
@override
Vector2D Vector2Refract(
Vector2D v,
Vector2D n,
double r,
) => $.Vector2$.Extract3(
(p) => _ffi.Vector2Refract(
$.Vector2$.Ref1(v).asNativePointer<Vector2C>().ref,
$.Vector2$.Ref2(n).asNativePointer<Vector2C>().ref,
r,
).toDart(p.asNativePointer()),
);