# HG changeset patch # User Mike Becker # Date 1748626333 -7200 # Node ID 84e89b36c792c0a4c8f7e56cfb25f9c18946e7df # Parent c36170c76a2b5cdf97c786d92078a9a7924f20f1 add functions to scale vectors diff -r c36170c76a2b -r 84e89b36c792 src/ascension/datatypes.h --- 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 // --------------------------------------------------------------------------