From 634403e3e3fae8e4b7301729d65570857463fc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Sun, 16 Mar 2025 17:45:58 +0100 Subject: [PATCH] docs(vectors): add docs for all functions. --- include/math/vector.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/math/vector.h b/include/math/vector.h index 0be67f8..f59a029 100644 --- a/include/math/vector.h +++ b/include/math/vector.h @@ -4,7 +4,23 @@ #include "math/vector3.h" #include "math/vector4.h" +/** + * @brief Converts a 4D vector to a 3D vector. + * @param v Pointer to the 4D vector. + * @return A pointer to a newly allocated 3D vector representing + * the first three components of the 4D vector (x, y, z). + * Returns NULL if the input vector is NULL or allocation fails. + */ Vec3* Vec4ToVec3(Vec4* v); + +/** + * @brief Converts a 3D vector to a 4D vector. + * @param v Pointer to the 3D vector. + * @return A pointer to a newly allocated 4D vector with the + * same x, y, and z components as the 3D vector and + * a default w component (1.0 for position, 0.0 for direction). + * Returns NULL if the input vector is NULL or allocation fails. + */ Vec4* Vec3ToVec4(Vec3* v); #endif // VECTOR_H \ No newline at end of file