fix power distillation projecting incorrectly

This commit is contained in:
yrsegal@gmail.com 2022-04-30 12:14:36 -04:00
parent 9561391995
commit 6e630b35d7

View file

@ -37,9 +37,9 @@ object OpPowProj : ConstManaOperator {
Vec3(lvec.x.pow(rnum), lvec.y.pow(rnum), lvec.z.pow(rnum))
},
{ rvec ->
if (rvec == Vec3.ZERO)
if (lvec == Vec3.ZERO)
throw MishapDivideByZero.of(lvec, rvec, "project")
rvec.scale(lvec.dot(rvec) / rvec.dot(rvec))
rvec.scale(rvec.dot(lvec) / lvec.dot(lvec))
}
)
})