MCPcopy Create free account
hub / github.com/melonjs/melonJS / isIdentity

Method isIdentity

packages/melonjs/src/math/matrix3d.ts:778–800  ·  view source on GitHub ↗

* Check if the matrix is an identity matrix. * @returns true if the matrix is an identity matrix

()

Source from the content-addressed store, hash-verified

776 * @returns true if the matrix is an identity matrix
777 */
778 isIdentity() {
779 const a = this.val;
780
781 // check translation first (most commonly non-zero), then diagonal, then rest
782 return (
783 a[12] === 0 &&
784 a[13] === 0 &&
785 a[0] === 1 &&
786 a[5] === 1 &&
787 a[10] === 1 &&
788 a[15] === 1 &&
789 a[1] === 0 &&
790 a[2] === 0 &&
791 a[3] === 0 &&
792 a[4] === 0 &&
793 a[6] === 0 &&
794 a[7] === 0 &&
795 a[8] === 0 &&
796 a[9] === 0 &&
797 a[11] === 0 &&
798 a[14] === 0
799 );
800 }
801
802 /**
803 * return true if the two matrices are identical

Callers 15

updateBoundsMethod · 0.45
updateMethod · 0.45
localToWorldMethod · 0.45
worldToLocalMethod · 0.45
drawMethod · 0.45
addFrameMethod · 0.45
updateBoundsMethod · 0.45
preDrawMethod · 0.45
addQuadMethod · 0.45
blitTextureMethod · 0.45
blitTextureMethod · 0.45
addQuadMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected