nl_tokens: Computes current device orientation quaternion from device orientation API Tait - Bryan angles .
pl_tokens: function computeQuaternion ( alpha , beta , gamma ) { // Convert Tait-Bryan angles to quaternion var quaternion = taitBryanToQuaternion ( alpha , beta , gamma ) ; // Apply world transform quaternion = quaternion . multiply ( new Quaternion ( Math . sqrt ( 0.5 ) , - Math . sqrt ( 0.5 ) , 0 , 0 ) ) ; // Apply screen transform var angle = window . orientation ? - window . orientation * Math . PI / 180 / 2 : 0 ; return quaternion . multiply ( new Quaternion ( Math . <mask> ( angle ) , 0 , - Math . sin ( angle ) , 0 ) ) ; }