@openhps/core
Version:
Open Hybrid Positioning System - Core component
27 lines • 849 B
JavaScript
import { __decorate, __metadata } from "tslib";
import { SerializableArrayMember, SerializableObject, NumberType } from '../../data/decorators';
import * as THREE from './_internal';
/**
* Serializable THREE.js Matrix3
*/
let Matrix3 = class Matrix3 extends THREE.Matrix3 {
/**
* Create a matrix from array
* @param {number[][]} array Array
* @returns {Matrix3} Matrix3
*/
static fromArray(array) {
const matrix = new this();
matrix.fromArray([].concat(...array));
matrix.transpose();
return matrix;
}
clone() {
return new this.constructor().fromArray(this.elements);
}
};
__decorate([SerializableArrayMember(Number, {
numberType: NumberType.DECIMAL
}), __metadata("design:type", Array)], Matrix3.prototype, "elements", void 0);
Matrix3 = __decorate([SerializableObject()], Matrix3);
export { Matrix3 };