Oculus ANE is a native extension that allows the use of Oculus Rift, a next-generation virtual reality headset designed for immersive gaming. The extension currently works on Mac OSX and Windows, with built-in support for Away3D.

Using the extension it’s possible to connect to the Oculus device and read its orientation information. The camera orientation is provided as a quaternion, which can be applied to the game camera to adjust it accordingly.

Sample

// Connect to the Oculus
var _oculus:OculusANE = new OculusANE();

private function enterFrame(event:Event) : void {

    var quatVec:Vector. = _oculus.getCameraQuaternion();
    var quat:Quaternion = new Quaternion(-quatVec[0], -quatVec[1], quatVec[2], quatVec[3]); 
    _camera.transform = quat.toMatrix3D(_core.transform);
    _view.render();
}

// In the end...
_oculus.dispose();
Air Native Extension, Mac, Windows. URL.