import * as THREE from 'three' ; const _matA = new THREE . Matrix4 ( ) ; param target export function mat4InvertCompat < T extends THREE . Matrix4 > ( target ) { if ( ( target as any ) . invert ) { target . invert ( ) ; } else { ( target as any ) . getInverse ( _matA . copy ( target ) ) ; } return target ; }