Unrotate object

i have a node which has a rotation. this node has a child, and this childs needs to have a constant lookAt-vector (world, not local).

how to achieve that? i tried:

      final float[] l_angles = getAngles();
        for (int i = l_angles.length; --i >= 0;) {
          l_angles[i] *= -1.0F;
        }
        m_simplifiedBounds.getLocalRotation().fromAngles(l_angles);



this works for left/right-rotations, but up/down cause my child to tilt sidewards (from the cameras viewpoint which is at the parent nodes center)
getangles simply calls:

public float[] getAngles() {
    getLocalRotation().toAngles(ms_angles);
    //noinspection ReturnOfCollectionOrArrayField
    return ms_angles;
  }



Get the rotation as a matrix, and invert that matrix and apply. Or, if it's a 3x3 matrix without scale, just transpose it, as the transpose is the same as the inverse in that case. Euler angles are not their own negative inverse, because to do that, you'd have to apply the angles in reverse order when going backwards.

easier: Quaternion.inverseLocal()

(lol)