From 13779f79f41e8bce483e98faa6353c07c12563c8 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 4 Jun 2014 14:56:30 -0400 Subject: triangles: Better API. --- libdimension/dimension/objects.h | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'libdimension/dimension') diff --git a/libdimension/dimension/objects.h b/libdimension/dimension/objects.h index eb476cf..b5d3bd7 100644 --- a/libdimension/dimension/objects.h +++ b/libdimension/dimension/objects.h @@ -26,29 +26,19 @@ #include /** - * A triangle, with normals interpolated between the points. + * A flat triangle, without normal interpolation. * @param[in] pool The memory pool to allocate from. - * @param[in] a The first corner of the triangle. - * @param[in] b The second corner of the triangle. - * @param[in] c The third corner of the triangle. - * @param[in] na The normal at \p a. - * @param[in] nb The normal at \p b. - * @param[in] nc The normal at \p c. + * @param[in] vertices The corners of the triangle. */ -dmnsn_object *dmnsn_new_triangle( - dmnsn_pool *pool, - dmnsn_vector a, dmnsn_vector b, dmnsn_vector c, - dmnsn_vector na, dmnsn_vector nb, dmnsn_vector nc -); +dmnsn_object *dmnsn_new_triangle(dmnsn_pool *pool, dmnsn_vector vertices[3]); /** - * A flat triangle, without normal interpolation. + * A triangle, with normals interpolated between the points. * @param[in] pool The memory pool to allocate from. - * @param[in] a The first corner of the triangle. - * @param[in] b The second corner of the triangle. - * @param[in] c The third corner of the triangle. + * @param[in] vertices The corners of the triangle. + * @param[in] normals The normals at each corner. */ -dmnsn_object *dmnsn_new_flat_triangle(dmnsn_pool *pool, dmnsn_vector a, dmnsn_vector b, dmnsn_vector c); +dmnsn_object *dmnsn_new_smooth_triangle(dmnsn_pool *pool, dmnsn_vector vertices[3], dmnsn_vector normals[3]); /** * A plane. -- cgit v1.2.3