17 lines
357 B
JavaScript
17 lines
357 B
JavaScript
module.exports = fromValues;
|
|
|
|
/**
|
|
* Creates a new vec3 initialized with the given values
|
|
*
|
|
* @param {Number} x X component
|
|
* @param {Number} y Y component
|
|
* @param {Number} z Z component
|
|
* @returns {vec3} a new 3D vector
|
|
*/
|
|
function fromValues(x, y, z) {
|
|
var out = new Float32Array(3)
|
|
out[0] = x
|
|
out[1] = y
|
|
out[2] = z
|
|
return out
|
|
} |