MCPcopy Create free account
hub / github.com/esengine/esengine / isIdentity

Function isIdentity

scripts/test-fbxloader-bindpose.mjs:47–53  ·  view source on GitHub ↗
(m, tolerance = 0.01)

Source from the content-addressed store, hash-verified

45}
46
47function isIdentity(m, tolerance = 0.01) {
48 const id = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
49 for (let i = 0; i < 16; i++) {
50 if (Math.abs(m[i] - id[i]) > tolerance) return false;
51 }
52 return true;
53}
54
55function maxDiffFromIdentity(m) {
56 const id = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected