Sha256: c75965cb9c131edee555a29e5ca5b49f04b97350885dd8613b016a03c05c303b

Contents?: true

Size: 571 Bytes

Versions: 13

Compression:

Stored size: 571 Bytes

Contents

/**
 * class vec2
 * 
 * A 2D vector.
 *
 * (Note: this is a Jax-specific extension. It does not appear by default
 * in the glMatrix library.)
 **/
if (typeof(vec2) == 'undefined') var vec2 = {};

/**
 * vec2.create([vec]) -> vec2
 * - vec (vec2): optional vec2 to initialize from
 * 
 * Creates a 2D vector and returns it.
 *
 * (Note: this is a Jax-specific extension. It does not appear by default
 * in the glMatrix library.)
 **/
vec2.create = function(src) {
  var vec = new glMatrixArrayType(2);
  if (src) { vec[0] = src[0]; vec[1] = src[1]; }
  return vec;
};

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
jax-2.0.12 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.11 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.10 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.9 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.8 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.7 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.6 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.5 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.4 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.3 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.2 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.1 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js
jax-2.0.0 lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js