@dcl/sdk 7.0.0-3039764556.commit-d9e186e → 7.0.0-3045967591.commit-85b242a
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/ecs7/index.d.ts +430 -96
- package/dist/ecs7/index.js +2939 -381
- package/dist/ecs7/index.min.js +1 -1
- package/dist/ecs7/index.min.js.map +1 -1
- package/dist/ecs7/proto-definitions/UiText.proto +16 -2
- package/package.json +4 -4
- package/types/ecs7/index.d.ts +430 -96
package/dist/ecs7/index.d.ts
CHANGED
@@ -231,7 +231,7 @@ export declare namespace Components {
|
|
231
231
|
/** @public */
|
232
232
|
const Material: ComponentDefinition<ISchema<PBMaterial>, PBMaterial>;
|
233
233
|
/** @public */
|
234
|
-
const MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, PBMeshCollider
|
234
|
+
const MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, Partial<PBMeshCollider>>;
|
235
235
|
/** @public */
|
236
236
|
const MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
|
237
237
|
/** @public */
|
@@ -443,14 +443,6 @@ export declare const CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>
|
|
443
443
|
*/
|
444
444
|
export declare type DeepReadonly<T> = T extends ReadonlyPrimitive ? T : T extends Map<infer K, infer V> ? DeepReadonlyMap<K, V> : T extends Set<infer M> ? DeepReadonlySet<M> : DeepReadonlyObject<T>;
|
445
445
|
|
446
|
-
/**
|
447
|
-
* Make each field readonly deeply
|
448
|
-
* @public
|
449
|
-
*/
|
450
|
-
declare type DeepReadonly_2<T> = {
|
451
|
-
readonly [P in keyof T]: DeepReadonly_2<T[P]>;
|
452
|
-
};
|
453
|
-
|
454
446
|
/**
|
455
447
|
* @public
|
456
448
|
*/
|
@@ -471,6 +463,7 @@ export declare type DeepReadonlySet<T> = ReadonlySet<DeepReadonly<T>>;
|
|
471
463
|
declare function defineSdkComponents(engine: PreEngine): {
|
472
464
|
Transform: ComponentDefinition<ISchema<TransformType>, Partial<TransformType>>;
|
473
465
|
MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
|
466
|
+
MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, Partial<PBMeshCollider>>;
|
474
467
|
Animator: ComponentDefinition<ISchema<PBAnimator>, PBAnimator>;
|
475
468
|
AudioSource: ComponentDefinition<ISchema<PBAudioSource>, PBAudioSource>;
|
476
469
|
AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach>, PBAvatarAttach>;
|
@@ -483,7 +476,6 @@ declare function defineSdkComponents(engine: PreEngine): {
|
|
483
476
|
CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>, PBCylinderShape>;
|
484
477
|
GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>, PBGLTFShape>;
|
485
478
|
Material: ComponentDefinition<ISchema<PBMaterial>, PBMaterial>;
|
486
|
-
MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, PBMeshCollider>;
|
487
479
|
NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTShape>;
|
488
480
|
OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>, PBOnPointerDown>;
|
489
481
|
OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>, PBOnPointerDownResult>;
|
@@ -508,9 +500,6 @@ declare function defineSdkComponents(engine: PreEngine): {
|
|
508
500
|
*/
|
509
501
|
export declare const DEG2RAD: number;
|
510
502
|
|
511
|
-
/** @public */
|
512
|
-
export declare type double = number;
|
513
|
-
|
514
503
|
/**
|
515
504
|
* @public
|
516
505
|
*/
|
@@ -532,12 +521,6 @@ export declare type Entity = number & {
|
|
532
521
|
|
533
522
|
declare const entitySymbol: unique symbol;
|
534
523
|
|
535
|
-
/**
|
536
|
-
* Constant used to define the minimal number value in Babylon.js
|
537
|
-
* @public
|
538
|
-
*/
|
539
|
-
export declare const Epsilon = 0.000001;
|
540
|
-
|
541
524
|
export declare const error: (message: string | Error, data?: any) => void;
|
542
525
|
|
543
526
|
/** Excludes property keys from T where the property is assignable to U */
|
@@ -553,10 +536,13 @@ declare const enum FilterMode {
|
|
553
536
|
}
|
554
537
|
|
555
538
|
/** @public */
|
556
|
-
|
539
|
+
declare type FloatArray = number[];
|
557
540
|
|
558
|
-
|
559
|
-
|
541
|
+
declare const enum Font {
|
542
|
+
LiberationSans = 0,
|
543
|
+
SansSerif = 1,
|
544
|
+
UNRECOGNIZED = -1
|
545
|
+
}
|
560
546
|
|
561
547
|
/** @public */
|
562
548
|
export declare const GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>, PBGLTFShape>;
|
@@ -701,21 +687,6 @@ export declare type ISchema<T = any> = {
|
|
701
687
|
create(): T;
|
702
688
|
};
|
703
689
|
|
704
|
-
/**
|
705
|
-
* Interface for the size containing width and height
|
706
|
-
* @public
|
707
|
-
*/
|
708
|
-
export declare interface ISize {
|
709
|
-
/**
|
710
|
-
* Width
|
711
|
-
*/
|
712
|
-
width: number;
|
713
|
-
/**
|
714
|
-
* Heighht
|
715
|
-
*/
|
716
|
-
height: number;
|
717
|
-
}
|
718
|
-
|
719
690
|
/**
|
720
691
|
* Check if a pointer event has been emited in the last tick-update.
|
721
692
|
* @param entity the entity to query, for global clicks use `engine.RootEntity`
|
@@ -768,11 +739,23 @@ declare namespace Matrix {
|
|
768
739
|
_isIdentity3x2Dirty: boolean;
|
769
740
|
_m: Matrix4x4;
|
770
741
|
};
|
771
|
-
type ReadonlyMatrix =
|
742
|
+
type ReadonlyMatrix = {
|
743
|
+
/**
|
744
|
+
* Gets the update flag of the matrix which is an unique number for the matrix.
|
745
|
+
* It will be incremented every time the matrix data change.
|
746
|
+
* You can use it to speed the comparison between two versions of the same matrix.
|
747
|
+
*/
|
748
|
+
readonly updateFlag: number;
|
749
|
+
readonly isIdentity: boolean;
|
750
|
+
readonly isIdentity3x2: boolean;
|
751
|
+
readonly _isIdentityDirty: boolean;
|
752
|
+
readonly _isIdentity3x2Dirty: boolean;
|
753
|
+
readonly _m: Matrix4x4;
|
754
|
+
};
|
772
755
|
/**
|
773
756
|
* Gets the internal data of the matrix
|
774
757
|
*/
|
775
|
-
function m(self: MutableMatrix):
|
758
|
+
function m(self: MutableMatrix): Matrix4x4;
|
776
759
|
/**
|
777
760
|
* Gets an identity matrix that must not be updated
|
778
761
|
*/
|
@@ -787,14 +770,14 @@ declare namespace Matrix {
|
|
787
770
|
* @param offset - defines an offset in the source array
|
788
771
|
* @returns a new Matrix set from the starting index of the given array
|
789
772
|
*/
|
790
|
-
function fromArray(array:
|
773
|
+
function fromArray(array: Matrix4x4, offset?: number): MutableMatrix;
|
791
774
|
/**
|
792
775
|
* Copy the content of an array into a given matrix
|
793
776
|
* @param array - defines the source array
|
794
777
|
* @param offset - defines an offset in the source array
|
795
778
|
* @param result - defines the target matrix
|
796
779
|
*/
|
797
|
-
function fromArrayToRef(array:
|
780
|
+
function fromArrayToRef(array: Matrix4x4, offset: number, result: MutableMatrix): void;
|
798
781
|
/**
|
799
782
|
* Stores an array into a matrix after having multiplied each component by a given factor
|
800
783
|
* @param array - defines the source array
|
@@ -1240,12 +1223,12 @@ declare namespace Matrix {
|
|
1240
1223
|
* Returns the matrix as a FloatArray
|
1241
1224
|
* @returns the matrix underlying array
|
1242
1225
|
*/
|
1243
|
-
function toArray(self: ReadonlyMatrix):
|
1226
|
+
function toArray(self: ReadonlyMatrix): Matrix4x4;
|
1244
1227
|
/**
|
1245
1228
|
* Returns the matrix as a FloatArray
|
1246
1229
|
* @returns the matrix underlying array.
|
1247
1230
|
*/
|
1248
|
-
function asArray(self: ReadonlyMatrix):
|
1231
|
+
function asArray(self: ReadonlyMatrix): Matrix4x4;
|
1249
1232
|
/**
|
1250
1233
|
* Sets all the matrix elements to zero
|
1251
1234
|
* @returns the current matrix
|
@@ -1452,7 +1435,7 @@ declare namespace Matrix {
|
|
1452
1435
|
}
|
1453
1436
|
|
1454
1437
|
/** @public */
|
1455
|
-
export declare const MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, PBMeshCollider
|
1438
|
+
export declare const MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, Partial<PBMeshCollider>>;
|
1456
1439
|
|
1457
1440
|
/** @public */
|
1458
1441
|
export declare const MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
|
@@ -1460,9 +1443,6 @@ export declare const MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>,
|
|
1460
1443
|
/** @public */
|
1461
1444
|
export declare const NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTShape>;
|
1462
1445
|
|
1463
|
-
/** @public */
|
1464
|
-
export declare type Nullable<T> = T | null;
|
1465
|
-
|
1466
1446
|
/**
|
1467
1447
|
* The Observable class is a simple implementation of the Observable pattern.
|
1468
1448
|
*
|
@@ -1809,19 +1789,6 @@ export declare const onVideoEvent: Observable<{
|
|
1809
1789
|
totalVideoLength: number;
|
1810
1790
|
}>;
|
1811
1791
|
|
1812
|
-
/**
|
1813
|
-
* Defines potential orientation for back face culling
|
1814
|
-
* @public
|
1815
|
-
*/
|
1816
|
-
export declare enum Orientation {
|
1817
|
-
/**
|
1818
|
-
* Clockwise
|
1819
|
-
*/
|
1820
|
-
CW = 0,
|
1821
|
-
/** Counter clockwise */
|
1822
|
-
CCW = 1
|
1823
|
-
}
|
1824
|
-
|
1825
1792
|
declare interface PBAnimationState {
|
1826
1793
|
name: string;
|
1827
1794
|
clip: string;
|
@@ -2203,8 +2170,15 @@ declare interface PBTextShape {
|
|
2203
2170
|
}
|
2204
2171
|
|
2205
2172
|
declare interface PBUiText {
|
2206
|
-
|
2207
|
-
|
2173
|
+
value: string;
|
2174
|
+
/** default=(1.0,1.0,1.0) */
|
2175
|
+
color?: Color3 | undefined;
|
2176
|
+
/** default='center' */
|
2177
|
+
textAlign?: TextAlign | undefined;
|
2178
|
+
/** default=0 */
|
2179
|
+
font?: Font | undefined;
|
2180
|
+
/** default=10 */
|
2181
|
+
fontSize?: number | undefined;
|
2208
2182
|
}
|
2209
2183
|
|
2210
2184
|
declare interface PBUiTransform {
|
@@ -2288,7 +2262,16 @@ declare namespace Plane {
|
|
2288
2262
|
*/
|
2289
2263
|
d: number;
|
2290
2264
|
};
|
2291
|
-
type ReadonlyPlane =
|
2265
|
+
type ReadonlyPlane = {
|
2266
|
+
/**
|
2267
|
+
* Normal of the plane (a,b,c)
|
2268
|
+
*/
|
2269
|
+
normal: Vector3.ReadonlyVector3;
|
2270
|
+
/**
|
2271
|
+
* d component of the plane
|
2272
|
+
*/
|
2273
|
+
d: number;
|
2274
|
+
};
|
2292
2275
|
/**
|
2293
2276
|
* Creates a Plane object according to the given floats a, b, c, d and the plane equation : ax + by + cz + d = 0
|
2294
2277
|
* @param a - a component of the plane
|
@@ -2305,7 +2288,7 @@ declare namespace Plane {
|
|
2305
2288
|
* @param array - the array to create a plane from
|
2306
2289
|
* @returns a new Plane from the given array.
|
2307
2290
|
*/
|
2308
|
-
function fromArray(array:
|
2291
|
+
function fromArray(array: number[]): MutablePlane;
|
2309
2292
|
/**
|
2310
2293
|
* Creates a plane from three points
|
2311
2294
|
* @param point1 - point used to create the plane
|
@@ -2443,7 +2426,12 @@ export declare namespace Quaternion {
|
|
2443
2426
|
/**
|
2444
2427
|
* @public
|
2445
2428
|
*/
|
2446
|
-
export type ReadonlyQuaternion =
|
2429
|
+
export type ReadonlyQuaternion = {
|
2430
|
+
readonly y: number;
|
2431
|
+
readonly x: number;
|
2432
|
+
readonly z: number;
|
2433
|
+
readonly w: number;
|
2434
|
+
};
|
2447
2435
|
/**
|
2448
2436
|
* Creates a new Quaternion from the given floats
|
2449
2437
|
* @param x - defines the first component (0 by default)
|
@@ -2585,6 +2573,22 @@ export declare namespace Quaternion {
|
|
2585
2573
|
*/
|
2586
2574
|
export function multiplyToRef(self: ReadonlyQuaternion, q1: ReadonlyQuaternion, result: MutableQuaternion): void;
|
2587
2575
|
export function angleAxis(degress: number, axis: Vector3.ReadonlyVector3): MutableQuaternion;
|
2576
|
+
/**
|
2577
|
+
* Creates a new quaternion containing the rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation)
|
2578
|
+
* @param axis1 - defines the first axis
|
2579
|
+
* @param axis2 - defines the second axis
|
2580
|
+
* @param axis3 - defines the third axis
|
2581
|
+
* @returns the new quaternion
|
2582
|
+
*/
|
2583
|
+
export function rotationQuaternionFromAxis(axis1: Vector3.ReadonlyVector3, axis2: Vector3.ReadonlyVector3, axis3: Vector3.ReadonlyVector3): MutableQuaternion;
|
2584
|
+
/**
|
2585
|
+
* Creates a rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) and stores it in the target quaternion
|
2586
|
+
* @param axis1 - defines the first axis
|
2587
|
+
* @param axis2 - defines the second axis
|
2588
|
+
* @param axis3 - defines the third axis
|
2589
|
+
* @param ref - defines the target quaternion
|
2590
|
+
*/
|
2591
|
+
export function rotationQuaternionFromAxisToRef(axis1: Vector3.ReadonlyVector3, axis2: Vector3.ReadonlyVector3, axis3: Vector3.ReadonlyVector3, ref: MutableQuaternion): void;
|
2588
2592
|
/**
|
2589
2593
|
* Returns a zero filled quaternion
|
2590
2594
|
*/
|
@@ -2674,19 +2678,6 @@ export declare namespace Schemas {
|
|
2674
2678
|
*/
|
2675
2679
|
export declare type SdkComponents = ReturnType<typeof defineSdkComponents>;
|
2676
2680
|
|
2677
|
-
/**
|
2678
|
-
* Defines supported spaces
|
2679
|
-
* @public
|
2680
|
-
*/
|
2681
|
-
export declare enum Space {
|
2682
|
-
/** Local (object) space */
|
2683
|
-
LOCAL = 0,
|
2684
|
-
/** World space */
|
2685
|
-
WORLD = 1,
|
2686
|
-
/** Bone space */
|
2687
|
-
BONE = 2
|
2688
|
-
}
|
2689
|
-
|
2690
2681
|
/**
|
2691
2682
|
* @public
|
2692
2683
|
*/
|
@@ -2702,6 +2693,13 @@ export declare const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PB
|
|
2702
2693
|
*/
|
2703
2694
|
export declare type SystemFn = (dt: number) => void;
|
2704
2695
|
|
2696
|
+
declare const enum TextAlign {
|
2697
|
+
Center = 0,
|
2698
|
+
Left = 1,
|
2699
|
+
Right = 2,
|
2700
|
+
UNRECOGNIZED = -1
|
2701
|
+
}
|
2702
|
+
|
2705
2703
|
/** @public */
|
2706
2704
|
export declare const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
|
2707
2705
|
|
@@ -2713,18 +2711,6 @@ declare const enum TextureWrapMode {
|
|
2713
2711
|
UNRECOGNIZED = -1
|
2714
2712
|
}
|
2715
2713
|
|
2716
|
-
/**
|
2717
|
-
* Constant used to convert a value to gamma space
|
2718
|
-
* @public
|
2719
|
-
*/
|
2720
|
-
export declare const ToGammaSpace: number;
|
2721
|
-
|
2722
|
-
/**
|
2723
|
-
* Constant used to convert a value to linear space
|
2724
|
-
* @public
|
2725
|
-
*/
|
2726
|
-
export declare const ToLinearSpace = 2.2;
|
2727
|
-
|
2728
2714
|
declare type ToOptional<T> = OnlyOptionalUndefinedTypes<T> & OnlyNonUndefinedTypes<T>;
|
2729
2715
|
|
2730
2716
|
/** @public */
|
@@ -2792,14 +2778,23 @@ export declare namespace Vector3 {
|
|
2792
2778
|
* @public
|
2793
2779
|
*/
|
2794
2780
|
export type MutableVector3 = {
|
2795
|
-
y: number;
|
2796
2781
|
x: number;
|
2782
|
+
y: number;
|
2797
2783
|
z: number;
|
2798
2784
|
};
|
2799
2785
|
/**
|
2800
2786
|
* @public
|
2801
2787
|
*/
|
2802
|
-
export type ReadonlyVector3 =
|
2788
|
+
export type ReadonlyVector3 = {
|
2789
|
+
readonly x: number;
|
2790
|
+
readonly y: number;
|
2791
|
+
readonly z: number;
|
2792
|
+
};
|
2793
|
+
/**
|
2794
|
+
* Gets a boolean indicating that the vector is non uniform meaning x, y or z are not all the same
|
2795
|
+
* @param vector - vector to check
|
2796
|
+
*/
|
2797
|
+
export function isNonUniform(vector: ReadonlyVector3): boolean;
|
2803
2798
|
/**
|
2804
2799
|
* Creates a new Vector3 object from the given x, y, z (floats) coordinates.
|
2805
2800
|
* @param x - defines the first coordinates (on X axis)
|
@@ -2826,31 +2821,100 @@ export declare namespace Vector3 {
|
|
2826
2821
|
* @returns the resulting vector
|
2827
2822
|
*/
|
2828
2823
|
export function add(vector1: ReadonlyVector3, vector2: ReadonlyVector3): MutableVector3;
|
2824
|
+
/**
|
2825
|
+
* Add component by component the vector2 into dest
|
2826
|
+
* @param dest - the first vector and destination of addition
|
2827
|
+
* @param vector2 - the second vector
|
2828
|
+
*/
|
2829
|
+
export function addToRef(vector1: ReadonlyVector3, vector2: ReadonlyVector3, result: MutableVector3): void;
|
2829
2830
|
/**
|
2830
2831
|
* Returns a new Vector3 as the result of the substraction of the two given vectors.
|
2831
2832
|
* @returns the resulting vector
|
2832
2833
|
*/
|
2833
|
-
export function subtract(
|
2834
|
+
export function subtract(vector1: ReadonlyVector3, vector2: ReadonlyVector3): MutableVector3;
|
2834
2835
|
/**
|
2835
2836
|
* Returns a new Vector3 as the result of the substraction of the two given vectors.
|
2836
2837
|
* @returns the resulting vector
|
2837
2838
|
*/
|
2838
|
-
export function subtractToRef(
|
2839
|
+
export function subtractToRef(vector1: ReadonlyVector3, vector2: ReadonlyVector3, result: MutableVector3): void;
|
2840
|
+
/**
|
2841
|
+
* Subtracts the given floats from the current Vector3 coordinates and set the given vector "result" with this result
|
2842
|
+
* @param x - defines the x coordinate of the operand
|
2843
|
+
* @param y - defines the y coordinate of the operand
|
2844
|
+
* @param z - defines the z coordinate of the operand
|
2845
|
+
* @param result - defines the Vector3 object where to store the result
|
2846
|
+
*/
|
2847
|
+
export function subtractFromFloatsToRef(vector1: ReadonlyVector3, x: number, y: number, z: number, result: MutableVector3): void;
|
2839
2848
|
/**
|
2840
2849
|
* Returns a new Vector3 with the other sign
|
2841
2850
|
* @returns the resulting vector
|
2842
2851
|
*/
|
2843
|
-
export function
|
2852
|
+
export function negate(value: ReadonlyVector3): MutableVector3;
|
2844
2853
|
/**
|
2845
2854
|
* Copy source into dest
|
2846
2855
|
*
|
2847
2856
|
*/
|
2848
2857
|
export function copy(source: ReadonlyVector3, dest: MutableVector3): void;
|
2858
|
+
/**
|
2859
|
+
* Sets the given vector "dest" with the given floats.
|
2860
|
+
* @param x - defines the x coordinate of the source
|
2861
|
+
* @param y - defines the y coordinate of the source
|
2862
|
+
* @param z - defines the z coordinate of the source
|
2863
|
+
* @param dest - defines the Vector3 where to store the result
|
2864
|
+
*/
|
2865
|
+
export function copyFromFloats(x: number, y: number, z: number, dest: MutableVector3): void;
|
2849
2866
|
/**
|
2850
2867
|
* Returns a new Vector3 with the same value
|
2851
2868
|
* @returns the resulting vector
|
2852
2869
|
*/
|
2853
2870
|
export function clone(source: ReadonlyVector3): MutableVector3;
|
2871
|
+
/**
|
2872
|
+
* Get the clip factor between two vectors
|
2873
|
+
* @param vector0 - defines the first operand
|
2874
|
+
* @param vector1 - defines the second operand
|
2875
|
+
* @param axis - defines the axis to use
|
2876
|
+
* @param size - defines the size along the axis
|
2877
|
+
* @returns the clip factor
|
2878
|
+
*/
|
2879
|
+
export function getClipFactor(vector0: ReadonlyVector3, vector1: ReadonlyVector3, axis: ReadonlyVector3, size: number): number;
|
2880
|
+
/**
|
2881
|
+
* Get angle between two vectors
|
2882
|
+
* @param vector0 - angle between vector0 and vector1
|
2883
|
+
* @param vector1 - angle between vector0 and vector1
|
2884
|
+
* @param normal - direction of the normal
|
2885
|
+
* @returns the angle between vector0 and vector1
|
2886
|
+
*/
|
2887
|
+
export function getAngleBetweenVectors(vector0: ReadonlyVector3, vector1: ReadonlyVector3, normal: ReadonlyVector3): number;
|
2888
|
+
/**
|
2889
|
+
* Returns a new Vector3 set from the index "offset" of the given array
|
2890
|
+
* @param array - defines the source array
|
2891
|
+
* @param offset - defines the offset in the source array
|
2892
|
+
* @returns the new Vector3
|
2893
|
+
*/
|
2894
|
+
export function fromArray(array: FloatArray, offset?: number): MutableVector3;
|
2895
|
+
/**
|
2896
|
+
* Returns a new Vector3 set from the index "offset" of the given FloatArray
|
2897
|
+
* This function is deprecated. Use FromArray instead
|
2898
|
+
* @param array - defines the source array
|
2899
|
+
* @param offset - defines the offset in the source array
|
2900
|
+
* @returns the new Vector3
|
2901
|
+
*/
|
2902
|
+
export function fromFloatArray(array: FloatArray, offset?: number): MutableVector3;
|
2903
|
+
/**
|
2904
|
+
* Sets the given vector "result" with the element values from the index "offset" of the given array
|
2905
|
+
* @param array - defines the source array
|
2906
|
+
* @param offset - defines the offset in the source array
|
2907
|
+
* @param result - defines the Vector3 where to store the result
|
2908
|
+
*/
|
2909
|
+
export function fromArrayToRef(array: number[], offset: number, result: MutableVector3): void;
|
2910
|
+
/**
|
2911
|
+
* Sets the given vector "result" with the element values from the index "offset" of the given FloatArray
|
2912
|
+
* This function is deprecated. Use FromArrayToRef instead.
|
2913
|
+
* @param array - defines the source array
|
2914
|
+
* @param offset - defines the offset in the source array
|
2915
|
+
* @param result - defines the Vector3 where to store the result
|
2916
|
+
*/
|
2917
|
+
export function fromFloatArrayToRef(array: FloatArray, offset: number, result: MutableVector3): void;
|
2854
2918
|
/**
|
2855
2919
|
* Gets the length of the Vector3
|
2856
2920
|
* @returns the length of the Vecto3
|
@@ -2906,13 +2970,31 @@ export declare namespace Vector3 {
|
|
2906
2970
|
* @returns the dot product
|
2907
2971
|
*/
|
2908
2972
|
export function dot(left: ReadonlyVector3, right: ReadonlyVector3): number;
|
2973
|
+
/**
|
2974
|
+
* Multiplies this vector (with an implicit 1 in the 4th dimension) and m, and divides by perspective
|
2975
|
+
* @param matrix - The transformation matrix
|
2976
|
+
* @returns result Vector3
|
2977
|
+
*/
|
2978
|
+
export function applyMatrix4(vector: ReadonlyVector3, matrix: Matrix.ReadonlyMatrix): MutableVector3;
|
2979
|
+
/**
|
2980
|
+
* Multiplies this vector (with an implicit 1 in the 4th dimension) and m, and divides by perspective and set the given vector "result" with this result
|
2981
|
+
* @param matrix - The transformation matrix
|
2982
|
+
* @param result - defines the Vector3 object where to store the result
|
2983
|
+
*/
|
2984
|
+
export function applyMatrix4ToRef(vector: ReadonlyVector3, matrix: Matrix.ReadonlyMatrix, result: MutableVector3): void;
|
2985
|
+
/**
|
2986
|
+
* Rotates the current Vector3 based on the given quaternion
|
2987
|
+
* @param q - defines the Quaternion
|
2988
|
+
* @returns the current Vector3
|
2989
|
+
*/
|
2990
|
+
export function rotate(vector: ReadonlyVector3, q: Quaternion.ReadonlyQuaternion): MutableVector3;
|
2909
2991
|
/**
|
2910
2992
|
* Rotates current Vector3 based on the given quaternion, but applies the rotation to target Vector3.
|
2911
2993
|
* @param q - defines the Quaternion
|
2912
2994
|
* @param result - defines the target Vector3
|
2913
2995
|
* @returns the current Vector3
|
2914
2996
|
*/
|
2915
|
-
export function
|
2997
|
+
export function rotateToRef(vector: ReadonlyVector3, q: Quaternion.ReadonlyQuaternion, result: MutableVector3): void;
|
2916
2998
|
/**
|
2917
2999
|
* Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end"
|
2918
3000
|
* @param start - defines the start value
|
@@ -2945,6 +3027,253 @@ export declare namespace Vector3 {
|
|
2945
3027
|
* @param result - defines the Vector3 where to store the result
|
2946
3028
|
*/
|
2947
3029
|
export function crossToRef(left: ReadonlyVector3, right: ReadonlyVector3, result: MutableVector3): void;
|
3030
|
+
/**
|
3031
|
+
* Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector.
|
3032
|
+
* This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
|
3033
|
+
* @param vector - defines the Vector3 to transform
|
3034
|
+
* @param transformation - defines the transformation matrix
|
3035
|
+
* @returns the transformed Vector3
|
3036
|
+
*/
|
3037
|
+
export function transformCoordinates(vector: ReadonlyVector3, transformation: Matrix.ReadonlyMatrix): MutableVector3;
|
3038
|
+
/**
|
3039
|
+
* Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector
|
3040
|
+
* This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
|
3041
|
+
* @param vector - defines the Vector3 to transform
|
3042
|
+
* @param transformation - defines the transformation matrix
|
3043
|
+
* @param result - defines the Vector3 where to store the result
|
3044
|
+
*/
|
3045
|
+
export function transformCoordinatesToRef(vector: ReadonlyVector3, transformation: Matrix.ReadonlyMatrix, result: MutableVector3): void;
|
3046
|
+
/**
|
3047
|
+
* Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
|
3048
|
+
* This method computes tranformed coordinates only, not transformed direction vectors
|
3049
|
+
* @param x - define the x coordinate of the source vector
|
3050
|
+
* @param y - define the y coordinate of the source vector
|
3051
|
+
* @param z - define the z coordinate of the source vector
|
3052
|
+
* @param transformation - defines the transformation matrix
|
3053
|
+
* @param result - defines the Vector3 where to store the result
|
3054
|
+
*/
|
3055
|
+
export function transformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix.ReadonlyMatrix, result: MutableVector3): void;
|
3056
|
+
/**
|
3057
|
+
* Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector
|
3058
|
+
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
3059
|
+
* @param vector - defines the Vector3 to transform
|
3060
|
+
* @param transformation - defines the transformation matrix
|
3061
|
+
* @returns the new Vector3
|
3062
|
+
*/
|
3063
|
+
export function transformNormal(vector: ReadonlyVector3, transformation: Matrix.ReadonlyMatrix): MutableVector3;
|
3064
|
+
/**
|
3065
|
+
* Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector
|
3066
|
+
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
3067
|
+
* @param vector - defines the Vector3 to transform
|
3068
|
+
* @param transformation - defines the transformation matrix
|
3069
|
+
* @param result - defines the Vector3 where to store the result
|
3070
|
+
*/
|
3071
|
+
export function transformNormalToRef(vector: ReadonlyVector3, transformation: Matrix.ReadonlyMatrix, result: MutableVector3): void;
|
3072
|
+
/**
|
3073
|
+
* Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z)
|
3074
|
+
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
3075
|
+
* @param x - define the x coordinate of the source vector
|
3076
|
+
* @param y - define the y coordinate of the source vector
|
3077
|
+
* @param z - define the z coordinate of the source vector
|
3078
|
+
* @param transformation - defines the transformation matrix
|
3079
|
+
* @param result - defines the Vector3 where to store the result
|
3080
|
+
*/
|
3081
|
+
export function transformNormalFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix.ReadonlyMatrix, result: MutableVector3): void;
|
3082
|
+
/**
|
3083
|
+
* Returns a new Vector3 located for "amount" on the CatmullRom interpolation spline defined by the vectors "value1", "value2", "value3", "value4"
|
3084
|
+
* @param value1 - defines the first control point
|
3085
|
+
* @param value2 - defines the second control point
|
3086
|
+
* @param value3 - defines the third control point
|
3087
|
+
* @param value4 - defines the fourth control point
|
3088
|
+
* @param amount - defines the amount on the spline to use
|
3089
|
+
* @returns the new Vector3
|
3090
|
+
*/
|
3091
|
+
export function catmullRom(value1: ReadonlyVector3, value2: ReadonlyVector3, value3: ReadonlyVector3, value4: ReadonlyVector3, amount: number): MutableVector3;
|
3092
|
+
/**
|
3093
|
+
* Returns a new Vector3 set with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max"
|
3094
|
+
* If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
|
3095
|
+
* If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
|
3096
|
+
* @param value - defines the current value
|
3097
|
+
* @param min - defines the lower range value
|
3098
|
+
* @param max - defines the upper range value
|
3099
|
+
* @returns the new Vector3
|
3100
|
+
*/
|
3101
|
+
export function clamp(value: ReadonlyVector3, min: ReadonlyVector3, max: ReadonlyVector3): MutableVector3;
|
3102
|
+
/**
|
3103
|
+
* Sets the given vector "result" with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max"
|
3104
|
+
* If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
|
3105
|
+
* If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
|
3106
|
+
* @param value - defines the current value
|
3107
|
+
* @param min - defines the lower range value
|
3108
|
+
* @param max - defines the upper range value
|
3109
|
+
* @param result - defines the Vector3 where to store the result
|
3110
|
+
*/
|
3111
|
+
export function clampToRef(value: ReadonlyVector3, min: ReadonlyVector3, max: ReadonlyVector3, result: MutableVector3): void;
|
3112
|
+
/**
|
3113
|
+
* Returns a new Vector3 located for "amount" (float) on the Hermite interpolation spline defined by the vectors "value1", "tangent1", "value2", "tangent2"
|
3114
|
+
* @param value1 - defines the first control point
|
3115
|
+
* @param tangent1 - defines the first tangent vector
|
3116
|
+
* @param value2 - defines the second control point
|
3117
|
+
* @param tangent2 - defines the second tangent vector
|
3118
|
+
* @param amount - defines the amount on the interpolation spline (between 0 and 1)
|
3119
|
+
* @returns the new Vector3
|
3120
|
+
*/
|
3121
|
+
export function hermite(value1: ReadonlyVector3, tangent1: ReadonlyVector3, value2: ReadonlyVector3, tangent2: ReadonlyVector3, amount: number): MutableVector3;
|
3122
|
+
/**
|
3123
|
+
* Gets the minimal coordinate values between two Vector3
|
3124
|
+
* @param left - defines the first operand
|
3125
|
+
* @param right - defines the second operand
|
3126
|
+
* @returns the new Vector3
|
3127
|
+
*/
|
3128
|
+
export function minimize(left: ReadonlyVector3, right: ReadonlyVector3): MutableVector3;
|
3129
|
+
/**
|
3130
|
+
* Gets the maximal coordinate values between two Vector3
|
3131
|
+
* @param left - defines the first operand
|
3132
|
+
* @param right - defines the second operand
|
3133
|
+
* @returns the new Vector3
|
3134
|
+
*/
|
3135
|
+
export function maximize(left: MutableVector3, right: MutableVector3): MutableVector3;
|
3136
|
+
/**
|
3137
|
+
* Returns the distance between the vectors "value1" and "value2"
|
3138
|
+
* @param value1 - defines the first operand
|
3139
|
+
* @param value2 - defines the second operand
|
3140
|
+
* @returns the distance
|
3141
|
+
*/
|
3142
|
+
export function distance(value1: ReadonlyVector3, value2: ReadonlyVector3): number;
|
3143
|
+
/**
|
3144
|
+
* Returns the squared distance between the vectors "value1" and "value2"
|
3145
|
+
* @param value1 - defines the first operand
|
3146
|
+
* @param value2 - defines the second operand
|
3147
|
+
* @returns the squared distance
|
3148
|
+
*/
|
3149
|
+
export function distanceSquared(value1: ReadonlyVector3, value2: ReadonlyVector3): number;
|
3150
|
+
/**
|
3151
|
+
* Returns a new Vector3 located at the center between "value1" and "value2"
|
3152
|
+
* @param value1 - defines the first operand
|
3153
|
+
* @param value2 - defines the second operand
|
3154
|
+
* @returns the new Vector3
|
3155
|
+
*/
|
3156
|
+
export function center(value1: ReadonlyVector3, value2: ReadonlyVector3): MutableVector3;
|
3157
|
+
/**
|
3158
|
+
* Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system),
|
3159
|
+
* RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply
|
3160
|
+
* to something in order to rotate it from its local system to the given target system
|
3161
|
+
* Note: axis1, axis2 and axis3 are normalized during this operation
|
3162
|
+
* @param axis1 - defines the first axis
|
3163
|
+
* @param axis2 - defines the second axis
|
3164
|
+
* @param axis3 - defines the third axis
|
3165
|
+
* @returns a new Vector3
|
3166
|
+
*/
|
3167
|
+
export function rotationFromAxis(axis1: MutableVector3, axis2: MutableVector3, axis3: MutableVector3): MutableVector3;
|
3168
|
+
/**
|
3169
|
+
* The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3
|
3170
|
+
* @param axis1 - defines the first axis
|
3171
|
+
* @param axis2 - defines the second axis
|
3172
|
+
* @param axis3 - defines the third axis
|
3173
|
+
* @param ref - defines the Vector3 where to store the result
|
3174
|
+
*/
|
3175
|
+
export function rotationFromAxisToRef(axis1: MutableVector3, axis2: MutableVector3, axis3: MutableVector3, result: MutableVector3): void;
|
3176
|
+
/**
|
3177
|
+
* Creates a string representation of the Vector3
|
3178
|
+
* @returns a string with the Vector3 coordinates.
|
3179
|
+
*/
|
3180
|
+
export function toString(vector: ReadonlyVector3): string;
|
3181
|
+
/**
|
3182
|
+
* Creates the Vector3 hash code
|
3183
|
+
* @returns a number which tends to be unique between Vector3 instances
|
3184
|
+
*/
|
3185
|
+
export function getHashCode(vector: ReadonlyVector3): number;
|
3186
|
+
/**
|
3187
|
+
* Returns true if the vector1 and the vector2 coordinates are strictly equal
|
3188
|
+
* @param vector1 - defines the first operand
|
3189
|
+
* @param vector2 - defines the second operand
|
3190
|
+
* @returns true if both vectors are equals
|
3191
|
+
*/
|
3192
|
+
export function equals(vector1: ReadonlyVector3, vector2: ReadonlyVector3): boolean;
|
3193
|
+
/**
|
3194
|
+
* Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon
|
3195
|
+
* @param otherVector - defines the second operand
|
3196
|
+
* @param epsilon - defines the minimal distance to define values as equals
|
3197
|
+
* @returns true if both vectors are distant less than epsilon
|
3198
|
+
*/
|
3199
|
+
export function equalsWithEpsilon(vector1: ReadonlyVector3, vector2: ReadonlyVector3, epsilon?: number): boolean;
|
3200
|
+
/**
|
3201
|
+
* Returns true if the current Vector3 coordinates equals the given floats
|
3202
|
+
* @param x - defines the x coordinate of the operand
|
3203
|
+
* @param y - defines the y coordinate of the operand
|
3204
|
+
* @param z - defines the z coordinate of the operand
|
3205
|
+
* @returns true if both vectors are equals
|
3206
|
+
*/
|
3207
|
+
export function equalsToFloats(vector: ReadonlyVector3, x: number, y: number, z: number): boolean;
|
3208
|
+
/**
|
3209
|
+
* Returns a new Vector3, result of the multiplication of vector1 by the vector2
|
3210
|
+
* @param vector1 - defines the first operand
|
3211
|
+
* @param vector2 - defines the second operand
|
3212
|
+
* @returns the new Vector3
|
3213
|
+
*/
|
3214
|
+
export function multiply(vector1: ReadonlyVector3, vector2: ReadonlyVector3): MutableVector3;
|
3215
|
+
/**
|
3216
|
+
* Multiplies the current Vector3 by the given one and stores the result in the given vector "result"
|
3217
|
+
* @param otherVector - defines the second operand
|
3218
|
+
* @param result - defines the Vector3 object where to store the result
|
3219
|
+
* @returns the current Vector3
|
3220
|
+
*/
|
3221
|
+
export function multiplyToRef(vector1: ReadonlyVector3, vector2: ReadonlyVector3, result: MutableVector3): void;
|
3222
|
+
/**
|
3223
|
+
* Returns a new Vector3 set with the result of the mulliplication of the current Vector3 coordinates by the given floats
|
3224
|
+
* @param x - defines the x coordinate of the operand
|
3225
|
+
* @param y - defines the y coordinate of the operand
|
3226
|
+
* @param z - defines the z coordinate of the operand
|
3227
|
+
* @returns the new Vector3
|
3228
|
+
*/
|
3229
|
+
export function multiplyByFloatsToRef(vector1: ReadonlyVector3, x: number, y: number, z: number, result: MutableVector3): void;
|
3230
|
+
/**
|
3231
|
+
* Returns a new Vector3 set with the result of the mulliplication of the current Vector3 coordinates by the given floats
|
3232
|
+
* @param x - defines the x coordinate of the operand
|
3233
|
+
* @param y - defines the y coordinate of the operand
|
3234
|
+
* @param z - defines the z coordinate of the operand
|
3235
|
+
* @returns the new Vector3
|
3236
|
+
*/
|
3237
|
+
export function multiplyByFloats(vector1: ReadonlyVector3, x: number, y: number, z: number): MutableVector3;
|
3238
|
+
/**
|
3239
|
+
* Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones
|
3240
|
+
* @param otherVector - defines the second operand
|
3241
|
+
* @returns the new Vector3
|
3242
|
+
*/
|
3243
|
+
export function divide(vector1: ReadonlyVector3, vector2: ReadonlyVector3): MutableVector3;
|
3244
|
+
/**
|
3245
|
+
* Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result"
|
3246
|
+
* @param otherVector - defines the second operand
|
3247
|
+
* @param result - defines the Vector3 object where to store the result
|
3248
|
+
* @returns the current Vector3
|
3249
|
+
*/
|
3250
|
+
export function divideToRef(vector1: ReadonlyVector3, vector2: ReadonlyVector3, result: MutableVector3): void;
|
3251
|
+
/**
|
3252
|
+
* Set result Vector3 with the maximal coordinate values between vector1 and the given coordinates
|
3253
|
+
* @param x - defines the x coordinate of the operand
|
3254
|
+
* @param y - defines the y coordinate of the operand
|
3255
|
+
* @param z - defines the z coordinate of the operand
|
3256
|
+
* @param result - the set Vector3
|
3257
|
+
*/
|
3258
|
+
export function maximizeInPlaceFromFloatsToRef(vector1: ReadonlyVector3, x: number, y: number, z: number, result: MutableVector3): void;
|
3259
|
+
/**
|
3260
|
+
* Set result Vector3 with the minimal coordinate values between vector1 and the given coordinates
|
3261
|
+
* @param x - defines the x coordinate of the operand
|
3262
|
+
* @param y - defines the y coordinate of the operand
|
3263
|
+
* @param z - defines the z coordinate of the operand
|
3264
|
+
* @param result - the set Vector3
|
3265
|
+
*/
|
3266
|
+
export function minimizeInPlaceFromFloatsToRef(vector1: ReadonlyVector3, x: number, y: number, z: number, result: MutableVector3): void;
|
3267
|
+
/**
|
3268
|
+
* Gets a new Vector3 from vector1 floored values
|
3269
|
+
* @returns a new Vector3
|
3270
|
+
*/
|
3271
|
+
export function floor(vector1: ReadonlyVector3): MutableVector3;
|
3272
|
+
/**
|
3273
|
+
* Gets a new Vector3 from vector1 floored values
|
3274
|
+
* @returns a new Vector3
|
3275
|
+
*/
|
3276
|
+
export function fract(vector1: ReadonlyVector3): MutableVector3;
|
2948
3277
|
/**
|
2949
3278
|
* Returns a new Vector3 set to (0.0, 0.0, 0.0)
|
2950
3279
|
* @returns a new empty Vector3
|
@@ -2985,6 +3314,11 @@ export declare namespace Vector3 {
|
|
2985
3314
|
* @returns a new left Vector3
|
2986
3315
|
*/
|
2987
3316
|
export function Left(): MutableVector3;
|
3317
|
+
/**
|
3318
|
+
* Returns a new random Vector3
|
3319
|
+
* @returns a random Vector3
|
3320
|
+
*/
|
3321
|
+
export function Random(): MutableVector3;
|
2988
3322
|
}
|
2989
3323
|
|
2990
3324
|
declare interface Vector3_2 {
|