Branimir Karadžić 8 年之前
父節點
當前提交
a78e615c7d
共有 2 個文件被更改,包括 22 次插入0 次删除
  1. 16 0
      include/bx/inline/math.inl
  2. 6 0
      include/bx/math.h

+ 16 - 0
include/bx/inline/math.inl

@@ -718,6 +718,22 @@ namespace bx
 		_result[2] = zz*invW;
 		_result[2] = zz*invW;
 	}
 	}
 
 
+	inline void vec4Mul(float* _result, const float* _a, const float* _b)
+	{
+		_result[0] = _a[0] * _b[0];
+		_result[1] = _a[1] * _b[1];
+		_result[2] = _a[2] * _b[2];
+		_result[3] = _a[3] * _b[3];
+	}
+
+	inline void vec4Mul(float* _result, const float* _a, float _b)
+	{
+		_result[0] = _a[0] * _b;
+		_result[1] = _a[1] * _b;
+		_result[2] = _a[2] * _b;
+		_result[3] = _a[3] * _b;
+	}
+
 	inline void vec4MulMtx(float* _result, const float* _vec, const float* _mat)
 	inline void vec4MulMtx(float* _result, const float* _vec, const float* _mat)
 	{
 	{
 		_result[0] = _vec[0] * _mat[ 0] + _vec[1] * _mat[4] + _vec[2] * _mat[ 8] + _vec[3] * _mat[12];
 		_result[0] = _vec[0] * _mat[ 0] + _vec[1] * _mat[4] + _vec[2] * _mat[ 8] + _vec[3] * _mat[12];

+ 6 - 0
include/bx/math.h

@@ -437,6 +437,12 @@ namespace bx
 	///
 	///
 	void vec3MulMtxH(float* _result, const float* _vec, const float* _mat);
 	void vec3MulMtxH(float* _result, const float* _vec, const float* _mat);
 
 
+	///
+	void vec4Mul(float* _result, const float* _a, const float* _b);
+
+	///
+	void vec4Mul(float* _result, const float* _a, float _b);
+
 	///
 	///
 	void vec4MulMtx(float* _result, const float* _vec, const float* _mat);
 	void vec4MulMtx(float* _result, const float* _vec, const float* _mat);