EnVector3<float> vec(0.0f, 0.0f, 1.0f);std::cout << "Test1 before: " << vec.to_string() << std::endl;EnQuaternion<float> quat(std::cos(M_PI_2 / 2.0f), std::sin(M_PI_2 / 2.0f), 0.0f, 0.0f);std::cout << "Test1 after: " << quat.rotate(vec).to_string() << std::endl;vec = EnVector3<float>(1.0f, 0.0f, 0.0f);std::cout << "Test2 before: " << vec.to_string() << std::endl;quat = EnQuaternion<float>(std::cos(M_PI_2 / 2.0f), 0.0f, 0.0f, std::sin(M_PI_2 / 2.0f));std::cout << "Test2 after: " << quat.rotate(vec).to_string() << std::endl;vec = EnVector3<float>(0.0f, 1.0f, 0.0f);std::cout << "Test3 before: " << vec.to_string() << std::endl;quat = EnQuaternion<float>(std::cos(M_PI_2 / 2.0f), 0.0f, 0.0f, std::sin(M_PI_2 / 2.0f));std::cout << "Test3 after: " << quat.rotate(vec).to_string() << std::endl;
Gives this:
Test1 before: (0, 0, 1)Test1 after: (0, -1, 0)Test2 before: (1, 0, 0)Test2 after: (0, 1, 0)Test3 before: (0, 1, 0)Test3 after: (-1, 0, 0)
Those look like the proper rotations when I work it out in my head. Just furthering my confusion now.