hilo3d 1.18.0 → 1.18.1-bone.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.
@@ -10,7 +10,7 @@ if (!window.notInit) {
10
10
  stage = new Hilo3d.Stage({
11
11
  container: document.getElementById('container'),
12
12
  camera: camera,
13
- clearColor: new Hilo3d.Color(0.4, 0.4, 0.4),
13
+ clearColor: new Hilo3d.Color(0.3, 0.35, 0.35),
14
14
  width: innerWidth,
15
15
  height: innerHeight,
16
16
  preferWebGL2: location.search.indexOf('webgl2') > -1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hilo3d",
3
- "version": "1.18.0",
3
+ "version": "1.18.1-bone.0",
4
4
  "description": "Hilo3d, a WebGL 3d engine.",
5
5
  "main": "build/Hilo3d.js",
6
6
  "types": "types/index.d.ts",
package/types/index.d.ts CHANGED
@@ -999,7 +999,6 @@ interface EventObject {
999
999
  * @param e.type - 事件类型
1000
1000
  * @param e.detail - 事件数据
1001
1001
  * @param e.target - 事件触发对象
1002
- * @param e.timeStamp - 时间戳
1003
1002
  * @param e.stageX - 鼠标相对 stage 的 x 偏移 ( 仅鼠标事件有效 )
1004
1003
  * @param e.stageY - 鼠标相对 stage 的 y 偏移 ( 仅鼠标事件有效 )
1005
1004
  * @param e.eventTarget - 触发鼠标事件的对象 ( 仅鼠标事件有效 )
@@ -1010,7 +1009,6 @@ type EventMixinCallback = (e: {
1010
1009
  type: string;
1011
1010
  detail: any;
1012
1011
  target: any;
1013
- timeStamp: number;
1014
1012
  stageX: number;
1015
1013
  stageY: number;
1016
1014
  eventTarget: Node;
@@ -3905,16 +3903,13 @@ class Vector4 {
3905
3903
  sqrLen(): void;
3906
3904
  }
3907
3905
 
3908
- interface Vector3Notifier extends EventMixin {
3909
- }
3910
-
3911
3906
  /**
3912
3907
  * 三维向量, 数据改变会发送事件
3913
3908
  * @param [x = 0] - X component
3914
3909
  * @param [y = 0] - Y component
3915
3910
  * @param [z = 0] - Z component
3916
3911
  */
3917
- class Vector3Notifier extends Vector3 implements EventMixin {
3912
+ class Vector3Notifier extends Vector3 {
3918
3913
  constructor(x?: number, y?: number, z?: number);
3919
3914
  /**
3920
3915
  * 类名 notify
@@ -3925,6 +3920,10 @@ class Vector3Notifier extends Vector3 implements EventMixin {
3925
3920
  * 数据
3926
3921
  */
3927
3922
  elements: Float32Array;
3923
+ /**
3924
+ * 更新的回调
3925
+ */
3926
+ onUpdate(): void;
3928
3927
  /**
3929
3928
  * X component
3930
3929
  */
@@ -4693,7 +4692,274 @@ class Ray {
4693
4692
  intersectsTriangleCell(cell: any[], positions: any[]): Vector3;
4694
4693
  }
4695
4694
 
4696
- interface Quaternion extends EventMixin {
4695
+ /**
4696
+ * @param [x = 0] - X component
4697
+ * @param [y = 0] - Y component
4698
+ * @param [z = 0] - Z component
4699
+ * @param [w = 1] - W component
4700
+ */
4701
+ class QuaternionNotifier {
4702
+ constructor(x?: number, y?: number, z?: number, w?: number);
4703
+ /**
4704
+ * 类名
4705
+ */
4706
+ className: string;
4707
+ isQuaternionNotifier: boolean;
4708
+ isQuaternion: boolean;
4709
+ /**
4710
+ * 数据
4711
+ */
4712
+ elements: Float32Array;
4713
+ /**
4714
+ * 更新的回调
4715
+ */
4716
+ onUpdate(): void;
4717
+ /**
4718
+ * Copy the values from one quat to this
4719
+ * @param q
4720
+ * @returns this
4721
+ */
4722
+ copy(q: Quaternion): Quaternion;
4723
+ /**
4724
+ * Creates a new quat initialized with values from an existing quaternion
4725
+ * @returns a new quaternion
4726
+ */
4727
+ clone(): Quaternion;
4728
+ /**
4729
+ * 转换到数组
4730
+ * @param [array = []] - 数组
4731
+ * @param [offset = 0] - 数组偏移值
4732
+ */
4733
+ toArray(array?: number[] | TypedArray, offset?: number): any[];
4734
+ /**
4735
+ * 从数组赋值
4736
+ * @param array - 数组
4737
+ * @param [offset = 0] - 数组偏移值
4738
+ * @returns this
4739
+ */
4740
+ fromArray(array: number[] | TypedArray, offset?: number): Quaternion;
4741
+ /**
4742
+ * Set the components of a quat to the given values
4743
+ * @param x - X component
4744
+ * @param y - Y component
4745
+ * @param z - Z component
4746
+ * @param w - W component
4747
+ * @returns this
4748
+ */
4749
+ set(x: number, y: number, z: number, w: number): Quaternion;
4750
+ /**
4751
+ * Set this to the identity quaternion
4752
+ * @returns this
4753
+ */
4754
+ identity(): Quaternion;
4755
+ /**
4756
+ * Sets a quaternion to represent the shortest rotation from one
4757
+ * vector to another.
4758
+ * @param a - the initial vector
4759
+ * @param b - the destination vector
4760
+ * @returns this
4761
+ */
4762
+ rotationTo(a: Vector3, b: Vector3): Quaternion;
4763
+ /**
4764
+ * Sets the specified quaternion with values corresponding to the given
4765
+ * axes. Each axis is a vec3 and is expected to be unit length and
4766
+ * perpendicular to all other specified axes.
4767
+ * @param view - the vector representing the viewing direction
4768
+ * @param right - the vector representing the local "right" direction
4769
+ * @param up - the vector representing the local "up" direction
4770
+ * @returns this
4771
+ */
4772
+ setAxes(view: Vector3, right: Vector3, up: Vector3): Quaternion;
4773
+ /**
4774
+ * Sets a quat from the given angle and rotation axis,
4775
+ * then returns it.
4776
+ * @param axis - the axis around which to rotate
4777
+ * @param rad - the angle in radians
4778
+ * @returns this
4779
+ */
4780
+ setAxisAngle(axis: Vector3, rad: number): Quaternion;
4781
+ /**
4782
+ * Gets the rotation axis and angle for a given
4783
+ * quaternion. If a quaternion is created with
4784
+ * setAxisAngle, this method will return the same
4785
+ * values as providied in the original parameter list
4786
+ * OR functionally equivalent values.
4787
+ * Example: The quaternion formed by axis [0, 0, 1] and
4788
+ * angle -90 is the same as the quaternion formed by
4789
+ * [0, 0, 1] and 270. This method favors the latter.
4790
+ * @param out_axis - Vector receiving the axis of rotation
4791
+ * @returns Angle, in radians, of the rotation
4792
+ */
4793
+ getAxisAngle(out_axis: Vector3): number;
4794
+ /**
4795
+ * Adds two quat's
4796
+ * @param q
4797
+ * @returns this
4798
+ */
4799
+ add(q: Quaternion): Quaternion;
4800
+ /**
4801
+ * Multiplies two quat's
4802
+ * @param q
4803
+ * @returns this
4804
+ */
4805
+ multiply(q: Quaternion): Quaternion;
4806
+ /**
4807
+ * premultiply the quat
4808
+ * @param q
4809
+ * @returns this
4810
+ */
4811
+ premultiply(q: Quaternion): Quaternion;
4812
+ /**
4813
+ * Scales a quat by a scalar number
4814
+ * @param scale - the vector to scale
4815
+ * @returns this
4816
+ */
4817
+ scale(scale: Vector3): Quaternion;
4818
+ /**
4819
+ * Rotates a quaternion by the given angle about the X axis
4820
+ * @param rad - angle (in radians) to rotate
4821
+ * @returns this
4822
+ */
4823
+ rotateX(rad: number): Quaternion;
4824
+ /**
4825
+ * Rotates a quaternion by the given angle about the Y axis
4826
+ * @param rad - angle (in radians) to rotate
4827
+ * @returns this
4828
+ */
4829
+ rotateY(rad: number): Quaternion;
4830
+ /**
4831
+ * Rotates a quaternion by the given angle about the Z axis
4832
+ * @param rad - angle (in radians) to rotate
4833
+ * @returns this
4834
+ */
4835
+ rotateZ(rad: number): Quaternion;
4836
+ /**
4837
+ * Calculates the W component of a quat from the X, Y, and Z components.
4838
+ * Assumes that quaternion is 1 unit in length.
4839
+ * Any existing W component will be ignored.
4840
+ * @returns this
4841
+ */
4842
+ calculateW(): Quaternion;
4843
+ /**
4844
+ * Calculates the dot product of two quat's
4845
+ * @param q
4846
+ * @returns dot product of two quat's
4847
+ */
4848
+ dot(q: Quaternion): number;
4849
+ /**
4850
+ * Performs a linear interpolation between two quat's
4851
+ * @param q
4852
+ * @param t - interpolation amount between the two inputs
4853
+ * @returns this
4854
+ */
4855
+ lerp(q: Quaternion, t: number): Quaternion;
4856
+ /**
4857
+ * Performs a spherical linear interpolation between two quat
4858
+ * @param q
4859
+ * @param t - interpolation amount between the two inputs
4860
+ * @returns this
4861
+ */
4862
+ slerp(q: Quaternion, t: number): Quaternion;
4863
+ /**
4864
+ * Performs a spherical linear interpolation with two control points
4865
+ * @param qa
4866
+ * @param qb
4867
+ * @param qc
4868
+ * @param qd
4869
+ * @param t - interpolation amount
4870
+ * @returns this
4871
+ */
4872
+ sqlerp(qa: Quaternion, qb: Quaternion, qc: Quaternion, qd: Quaternion, t: number): Quaternion;
4873
+ /**
4874
+ * Calculates the inverse of a quat
4875
+ * @returns this
4876
+ */
4877
+ invert(): Quaternion;
4878
+ /**
4879
+ * Calculates the conjugate of a quat
4880
+ * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.
4881
+ * @returns this
4882
+ */
4883
+ conjugate(): Quaternion;
4884
+ /**
4885
+ * Calculates the length of a quat
4886
+ * @returns length of this
4887
+ */
4888
+ length(): number;
4889
+ /**
4890
+ * Calculates the squared length of a quat
4891
+ * @returns squared length of this
4892
+ */
4893
+ squaredLength(): number;
4894
+ /**
4895
+ * Normalize this
4896
+ * @returns this
4897
+ */
4898
+ normalize(): Quaternion;
4899
+ /**
4900
+ * Creates a quaternion from the given 3x3 rotation matrix.
4901
+ *
4902
+ * NOTE: The resultant quaternion is not normalized, so you should be sure
4903
+ * to renormalize the quaternion yourself where necessary.
4904
+ * @param m - rotation matrix
4905
+ * @returns this
4906
+ */
4907
+ fromMat3(m: Matrix3): Quaternion;
4908
+ /**
4909
+ * Creates a quaternion from the given 3x3 rotation matrix.
4910
+ *
4911
+ * NOTE: The resultant quaternion is not normalized, so you should be sure
4912
+ * to renormalize the quaternion yourself where necessary.
4913
+ * @param m - rotation matrix
4914
+ * @returns this
4915
+ */
4916
+ fromMat4(m: Matrix4): Quaternion;
4917
+ /**
4918
+ * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)
4919
+ * @param q
4920
+ */
4921
+ exactEquals(q: Quaternion): boolean;
4922
+ /**
4923
+ * Returns whether or not the quaternions have approximately the same elements in the same position.
4924
+ * @param q
4925
+ */
4926
+ equals(q: Quaternion): boolean;
4927
+ /**
4928
+ * Creates a quaternion from the given euler.
4929
+ * @param euler
4930
+ * @param [notCallUpdate = false] - 是否需要调用onUpdate
4931
+ * @returns this
4932
+ */
4933
+ fromEuler(euler: Euler, notCallUpdate?: boolean): Quaternion;
4934
+ /**
4935
+ * X component
4936
+ */
4937
+ x: number;
4938
+ /**
4939
+ * Y component
4940
+ */
4941
+ y: number;
4942
+ /**
4943
+ * Z component
4944
+ */
4945
+ z: number;
4946
+ /**
4947
+ * W component
4948
+ */
4949
+ w: number;
4950
+ /**
4951
+ * Alias for {@link QuaternionNotifier#multiply}
4952
+ * @param q
4953
+ */
4954
+ mul(q: QuaternionNotifier): void;
4955
+ /**
4956
+ * Alias for {@link QuaternionNotifier#length}
4957
+ */
4958
+ len(): void;
4959
+ /**
4960
+ * Alias for {@link QuaternionNotifier#squaredLength}
4961
+ */
4962
+ sqrLen(): void;
4697
4963
  }
4698
4964
 
4699
4965
  /**
@@ -4702,7 +4968,7 @@ interface Quaternion extends EventMixin {
4702
4968
  * @param [z = 0] - Z component
4703
4969
  * @param [w = 1] - W component
4704
4970
  */
4705
- class Quaternion implements EventMixin {
4971
+ class Quaternion {
4706
4972
  constructor(x?: number, y?: number, z?: number, w?: number);
4707
4973
  /**
4708
4974
  * 类名
@@ -4716,10 +4982,9 @@ class Quaternion implements EventMixin {
4716
4982
  /**
4717
4983
  * Copy the values from one quat to this
4718
4984
  * @param q
4719
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4720
4985
  * @returns this
4721
4986
  */
4722
- copy(q: Quaternion, dontFireEvent?: boolean): Quaternion;
4987
+ copy(q: Quaternion): Quaternion;
4723
4988
  /**
4724
4989
  * Creates a new quat initialized with values from an existing quaternion
4725
4990
  * @returns a new quaternion
@@ -4735,35 +5000,31 @@ class Quaternion implements EventMixin {
4735
5000
  * 从数组赋值
4736
5001
  * @param array - 数组
4737
5002
  * @param [offset = 0] - 数组偏移值
4738
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4739
5003
  * @returns this
4740
5004
  */
4741
- fromArray(array: number[] | TypedArray, offset?: number, dontFireEvent?: boolean): Quaternion;
5005
+ fromArray(array: number[] | TypedArray, offset?: number): Quaternion;
4742
5006
  /**
4743
5007
  * Set the components of a quat to the given values
4744
5008
  * @param x - X component
4745
5009
  * @param y - Y component
4746
5010
  * @param z - Z component
4747
5011
  * @param w - W component
4748
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4749
5012
  * @returns this
4750
5013
  */
4751
- set(x: number, y: number, z: number, w: number, dontFireEvent?: boolean): Quaternion;
5014
+ set(x: number, y: number, z: number, w: number): Quaternion;
4752
5015
  /**
4753
5016
  * Set this to the identity quaternion
4754
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4755
5017
  * @returns this
4756
5018
  */
4757
- identity(dontFireEvent?: boolean): Quaternion;
5019
+ identity(): Quaternion;
4758
5020
  /**
4759
5021
  * Sets a quaternion to represent the shortest rotation from one
4760
5022
  * vector to another.
4761
5023
  * @param a - the initial vector
4762
5024
  * @param b - the destination vector
4763
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4764
5025
  * @returns this
4765
5026
  */
4766
- rotationTo(a: Vector3, b: Vector3, dontFireEvent?: boolean): Quaternion;
5027
+ rotationTo(a: Vector3, b: Vector3): Quaternion;
4767
5028
  /**
4768
5029
  * Sets the specified quaternion with values corresponding to the given
4769
5030
  * axes. Each axis is a vec3 and is expected to be unit length and
@@ -4771,19 +5032,17 @@ class Quaternion implements EventMixin {
4771
5032
  * @param view - the vector representing the viewing direction
4772
5033
  * @param right - the vector representing the local "right" direction
4773
5034
  * @param up - the vector representing the local "up" direction
4774
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4775
5035
  * @returns this
4776
5036
  */
4777
- setAxes(view: Vector3, right: Vector3, up: Vector3, dontFireEvent?: boolean): Quaternion;
5037
+ setAxes(view: Vector3, right: Vector3, up: Vector3): Quaternion;
4778
5038
  /**
4779
5039
  * Sets a quat from the given angle and rotation axis,
4780
5040
  * then returns it.
4781
5041
  * @param axis - the axis around which to rotate
4782
5042
  * @param rad - the angle in radians
4783
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4784
5043
  * @returns this
4785
5044
  */
4786
- setAxisAngle(axis: Vector3, rad: number, dontFireEvent?: boolean): Quaternion;
5045
+ setAxisAngle(axis: Vector3, rad: number): Quaternion;
4787
5046
  /**
4788
5047
  * Gets the rotation axis and angle for a given
4789
5048
  * quaternion. If a quaternion is created with
@@ -4800,60 +5059,52 @@ class Quaternion implements EventMixin {
4800
5059
  /**
4801
5060
  * Adds two quat's
4802
5061
  * @param q
4803
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4804
5062
  * @returns this
4805
5063
  */
4806
- add(q: Quaternion, dontFireEvent?: boolean): Quaternion;
5064
+ add(q: Quaternion): Quaternion;
4807
5065
  /**
4808
5066
  * Multiplies two quat's
4809
5067
  * @param q
4810
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4811
5068
  * @returns this
4812
5069
  */
4813
- multiply(q: Quaternion, dontFireEvent?: boolean): Quaternion;
5070
+ multiply(q: Quaternion): Quaternion;
4814
5071
  /**
4815
5072
  * premultiply the quat
4816
5073
  * @param q
4817
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4818
5074
  * @returns this
4819
5075
  */
4820
- premultiply(q: Quaternion, dontFireEvent?: boolean): Quaternion;
5076
+ premultiply(q: Quaternion): Quaternion;
4821
5077
  /**
4822
5078
  * Scales a quat by a scalar number
4823
5079
  * @param scale - the vector to scale
4824
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4825
5080
  * @returns this
4826
5081
  */
4827
- scale(scale: Vector3, dontFireEvent?: boolean): Quaternion;
5082
+ scale(scale: Vector3): Quaternion;
4828
5083
  /**
4829
5084
  * Rotates a quaternion by the given angle about the X axis
4830
5085
  * @param rad - angle (in radians) to rotate
4831
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4832
5086
  * @returns this
4833
5087
  */
4834
- rotateX(rad: number, dontFireEvent?: boolean): Quaternion;
5088
+ rotateX(rad: number): Quaternion;
4835
5089
  /**
4836
5090
  * Rotates a quaternion by the given angle about the Y axis
4837
5091
  * @param rad - angle (in radians) to rotate
4838
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4839
5092
  * @returns this
4840
5093
  */
4841
- rotateY(rad: number, dontFireEvent?: boolean): Quaternion;
5094
+ rotateY(rad: number): Quaternion;
4842
5095
  /**
4843
5096
  * Rotates a quaternion by the given angle about the Z axis
4844
5097
  * @param rad - angle (in radians) to rotate
4845
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4846
5098
  * @returns this
4847
5099
  */
4848
- rotateZ(rad: number, dontFireEvent?: boolean): Quaternion;
5100
+ rotateZ(rad: number): Quaternion;
4849
5101
  /**
4850
5102
  * Calculates the W component of a quat from the X, Y, and Z components.
4851
5103
  * Assumes that quaternion is 1 unit in length.
4852
5104
  * Any existing W component will be ignored.
4853
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4854
5105
  * @returns this
4855
5106
  */
4856
- calculateW(dontFireEvent?: boolean): Quaternion;
5107
+ calculateW(): Quaternion;
4857
5108
  /**
4858
5109
  * Calculates the dot product of two quat's
4859
5110
  * @param q
@@ -4864,18 +5115,16 @@ class Quaternion implements EventMixin {
4864
5115
  * Performs a linear interpolation between two quat's
4865
5116
  * @param q
4866
5117
  * @param t - interpolation amount between the two inputs
4867
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4868
5118
  * @returns this
4869
5119
  */
4870
- lerp(q: Quaternion, t: number, dontFireEvent?: boolean): Quaternion;
5120
+ lerp(q: Quaternion, t: number): Quaternion;
4871
5121
  /**
4872
5122
  * Performs a spherical linear interpolation between two quat
4873
5123
  * @param q
4874
5124
  * @param t - interpolation amount between the two inputs
4875
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4876
5125
  * @returns this
4877
5126
  */
4878
- slerp(q: Quaternion, t: number, dontFireEvent?: boolean): Quaternion;
5127
+ slerp(q: Quaternion, t: number): Quaternion;
4879
5128
  /**
4880
5129
  * Performs a spherical linear interpolation with two control points
4881
5130
  * @param qa
@@ -4883,23 +5132,20 @@ class Quaternion implements EventMixin {
4883
5132
  * @param qc
4884
5133
  * @param qd
4885
5134
  * @param t - interpolation amount
4886
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4887
5135
  * @returns this
4888
5136
  */
4889
- sqlerp(qa: Quaternion, qb: Quaternion, qc: Quaternion, qd: Quaternion, t: number, dontFireEvent?: boolean): Quaternion;
5137
+ sqlerp(qa: Quaternion, qb: Quaternion, qc: Quaternion, qd: Quaternion, t: number): Quaternion;
4890
5138
  /**
4891
5139
  * Calculates the inverse of a quat
4892
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4893
5140
  * @returns this
4894
5141
  */
4895
- invert(dontFireEvent?: boolean): Quaternion;
5142
+ invert(): Quaternion;
4896
5143
  /**
4897
5144
  * Calculates the conjugate of a quat
4898
5145
  * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.
4899
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4900
5146
  * @returns this
4901
5147
  */
4902
- conjugate(dontFireEvent?: boolean): Quaternion;
5148
+ conjugate(): Quaternion;
4903
5149
  /**
4904
5150
  * Calculates the length of a quat
4905
5151
  * @returns length of this
@@ -4912,30 +5158,27 @@ class Quaternion implements EventMixin {
4912
5158
  squaredLength(): number;
4913
5159
  /**
4914
5160
  * Normalize this
4915
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4916
5161
  * @returns this
4917
5162
  */
4918
- normalize(dontFireEvent?: boolean): Quaternion;
5163
+ normalize(): Quaternion;
4919
5164
  /**
4920
5165
  * Creates a quaternion from the given 3x3 rotation matrix.
4921
5166
  *
4922
5167
  * NOTE: The resultant quaternion is not normalized, so you should be sure
4923
5168
  * to renormalize the quaternion yourself where necessary.
4924
5169
  * @param m - rotation matrix
4925
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4926
5170
  * @returns this
4927
5171
  */
4928
- fromMat3(m: Matrix3, dontFireEvent?: boolean): Quaternion;
5172
+ fromMat3(m: Matrix3): Quaternion;
4929
5173
  /**
4930
5174
  * Creates a quaternion from the given 3x3 rotation matrix.
4931
5175
  *
4932
5176
  * NOTE: The resultant quaternion is not normalized, so you should be sure
4933
5177
  * to renormalize the quaternion yourself where necessary.
4934
5178
  * @param m - rotation matrix
4935
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4936
5179
  * @returns this
4937
5180
  */
4938
- fromMat4(m: Matrix4, dontFireEvent?: boolean): Quaternion;
5181
+ fromMat4(m: Matrix4): Quaternion;
4939
5182
  /**
4940
5183
  * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)
4941
5184
  * @param q
@@ -4949,10 +5192,9 @@ class Quaternion implements EventMixin {
4949
5192
  /**
4950
5193
  * Creates a quaternion from the given euler.
4951
5194
  * @param euler
4952
- * @param [dontFireEvent = false] - wether or not don`t fire change event.
4953
5195
  * @returns this
4954
5196
  */
4955
- fromEuler(euler: Euler, dontFireEvent?: boolean): Quaternion;
5197
+ fromEuler(euler: Euler): Quaternion;
4956
5198
  /**
4957
5199
  * X component
4958
5200
  */
@@ -4971,8 +5213,9 @@ class Quaternion implements EventMixin {
4971
5213
  w: number;
4972
5214
  /**
4973
5215
  * Alias for {@link Quaternion#multiply}
5216
+ * @param q
4974
5217
  */
4975
- mul(): void;
5218
+ mul(q: Quaternion): void;
4976
5219
  /**
4977
5220
  * Alias for {@link Quaternion#length}
4978
5221
  */
@@ -5053,6 +5296,10 @@ class Matrix4Notifier extends Matrix4 {
5053
5296
  * 数据
5054
5297
  */
5055
5298
  elements: Float32Array;
5299
+ /**
5300
+ * 更新的回调
5301
+ */
5302
+ onUpdate(): void;
5056
5303
  }
5057
5304
 
5058
5305
  /**
@@ -5376,10 +5623,10 @@ class Matrix4 {
5376
5623
  * @param q - quaternion
5377
5624
  * @param v - position
5378
5625
  * @param s - scale
5379
- * @param p - [pivot]
5626
+ * @param [p] - pivot
5380
5627
  * @returns this
5381
5628
  */
5382
- compose(q: Quaternion, v: Vector3, s: Vector3, p: Vector3): Matrix4;
5629
+ compose(q: Quaternion, v: Vector3, s: Vector3, p?: Vector3): Matrix4;
5383
5630
  /**
5384
5631
  * decompose
5385
5632
  * @param q - quaternion
@@ -5627,22 +5874,23 @@ class Frustum {
5627
5874
  intersectsSphere(sphere: Sphere): boolean;
5628
5875
  }
5629
5876
 
5630
- interface EulerNotifier extends EventMixin {
5631
- }
5632
-
5633
5877
  /**
5634
5878
  * 欧拉角, 数据改变会发送事件
5635
5879
  * @param [x = 0] - 角度 X, 弧度制
5636
5880
  * @param [y = 0] - 角度 Y, 弧度制
5637
5881
  * @param [z = 0] - 角度 Z, 弧度制
5638
5882
  */
5639
- class EulerNotifier extends Euler implements EventMixin {
5883
+ class EulerNotifier extends Euler {
5640
5884
  constructor(x?: number, y?: number, z?: number);
5641
5885
  /**
5642
5886
  * 类名
5643
5887
  */
5644
5888
  className: string;
5645
5889
  isEulerNotifier: boolean;
5890
+ /**
5891
+ * 更新的回调
5892
+ */
5893
+ onUpdate(): void;
5646
5894
  /**
5647
5895
  * 角度 X, 角度制
5648
5896
  */
@@ -8445,6 +8693,10 @@ class Node implements EventMixin {
8445
8693
  * update 回调
8446
8694
  */
8447
8695
  onUpdate: (...params: any[]) => any;
8696
+ /**
8697
+ * 只同步四元数,不同步欧拉角
8698
+ */
8699
+ onlySyncQuaternion: boolean;
8448
8700
  id: string;
8449
8701
  /**
8450
8702
  * 元素的up向量
@@ -8723,6 +8975,10 @@ class Node implements EventMixin {
8723
8975
  * 矩阵 version,每次改变会加一
8724
8976
  */
8725
8977
  readonly matrixVersion: number;
8978
+ /**
8979
+ * 世界矩阵 version,每次改变会加一
8980
+ */
8981
+ worldMatrixVersion: number;
8726
8982
  /**
8727
8983
  * 获取元素的包围盒信息
8728
8984
  * @param [parent] - 元素相对于哪个祖先元素的包围盒,不传表示世界