Branimir Karadžić 7 years ago
parent
commit
18c84e1f7f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/02-metaballs/metaballs.cpp

+ 2 - 2
examples/02-metaballs/metaballs.cpp

@@ -665,14 +665,14 @@ public:
 						uint32_t xoffset = offset + xx;
 
 						Grid* grid = m_grid;
-						float normal[3] =
+						const bx::Vec3 normal =
 						{
 							grid[xoffset-1     ].m_val - grid[xoffset+1     ].m_val,
 							grid[xoffset-ypitch].m_val - grid[xoffset+ypitch].m_val,
 							grid[xoffset-zpitch].m_val - grid[xoffset+zpitch].m_val,
 						};
 
-						bx::vec3Norm(grid[xoffset].m_normal, normal);
+						bx::store(grid[xoffset].m_normal, bx::normalize(normal) );
 					}
 				}
 			}