@dcl/sdk 7.0.0-3040253589.commit-8782388 → 7.0.0-3046198202.commit-4f23ef8
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 +423 -121
- package/dist/ecs7/index.js +2994 -407
- package/dist/ecs7/index.min.js +1 -1
- package/dist/ecs7/index.min.js.map +1 -1
- package/package.json +4 -4
- package/types/ecs7/index.d.ts +422 -120
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,7 @@ declare const enum FilterMode {
|
|
553
536
|
}
|
554
537
|
|
555
538
|
/** @public */
|
556
|
-
|
557
|
-
|
558
|
-
/** @public */
|
559
|
-
export declare type FloatArray = number[];
|
539
|
+
declare type FloatArray = number[];
|
560
540
|
|
561
541
|
declare const enum Font {
|
562
542
|
LiberationSans = 0,
|
@@ -707,21 +687,6 @@ export declare type ISchema<T = any> = {
|
|
707
687
|
create(): T;
|
708
688
|
};
|
709
689
|
|
710
|
-
/**
|
711
|
-
* Interface for the size containing width and height
|
712
|
-
* @public
|
713
|
-
*/
|
714
|
-
export declare interface ISize {
|
715
|
-
/**
|
716
|
-
* Width
|
717
|
-
*/
|
718
|
-
width: number;
|
719
|
-
/**
|
720
|
-
* Heighht
|
721
|
-
*/
|
722
|
-
height: number;
|
723
|
-
}
|
724
|
-
|
725
690
|
/**
|
726
691
|
* Check if a pointer event has been emited in the last tick-update.
|
727
692
|
* @param entity the entity to query, for global clicks use `engine.RootEntity`
|
@@ -774,11 +739,23 @@ declare namespace Matrix {
|
|
774
739
|
_isIdentity3x2Dirty: boolean;
|
775
740
|
_m: Matrix4x4;
|
776
741
|
};
|
777
|
-
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
|
+
};
|
778
755
|
/**
|
779
756
|
* Gets the internal data of the matrix
|
780
757
|
*/
|
781
|
-
function m(self: MutableMatrix):
|
758
|
+
function m(self: MutableMatrix): Matrix4x4;
|
782
759
|
/**
|
783
760
|
* Gets an identity matrix that must not be updated
|
784
761
|
*/
|
@@ -793,14 +770,14 @@ declare namespace Matrix {
|
|
793
770
|
* @param offset - defines an offset in the source array
|
794
771
|
* @returns a new Matrix set from the starting index of the given array
|
795
772
|
*/
|
796
|
-
function fromArray(array:
|
773
|
+
function fromArray(array: Matrix4x4, offset?: number): MutableMatrix;
|
797
774
|
/**
|
798
775
|
* Copy the content of an array into a given matrix
|
799
776
|
* @param array - defines the source array
|
800
777
|
* @param offset - defines an offset in the source array
|
801
778
|
* @param result - defines the target matrix
|
802
779
|
*/
|
803
|
-
function fromArrayToRef(array:
|
780
|
+
function fromArrayToRef(array: Matrix4x4, offset: number, result: MutableMatrix): void;
|
804
781
|
/**
|
805
782
|
* Stores an array into a matrix after having multiplied each component by a given factor
|
806
783
|
* @param array - defines the source array
|
@@ -1246,12 +1223,12 @@ declare namespace Matrix {
|
|
1246
1223
|
* Returns the matrix as a FloatArray
|
1247
1224
|
* @returns the matrix underlying array
|
1248
1225
|
*/
|
1249
|
-
function toArray(self: ReadonlyMatrix):
|
1226
|
+
function toArray(self: ReadonlyMatrix): Matrix4x4;
|
1250
1227
|
/**
|
1251
1228
|
* Returns the matrix as a FloatArray
|
1252
1229
|
* @returns the matrix underlying array.
|
1253
1230
|
*/
|
1254
|
-
function asArray(self: ReadonlyMatrix):
|
1231
|
+
function asArray(self: ReadonlyMatrix): Matrix4x4;
|
1255
1232
|
/**
|
1256
1233
|
* Sets all the matrix elements to zero
|
1257
1234
|
* @returns the current matrix
|
@@ -1458,16 +1435,27 @@ declare namespace Matrix {
|
|
1458
1435
|
}
|
1459
1436
|
|
1460
1437
|
/** @public */
|
1461
|
-
export declare const MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, PBMeshCollider
|
1438
|
+
export declare const MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, Partial<PBMeshCollider>>;
|
1462
1439
|
|
1463
1440
|
/** @public */
|
1464
1441
|
export declare const MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
|
1465
1442
|
|
1466
|
-
/**
|
1467
|
-
|
1443
|
+
/**
|
1444
|
+
* @public
|
1445
|
+
* @deprecated
|
1446
|
+
*/
|
1447
|
+
export declare class MessageBus {
|
1448
|
+
private messageQueue;
|
1449
|
+
private connected;
|
1450
|
+
private flushing;
|
1451
|
+
constructor();
|
1452
|
+
on(message: string, callback: (value: any, sender: string) => void): Observer<IEvents['comms']>;
|
1453
|
+
emit(message: string, payload: Record<any, any>): void;
|
1454
|
+
private flush;
|
1455
|
+
}
|
1468
1456
|
|
1469
1457
|
/** @public */
|
1470
|
-
export declare
|
1458
|
+
export declare const NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTShape>;
|
1471
1459
|
|
1472
1460
|
/**
|
1473
1461
|
* The Observable class is a simple implementation of the Observable pattern.
|
@@ -1661,15 +1649,6 @@ export declare class ObserverEventState {
|
|
1661
1649
|
initalize(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any): ObserverEventState;
|
1662
1650
|
}
|
1663
1651
|
|
1664
|
-
/**
|
1665
|
-
* This event is triggered when you change your camera between 1st and 3rd person
|
1666
|
-
* @public
|
1667
|
-
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
1668
|
-
*/
|
1669
|
-
export declare const onCameraModeChangedObservable: Observable<{
|
1670
|
-
cameraMode: 0 | 1 | 2;
|
1671
|
-
}>;
|
1672
|
-
|
1673
1652
|
/** @public
|
1674
1653
|
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
1675
1654
|
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed. Use onEnterSceneObservable instead. */
|
@@ -1686,15 +1665,6 @@ export declare const onEnterSceneObservable: Observable<{
|
|
1686
1665
|
userId: string;
|
1687
1666
|
}>;
|
1688
1667
|
|
1689
|
-
/**
|
1690
|
-
* This event is triggered when you change your camera between 1st and 3rd person
|
1691
|
-
* @public
|
1692
|
-
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
1693
|
-
*/
|
1694
|
-
export declare const onIdleStateChangedObservable: Observable<{
|
1695
|
-
isIdle: boolean;
|
1696
|
-
}>;
|
1697
|
-
|
1698
1668
|
/** @public
|
1699
1669
|
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
1700
1670
|
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed. Use onLeaveSceneObservable instead. */
|
@@ -1762,14 +1732,6 @@ export declare const OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>
|
|
1762
1732
|
/** @public */
|
1763
1733
|
export declare const OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>, PBOnPointerDownResult>;
|
1764
1734
|
|
1765
|
-
/**
|
1766
|
-
* @public
|
1767
|
-
* @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
|
1768
|
-
*/
|
1769
|
-
export declare const onPointerLockedStateChange: Observable<{
|
1770
|
-
locked?: boolean | undefined;
|
1771
|
-
}>;
|
1772
|
-
|
1773
1735
|
/** @public */
|
1774
1736
|
export declare const OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>, PBOnPointerUp>;
|
1775
1737
|
|
@@ -1815,19 +1777,6 @@ export declare const onVideoEvent: Observable<{
|
|
1815
1777
|
totalVideoLength: number;
|
1816
1778
|
}>;
|
1817
1779
|
|
1818
|
-
/**
|
1819
|
-
* Defines potential orientation for back face culling
|
1820
|
-
* @public
|
1821
|
-
*/
|
1822
|
-
export declare enum Orientation {
|
1823
|
-
/**
|
1824
|
-
* Clockwise
|
1825
|
-
*/
|
1826
|
-
CW = 0,
|
1827
|
-
/** Counter clockwise */
|
1828
|
-
CCW = 1
|
1829
|
-
}
|
1830
|
-
|
1831
1780
|
declare interface PBAnimationState {
|
1832
1781
|
name: string;
|
1833
1782
|
clip: string;
|
@@ -2301,7 +2250,16 @@ declare namespace Plane {
|
|
2301
2250
|
*/
|
2302
2251
|
d: number;
|
2303
2252
|
};
|
2304
|
-
type ReadonlyPlane =
|
2253
|
+
type ReadonlyPlane = {
|
2254
|
+
/**
|
2255
|
+
* Normal of the plane (a,b,c)
|
2256
|
+
*/
|
2257
|
+
normal: Vector3.ReadonlyVector3;
|
2258
|
+
/**
|
2259
|
+
* d component of the plane
|
2260
|
+
*/
|
2261
|
+
d: number;
|
2262
|
+
};
|
2305
2263
|
/**
|
2306
2264
|
* Creates a Plane object according to the given floats a, b, c, d and the plane equation : ax + by + cz + d = 0
|
2307
2265
|
* @param a - a component of the plane
|
@@ -2318,7 +2276,7 @@ declare namespace Plane {
|
|
2318
2276
|
* @param array - the array to create a plane from
|
2319
2277
|
* @returns a new Plane from the given array.
|
2320
2278
|
*/
|
2321
|
-
function fromArray(array:
|
2279
|
+
function fromArray(array: number[]): MutablePlane;
|
2322
2280
|
/**
|
2323
2281
|
* Creates a plane from three points
|
2324
2282
|
* @param point1 - point used to create the plane
|
@@ -2456,7 +2414,12 @@ export declare namespace Quaternion {
|
|
2456
2414
|
/**
|
2457
2415
|
* @public
|
2458
2416
|
*/
|
2459
|
-
export type ReadonlyQuaternion =
|
2417
|
+
export type ReadonlyQuaternion = {
|
2418
|
+
readonly y: number;
|
2419
|
+
readonly x: number;
|
2420
|
+
readonly z: number;
|
2421
|
+
readonly w: number;
|
2422
|
+
};
|
2460
2423
|
/**
|
2461
2424
|
* Creates a new Quaternion from the given floats
|
2462
2425
|
* @param x - defines the first component (0 by default)
|
@@ -2598,6 +2561,22 @@ export declare namespace Quaternion {
|
|
2598
2561
|
*/
|
2599
2562
|
export function multiplyToRef(self: ReadonlyQuaternion, q1: ReadonlyQuaternion, result: MutableQuaternion): void;
|
2600
2563
|
export function angleAxis(degress: number, axis: Vector3.ReadonlyVector3): MutableQuaternion;
|
2564
|
+
/**
|
2565
|
+
* 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)
|
2566
|
+
* @param axis1 - defines the first axis
|
2567
|
+
* @param axis2 - defines the second axis
|
2568
|
+
* @param axis3 - defines the third axis
|
2569
|
+
* @returns the new quaternion
|
2570
|
+
*/
|
2571
|
+
export function rotationQuaternionFromAxis(axis1: Vector3.ReadonlyVector3, axis2: Vector3.ReadonlyVector3, axis3: Vector3.ReadonlyVector3): MutableQuaternion;
|
2572
|
+
/**
|
2573
|
+
* 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
|
2574
|
+
* @param axis1 - defines the first axis
|
2575
|
+
* @param axis2 - defines the second axis
|
2576
|
+
* @param axis3 - defines the third axis
|
2577
|
+
* @param ref - defines the target quaternion
|
2578
|
+
*/
|
2579
|
+
export function rotationQuaternionFromAxisToRef(axis1: Vector3.ReadonlyVector3, axis2: Vector3.ReadonlyVector3, axis3: Vector3.ReadonlyVector3, ref: MutableQuaternion): void;
|
2601
2580
|
/**
|
2602
2581
|
* Returns a zero filled quaternion
|
2603
2582
|
*/
|
@@ -2687,19 +2666,6 @@ export declare namespace Schemas {
|
|
2687
2666
|
*/
|
2688
2667
|
export declare type SdkComponents = ReturnType<typeof defineSdkComponents>;
|
2689
2668
|
|
2690
|
-
/**
|
2691
|
-
* Defines supported spaces
|
2692
|
-
* @public
|
2693
|
-
*/
|
2694
|
-
export declare enum Space {
|
2695
|
-
/** Local (object) space */
|
2696
|
-
LOCAL = 0,
|
2697
|
-
/** World space */
|
2698
|
-
WORLD = 1,
|
2699
|
-
/** Bone space */
|
2700
|
-
BONE = 2
|
2701
|
-
}
|
2702
|
-
|
2703
2669
|
/**
|
2704
2670
|
* @public
|
2705
2671
|
*/
|
@@ -2733,18 +2699,6 @@ declare const enum TextureWrapMode {
|
|
2733
2699
|
UNRECOGNIZED = -1
|
2734
2700
|
}
|
2735
2701
|
|
2736
|
-
/**
|
2737
|
-
* Constant used to convert a value to gamma space
|
2738
|
-
* @public
|
2739
|
-
*/
|
2740
|
-
export declare const ToGammaSpace: number;
|
2741
|
-
|
2742
|
-
/**
|
2743
|
-
* Constant used to convert a value to linear space
|
2744
|
-
* @public
|
2745
|
-
*/
|
2746
|
-
export declare const ToLinearSpace = 2.2;
|
2747
|
-
|
2748
2702
|
declare type ToOptional<T> = OnlyOptionalUndefinedTypes<T> & OnlyNonUndefinedTypes<T>;
|
2749
2703
|
|
2750
2704
|
/** @public */
|
@@ -2812,14 +2766,23 @@ export declare namespace Vector3 {
|
|
2812
2766
|
* @public
|
2813
2767
|
*/
|
2814
2768
|
export type MutableVector3 = {
|
2815
|
-
y: number;
|
2816
2769
|
x: number;
|
2770
|
+
y: number;
|
2817
2771
|
z: number;
|
2818
2772
|
};
|
2819
2773
|
/**
|
2820
2774
|
* @public
|
2821
2775
|
*/
|
2822
|
-
export type ReadonlyVector3 =
|
2776
|
+
export type ReadonlyVector3 = {
|
2777
|
+
readonly x: number;
|
2778
|
+
readonly y: number;
|
2779
|
+
readonly z: number;
|
2780
|
+
};
|
2781
|
+
/**
|
2782
|
+
* Gets a boolean indicating that the vector is non uniform meaning x, y or z are not all the same
|
2783
|
+
* @param vector - vector to check
|
2784
|
+
*/
|
2785
|
+
export function isNonUniform(vector: ReadonlyVector3): boolean;
|
2823
2786
|
/**
|
2824
2787
|
* Creates a new Vector3 object from the given x, y, z (floats) coordinates.
|
2825
2788
|
* @param x - defines the first coordinates (on X axis)
|
@@ -2846,31 +2809,100 @@ export declare namespace Vector3 {
|
|
2846
2809
|
* @returns the resulting vector
|
2847
2810
|
*/
|
2848
2811
|
export function add(vector1: ReadonlyVector3, vector2: ReadonlyVector3): MutableVector3;
|
2812
|
+
/**
|
2813
|
+
* Add component by component the vector2 into dest
|
2814
|
+
* @param dest - the first vector and destination of addition
|
2815
|
+
* @param vector2 - the second vector
|
2816
|
+
*/
|
2817
|
+
export function addToRef(vector1: ReadonlyVector3, vector2: ReadonlyVector3, result: MutableVector3): void;
|
2849
2818
|
/**
|
2850
2819
|
* Returns a new Vector3 as the result of the substraction of the two given vectors.
|
2851
2820
|
* @returns the resulting vector
|
2852
2821
|
*/
|
2853
|
-
export function subtract(
|
2822
|
+
export function subtract(vector1: ReadonlyVector3, vector2: ReadonlyVector3): MutableVector3;
|
2854
2823
|
/**
|
2855
2824
|
* Returns a new Vector3 as the result of the substraction of the two given vectors.
|
2856
2825
|
* @returns the resulting vector
|
2857
2826
|
*/
|
2858
|
-
export function subtractToRef(
|
2827
|
+
export function subtractToRef(vector1: ReadonlyVector3, vector2: ReadonlyVector3, result: MutableVector3): void;
|
2828
|
+
/**
|
2829
|
+
* Subtracts the given floats from the current Vector3 coordinates and set the given vector "result" with this result
|
2830
|
+
* @param x - defines the x coordinate of the operand
|
2831
|
+
* @param y - defines the y coordinate of the operand
|
2832
|
+
* @param z - defines the z coordinate of the operand
|
2833
|
+
* @param result - defines the Vector3 object where to store the result
|
2834
|
+
*/
|
2835
|
+
export function subtractFromFloatsToRef(vector1: ReadonlyVector3, x: number, y: number, z: number, result: MutableVector3): void;
|
2859
2836
|
/**
|
2860
2837
|
* Returns a new Vector3 with the other sign
|
2861
2838
|
* @returns the resulting vector
|
2862
2839
|
*/
|
2863
|
-
export function
|
2840
|
+
export function negate(value: ReadonlyVector3): MutableVector3;
|
2864
2841
|
/**
|
2865
2842
|
* Copy source into dest
|
2866
2843
|
*
|
2867
2844
|
*/
|
2868
2845
|
export function copy(source: ReadonlyVector3, dest: MutableVector3): void;
|
2846
|
+
/**
|
2847
|
+
* Sets the given vector "dest" with the given floats.
|
2848
|
+
* @param x - defines the x coordinate of the source
|
2849
|
+
* @param y - defines the y coordinate of the source
|
2850
|
+
* @param z - defines the z coordinate of the source
|
2851
|
+
* @param dest - defines the Vector3 where to store the result
|
2852
|
+
*/
|
2853
|
+
export function copyFromFloats(x: number, y: number, z: number, dest: MutableVector3): void;
|
2869
2854
|
/**
|
2870
2855
|
* Returns a new Vector3 with the same value
|
2871
2856
|
* @returns the resulting vector
|
2872
2857
|
*/
|
2873
2858
|
export function clone(source: ReadonlyVector3): MutableVector3;
|
2859
|
+
/**
|
2860
|
+
* Get the clip factor between two vectors
|
2861
|
+
* @param vector0 - defines the first operand
|
2862
|
+
* @param vector1 - defines the second operand
|
2863
|
+
* @param axis - defines the axis to use
|
2864
|
+
* @param size - defines the size along the axis
|
2865
|
+
* @returns the clip factor
|
2866
|
+
*/
|
2867
|
+
export function getClipFactor(vector0: ReadonlyVector3, vector1: ReadonlyVector3, axis: ReadonlyVector3, size: number): number;
|
2868
|
+
/**
|
2869
|
+
* Get angle between two vectors
|
2870
|
+
* @param vector0 - angle between vector0 and vector1
|
2871
|
+
* @param vector1 - angle between vector0 and vector1
|
2872
|
+
* @param normal - direction of the normal
|
2873
|
+
* @returns the angle between vector0 and vector1
|
2874
|
+
*/
|
2875
|
+
export function getAngleBetweenVectors(vector0: ReadonlyVector3, vector1: ReadonlyVector3, normal: ReadonlyVector3): number;
|
2876
|
+
/**
|
2877
|
+
* Returns a new Vector3 set from the index "offset" of the given array
|
2878
|
+
* @param array - defines the source array
|
2879
|
+
* @param offset - defines the offset in the source array
|
2880
|
+
* @returns the new Vector3
|
2881
|
+
*/
|
2882
|
+
export function fromArray(array: FloatArray, offset?: number): MutableVector3;
|
2883
|
+
/**
|
2884
|
+
* Returns a new Vector3 set from the index "offset" of the given FloatArray
|
2885
|
+
* This function is deprecated. Use FromArray instead
|
2886
|
+
* @param array - defines the source array
|
2887
|
+
* @param offset - defines the offset in the source array
|
2888
|
+
* @returns the new Vector3
|
2889
|
+
*/
|
2890
|
+
export function fromFloatArray(array: FloatArray, offset?: number): MutableVector3;
|
2891
|
+
/**
|
2892
|
+
* Sets the given vector "result" with the element values from the index "offset" of the given array
|
2893
|
+
* @param array - defines the source array
|
2894
|
+
* @param offset - defines the offset in the source array
|
2895
|
+
* @param result - defines the Vector3 where to store the result
|
2896
|
+
*/
|
2897
|
+
export function fromArrayToRef(array: number[], offset: number, result: MutableVector3): void;
|
2898
|
+
/**
|
2899
|
+
* Sets the given vector "result" with the element values from the index "offset" of the given FloatArray
|
2900
|
+
* This function is deprecated. Use FromArrayToRef instead.
|
2901
|
+
* @param array - defines the source array
|
2902
|
+
* @param offset - defines the offset in the source array
|
2903
|
+
* @param result - defines the Vector3 where to store the result
|
2904
|
+
*/
|
2905
|
+
export function fromFloatArrayToRef(array: FloatArray, offset: number, result: MutableVector3): void;
|
2874
2906
|
/**
|
2875
2907
|
* Gets the length of the Vector3
|
2876
2908
|
* @returns the length of the Vecto3
|
@@ -2926,13 +2958,31 @@ export declare namespace Vector3 {
|
|
2926
2958
|
* @returns the dot product
|
2927
2959
|
*/
|
2928
2960
|
export function dot(left: ReadonlyVector3, right: ReadonlyVector3): number;
|
2961
|
+
/**
|
2962
|
+
* Multiplies this vector (with an implicit 1 in the 4th dimension) and m, and divides by perspective
|
2963
|
+
* @param matrix - The transformation matrix
|
2964
|
+
* @returns result Vector3
|
2965
|
+
*/
|
2966
|
+
export function applyMatrix4(vector: ReadonlyVector3, matrix: Matrix.ReadonlyMatrix): MutableVector3;
|
2967
|
+
/**
|
2968
|
+
* 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
|
2969
|
+
* @param matrix - The transformation matrix
|
2970
|
+
* @param result - defines the Vector3 object where to store the result
|
2971
|
+
*/
|
2972
|
+
export function applyMatrix4ToRef(vector: ReadonlyVector3, matrix: Matrix.ReadonlyMatrix, result: MutableVector3): void;
|
2973
|
+
/**
|
2974
|
+
* Rotates the current Vector3 based on the given quaternion
|
2975
|
+
* @param q - defines the Quaternion
|
2976
|
+
* @returns the current Vector3
|
2977
|
+
*/
|
2978
|
+
export function rotate(vector: ReadonlyVector3, q: Quaternion.ReadonlyQuaternion): MutableVector3;
|
2929
2979
|
/**
|
2930
2980
|
* Rotates current Vector3 based on the given quaternion, but applies the rotation to target Vector3.
|
2931
2981
|
* @param q - defines the Quaternion
|
2932
2982
|
* @param result - defines the target Vector3
|
2933
2983
|
* @returns the current Vector3
|
2934
2984
|
*/
|
2935
|
-
export function
|
2985
|
+
export function rotateToRef(vector: ReadonlyVector3, q: Quaternion.ReadonlyQuaternion, result: MutableVector3): void;
|
2936
2986
|
/**
|
2937
2987
|
* Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end"
|
2938
2988
|
* @param start - defines the start value
|
@@ -2965,6 +3015,253 @@ export declare namespace Vector3 {
|
|
2965
3015
|
* @param result - defines the Vector3 where to store the result
|
2966
3016
|
*/
|
2967
3017
|
export function crossToRef(left: ReadonlyVector3, right: ReadonlyVector3, result: MutableVector3): void;
|
3018
|
+
/**
|
3019
|
+
* Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector.
|
3020
|
+
* This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
|
3021
|
+
* @param vector - defines the Vector3 to transform
|
3022
|
+
* @param transformation - defines the transformation matrix
|
3023
|
+
* @returns the transformed Vector3
|
3024
|
+
*/
|
3025
|
+
export function transformCoordinates(vector: ReadonlyVector3, transformation: Matrix.ReadonlyMatrix): MutableVector3;
|
3026
|
+
/**
|
3027
|
+
* Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector
|
3028
|
+
* This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
|
3029
|
+
* @param vector - defines the Vector3 to transform
|
3030
|
+
* @param transformation - defines the transformation matrix
|
3031
|
+
* @param result - defines the Vector3 where to store the result
|
3032
|
+
*/
|
3033
|
+
export function transformCoordinatesToRef(vector: ReadonlyVector3, transformation: Matrix.ReadonlyMatrix, result: MutableVector3): void;
|
3034
|
+
/**
|
3035
|
+
* Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
|
3036
|
+
* This method computes tranformed coordinates only, not transformed direction vectors
|
3037
|
+
* @param x - define the x coordinate of the source vector
|
3038
|
+
* @param y - define the y coordinate of the source vector
|
3039
|
+
* @param z - define the z coordinate of the source vector
|
3040
|
+
* @param transformation - defines the transformation matrix
|
3041
|
+
* @param result - defines the Vector3 where to store the result
|
3042
|
+
*/
|
3043
|
+
export function transformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix.ReadonlyMatrix, result: MutableVector3): void;
|
3044
|
+
/**
|
3045
|
+
* Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector
|
3046
|
+
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
3047
|
+
* @param vector - defines the Vector3 to transform
|
3048
|
+
* @param transformation - defines the transformation matrix
|
3049
|
+
* @returns the new Vector3
|
3050
|
+
*/
|
3051
|
+
export function transformNormal(vector: ReadonlyVector3, transformation: Matrix.ReadonlyMatrix): MutableVector3;
|
3052
|
+
/**
|
3053
|
+
* Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector
|
3054
|
+
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
3055
|
+
* @param vector - defines the Vector3 to transform
|
3056
|
+
* @param transformation - defines the transformation matrix
|
3057
|
+
* @param result - defines the Vector3 where to store the result
|
3058
|
+
*/
|
3059
|
+
export function transformNormalToRef(vector: ReadonlyVector3, transformation: Matrix.ReadonlyMatrix, result: MutableVector3): void;
|
3060
|
+
/**
|
3061
|
+
* Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z)
|
3062
|
+
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
3063
|
+
* @param x - define the x coordinate of the source vector
|
3064
|
+
* @param y - define the y coordinate of the source vector
|
3065
|
+
* @param z - define the z coordinate of the source vector
|
3066
|
+
* @param transformation - defines the transformation matrix
|
3067
|
+
* @param result - defines the Vector3 where to store the result
|
3068
|
+
*/
|
3069
|
+
export function transformNormalFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix.ReadonlyMatrix, result: MutableVector3): void;
|
3070
|
+
/**
|
3071
|
+
* Returns a new Vector3 located for "amount" on the CatmullRom interpolation spline defined by the vectors "value1", "value2", "value3", "value4"
|
3072
|
+
* @param value1 - defines the first control point
|
3073
|
+
* @param value2 - defines the second control point
|
3074
|
+
* @param value3 - defines the third control point
|
3075
|
+
* @param value4 - defines the fourth control point
|
3076
|
+
* @param amount - defines the amount on the spline to use
|
3077
|
+
* @returns the new Vector3
|
3078
|
+
*/
|
3079
|
+
export function catmullRom(value1: ReadonlyVector3, value2: ReadonlyVector3, value3: ReadonlyVector3, value4: ReadonlyVector3, amount: number): MutableVector3;
|
3080
|
+
/**
|
3081
|
+
* 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"
|
3082
|
+
* If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
|
3083
|
+
* If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
|
3084
|
+
* @param value - defines the current value
|
3085
|
+
* @param min - defines the lower range value
|
3086
|
+
* @param max - defines the upper range value
|
3087
|
+
* @returns the new Vector3
|
3088
|
+
*/
|
3089
|
+
export function clamp(value: ReadonlyVector3, min: ReadonlyVector3, max: ReadonlyVector3): MutableVector3;
|
3090
|
+
/**
|
3091
|
+
* 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"
|
3092
|
+
* If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
|
3093
|
+
* If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
|
3094
|
+
* @param value - defines the current value
|
3095
|
+
* @param min - defines the lower range value
|
3096
|
+
* @param max - defines the upper range value
|
3097
|
+
* @param result - defines the Vector3 where to store the result
|
3098
|
+
*/
|
3099
|
+
export function clampToRef(value: ReadonlyVector3, min: ReadonlyVector3, max: ReadonlyVector3, result: MutableVector3): void;
|
3100
|
+
/**
|
3101
|
+
* Returns a new Vector3 located for "amount" (float) on the Hermite interpolation spline defined by the vectors "value1", "tangent1", "value2", "tangent2"
|
3102
|
+
* @param value1 - defines the first control point
|
3103
|
+
* @param tangent1 - defines the first tangent vector
|
3104
|
+
* @param value2 - defines the second control point
|
3105
|
+
* @param tangent2 - defines the second tangent vector
|
3106
|
+
* @param amount - defines the amount on the interpolation spline (between 0 and 1)
|
3107
|
+
* @returns the new Vector3
|
3108
|
+
*/
|
3109
|
+
export function hermite(value1: ReadonlyVector3, tangent1: ReadonlyVector3, value2: ReadonlyVector3, tangent2: ReadonlyVector3, amount: number): MutableVector3;
|
3110
|
+
/**
|
3111
|
+
* Gets the minimal coordinate values between two Vector3
|
3112
|
+
* @param left - defines the first operand
|
3113
|
+
* @param right - defines the second operand
|
3114
|
+
* @returns the new Vector3
|
3115
|
+
*/
|
3116
|
+
export function minimize(left: ReadonlyVector3, right: ReadonlyVector3): MutableVector3;
|
3117
|
+
/**
|
3118
|
+
* Gets the maximal coordinate values between two Vector3
|
3119
|
+
* @param left - defines the first operand
|
3120
|
+
* @param right - defines the second operand
|
3121
|
+
* @returns the new Vector3
|
3122
|
+
*/
|
3123
|
+
export function maximize(left: MutableVector3, right: MutableVector3): MutableVector3;
|
3124
|
+
/**
|
3125
|
+
* Returns the distance between the vectors "value1" and "value2"
|
3126
|
+
* @param value1 - defines the first operand
|
3127
|
+
* @param value2 - defines the second operand
|
3128
|
+
* @returns the distance
|
3129
|
+
*/
|
3130
|
+
export function distance(value1: ReadonlyVector3, value2: ReadonlyVector3): number;
|
3131
|
+
/**
|
3132
|
+
* Returns the squared distance between the vectors "value1" and "value2"
|
3133
|
+
* @param value1 - defines the first operand
|
3134
|
+
* @param value2 - defines the second operand
|
3135
|
+
* @returns the squared distance
|
3136
|
+
*/
|
3137
|
+
export function distanceSquared(value1: ReadonlyVector3, value2: ReadonlyVector3): number;
|
3138
|
+
/**
|
3139
|
+
* Returns a new Vector3 located at the center between "value1" and "value2"
|
3140
|
+
* @param value1 - defines the first operand
|
3141
|
+
* @param value2 - defines the second operand
|
3142
|
+
* @returns the new Vector3
|
3143
|
+
*/
|
3144
|
+
export function center(value1: ReadonlyVector3, value2: ReadonlyVector3): MutableVector3;
|
3145
|
+
/**
|
3146
|
+
* Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system),
|
3147
|
+
* RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply
|
3148
|
+
* to something in order to rotate it from its local system to the given target system
|
3149
|
+
* Note: axis1, axis2 and axis3 are normalized during this operation
|
3150
|
+
* @param axis1 - defines the first axis
|
3151
|
+
* @param axis2 - defines the second axis
|
3152
|
+
* @param axis3 - defines the third axis
|
3153
|
+
* @returns a new Vector3
|
3154
|
+
*/
|
3155
|
+
export function rotationFromAxis(axis1: MutableVector3, axis2: MutableVector3, axis3: MutableVector3): MutableVector3;
|
3156
|
+
/**
|
3157
|
+
* The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3
|
3158
|
+
* @param axis1 - defines the first axis
|
3159
|
+
* @param axis2 - defines the second axis
|
3160
|
+
* @param axis3 - defines the third axis
|
3161
|
+
* @param ref - defines the Vector3 where to store the result
|
3162
|
+
*/
|
3163
|
+
export function rotationFromAxisToRef(axis1: MutableVector3, axis2: MutableVector3, axis3: MutableVector3, result: MutableVector3): void;
|
3164
|
+
/**
|
3165
|
+
* Creates a string representation of the Vector3
|
3166
|
+
* @returns a string with the Vector3 coordinates.
|
3167
|
+
*/
|
3168
|
+
export function toString(vector: ReadonlyVector3): string;
|
3169
|
+
/**
|
3170
|
+
* Creates the Vector3 hash code
|
3171
|
+
* @returns a number which tends to be unique between Vector3 instances
|
3172
|
+
*/
|
3173
|
+
export function getHashCode(vector: ReadonlyVector3): number;
|
3174
|
+
/**
|
3175
|
+
* Returns true if the vector1 and the vector2 coordinates are strictly equal
|
3176
|
+
* @param vector1 - defines the first operand
|
3177
|
+
* @param vector2 - defines the second operand
|
3178
|
+
* @returns true if both vectors are equals
|
3179
|
+
*/
|
3180
|
+
export function equals(vector1: ReadonlyVector3, vector2: ReadonlyVector3): boolean;
|
3181
|
+
/**
|
3182
|
+
* Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon
|
3183
|
+
* @param otherVector - defines the second operand
|
3184
|
+
* @param epsilon - defines the minimal distance to define values as equals
|
3185
|
+
* @returns true if both vectors are distant less than epsilon
|
3186
|
+
*/
|
3187
|
+
export function equalsWithEpsilon(vector1: ReadonlyVector3, vector2: ReadonlyVector3, epsilon?: number): boolean;
|
3188
|
+
/**
|
3189
|
+
* Returns true if the current Vector3 coordinates equals the given floats
|
3190
|
+
* @param x - defines the x coordinate of the operand
|
3191
|
+
* @param y - defines the y coordinate of the operand
|
3192
|
+
* @param z - defines the z coordinate of the operand
|
3193
|
+
* @returns true if both vectors are equals
|
3194
|
+
*/
|
3195
|
+
export function equalsToFloats(vector: ReadonlyVector3, x: number, y: number, z: number): boolean;
|
3196
|
+
/**
|
3197
|
+
* Returns a new Vector3, result of the multiplication of vector1 by the vector2
|
3198
|
+
* @param vector1 - defines the first operand
|
3199
|
+
* @param vector2 - defines the second operand
|
3200
|
+
* @returns the new Vector3
|
3201
|
+
*/
|
3202
|
+
export function multiply(vector1: ReadonlyVector3, vector2: ReadonlyVector3): MutableVector3;
|
3203
|
+
/**
|
3204
|
+
* Multiplies the current Vector3 by the given one and stores the result in the given vector "result"
|
3205
|
+
* @param otherVector - defines the second operand
|
3206
|
+
* @param result - defines the Vector3 object where to store the result
|
3207
|
+
* @returns the current Vector3
|
3208
|
+
*/
|
3209
|
+
export function multiplyToRef(vector1: ReadonlyVector3, vector2: ReadonlyVector3, result: MutableVector3): void;
|
3210
|
+
/**
|
3211
|
+
* Returns a new Vector3 set with the result of the mulliplication of the current Vector3 coordinates by the given floats
|
3212
|
+
* @param x - defines the x coordinate of the operand
|
3213
|
+
* @param y - defines the y coordinate of the operand
|
3214
|
+
* @param z - defines the z coordinate of the operand
|
3215
|
+
* @returns the new Vector3
|
3216
|
+
*/
|
3217
|
+
export function multiplyByFloatsToRef(vector1: ReadonlyVector3, x: number, y: number, z: number, result: MutableVector3): void;
|
3218
|
+
/**
|
3219
|
+
* Returns a new Vector3 set with the result of the mulliplication of the current Vector3 coordinates by the given floats
|
3220
|
+
* @param x - defines the x coordinate of the operand
|
3221
|
+
* @param y - defines the y coordinate of the operand
|
3222
|
+
* @param z - defines the z coordinate of the operand
|
3223
|
+
* @returns the new Vector3
|
3224
|
+
*/
|
3225
|
+
export function multiplyByFloats(vector1: ReadonlyVector3, x: number, y: number, z: number): MutableVector3;
|
3226
|
+
/**
|
3227
|
+
* Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones
|
3228
|
+
* @param otherVector - defines the second operand
|
3229
|
+
* @returns the new Vector3
|
3230
|
+
*/
|
3231
|
+
export function divide(vector1: ReadonlyVector3, vector2: ReadonlyVector3): MutableVector3;
|
3232
|
+
/**
|
3233
|
+
* Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result"
|
3234
|
+
* @param otherVector - defines the second operand
|
3235
|
+
* @param result - defines the Vector3 object where to store the result
|
3236
|
+
* @returns the current Vector3
|
3237
|
+
*/
|
3238
|
+
export function divideToRef(vector1: ReadonlyVector3, vector2: ReadonlyVector3, result: MutableVector3): void;
|
3239
|
+
/**
|
3240
|
+
* Set result Vector3 with the maximal coordinate values between vector1 and the given coordinates
|
3241
|
+
* @param x - defines the x coordinate of the operand
|
3242
|
+
* @param y - defines the y coordinate of the operand
|
3243
|
+
* @param z - defines the z coordinate of the operand
|
3244
|
+
* @param result - the set Vector3
|
3245
|
+
*/
|
3246
|
+
export function maximizeInPlaceFromFloatsToRef(vector1: ReadonlyVector3, x: number, y: number, z: number, result: MutableVector3): void;
|
3247
|
+
/**
|
3248
|
+
* Set result Vector3 with the minimal coordinate values between vector1 and the given coordinates
|
3249
|
+
* @param x - defines the x coordinate of the operand
|
3250
|
+
* @param y - defines the y coordinate of the operand
|
3251
|
+
* @param z - defines the z coordinate of the operand
|
3252
|
+
* @param result - the set Vector3
|
3253
|
+
*/
|
3254
|
+
export function minimizeInPlaceFromFloatsToRef(vector1: ReadonlyVector3, x: number, y: number, z: number, result: MutableVector3): void;
|
3255
|
+
/**
|
3256
|
+
* Gets a new Vector3 from vector1 floored values
|
3257
|
+
* @returns a new Vector3
|
3258
|
+
*/
|
3259
|
+
export function floor(vector1: ReadonlyVector3): MutableVector3;
|
3260
|
+
/**
|
3261
|
+
* Gets a new Vector3 from vector1 floored values
|
3262
|
+
* @returns a new Vector3
|
3263
|
+
*/
|
3264
|
+
export function fract(vector1: ReadonlyVector3): MutableVector3;
|
2968
3265
|
/**
|
2969
3266
|
* Returns a new Vector3 set to (0.0, 0.0, 0.0)
|
2970
3267
|
* @returns a new empty Vector3
|
@@ -3005,6 +3302,11 @@ export declare namespace Vector3 {
|
|
3005
3302
|
* @returns a new left Vector3
|
3006
3303
|
*/
|
3007
3304
|
export function Left(): MutableVector3;
|
3305
|
+
/**
|
3306
|
+
* Returns a new random Vector3
|
3307
|
+
* @returns a random Vector3
|
3308
|
+
*/
|
3309
|
+
export function Random(): MutableVector3;
|
3008
3310
|
}
|
3009
3311
|
|
3010
3312
|
declare interface Vector3_2 {
|