normalize method

dynamic normalize()

Implementation

normalize() {
  this.computeBoundingSphere();

  var center = this.boundingSphere!.center;
  var radius = this.boundingSphere!.radius;

  var s = (radius == 0 ? 1 : 1.0 / radius).toDouble();

  var matrix = new THREE.Matrix4();
  matrix.set(s, 0, 0, -s * center.x, 0, s, 0, -s * center.y, 0, 0, s,
      -s * center.z, 0, 0, 0, 1);

  this.applyMatrix4(matrix);

  return this;
}