MCPcopy Create free account
hub / github.com/assimp/assimp / AllIdentical

Function AllIdentical

code/PostProcessing/FindInvalidDataProcess.cpp:242–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240// ------------------------------------------------------------------------------------------------
241template <typename T>
242inline bool AllIdentical(T *in, unsigned int num, ai_real epsilon) {
243 if (num <= 1) {
244 return true;
245 }
246
247 if (fabs(epsilon) > 0.f) {
248 for (unsigned int i = 0; i < num - 1; ++i) {
249 if (!EpsilonCompare(in[i], in[i + 1], epsilon)) {
250 return false;
251 }
252 }
253 } else {
254 for (unsigned int i = 0; i < num - 1; ++i) {
255 if (in[i] != in[i + 1]) {
256 return false;
257 }
258 }
259 }
260 return true;
261}
262
263// ------------------------------------------------------------------------------------------------
264// Search an animation for invalid content

Callers 1

Calls 1

EpsilonCompareFunction · 0.85

Tested by

no test coverage detected