A method, comprising: generating and displaying a virtual environment on a display of a head mounted electronic device operating in an ambient environment; tracking movement of a handheld electronic device in the ambient environment, including: generating, by a depth camera of the head mounted electronic device, infrared signals; collecting, by the head mounted electronic device, position data of the handheld electronic device relative to the head mounted electronic device based on responses to the infrared signals generated by the depth camera of the head mounted electronic device; collecting image data featuring the head mounted electronic device that is captured by a camera of the handheld electronic device; receiving, by the head mounted electronic device, acceleration data of the handheld electronic device collected by an accelerometer of the handheld electronic device and orientation data of the handheld electronic device collected by a gyroscope of the handheld electronic device; and processing, by the head mounted electronic device, the position data, the acceleration data and the orientation data to determine a six-degree-of-freedom - 6DOF - position of the handheld electronic device, including using the image data to reduce a search space for locating the handheld electronic device relative to the head mounted electronic device; and translating the tracked movement of the handheld electronic device into a corresponding action in the virtual environment displayed by the head mounted electronic device. generating and displaying a virtual environment on a display of a head mounted electronic device operating in an ambient environment; tracking movement of a handheld electronic device in the ambient environment, including: generating, by a depth camera of the head mounted electronic device, infrared signals; collecting, by the head mounted electronic device, position data of the handheld electronic device relative to the head mounted electronic device based on responses to the infrared signals generated by the depth camera of the head mounted electronic device; collecting image data featuring the head mounted electronic device that is captured by a camera of the handheld electronic device; receiving, by the head mounted electronic device, acceleration data of the handheld electronic device collected by an accelerometer of the handheld electronic device and orientation data of the handheld electronic device collected by a gyroscope of the handheld electronic device; and processing, by the head mounted electronic device, the position data, the acceleration data and the orientation data to determine a six-degree-of-freedom - 6DOF - position of the handheld electronic device, including using the image data to reduce a search space for locating the handheld electronic device relative to the head mounted electronic device; and generating, by a depth camera of the head mounted electronic device, infrared signals; collecting, by the head mounted electronic device, position data of the handheld electronic device relative to the head mounted electronic device based on responses to the infrared signals generated by the depth camera of the head mounted electronic device; collecting image data featuring the head mounted electronic device that is captured by a camera of the handheld electronic device; receiving, by the head mounted electronic device, acceleration data of the handheld electronic device collected by an accelerometer of the handheld electronic device and orientation data of the handheld electronic device collected by a gyroscope of the handheld electronic device; and processing, by the head mounted electronic device, the position data, the acceleration data and the orientation data to determine a six-degree-of-freedom - 6DOF - position of the handheld electronic device, including using the image data to reduce a search space for locating the handheld electronic device relative to the head mounted electronic device; and translating the tracked movement of the handheld electronic device into a corresponding action in the virtual environment displayed by the head mounted electronic device.