add functions to scale vectors

Fri, 30 May 2025 19:32:13 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 30 May 2025 19:32:13 +0200
changeset 129
84e89b36c792
parent 128
c36170c76a2b
child 130
c3fce2a543ee

add functions to scale vectors

src/ascension/datatypes.h file | annotate | diff | comparison | revisions
--- a/src/ascension/datatypes.h	Thu May 29 11:34:34 2025 +0200
+++ b/src/ascension/datatypes.h	Fri May 30 19:32:13 2025 +0200
@@ -166,6 +166,18 @@
 }
 
 // --------------------------------------------------------------------------
+//   Vector Functions
+// --------------------------------------------------------------------------
+
+static inline asc_vec2f asc_vec2f_scale(asc_vec2f v, float s) {
+    return asc_vec2f_new(v.x*s, v.y*s);
+}
+
+static inline asc_vec3f asc_vec3f_scale(asc_vec3f v, float s) {
+    return asc_vec3f_new(v.x*s, v.y*s, v.z*s);
+}
+
+// --------------------------------------------------------------------------
 //   Matrix Functions
 // --------------------------------------------------------------------------
 

mercurial