@galacean/engine-math 1.1.0-alpha.4 → 1.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -4475,6 +4475,31 @@ function _create_class(Constructor, protoProps, staticProps) {
4475
4475
  return this;
4476
4476
  };
4477
4477
  /**
4478
+ * Copy from array like object.
4479
+ * @param source - Array like object
4480
+ * @param offset - The start offset
4481
+ * @returns This color
4482
+ */ _proto.copyFromArray = function copyFromArray(source, offset) {
4483
+ if (offset === void 0) offset = 0;
4484
+ this._r = source[offset];
4485
+ this._g = source[offset + 1];
4486
+ this._b = source[offset + 2];
4487
+ this._a = source[offset + 3];
4488
+ this._onValueChanged && this._onValueChanged();
4489
+ return this;
4490
+ };
4491
+ /**
4492
+ * Copy the value of this color to an array.
4493
+ * @param out - The color
4494
+ * @param outOffset - The start offset
4495
+ */ _proto.copyToArray = function copyToArray(out, outOffset) {
4496
+ if (outOffset === void 0) outOffset = 0;
4497
+ out[outOffset] = this._r;
4498
+ out[outOffset + 1] = this._g;
4499
+ out[outOffset + 2] = this._b;
4500
+ out[outOffset + 3] = this._a;
4501
+ };
4502
+ /**
4478
4503
  * Modify components (r, g, b) of this color from gamma space to linear space.
4479
4504
  * @param out - The color in linear space
4480
4505
  * @returns The color in linear space