23 Nov 2015, 19:33
(23 Nov 2015, 18:41)Flávio Rebouças Santos Wrote: I am trying to use the signature: SetRotation(const Vector & axis, Real angle)
Could you help-me with it?
void App::ColorCubeLogic::OnProcessTick(const Logic::IState* state)
{
static Double angleX = 0;
static Double spinSpeed = 0.007;
angleX += spinSpeed;
angleX = Math::Fmod(angleX, Math::TWO_PI);
Graph::Vector axis(Vector::ZERO_DIRECTION);
axis.x = 1;
axis.y = 1;
axis.NormalizeAxisSelf();
mCubeTransform->SetRotation(axis, angleX);
The vector axis defines the rotation axis (45° between x and y).
The vector needs to have unit length.
This can be accomplished with axis.NormalizeAxisSelf();