View Single Post
Grzyboo
Junior Member
Join Date: Apr 2011
Old 04-14-2019 , 08:02   Re: [INC] Vector helpers
Reply With Quote #4

Code:
stock void VectorRotate(float vec[3], const float matrix[3][3])
{
	vec[0] = GetVectorDotProduct(vec, matrix[0]);
	vec[1] = GetVectorDotProduct(vec, matrix[1]);
	vec[2] = GetVectorDotProduct(vec, matrix[2]);
}
This is fundamentally wrong. You are using already rotated vector values when rotating in next axes.
The rotation matrix values don't seem to be correct either.

Basically, you shouldn't use this .inc file, unless you want to face bugs that are really hard to debug.

Last edited by Grzyboo; 04-14-2019 at 08:07.
Grzyboo is offline