download
raw
452 Bytes
import { Matrix4 } from 'three'
/**
* Helper for smoothing out the `m.getInverse(x)` --> `m.copy(x).invert()` conversion
* that happened in ThreeJS r123.
* @param {Matrix4} srcMatrix
* @param {Matrix4} [tgtMatrix]
*/
export function invertMatrix4(srcMatrix, tgtMatrix = new Matrix4()) {
if (typeof tgtMatrix.invert === 'function') {
tgtMatrix.copy(srcMatrix).invert()
} else {
tgtMatrix.getInverse(srcMatrix)
}
return tgtMatrix
}

Xet Storage Details

Size:
452 Bytes
·
Xet hash:
b807c50a6107acf09410018000e8d05d611f4820a192180eae2f11d036a260dd

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.