mirror of
https://github.com/recp/cglm.git
synced 2026-01-02 13:49:59 +00:00
fix glms_vec2_rotate() by using a dest vec2s instead of taking an axis vector (#122)
This commit is contained in:
@@ -455,18 +455,18 @@ glms_vec2_normalize(vec2s v) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief rotate vec2 around axis by angle using Rodrigues' rotation formula
|
||||
* @brief rotate vec2 by angle using Rodrigues' rotation formula
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @param[in] axis axis vector (must be unit vector)
|
||||
* @param[in] angle angle by radians
|
||||
* @returns rotated vector
|
||||
*/
|
||||
CGLM_INLINE
|
||||
vec2s
|
||||
glms_vec2_rotate(vec2s v, float angle, vec2s axis) {
|
||||
glm_vec2_rotate(v.raw, angle, axis.raw);
|
||||
return v;
|
||||
glms_vec2_rotate(vec2s v, float angle) {
|
||||
vec2s r;
|
||||
glm_vec2_rotate(v.raw, angle, r.raw);
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user