normalize method

dynamic normalize()

Implementation

normalize() {
  computeBoundingSphere();

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

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

  var matrix = 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);

  applyMatrix4(matrix);

  return this;
}