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

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

@@ -698,6 +698,13 @@ namespace bx
 		_result[2] = _vec[0] * _mat[ 2] + _vec[1] * _mat[6] + _vec[2] * _mat[10] + _mat[14];
 	}
 
+	inline void vec3MulMtxXyz0(float* _result, const float* _vec, const float* _mat)
+	{
+		_result[0] = _vec[0] * _mat[ 0] + _vec[1] * _mat[4] + _vec[2] * _mat[ 8];
+		_result[1] = _vec[0] * _mat[ 1] + _vec[1] * _mat[5] + _vec[2] * _mat[ 9];
+		_result[2] = _vec[0] * _mat[ 2] + _vec[1] * _mat[6] + _vec[2] * _mat[10];
+	}
+
 	inline void vec3MulMtxH(float* _result, const float* _vec, const float* _mat)
 	{
 		float xx = _vec[0] * _mat[ 0] + _vec[1] * _mat[4] + _vec[2] * _mat[ 8] + _mat[12];

+ 3 - 0
include/bx/math.h

@@ -442,6 +442,9 @@ namespace bx
 	///
 	void vec3MulMtx(float* _result, const float* _vec, const float* _mat);
 
+	///
+	void vec3MulMtxXyz0(float* _result, const float* _vec, const float* _mat);
+
 	///
 	void vec3MulMtxH(float* _result, const float* _vec, const float* _mat);