# Quick vector question - confusion with a line from Newton's character controller

## Recommended Posts

Hi all, I'm implementing my own character controller using Newton Archimedia, and I'm reading through other character controllers for some research. These lines in Newton's character controller has me stumped, it's from a section that calculates turn torque from a target heading:
//calculate the turn angle and omega
turnAngle = min (max ((bodyMatrix.m_front * heading).m_y, -1.0f), 1.0f);


The dVector's constructor takes X, Y, Z, and W. In the first line, Y is initialised to 0.0f. On the second line, the vector is multiplied by the matrix's Forward vector, and the resulting Y value is taken for the TurnAngle. But Y will always be 0... no? The character controller itself works fine (I've compiled using this code), but this has confused me to no end. I'd be very grateful if someone could clear this up, as I thought my maths was actually progressing well until now :P

##### Share on other sites
alvaro    21246
I am guessing *' means the cross product. In that case, and if bodyMatrix.m_front is also in the XZ plane, the code is measuring the sine of the angle between bodyMatrix.m_front and heading.

##### Share on other sites
Quote:
 Original post by alvaroI am guessing *' means the cross product. In that case, and if bodyMatrix.m_front is also in the XZ plane, the code is measuring the sine of the angle between bodyMatrix.m_front and heading.

Ahh of course! I wish people wouldn't use * and % for Cross and Dot...