stop appending repeat keys to the input buffer
[retroray] / libs / cgmath / cgmvec3.inl
index e03cc32..8191c63 100644 (file)
@@ -1,5 +1,5 @@
 /* gph-cmath - C graphics math library
- * Copyright (C) 2018 John Tsiombikas <nuclear@member.fsf.org>
+ * Copyright (C) 2018-2023 John Tsiombikas <nuclear@member.fsf.org>
  *
  * 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;