| 142 | } |
| 143 | |
| 144 | VRKneeboard::RenderParameters VRKneeboard::GetRenderParameters( |
| 145 | const SHM::Snapshot& snapshot, |
| 146 | const SHM::LayerConfig& layer, |
| 147 | const Pose& hmdPose) { |
| 148 | auto config = snapshot.GetConfig(); |
| 149 | const auto kneeboardPose = this->GetKneeboardPose(config.mVR, layer, hmdPose); |
| 150 | const auto isLookingAtKneeboard |
| 151 | = this->IsLookingAtKneeboard(config, layer, hmdPose, kneeboardPose); |
| 152 | |
| 153 | auto cacheKey = snapshot.GetRenderCacheKey(); |
| 154 | if (isLookingAtKneeboard) { |
| 155 | cacheKey |= 1ui64; |
| 156 | } else { |
| 157 | cacheKey &= ~(1ui64); |
| 158 | } |
| 159 | |
| 160 | return { |
| 161 | .mKneeboardPose = kneeboardPose, |
| 162 | .mKneeboardSize |
| 163 | = this->GetKneeboardSize(config, layer, isLookingAtKneeboard), |
| 164 | .mCacheKey = cacheKey, |
| 165 | .mKneeboardOpacity = isLookingAtKneeboard ? layer.mVR.mOpacity.mGaze |
| 166 | : layer.mVR.mOpacity.mNormal, |
| 167 | .mIsLookingAtKneeboard = isLookingAtKneeboard, |
| 168 | }; |
| 169 | } |
| 170 | |
| 171 | bool VRKneeboard::IsLookingAtKneeboard( |
| 172 | const SHM::Config& config, |
nothing calls this directly
no test coverage detected