Skip to content

Commit

Permalink
Fixed implementation of normalize for afVector and * operator for afM…
Browse files Browse the repository at this point in the history
…atrix3d
  • Loading branch information
adnanmunawar committed Feb 3, 2021
1 parent 91e1f4e commit aa85aae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ambf_math/afMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class afVector3d{

void normalize(){
double magInv = 1.0 / getNorm();
(*this)(0) += magInv;
(*this)(0) *= magInv;
(*this)(1) *= magInv;
(*this)(2) *= magInv;
}
Expand Down Expand Up @@ -233,9 +233,9 @@ class afMatrix3d{
afVector3d operator *(afVector3d vIn){
afVector3d vOut;

vOut(0) = m_data[0][0] * vIn(0) + m_data[0][1] * vIn(0) + m_data[0][2] * vOut(0);
vOut(1) = m_data[1][0] * vIn(1) + m_data[1][1] * vIn(1) + m_data[1][2] * vOut(1);
vOut(2) = m_data[2][0] * vIn(2) + m_data[2][1] * vIn(2) + m_data[2][2] * vOut(2);
vOut(0) = m_data[0][0] * vIn(0) + m_data[0][1] * vIn(1) + m_data[0][2] * vIn(2);
vOut(1) = m_data[1][0] * vIn(0) + m_data[1][1] * vIn(1) + m_data[1][2] * vIn(2);
vOut(2) = m_data[2][0] * vIn(0) + m_data[2][1] * vIn(1) + m_data[2][2] * vIn(2);

return vOut;
}
Expand Down

0 comments on commit aa85aae

Please sign in to comment.