X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=libs%2Fcgmath%2Fcgmvec3.inl;h=8191c63dc1c00b4c4a5d15cb65f04b7ea96da54e;hb=HEAD;hp=e03cc3280f7d0a56fe1323e6c22dd0c1482aac9d;hpb=7fccf8b3543c8cdb993252f0cf9a6b9ed826408e;p=retroray diff --git a/libs/cgmath/cgmvec3.inl b/libs/cgmath/cgmvec3.inl index e03cc32..8191c63 100644 --- a/libs/cgmath/cgmvec3.inl +++ b/libs/cgmath/cgmvec3.inl @@ -1,5 +1,5 @@ /* gph-cmath - C graphics math library - * Copyright (C) 2018 John Tsiombikas + * Copyright (C) 2018-2023 John Tsiombikas * * This program is free software. Feel free to use, modify, and/or redistribute * it under the terms of the MIT/X11 license. See LICENSE for details. @@ -22,6 +22,13 @@ static CGM_INLINE cgm_vec3 cgm_vvec(float x, float y, float z) return v; } +static CGM_INLINE void cgm_vneg(cgm_vec3 *v) +{ + v->x = -v->x; + v->y = -v->y; + v->z = -v->z; +} + static CGM_INLINE void cgm_vadd(cgm_vec3 *a, const cgm_vec3 *b) { a->x += b->x;