summaryrefslogtreecommitdiff
path: root/src/math/vec4.c
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-12-15 00:39:18 +0800
committerchai <chaifix@163.com>2019-12-15 00:39:18 +0800
commit749bbc6a54e50c297ab49d9e515a3679651d1461 (patch)
tree097bbe044332e816aa481db1a4e325b8d3f63b0d /src/math/vec4.c
parent3f44877edfe4c301b258d522bcb4e8d9b6e92382 (diff)
*misc
Diffstat (limited to 'src/math/vec4.c')
-rw-r--r--src/math/vec4.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/math/vec4.c b/src/math/vec4.c
index b79adca..202aabd 100644
--- a/src/math/vec4.c
+++ b/src/math/vec4.c
@@ -6,6 +6,8 @@
Vec4 vec4zero = { 0, 0, 0,0 };
+static Vec4 sharedmat4;
+
void vec4_dividew(Vec4* v, Vec3* out) {
ssr_assert(out && v);
float w = 1.f / v->w;
@@ -28,4 +30,11 @@ void vec4_lerp(Vec4* a, Vec4* b, float t, Vec4* out) {
out->y = lerp(a->y, b->y, t);
out->z = lerp(a->z, b->z, t);
out->w = lerp(a->w, b->w, t);
-} \ No newline at end of file
+}
+
+void vec4_scale(Vec4* v, float t, Vec4* out) {
+ out->x = v->x * t;
+ out->y = v->y * t;
+ out->z = v->z * t;
+ out->w = v->w * t;
+}