<commit_before>/**
 * @class Mesh
 * @extends Entity
 */

EZ3.Mesh = function(geometry, material) {
  EZ3.Entity.call(this);

  this.dynamic = false;
  this._buffer = new EZ3.Buffer();
  this.material = (material instanceof EZ3.Material) ? material : null;
  this.geometry = (geometry instanceof EZ3.Geometry) ? geometry : null;
};

EZ3.Mesh.prototype = Object.create(EZ3.Entity.prototype);
EZ3.Mesh.prototype.constructor = EZ3.Mesh;

EZ3.Mesh.prototype._setupBuffer = function(gl) {
  if (this.geometry) {
    var hint = (this.dynamic) ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW;

    if (this.geometry.verticesNeedUpdate) {
      this._buffer.setup(gl, EZ3.Buffer.VERTEX, this.geometry.vertices.length, this.geometry.vertices, hint);
      this.geometry.verticesNeedUpdate = false;
    }

    if (this.geometry.normalsNeedUpdate) {
      this._buffer.setup(gl, EZ3.Buffer.NORMAL, this.geometry.normals.length, this.geometry.normals, hint);
      this.geometry.normalsNeedUpdate = false;
    }
<commit_msg>Updated Mesh<commit_after>/**
 * @class Mesh
 * @extends Entity
 */

EZ3.Mesh = function(geometry, material) {
  EZ3.Entity.call(this);

  this._buffer = new EZ3.Buffer();
  this._dynamic = material.dynamic || false;
  this.material = (material instanceof EZ3.Material) ? material : null;
  this.geometry = (geometry instanceof EZ3.Geometry) ? geometry : null;
};

EZ3.Mesh.prototype = Object.create(EZ3.Entity.prototype);
EZ3.Mesh.prototype.constructor = EZ3.Mesh;

EZ3.Mesh.prototype._setupBuffer = function(gl) {
  if (this.geometry) {
    var hint = (this.dynamic) ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW;

    if (this.geometry.verticesNeedUpdate) {
      this._buffer.setup(gl, EZ3.Buffer.VERTEX, this.geometry.vertices.length, this.geometry.vertices, hint);
      this.geometry.verticesNeedUpdate = false;
    }

    if (this.geometry.normalsNeedUpdate) {
      this._buffer.setup(gl, EZ3.Buffer.NORMAL, this.geometry.normals.length, this.geometry.normals, hint);
      this.geometry.normalsNeedUpdate = false;
    }

{'fraction_non_alphanumeric': 0.13726461843409316, 'fraction_numerical': 0.011892963330029732, 'mean_word_length': 3.88861985472155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '191750', 'n_tokens_mistral': 697, 'n_tokens_neox': 688, 'n_words': 116}