MCPcopy Create free account
hub / github.com/OpenKneeboard/OpenKneeboard / GetRenderParameters

Method GetRenderParameters

src/lib/VRKneeboard.cpp:144–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144VRKneeboard::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
171bool VRKneeboard::IsLookingAtKneeboard(
172 const SHM::Config& config,

Callers

nothing calls this directly

Calls 5

GetKneeboardPoseMethod · 0.95
IsLookingAtKneeboardMethod · 0.95
GetKneeboardSizeMethod · 0.95
GetConfigMethod · 0.80
GetRenderCacheKeyMethod · 0.80

Tested by

no test coverage detected