Various bug fixes + Material setters

This commit is contained in:
Crizomb 2025-09-27 02:37:11 +02:00
parent e35cca1830
commit f5c912c489
5 changed files with 53 additions and 22 deletions

View file

@ -69,7 +69,7 @@ func (u Vector3) Min(x float64) Vector3 {
// i incident, n normal. Both vector should be normalized
func Reflect(i Vector3, n Vector3) Vector3 {
y := i.Dot(n)
return (i.Add(n.Scale(2 * y))).Normalized()
return (n.Scale(2 * y)).Sub(i)
}
// Todo : Refract