TransformNode.setPivotMatrix(…) requires a DeepImmutableObject
public setPreTransformMatrix(matrix: Matrix): TransformNode {
return this.setPivotMatrix(matrix, false);
}
/**
* Sets a new pivot matrix to the current node
* @param matrix defines the new pivot matrix to use
* @param postMultiplyPivotMatrix defines if the pivot matrix must be cancelled in the world matrix. When this parameter is set to true (default), the inverse of the pivot matrix is also applied at the end to cancel the transformation effect
* @returns the current TransformNode
*/
public setPivotMatrix(matrix: DeepImmutable<Matrix>, postMultiplyPivotMatrix = true): TransformNode {
this._pivotMatrix.copyFrom(matrix);
this._usePivotMatrix = !this._pivotMatrix.isIdentity();
this._cache.pivotMatrixUpdated = true;
this._postMultiplyPivotMatrix = postMultiplyPivotMatrix;
if (this._postMultiplyPivotMatrix) {
if (!this._pivotMatrixInverse) {
this._pivotMatrixInverse = Matrix.Invert(this._pivotMatrix);
} else {
I see it is intentionally hidden:
: T extends Array<infer U>
? DeepImmutableArray<U>
: /* T extends Map<infer K, infer V> ? DeepImmutableMap<K, V> : // es2015+ only */
DeepImmutableObject<T>;
/** @hidden */
interface DeepImmutableArray<T> extends ReadonlyArray<DeepImmutable<T>> { }
/** @hidden */
/* interface DeepImmutableMap<K, V> extends ReadonlyMap<DeepImmutable<K>, DeepImmutable<V>> {} // es2015+ only */
/** @hidden */
type DeepImmutableObject<T> = { readonly [K in keyof T]: DeepImmutable<T[K]> };
Wondering what a good solution is here if you know one, but otherwise I can dig into it more and do a PR or is there a reason we can’t have the method signature use BabylonjsCoreMatrix
?. Thanks.
Cedric
September 19, 2019, 4:05pm
2
Hi @brianzinn
Not sure I can help you. Maybe @Deltakosh ?
We can definitely expose it Please just export it and add a comment
I’ll do a PR tonight. Thanks.
1 Like