Miloslav Číž пре 4 година
родитељ
комит
6519c9762f
1 измењених фајлова са 14 додато и 0 уклоњено
  1. 14 0
      tinyphysicsengine.h

+ 14 - 0
tinyphysicsengine.h

@@ -235,6 +235,13 @@ static inline TPE_Unit TPE_nonZero(TPE_Unit x)
   return x + (x == 0);
 }
 
+void TPE_vec3Add(const TPE_Vec4 a, const TPE_Vec4 b, TPE_Vec4 result)
+{
+  result.x = a.x + b.x;
+  result.y = a.y + b.y;
+  result.z = a.z + b.z;
+}
+
 void TPE_vec4Add(const TPE_Vec4 a, const TPE_Vec4 b, TPE_Vec4 result)
 {
   result.x = a.x + b.x;
@@ -243,6 +250,13 @@ void TPE_vec4Add(const TPE_Vec4 a, const TPE_Vec4 b, TPE_Vec4 result)
   result.w = a.w + b.w;
 }
 
+void TPE_vec3Substract(const TPE_Vec4 a, const TPE_Vec4 b, TPE_Vec4 result)
+{
+  result.x = a.x - b.x;
+  result.y = a.y - b.y;
+  result.z = a.z - b.z;
+}
+
 void TPE_vec4Substract(const TPE_Vec4 a, const TPE_Vec4 b, TPE_Vec4 result)
 {
   result.x = a.x - b.x;