fix slow full btMatrixX operator* (was not used)

This commit is contained in:
Erwin Coumans
2019-10-08 19:31:58 -07:00
parent 2caf4505f0
commit 3a4159c793

View File

@@ -338,24 +338,23 @@ struct btMatrixX
btMatrixX res(rows(), other.cols()); btMatrixX res(rows(), other.cols());
res.setZero(); res.setZero();
// BT_PROFILE("btMatrixX mul"); // BT_PROFILE("btMatrixX mul");
for (int j = 0; j < res.cols(); ++j) for (int i = 0; i < rows(); ++i)
{ {
{ {
for (int i = 0; i < res.rows(); ++i) for (int j = 0; j < other.cols(); ++j)
{ {
T dotProd = 0; T dotProd = 0;
// T dotProd2=0; {
//int waste=0,waste2=0; {
int r = rows();
int c = cols();
for (int k = 0; k < cols(); k++)
{ {
// bool useOtherCol = true; T w = (*this)(i, k);
if (other(k, j) != 0.f)
{ {
for (int v = 0; v < rows(); v++) dotProd += w * other(k, j);
{
T w = (*this)(i, v);
if (other(v, j) != 0.f)
{
dotProd += w * other(v, j);
} }
} }
} }