btGeneric6DOFConstraint's getAngle strange behavior

Herleson
Posts: 9
Joined: Wed Mar 28, 2012 10:55 pm

btGeneric6DOFConstraint's getAngle strange behavior

Post by Herleson »

Hello Everyone,

I'm trying to get the angle of each axis of a 6DOF constraint, so I can pass to my program. The code is below:

Code: Select all

btTypedConstraint* articulacao = mundoDinamico -> getConstraint(i);
btUniversalConstraint* articulacaoUni = (btUniversalConstraint *)(btGeneric6DofConstraint *) articulacao;

float anguloX, anguloY, anguloZ;

anguloX = articulacaoUni -> getAngle(1);
anguloY = articulacaoUni -> getAngle(0);
anguloZ = articulacaoUni -> getAngle(2);
Imagine a example where I have two links with a 6DOF joint, and the second link makes an angle of 45 degrees with the first link.
Well, the strange behavior is that the getAngle returns zero after I start the simulation. Also, the getAngle method is not documented, so I want to understand exactly what is the range of values for the parameter of this method, and why its using YXZ. This method returns the absolute value, or the difference between each integration?

Thanks for the help!