vecmat3 addouter()

This commit is contained in:
2024-01-18 13:54:21 +01:00
parent ae83e43b4e
commit e75248eb23
2 changed files with 18 additions and 0 deletions

View File

@@ -69,6 +69,23 @@ m[2][2]=q[2]*rhs.q[2];
return m;
}
template<typename T>
void Vec3<T>::addouter(Mat3<T> &m, const Vec3<T> &rhs, const T weight) const
{
m[0][0]+=weight* q[0]*rhs.q[0];
m[0][1]+=weight* q[0]*rhs.q[1];
m[0][2]+=weight* q[0]*rhs.q[2];
m[1][0]+=weight* q[1]*rhs.q[0];
m[1][1]+=weight* q[1]*rhs.q[1];
m[1][2]+=weight* q[1]*rhs.q[2];
m[2][0]+=weight* q[2]*rhs.q[0];
m[2][1]+=weight* q[2]*rhs.q[1];
m[2][2]+=weight* q[2]*rhs.q[2];
}
template<typename T>
void Vec3<T>::inertia(Mat3<T> &m, const T weight) const