Skip to content

Commit

Permalink
Core: fixed narrowing conversion in Vectormath.
Browse files Browse the repository at this point in the history
This was an error under Windows when using float as scalar type.
  • Loading branch information
GPMueller committed Apr 5, 2019
1 parent 229ff68 commit 1043fa5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions core/src/engine/Vectormath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ namespace Engine
Vector3 triangle_normal;
vectorfield tri_positions(3);
for(int i=0; i<3; i++)
{
tri_positions[i] = {basis_cell_points[tri[i]].x, basis_cell_points[tri[i]].y, 0};
}
tri_positions[i] = {scalar(basis_cell_points[tri[i]].x), scalar(basis_cell_points[tri[i]].y), scalar(0)};
triangle_normal = (tri_positions[0]-tri_positions[1]).cross(tri_positions[0] - tri_positions[2]);
triangle_normal.normalize();
scalar sign = triangle_normal[2]/std::abs(triangle_normal[2]);
Expand Down

0 comments on commit 1043fa5

Please sign in to comment.