Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor() {
super();
// FIXME: replace identity() with create()
this.matrix = identity([]);
this.matrixWorld = identity([]);
this.position = [0, 0, 0];
this.scale = [1, 1, 1];
this.quaternion = [0, 0, 0, 1];
this.children = [];
this.matrixAutoUpdate = true;
this.matrixWorldAutoUpdate = true;
}
return (props) => {
const defaults = {
model: mat4.identity([])
}
props = Object.assign({}, defaults, props)
return single([
{ color: xColor, model: mat4.multiply(mat4.create(), props.model, xAxisModel) }, // X
{ color: yColor, model: mat4.multiply(mat4.create(), props.model, yAxisModel) }, // Y
{ color: zColor, model: mat4.multiply(mat4.create(), props.model, zAxisModel) } // Z
])
}
}
model: (_, props, batchId) => {
var m = mat4.identity([])
var rot = quat.create()
quat.rotateX(rot, rot, props.rotation[0])
quat.rotateY(rot, rot, props.rotation[1])
quat.rotateZ(rot, rot, props.rotation[2])
fromRotationTranslationScale2(m, rot, props.translate, [props.scale, props.scale, props.scale])
return m
}
},