This commit is contained in:
Бранимир Караџић 2019-03-03 15:17:09 -08:00
parent d2ccc4e312
commit 53fe0138f0
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ void toAabb(Aabb& _outAabb, const Cylinder& _cylinder)
const Vec3 axis = sub(_cylinder.end, _cylinder.pos);
const Vec3 asq = mul(axis, axis);
const Vec3 nsq = mul(asq, 1.0f/dot(axis, axis) );
const Vec3 tmp = sub(1.0f, nsq);
const Vec3 tmp = sub(Vec3(1.0f), nsq);
const float inv = 1.0f/(tmp.x*tmp.y*tmp.z);
@ -1228,7 +1228,7 @@ Vec3 closestPoint(const Triangle& _triangle, const Vec3& _point)
const Vec3 pos = closestPoint(plane, _point);
const Vec3 uvw = barycentric(_triangle, pos);
return cartesian(_triangle, clamp<Vec3>(uvw, 0.0f, 1.0f) );
return cartesian(_triangle, clamp<Vec3>(uvw, Vec3(0.0f), Vec3(1.0f) ) );
}
bool overlap(const Aabb& _aabb, const Vec3& _pos)