Commit 2c3cb630 authored by Philip Trettner's avatar Philip Trettner

fixed normal of integer objects

parent 5038e435
......@@ -501,14 +501,14 @@ public:
triangle_ref add_face(tg::triangle<D, T> const& t, material const& mat = {})
{
static_assert(D == 3, "only supports 3D currently");
auto n = tg::vec3(tg::normal_of(t));
auto n = tg::normal_of(tg::triangle3(t));
return _add_triangle(tg::pos3(t.pos0), tg::pos3(t.pos1), tg::pos3(t.pos2), n, n, n, mat);
}
template <class T>
triangle_ref add_face(tg::box<2, T, 3> const& t, material const& mat = {})
{
auto start_cnt = _triangles.size();
auto n = tg::vec3(tg::normal_of(t));
auto n = tg::normal_of(tg::box2in3(t));
auto v00 = tg::pos3(t[{-1, -1}]);
auto v01 = tg::pos3(t[{-1, +1}]);
auto v10 = tg::pos3(t[{+1, -1}]);
......@@ -522,7 +522,7 @@ public:
{
auto start_cnt = _triangles.size();
static_assert(D == 3, "only supports 3D currently");
auto vc = tg::pos3(tg::centroid_of(t));
auto vc = tg::centroid_of(tg::quad3(t));
auto v00 = tg::pos3(t.pos00);
auto v01 = tg::pos3(t.pos01);
auto v10 = tg::pos3(t.pos10);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment