Jump to content

Using rotation() function


photo

Recommended Posts

Posted

I use next code:

float angleVert = actor.getThetaAngle();
float angleHorz = actor.getPhiAngle();

quat rot = quat(0, 1, 0, angleVert) * quat(0, 0, 1, angleHorz);

mat4 a = rotation(rot);

and have next error:

10:38:24 source/scripts/game/objects/Player.h:272: Interpreter::parse_expression(): error before '(' in "rotation(rot)" expression

In manual says:

rotation

Variable rotation(variable v)

Description

Returns rotation matrix of the input matrix, supports quat and mat4 arguments.

Arguments

variable v - Argument, can be of quat or mat4 type.

Return value

Rotation matrix.

What I'm doing wrong? Thanks

Posted

This code works fine:

quat rot = quat(0, 1, 0, 0) * quat(0, 0, 1, 0);
mat4 a = rotation(rot);
printf("%s\n",string(a));

 

This code produces following error message:

 

"test.cpp:2392: Interpreter::parse_expression(): error before '(' in "rotation(rot)" expression"

 

int rotation = 0;
quat rot = quat(0, 1, 0, 0) * quat(0, 0, 1, 0);
mat4 a = rotation(rot);
printf("%s\n",string(a));

Posted

I see, I find variable rotation in my base class, thanks.

×
×
  • Create New...