Skip to content

Commit 68fba2b

Browse files
authored
Merge pull request #156 from KaoCC/matrix_fix
fix a bug in matrix multiplication
2 parents 6075499 + b83d307 commit 68fba2b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

RadeonRays/include/math/matrix.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,13 @@ namespace RadeonRays
179179
return res*=c;
180180
}
181181

182-
inline float3 operator * (matrix const& m, float3 const& v)
182+
inline float4 operator * (matrix const& m, float4 const& v)
183183
{
184-
float3 res;
184+
float4 res {0, 0, 0, 0};
185185

186-
for (int i=0;i<3;++i)
187-
{
188-
res[i] = 0.f;
189-
for (int j=0;j<3;++j)
186+
for (int i = 0; i < 4; ++i) {
187+
//res[i] = 0.f;
188+
for (int j = 0; j < 4; ++j)
190189
res[i] += m.m[i][j] * v[j];
191190
}
192191

0 commit comments

Comments
 (0)