X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=gph-cmath;a=blobdiff_plain;f=src%2Fcgmvec3.inl;h=05bb895642ab94dfc2d4fabd8ca9c3c252443d5d;hp=1320c0869e323f140149f7e1c27b6ca6cee84ee2;hb=HEAD;hpb=cc26f59c90c0935eef7d7fdcf8ac327e23d14ebc diff --git a/src/cgmvec3.inl b/src/cgmvec3.inl index 1320c08..05bb895 100644 --- a/src/cgmvec3.inl +++ b/src/cgmvec3.inl @@ -1,3 +1,11 @@ + /* +Copyright (C) 2018 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. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ static inline void cgm_vcons(cgm_vec3 *v, float x, float y, float z) { v->x = x; @@ -151,17 +159,24 @@ static inline void cgm_vrotate_quat(cgm_vec3 *v, const cgm_quat *q) cgm_vcons(v, vq.x, vq.y, vq.z); } -static inline void cgm_vrotate_axis(cgm_vec3 *v, const cgm_vec3 *axis, float angle) +static inline void cgm_vrotate_axis(cgm_vec3 *v, int axis, float angle) { float m[16]; cgm_mrotation_axis(m, axis, angle); cgm_vmul_m3v3(v, m); } -static inline void cgm_vrotate_euler(cgm_vec3 *v, const cgm_vec3 *euler, enum cgm_euler_mode mode) +static inline void cgm_vrotate(cgm_vec3 *v, float angle, float x, float y, float z) { float m[16]; - cgm_mrotation_euler(m, euler, mode); + cgm_mrotation(m, angle, x, y, z); + cgm_vmul_m3v3(v, m); +} + +static inline void cgm_vrotate_euler(cgm_vec3 *v, float a, float b, float c, enum cgm_euler_mode mode) +{ + float m[16]; + cgm_mrotation_euler(m, a, b, c, mode); cgm_vmul_m3v3(v, m); }