Add set_null_vector() function
Set the vector to a null vector.
This commit is contained in:
parent
20d013c401
commit
366da0177c
19
src/vector.c
19
src/vector.c
@ -165,3 +165,22 @@ bool copy_vector(vector *a, vector *b)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the vector to a null vector.
|
||||||
|
*
|
||||||
|
* @param a vector [out]
|
||||||
|
* @return true/false for success/failure
|
||||||
|
*/
|
||||||
|
bool set_null_vector(vector *a)
|
||||||
|
{
|
||||||
|
if (!a)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
a->x = 0;
|
||||||
|
a->y = 0;
|
||||||
|
a->z = 0;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -48,6 +48,7 @@ bool add_vectors(vector *a, vector *b, vector *c);
|
|||||||
bool sub_vectors(vector *a, vector *b, vector *c);
|
bool sub_vectors(vector *a, vector *b, vector *c);
|
||||||
bool normalize_vector(vector *a, vector *b);
|
bool normalize_vector(vector *a, vector *b);
|
||||||
bool copy_vector(vector *a, vector *b);
|
bool copy_vector(vector *a, vector *b);
|
||||||
|
bool set_null_vector(vector *a);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _DROW_ENGINE_VEC_MATH_H */
|
#endif /* _DROW_ENGINE_VEC_MATH_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user