// This class tries to mimic the tracking done in SteamVR's SteamVR_TrackedObject, which updates
        // poses in response to the event "new_poses". This event is sent in
        // SteamVR_UpdatePoses.OnPreCull(). But OnPreCull() is only available to components attached to
        // the camera, which this class is not. So this public OnPreCull() is called exactly once
        // from OculusPreCullHook.OnPreCull() which is attached to the camera.
        public void OnPreCull()
        {
            // There are checks for each controller instead of a single check for
            // both so the player will know if either controller is having problems.
            foreach (ControllerInfo baseInfo in InputManager.Controllers)
            {
                OculusControllerInfo info = baseInfo as OculusControllerInfo;
                if (info == null)
                {
                    continue; // should never happen
                }

                info.UpdatePosesAndValidity();
            }

            if (NewPosesApplied != null)
            {
                NewPosesApplied();
            }
        }