add Metal material

This commit is contained in:
Fabien Freling 2021-05-11 22:52:51 +02:00
parent b3c47a914f
commit bc3fb54991
3 changed files with 45 additions and 11 deletions

View file

@ -78,6 +78,10 @@ pub const Vec3 = packed struct {
and math.absFloat(self.y) < t
and math.absFloat(self.z) < t;
}
pub fn reflect(self: Vec3, n: Vec3) Vec3 {
return self.sub(n.mul_s(self.dot(n) * 2));
}
};
pub fn random(rng: *Random, min: f32, max: f32) Vec3 {