MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetSubdivisionCount

Function GetSubdivisionCount

trinity/Eve/UI/EveTacticalOverlay.cpp:160–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160static inline float GetSubdivisionCount( float pixelSize, float low, float mid, float high, const EveUpdateContext& updateContext )
161{
162 if( pixelSize < updateContext.GetVisibilityThreshold() )
163 {
164 return 0;
165 }
166 float lowCount;
167 float highCount;
168 float lowStep;
169 float highStep;
170
171 if( pixelSize <= updateContext.GetLowDetailThreshold() )
172 {
173 lowCount = 1;
174 highCount = low;
175 lowStep = updateContext.GetVisibilityThreshold();
176 highStep = updateContext.GetLowDetailThreshold();
177 }
178 else if( pixelSize <= updateContext.GetMediumDetailThreshold() )
179 {
180 lowCount = low;
181 highCount = mid;
182 lowStep = updateContext.GetLowDetailThreshold();
183 highStep = updateContext.GetMediumDetailThreshold();
184 }
185 else
186 {
187 lowCount = mid;
188 highCount = high;
189 lowStep = updateContext.GetMediumDetailThreshold();
190 highStep = updateContext.GetHighDetailThreshold();
191 }
192
193 float linstep = TriLinearize( lowStep, highStep, pixelSize );
194 return floor( Lerp( lowCount, highCount, linstep ) );
195}
196
197// --------------------------------------------------------------------------------------
198// Description:

Callers 1

UpdateVisibilityMethod · 0.85

Calls 6

TriLinearizeFunction · 0.85
LerpFunction · 0.85
GetLowDetailThresholdMethod · 0.80

Tested by

no test coverage detected