![]() Registered Member ![]()
|
Hello,
I have two floating point vectors (Vector4f), but I would like to get the dot product of the two of them without making another instance of the two as Vector3f. I was able to make a hack to do it, but I imagine there is a much more elegant solution. Thank You ![]()
|
![]() Registered Member ![]()
|
You can get the first y entries of a vector by writing vector.head(y); if y is known at compile-time then vector.head<y>() is slightly faster. So you can write the computation in your program alternatively as
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]