<commit_before>/**
 * class Jax.Mesh.Quad < Jax.Mesh
 * 
 * A simple square or rectangle. You can adjust its width and height, and that's about it.
 * 
 * This mesh is generally used for testing purposes, or for simple, textured objects like smoke particles.
 *
 * Examples:
 * 
 *     var quad = new Jax.Mesh.Quad({width: 2, height: 1});
 *     var quad = new Jax.Mesh.Quad(1.5);
 * 
 **/
Jax.Mesh.Quad = (function() {
  return Jax.Class.create(Jax.Mesh, {
    initialize: function($super, options) {
      if (typeof(options) == "number") { options = {width:options, height:options}; }
      this.draw_mode = GL_TRIANGLE_STRIP;
      $super(options);
      
      this.setSize(options && options.width || options.size || 1, options && options.height || options.size || 1)
    },

    /**
     * Jax.Mesh.Quad#setWidth(width) -> undefined
     * - width (Number): the width of this quad in WebGL Units.
     * Sets the width of this quad.
     **/
    setWidth: function(width) { this.setSize(width, this.height); },
    
    /**
     * Jax.Mesh.Quad#setHeight(height) -> undefined
     * - height (Number): the height of this quad in WebGL Units.
     * Sets the height of this quad.
     **/
    setHeight:function(height){ this.setHeight(this.width, height); },
    
    /**
     * Jax.Mesh.Quad#setSize(width, height) -> undefined
     * - width (Number): the width of this quad in WebGL Units.
     * - height (Number): the height of this quad in WebGL Units.
     * Sets the width and height of this quad.
     **/
    setSize: function(width, height) {
      this.width = width;
      this.height = height;
      this.rebuild();
    },
    
    init: function(verts, colors, textureCoords, normals) {
      var width = this.width/2, height = this.height/2;
      
      verts.push(-width, -height, 0);
      verts.push(-width,  height, 0);
      verts.push( width, -height, 0);
      verts.push( width,  height, 0);

      colors.push(1,1,1,1);
      colors.push(1,1,1,1);
      colors.push(1,1,1,1);
      colors.push(1,1,1,1);
          
      textureCoords.push(0, 1);
      textureCoords.push(0, 0);
      textureCoords.push(1, 1);
      textureCoords.push(1, 0);
      
      normals.push(0,0,1);
      normals.push(0,0,1);
      normals.push(0,0,1);
      normals.push(0,0,1);
    }
  });
})();<commit_msg>bugfix: Jax.Mesh.Quad vertex winding was clockwise; changed to CCW.<commit_after>/**
 * class Jax.Mesh.Quad < Jax.Mesh
 * 
 * A simple square or rectangle. You can adjust its width and height, and that's about it.
 * 
 * This mesh is generally used for testing purposes, or for simple, textured objects like smoke particles.
 *
 * Examples:
 * 
 *     var quad = new Jax.Mesh.Quad({width: 2, height: 1});
 *     var quad = new Jax.Mesh.Quad(1.5);
 * 
 **/
Jax.Mesh.Quad = (function() {
  return Jax.Class.create(Jax.Mesh, {
    initialize: function($super, options) {
      if (typeof(options) == "number") { options = {width:options, height:options}; }
      this.draw_mode = GL_TRIANGLE_STRIP;
      $super(options);
      
      this.setSize(options && options.width || options.size || 1, options && options.height || options.size || 1)
    },

    /**
     * Jax.Mesh.Quad#setWidth(width) -> undefined
     * - width (Number): the width of this quad in WebGL Units.
     * Sets the width of this quad.
     **/
    setWidth: function(width) { this.setSize(width, this.height); },
    
    /**
     * Jax.Mesh.Quad#setHeight(height) -> undefined
     * - height (Number): the height of this quad in WebGL Units.
     * Sets the height of this quad.
     **/
    setHeight:function(height){ this.setHeight(this.width, height); },
    
    /**
     * Jax.Mesh.Quad#setSize(width, height) -> undefined
     * - width (Number): the width of this quad in WebGL Units.
     * - height (Number): the height of this quad in WebGL Units.
     * Sets the width and height of this quad.
     **/
    setSize: function(width, height) {
      this.width = width;
      this.height = height;
      this.rebuild();
    },
    
    init: function(verts, colors, textureCoords, normals) {
      var width = this.width/2, height = this.height/2;
      
      verts.push(-width,  height, 0);
      verts.push(-width, -height, 0);
      verts.push( width,  height, 0);
      verts.push( width, -height, 0);

      colors.push(1,1,1,1);
      colors.push(1,1,1,1);
      colors.push(1,1,1,1);
      colors.push(1,1,1,1);
          
      textureCoords.push(0, 1);
      textureCoords.push(0, 0);
      textureCoords.push(1, 1);
      textureCoords.push(1, 0);
      
      normals.push(0,0,1);
      normals.push(0,0,1);
      normals.push(0,0,1);
      normals.push(0,0,1);
    }
  });
})();
{'fraction_non_alphanumeric': 0.15146996165317428, 'fraction_numerical': 0.020451640391989774, 'mean_word_length': 2.4572901325478647, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6176977', 'n_tokens_mistral': 1637, 'n_tokens_neox': 1581, 'n_words': 396}