import { vec3 , vec4 } from 'gl-matrix' ; import isNumber from 'lodash/isNumber' ; export function getAngle ( angle ) { if ( angle === undefined ) { return 0 ; } else if ( angle > 360 || angle < - 360 ) { return angle % 360 ; } return angle ; } export function createVec3 ( x , y ? , z ? ) { if ( isNumber ( x ) ) { return vec3 . fromValues ( x , y as number , z as number ) ; } if ( ( x as vec3 ) . length === 3 ) { return vec3 . clone ( x as vec3 ) ; } return vec3 . fromValues ( x [ 0 ] , x [ 1 ] , x [ 2 ] ) ; }