forked from BabylonJS/Babylon.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabylon.2.0.d.ts
4271 lines (4271 loc) · 186 KB
/
babylon.2.0.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
declare module BABYLON {
class _DepthCullingState {
private _isDepthTestDirty;
private _isDepthMaskDirty;
private _isDepthFuncDirty;
private _isCullFaceDirty;
private _isCullDirty;
private _depthTest;
private _depthMask;
private _depthFunc;
private _cull;
private _cullFace;
public isDirty : boolean;
public cullFace : number;
public cull : boolean;
public depthFunc : number;
public depthMask : boolean;
public depthTest : boolean;
public reset(): void;
public apply(gl: WebGLRenderingContext): void;
}
class _AlphaState {
private _isAlphaBlendDirty;
private _isBlendFunctionParametersDirty;
private _alphaBlend;
private _blendFunctionParameters;
public isDirty : boolean;
public alphaBlend : boolean;
public setAlphaBlendFunctionParameters(value0: number, value1: number, value2: number, value3: number): void;
public reset(): void;
public apply(gl: WebGLRenderingContext): void;
}
class EngineCapabilities {
public maxTexturesImageUnits: number;
public maxTextureSize: number;
public maxCubemapTextureSize: number;
public maxRenderTextureSize: number;
public standardDerivatives: boolean;
public s3tc: any;
public textureFloat: boolean;
public textureAnisotropicFilterExtension: any;
public maxAnisotropy: number;
public instancedArrays: any;
public uintIndices: boolean;
}
class Engine {
private static _ALPHA_DISABLE;
private static _ALPHA_ADD;
private static _ALPHA_COMBINE;
private static _DELAYLOADSTATE_NONE;
private static _DELAYLOADSTATE_LOADED;
private static _DELAYLOADSTATE_LOADING;
private static _DELAYLOADSTATE_NOTLOADED;
static ALPHA_DISABLE : number;
static ALPHA_ADD : number;
static ALPHA_COMBINE : number;
static DELAYLOADSTATE_NONE : number;
static DELAYLOADSTATE_LOADED : number;
static DELAYLOADSTATE_LOADING : number;
static DELAYLOADSTATE_NOTLOADED : number;
static Version : string;
static Epsilon: number;
static CollisionsEpsilon: number;
static ShadersRepository: string;
public isFullscreen: boolean;
public isPointerLock: boolean;
public cullBackFaces: boolean;
public renderEvenInBackground: boolean;
public scenes: Scene[];
private _gl;
private _renderingCanvas;
private _windowIsBackground;
private _audioEngine;
private _onBlur;
private _onFocus;
private _onFullscreenChange;
private _onPointerLockChange;
private _hardwareScalingLevel;
private _caps;
private _pointerLockRequested;
private _alphaTest;
private _runningLoop;
private _renderFunction;
private _resizeLoadingUI;
private _loadingDiv;
private _loadingTextDiv;
private _loadingDivBackgroundColor;
private _drawCalls;
private _depthCullingState;
private _alphaState;
private _alphaMode;
private _loadedTexturesCache;
public _activeTexturesCache: BaseTexture[];
private _currentEffect;
private _compiledEffects;
private _vertexAttribArrays;
private _cachedViewport;
private _cachedVertexBuffers;
private _cachedIndexBuffer;
private _cachedEffectForVertexBuffers;
private _currentRenderTarget;
private _canvasClientRect;
private _uintIndicesCurrentlySet;
private _workingCanvas;
private _workingContext;
constructor(canvas: HTMLCanvasElement, antialias?: boolean, options?: any);
public getAudioEngine(): AudioEngine;
public getAspectRatio(camera: Camera): number;
public getRenderWidth(): number;
public getRenderHeight(): number;
public getRenderingCanvas(): HTMLCanvasElement;
public getRenderingCanvasClientRect(): ClientRect;
public setHardwareScalingLevel(level: number): void;
public getHardwareScalingLevel(): number;
public getLoadedTexturesCache(): WebGLTexture[];
public getCaps(): EngineCapabilities;
public drawCalls : number;
public resetDrawCalls(): void;
public setDepthFunctionToGreater(): void;
public setDepthFunctionToGreaterOrEqual(): void;
public setDepthFunctionToLess(): void;
public setDepthFunctionToLessOrEqual(): void;
public stopRenderLoop(): void;
public _renderLoop(): void;
public runRenderLoop(renderFunction: () => void): void;
public switchFullscreen(requestPointerLock: boolean): void;
public clear(color: any, backBuffer: boolean, depthStencil: boolean): void;
public setViewport(viewport: Viewport, requiredWidth?: number, requiredHeight?: number): void;
public setDirectViewport(x: number, y: number, width: number, height: number): void;
public beginFrame(): void;
public endFrame(): void;
public resize(): void;
public setSize(width: number, height: number): void;
public bindFramebuffer(texture: WebGLTexture): void;
public unBindFramebuffer(texture: WebGLTexture): void;
public flushFramebuffer(): void;
public restoreDefaultFramebuffer(): void;
private _resetVertexBufferBinding();
public createVertexBuffer(vertices: number[]): WebGLBuffer;
public createDynamicVertexBuffer(capacity: number): WebGLBuffer;
public updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: any, offset?: number): void;
private _resetIndexBufferBinding();
public createIndexBuffer(indices: number[]): WebGLBuffer;
public bindBuffers(vertexBuffer: WebGLBuffer, indexBuffer: WebGLBuffer, vertexDeclaration: number[], vertexStrideSize: number, effect: Effect): void;
public bindMultiBuffers(vertexBuffers: VertexBuffer[], indexBuffer: WebGLBuffer, effect: Effect): void;
public _releaseBuffer(buffer: WebGLBuffer): boolean;
public createInstancesBuffer(capacity: number): WebGLBuffer;
public deleteInstancesBuffer(buffer: WebGLBuffer): void;
public updateAndBindInstancesBuffer(instancesBuffer: WebGLBuffer, data: Float32Array, offsetLocations: number[]): void;
public unBindInstancesBuffer(instancesBuffer: WebGLBuffer, offsetLocations: number[]): void;
public applyStates(): void;
public draw(useTriangles: boolean, indexStart: number, indexCount: number, instancesCount?: number): void;
public drawPointClouds(verticesStart: number, verticesCount: number, instancesCount?: number): void;
public _releaseEffect(effect: Effect): void;
public createEffect(baseName: any, attributesNames: string[], uniformsNames: string[], samplers: string[], defines: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void): Effect;
public createEffectForParticles(fragmentName: string, uniformsNames?: string[], samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void): Effect;
public createShaderProgram(vertexCode: string, fragmentCode: string, defines: string): WebGLProgram;
public getUniforms(shaderProgram: WebGLProgram, uniformsNames: string[]): WebGLUniformLocation[];
public getAttributes(shaderProgram: WebGLProgram, attributesNames: string[]): number[];
public enableEffect(effect: Effect): void;
public setArray(uniform: WebGLUniformLocation, array: number[]): void;
public setMatrices(uniform: WebGLUniformLocation, matrices: Float32Array): void;
public setMatrix(uniform: WebGLUniformLocation, matrix: Matrix): void;
public setFloat(uniform: WebGLUniformLocation, value: number): void;
public setFloat2(uniform: WebGLUniformLocation, x: number, y: number): void;
public setFloat3(uniform: WebGLUniformLocation, x: number, y: number, z: number): void;
public setBool(uniform: WebGLUniformLocation, bool: number): void;
public setFloat4(uniform: WebGLUniformLocation, x: number, y: number, z: number, w: number): void;
public setColor3(uniform: WebGLUniformLocation, color3: Color3): void;
public setColor4(uniform: WebGLUniformLocation, color3: Color3, alpha: number): void;
public setState(culling: boolean, force?: boolean): void;
public setDepthBuffer(enable: boolean): void;
public getDepthWrite(): boolean;
public setDepthWrite(enable: boolean): void;
public setColorWrite(enable: boolean): void;
public setAlphaMode(mode: number): void;
public getAlphaMode(): number;
public setAlphaTesting(enable: boolean): void;
public getAlphaTesting(): boolean;
public wipeCaches(): void;
public setSamplingMode(texture: WebGLTexture, samplingMode: number): void;
public createTexture(url: string, noMipmap: boolean, invertY: boolean, scene: Scene, samplingMode?: number, onLoad?: () => void, onError?: () => void, buffer?: any): WebGLTexture;
public createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): WebGLTexture;
public updateDynamicTexture(texture: WebGLTexture, canvas: HTMLCanvasElement, invertY: boolean): void;
public updateVideoTexture(texture: WebGLTexture, video: HTMLVideoElement, invertY: boolean): void;
public createRenderTargetTexture(size: any, options: any): WebGLTexture;
public createCubeTexture(rootUrl: string, scene: Scene, extensions: string[], noMipmap?: boolean): WebGLTexture;
public _releaseTexture(texture: WebGLTexture): void;
public bindSamplers(effect: Effect): void;
public _bindTexture(channel: number, texture: WebGLTexture): void;
public setTextureFromPostProcess(channel: number, postProcess: PostProcess): void;
public setTexture(channel: number, texture: BaseTexture): void;
public _setAnisotropicLevel(key: number, texture: BaseTexture): void;
public readPixels(x: number, y: number, width: number, height: number): Uint8Array;
public dispose(): void;
public displayLoadingUI(): void;
public loadingUIText : string;
public loadingUIBackgroundColor : string;
public hideLoadingUI(): void;
static isSupported(): boolean;
}
}
interface Window {
mozIndexedDB(func: any): any;
webkitIndexedDB(func: any): any;
IDBTransaction(func: any): any;
webkitIDBTransaction(func: any): any;
msIDBTransaction(func: any): any;
IDBKeyRange(func: any): any;
webkitIDBKeyRange(func: any): any;
msIDBKeyRange(func: any): any;
URL: HTMLURL;
webkitURL: HTMLURL;
webkitRequestAnimationFrame(func: any): any;
mozRequestAnimationFrame(func: any): any;
oRequestAnimationFrame(func: any): any;
WebGLRenderingContext: WebGLRenderingContext;
MSGesture: MSGesture;
}
interface HTMLURL {
createObjectURL(param1: any, param2?: any): any;
}
interface Document {
exitFullscreen(): void;
webkitCancelFullScreen(): void;
mozCancelFullScreen(): void;
msCancelFullScreen(): void;
webkitIsFullScreen: boolean;
mozFullScreen: boolean;
msIsFullScreen: boolean;
fullscreen: boolean;
mozPointerLockElement: HTMLElement;
msPointerLockElement: HTMLElement;
webkitPointerLockElement: HTMLElement;
pointerLockElement: HTMLElement;
}
interface HTMLCanvasElement {
requestPointerLock(): void;
msRequestPointerLock(): void;
mozRequestPointerLock(): void;
webkitRequestPointerLock(): void;
}
interface WebGLTexture {
isReady: boolean;
isCube: boolean;
url: string;
noMipmap: boolean;
references: number;
generateMipMaps: boolean;
_size: number;
_baseWidth: number;
_baseHeight: number;
_width: number;
_height: number;
_workingCanvas: HTMLCanvasElement;
_workingContext: CanvasRenderingContext2D;
_framebuffer: WebGLFramebuffer;
_depthBuffer: WebGLRenderbuffer;
_cachedCoordinatesMode: number;
_cachedWrapU: number;
_cachedWrapV: number;
}
interface WebGLBuffer {
references: number;
capacity: number;
is32Bits: boolean;
}
interface MouseEvent {
movementX: number;
movementY: number;
mozMovementX: number;
mozMovementY: number;
webkitMovementX: number;
webkitMovementY: number;
msMovementX: number;
msMovementY: number;
}
interface MSStyleCSSProperties {
webkitTransform: string;
webkitTransition: string;
}
interface Navigator {
getVRDevices: () => any;
mozGetVRDevices: (any: any) => any;
isCocoonJS: boolean;
}
declare module BABYLON {
class Node {
public parent: Node;
public name: string;
public id: string;
public state: string;
public animations: Animation[];
public onReady: (node: Node) => void;
private _childrenFlag;
private _isEnabled;
private _isReady;
public _currentRenderId: number;
public _waitingParentId: string;
private _scene;
public _cache: any;
constructor(name: string, scene: any);
public getScene(): Scene;
public getEngine(): Engine;
public getWorldMatrix(): Matrix;
public _initCache(): void;
public updateCache(force?: boolean): void;
public _updateCache(ignoreParentClass?: boolean): void;
public _isSynchronized(): boolean;
public isSynchronizedWithParent(): boolean;
public isSynchronized(updateCache?: boolean): boolean;
public hasNewParent(update?: boolean): boolean;
public isReady(): boolean;
public isEnabled(): boolean;
public setEnabled(value: boolean): void;
public isDescendantOf(ancestor: Node): boolean;
public _getDescendants(list: Node[], results: Node[]): void;
public getDescendants(): Node[];
public _setReady(state: boolean): void;
}
}
declare module BABYLON {
interface IDisposable {
dispose(): void;
}
class Scene {
static FOGMODE_NONE: number;
static FOGMODE_EXP: number;
static FOGMODE_EXP2: number;
static FOGMODE_LINEAR: number;
static MinDeltaTime: number;
static MaxDeltaTime: number;
public autoClear: boolean;
public clearColor: any;
public ambientColor: Color3;
public beforeRender: () => void;
public afterRender: () => void;
public onDispose: () => void;
public beforeCameraRender: (camera: Camera) => void;
public afterCameraRender: (camera: Camera) => void;
public forceWireframe: boolean;
public forcePointsCloud: boolean;
public forceShowBoundingBoxes: boolean;
public clipPlane: Plane;
public animationsEnabled: boolean;
private _onPointerMove;
private _onPointerDown;
public onPointerDown: (evt: PointerEvent, pickInfo: PickingInfo) => void;
public cameraToUseForPointers: Camera;
private _pointerX;
private _pointerY;
private _meshUnderPointer;
private _onKeyDown;
private _onKeyUp;
public fogEnabled: boolean;
public fogMode: number;
public fogColor: Color3;
public fogDensity: number;
public fogStart: number;
public fogEnd: number;
public shadowsEnabled: boolean;
public lightsEnabled: boolean;
public lights: Light[];
public cameras: Camera[];
public activeCameras: Camera[];
public activeCamera: Camera;
public meshes: AbstractMesh[];
private _geometries;
public materials: Material[];
public multiMaterials: MultiMaterial[];
public defaultMaterial: StandardMaterial;
public texturesEnabled: boolean;
public textures: BaseTexture[];
public particlesEnabled: boolean;
public particleSystems: ParticleSystem[];
public spriteManagers: SpriteManager[];
public layers: Layer[];
public skeletonsEnabled: boolean;
public skeletons: Skeleton[];
public lensFlaresEnabled: boolean;
public lensFlareSystems: LensFlareSystem[];
public collisionsEnabled: boolean;
public gravity: Vector3;
public postProcessesEnabled: boolean;
public postProcessManager: PostProcessManager;
public postProcessRenderPipelineManager: PostProcessRenderPipelineManager;
public renderTargetsEnabled: boolean;
public customRenderTargets: RenderTargetTexture[];
public useDelayedTextureLoading: boolean;
public importedMeshesFiles: String[];
public database: any;
public actionManager: ActionManager;
public _actionManagers: ActionManager[];
private _meshesForIntersections;
public proceduralTexturesEnabled: boolean;
public _proceduralTextures: ProceduralTexture[];
public mainSoundTrack: SoundTrack;
public soundTracks: SoundTrack[];
private _engine;
private _totalVertices;
public _activeVertices: number;
public _activeParticles: number;
private _lastFrameDuration;
private _evaluateActiveMeshesDuration;
private _renderTargetsDuration;
public _particlesDuration: number;
private _renderDuration;
public _spritesDuration: number;
private _animationRatio;
private _animationStartDate;
public _cachedMaterial: Material;
private _renderId;
private _executeWhenReadyTimeoutId;
public _toBeDisposed: SmartArray<IDisposable>;
private _onReadyCallbacks;
private _pendingData;
private _onBeforeRenderCallbacks;
private _onAfterRenderCallbacks;
private _activeMeshes;
private _processedMaterials;
private _renderTargets;
public _activeParticleSystems: SmartArray<ParticleSystem>;
private _activeSkeletons;
private _activeBones;
private _renderingManager;
private _physicsEngine;
public _activeAnimatables: Animatable[];
private _transformMatrix;
private _pickWithRayInverseMatrix;
private _scaledPosition;
private _scaledVelocity;
private _boundingBoxRenderer;
private _outlineRenderer;
private _viewMatrix;
private _projectionMatrix;
private _frustumPlanes;
private _selectionOctree;
private _pointerOverMesh;
private _debugLayer;
constructor(engine: Engine);
public debugLayer : DebugLayer;
public meshUnderPointer : AbstractMesh;
public pointerX : number;
public pointerY : number;
public getCachedMaterial(): Material;
public getBoundingBoxRenderer(): BoundingBoxRenderer;
public getOutlineRenderer(): OutlineRenderer;
public getEngine(): Engine;
public getTotalVertices(): number;
public getActiveVertices(): number;
public getActiveParticles(): number;
public getActiveBones(): number;
public getLastFrameDuration(): number;
public getEvaluateActiveMeshesDuration(): number;
public getActiveMeshes(): SmartArray<Mesh>;
public getRenderTargetsDuration(): number;
public getRenderDuration(): number;
public getParticlesDuration(): number;
public getSpritesDuration(): number;
public getAnimationRatio(): number;
public getRenderId(): number;
private _updatePointerPosition(evt);
public attachControl(): void;
public detachControl(): void;
public isReady(): boolean;
public resetCachedMaterial(): void;
public registerBeforeRender(func: () => void): void;
public unregisterBeforeRender(func: () => void): void;
public registerAfterRender(func: () => void): void;
public unregisterAfterRender(func: () => void): void;
public _addPendingData(data: any): void;
public _removePendingData(data: any): void;
public getWaitingItemsCount(): number;
public executeWhenReady(func: () => void): void;
public _checkIsReady(): void;
public beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void, animatable?: Animatable): Animatable;
public beginDirectAnimation(target: any, animations: Animation[], from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): Animatable;
public getAnimatableByTarget(target: any): Animatable;
public stopAnimation(target: any): void;
private _animate();
public getViewMatrix(): Matrix;
public getProjectionMatrix(): Matrix;
public getTransformMatrix(): Matrix;
public setTransformMatrix(view: Matrix, projection: Matrix): void;
public setActiveCameraByID(id: string): Camera;
public setActiveCameraByName(name: string): Camera;
public getMaterialByID(id: string): Material;
public getMaterialByName(name: string): Material;
public getCameraByID(id: string): Camera;
public getCameraByName(name: string): Camera;
public getLightByName(name: string): Light;
public getLightByID(id: string): Light;
public getGeometryByID(id: string): Geometry;
public pushGeometry(geometry: Geometry, force?: boolean): boolean;
public getGeometries(): Geometry[];
public getMeshByID(id: string): AbstractMesh;
public getLastMeshByID(id: string): AbstractMesh;
public getLastEntryByID(id: string): Node;
public getMeshByName(name: string): AbstractMesh;
public getLastSkeletonByID(id: string): Skeleton;
public getSkeletonById(id: string): Skeleton;
public getSkeletonByName(name: string): Skeleton;
public isActiveMesh(mesh: Mesh): boolean;
private _evaluateSubMesh(subMesh, mesh);
private _evaluateActiveMeshes();
private _activeMesh(mesh);
public updateTransformMatrix(force?: boolean): void;
private _renderForCamera(camera);
private _processSubCameras(camera);
private _checkIntersections();
public render(): void;
private _updateAudioParameters();
public dispose(): void;
public _getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, finalPosition: Vector3, excludedMesh?: AbstractMesh): void;
private _collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh?);
public createOrUpdateSelectionOctree(maxCapacity?: number, maxDepth?: number): Octree<AbstractMesh>;
public createPickingRay(x: number, y: number, world: Matrix, camera: Camera): Ray;
private _internalPick(rayFunction, predicate, fastCheck?);
public pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo;
public pickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean, fastCheck?: boolean): PickingInfo;
public setPointerOverMesh(mesh: AbstractMesh): void;
public getPointerOverMesh(): AbstractMesh;
public getPhysicsEngine(): PhysicsEngine;
public enablePhysics(gravity: Vector3, plugin?: IPhysicsEnginePlugin): boolean;
public disablePhysicsEngine(): void;
public isPhysicsEnabled(): boolean;
public setGravity(gravity: Vector3): void;
public createCompoundImpostor(parts: any, options: PhysicsBodyCreationOptions): any;
public deleteCompoundImpostor(compound: any): void;
private _getByTags(list, tagsQuery);
public getMeshesByTags(tagsQuery: string): Mesh[];
public getCamerasByTags(tagsQuery: string): Camera[];
public getLightsByTags(tagsQuery: string): Light[];
public getMaterialByTags(tagsQuery: string): Material[];
}
}
declare module BABYLON {
class Action {
public triggerOptions: any;
public trigger: number;
public _actionManager: ActionManager;
private _nextActiveAction;
private _child;
private _condition;
private _triggerParameter;
constructor(triggerOptions: any, condition?: Condition);
public _prepare(): void;
public getTriggerParameter(): any;
public _executeCurrent(evt: ActionEvent): void;
public execute(evt: ActionEvent): void;
public then(action: Action): Action;
public _getProperty(propertyPath: string): string;
public _getEffectiveTarget(target: any, propertyPath: string): any;
}
}
declare module BABYLON {
class ActionEvent {
public source: AbstractMesh;
public pointerX: number;
public pointerY: number;
public meshUnderPointer: AbstractMesh;
public sourceEvent: any;
constructor(source: AbstractMesh, pointerX: number, pointerY: number, meshUnderPointer: AbstractMesh, sourceEvent?: any);
static CreateNew(source: AbstractMesh): ActionEvent;
static CreateNewFromScene(scene: Scene, evt: Event): ActionEvent;
}
class ActionManager {
private static _NothingTrigger;
private static _OnPickTrigger;
private static _OnLeftPickTrigger;
private static _OnRightPickTrigger;
private static _OnCenterPickTrigger;
private static _OnPointerOverTrigger;
private static _OnPointerOutTrigger;
private static _OnEveryFrameTrigger;
private static _OnIntersectionEnterTrigger;
private static _OnIntersectionExitTrigger;
private static _OnKeyDownTrigger;
private static _OnKeyUpTrigger;
static NothingTrigger : number;
static OnPickTrigger : number;
static OnLeftPickTrigger : number;
static OnRightPickTrigger : number;
static OnCenterPickTrigger : number;
static OnPointerOverTrigger : number;
static OnPointerOutTrigger : number;
static OnEveryFrameTrigger : number;
static OnIntersectionEnterTrigger : number;
static OnIntersectionExitTrigger : number;
static OnKeyDownTrigger : number;
static OnKeyUpTrigger : number;
public actions: Action[];
private _scene;
constructor(scene: Scene);
public dispose(): void;
public getScene(): Scene;
public hasSpecificTriggers(triggers: number[]): boolean;
public hasPointerTriggers : boolean;
public hasPickTriggers : boolean;
public registerAction(action: Action): Action;
public processTrigger(trigger: number, evt: ActionEvent): void;
public _getEffectiveTarget(target: any, propertyPath: string): any;
public _getProperty(propertyPath: string): string;
}
}
declare module BABYLON {
class Condition {
public _actionManager: ActionManager;
public _evaluationId: number;
public _currentResult: boolean;
constructor(actionManager: ActionManager);
public isValid(): boolean;
public _getProperty(propertyPath: string): string;
public _getEffectiveTarget(target: any, propertyPath: string): any;
}
class ValueCondition extends Condition {
public propertyPath: string;
public value: any;
public operator: number;
private static _IsEqual;
private static _IsDifferent;
private static _IsGreater;
private static _IsLesser;
static IsEqual : number;
static IsDifferent : number;
static IsGreater : number;
static IsLesser : number;
public _actionManager: ActionManager;
private _target;
private _property;
constructor(actionManager: ActionManager, target: any, propertyPath: string, value: any, operator?: number);
public isValid(): boolean;
}
class PredicateCondition extends Condition {
public predicate: () => boolean;
public _actionManager: ActionManager;
constructor(actionManager: ActionManager, predicate: () => boolean);
public isValid(): boolean;
}
class StateCondition extends Condition {
public value: string;
public _actionManager: ActionManager;
private _target;
constructor(actionManager: ActionManager, target: any, value: string);
public isValid(): boolean;
}
}
declare module BABYLON {
class SwitchBooleanAction extends Action {
public propertyPath: string;
private _target;
private _property;
constructor(triggerOptions: any, target: any, propertyPath: string, condition?: Condition);
public _prepare(): void;
public execute(): void;
}
class SetStateAction extends Action {
public value: string;
private _target;
constructor(triggerOptions: any, target: any, value: string, condition?: Condition);
public execute(): void;
}
class SetValueAction extends Action {
public propertyPath: string;
public value: any;
private _target;
private _property;
constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition);
public _prepare(): void;
public execute(): void;
}
class IncrementValueAction extends Action {
public propertyPath: string;
public value: any;
private _target;
private _property;
constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition);
public _prepare(): void;
public execute(): void;
}
class PlayAnimationAction extends Action {
public from: number;
public to: number;
public loop: boolean;
private _target;
constructor(triggerOptions: any, target: any, from: number, to: number, loop?: boolean, condition?: Condition);
public _prepare(): void;
public execute(): void;
}
class StopAnimationAction extends Action {
private _target;
constructor(triggerOptions: any, target: any, condition?: Condition);
public _prepare(): void;
public execute(): void;
}
class DoNothingAction extends Action {
constructor(triggerOptions?: any, condition?: Condition);
public execute(): void;
}
class CombineAction extends Action {
public children: Action[];
constructor(triggerOptions: any, children: Action[], condition?: Condition);
public _prepare(): void;
public execute(evt: ActionEvent): void;
}
class ExecuteCodeAction extends Action {
public func: (evt: ActionEvent) => void;
constructor(triggerOptions: any, func: (evt: ActionEvent) => void, condition?: Condition);
public execute(evt: ActionEvent): void;
}
class SetParentAction extends Action {
private _parent;
private _target;
constructor(triggerOptions: any, target: any, parent: any, condition?: Condition);
public _prepare(): void;
public execute(): void;
}
}
declare module BABYLON {
class InterpolateValueAction extends Action {
public propertyPath: string;
public value: any;
public duration: number;
public stopOtherAnimations: boolean;
private _target;
private _property;
constructor(triggerOptions: any, target: any, propertyPath: string, value: any, duration?: number, condition?: Condition, stopOtherAnimations?: boolean);
public _prepare(): void;
public execute(): void;
}
}
declare module BABYLON {
class Animatable {
public target: any;
public fromFrame: number;
public toFrame: number;
public loopAnimation: boolean;
public speedRatio: number;
public onAnimationEnd: any;
private _localDelayOffset;
private _pausedDelay;
private _animations;
private _paused;
private _scene;
public animationStarted: boolean;
constructor(scene: Scene, target: any, fromFrame?: number, toFrame?: number, loopAnimation?: boolean, speedRatio?: number, onAnimationEnd?: any, animations?: any);
public appendAnimations(target: any, animations: Animation[]): void;
public getAnimationByTargetProperty(property: string): Animation;
public pause(): void;
public restart(): void;
public stop(): void;
public _animate(delay: number): boolean;
}
}
declare module BABYLON {
class Animation {
public name: string;
public targetProperty: string;
public framePerSecond: number;
public dataType: number;
public loopMode: number;
private _keys;
private _offsetsCache;
private _highLimitsCache;
private _stopped;
public _target: any;
private _easingFunction;
public targetPropertyPath: string[];
public currentFrame: number;
static CreateAndStartAnimation(name: string, mesh: AbstractMesh, tartgetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number): void;
constructor(name: string, targetProperty: string, framePerSecond: number, dataType: number, loopMode?: number);
public isStopped(): boolean;
public getKeys(): any[];
public getEasingFunction(): IEasingFunction;
public setEasingFunction(easingFunction: EasingFunction): void;
public floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number;
public quaternionInterpolateFunction(startValue: Quaternion, endValue: Quaternion, gradient: number): Quaternion;
public vector3InterpolateFunction(startValue: Vector3, endValue: Vector3, gradient: number): Vector3;
public vector2InterpolateFunction(startValue: Vector2, endValue: Vector2, gradient: number): Vector2;
public color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3;
public clone(): Animation;
public setKeys(values: any[]): void;
private _interpolate(currentFrame, repeatCount, loopMode, offsetValue?, highLimitValue?);
public animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number): boolean;
private static _ANIMATIONTYPE_FLOAT;
private static _ANIMATIONTYPE_VECTOR3;
private static _ANIMATIONTYPE_QUATERNION;
private static _ANIMATIONTYPE_MATRIX;
private static _ANIMATIONTYPE_COLOR3;
private static _ANIMATIONTYPE_VECTOR2;
private static _ANIMATIONLOOPMODE_RELATIVE;
private static _ANIMATIONLOOPMODE_CYCLE;
private static _ANIMATIONLOOPMODE_CONSTANT;
static ANIMATIONTYPE_FLOAT : number;
static ANIMATIONTYPE_VECTOR3 : number;
static ANIMATIONTYPE_VECTOR2 : number;
static ANIMATIONTYPE_QUATERNION : number;
static ANIMATIONTYPE_MATRIX : number;
static ANIMATIONTYPE_COLOR3 : number;
static ANIMATIONLOOPMODE_RELATIVE : number;
static ANIMATIONLOOPMODE_CYCLE : number;
static ANIMATIONLOOPMODE_CONSTANT : number;
}
}
declare module BABYLON {
interface IEasingFunction {
ease(gradient: number): number;
}
class EasingFunction implements IEasingFunction {
private static _EASINGMODE_EASEIN;
private static _EASINGMODE_EASEOUT;
private static _EASINGMODE_EASEINOUT;
static EASINGMODE_EASEIN : number;
static EASINGMODE_EASEOUT : number;
static EASINGMODE_EASEINOUT : number;
private _easingMode;
public setEasingMode(easingMode: number): void;
public getEasingMode(): number;
public easeInCore(gradient: number): number;
public ease(gradient: number): number;
}
class CircleEase extends EasingFunction implements IEasingFunction {
public easeInCore(gradient: number): number;
}
class BackEase extends EasingFunction implements IEasingFunction {
public amplitude: number;
constructor(amplitude?: number);
public easeInCore(gradient: number): number;
}
class BounceEase extends EasingFunction implements IEasingFunction {
public bounces: number;
public bounciness: number;
constructor(bounces?: number, bounciness?: number);
public easeInCore(gradient: number): number;
}
class CubicEase extends EasingFunction implements IEasingFunction {
public easeInCore(gradient: number): number;
}
class ElasticEase extends EasingFunction implements IEasingFunction {
public oscillations: number;
public springiness: number;
constructor(oscillations?: number, springiness?: number);
public easeInCore(gradient: number): number;
}
class ExponentialEase extends EasingFunction implements IEasingFunction {
public exponent: number;
constructor(exponent?: number);
public easeInCore(gradient: number): number;
}
class PowerEase extends EasingFunction implements IEasingFunction {
public power: number;
constructor(power?: number);
public easeInCore(gradient: number): number;
}
class QuadraticEase extends EasingFunction implements IEasingFunction {
public easeInCore(gradient: number): number;
}
class QuarticEase extends EasingFunction implements IEasingFunction {
public easeInCore(gradient: number): number;
}
class QuinticEase extends EasingFunction implements IEasingFunction {
public easeInCore(gradient: number): number;
}
class SineEase extends EasingFunction implements IEasingFunction {
public easeInCore(gradient: number): number;
}
class BezierCurveEase extends EasingFunction implements IEasingFunction {
public x1: number;
public y1: number;
public x2: number;
public y2: number;
constructor(x1?: number, y1?: number, x2?: number, y2?: number);
public easeInCore(gradient: number): number;
}
}
declare module BABYLON {
class AudioEngine {
public audioContext: AudioContext;
public canUseWebAudio: boolean;
public masterGain: GainNode;
constructor();
public getGlobalVolume(): number;
public setGlobalVolume(newVolume: number): void;
}
}
declare module BABYLON {
class Sound {
public maxDistance: number;
public autoplay: boolean;
public loop: boolean;
public useBabylonJSAttenuation: boolean;
public soundTrackId: number;
private _position;
private _localDirection;
private _volume;
private _isLoaded;
private _isReadyToPlay;
private _isPlaying;
private _isDirectional;
private _audioEngine;
private _readyToPlayCallback;
private _audioBuffer;
private _soundSource;
private _soundPanner;
private _soundGain;
private _coneInnerAngle;
private _coneOuterAngle;
private _coneOuterGain;
private _scene;
private _name;
private _connectedMesh;
/**
* Create a sound and attach it to a scene
* @param name Name of your sound
* @param url Url to the sound to load async
* @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played
* @param options Objects to provide with the current available options: autoplay, loop, distanceMax
*/
constructor(name: string, url: string, scene: Scene, readyToPlayCallback?: () => void, options?: any);
public connectToSoundTrackAudioNode(soundTrackAudioNode: AudioNode): void;
/**
* Transform this sound into a directional source
* @param coneInnerAngle Size of the inner cone in degree
* @param coneOuterAngle Size of the outer cone in degree
* @param coneOuterGain Volume of the sound outside the outer cone (between 0.0 and 1.0)
*/
public setDirectionalCone(coneInnerAngle: number, coneOuterAngle: number, coneOuterGain: number): void;
public setPosition(newPosition: Vector3): void;
public setLocalDirectionToMesh(newLocalDirection: Vector3): void;
private _updateDirection();
public updateDistanceFromListener(): void;
/**
* Play the sound
* @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
*/
public play(time?: number): void;
/**
* Stop the sound
* @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default.
*/
public stop(time?: number): void;
public pause(): void;
public setVolume(newVolume: number): void;
public getVolume(): number;
public attachToMesh(meshToConnectTo: AbstractMesh): void;
private _onRegisterAfterWorldMatrixUpdate(connectedMesh);
private _soundLoaded(audioData);
}
}
declare module BABYLON {
class SoundTrack {
private _audioEngine;
private _trackGain;
private _trackConvolver;
private _scene;
public id: number;
public soundCollection: Sound[];
private _isMainTrack;
constructor(scene: Scene, options?: any);
public AddSound(sound: Sound): void;
public RemoveSound(sound: Sound): void;
public setVolume(newVolume: number): void;
}
}
declare module BABYLON {
class Bone {
public name: string;
public children: Bone[];
public animations: Animation[];
private _skeleton;
private _matrix;
private _baseMatrix;
private _worldTransform;
private _absoluteTransform;
private _invertedAbsoluteTransform;
private _parent;
constructor(name: string, skeleton: Skeleton, parentBone: Bone, matrix: Matrix);
public getParent(): Bone;
public getLocalMatrix(): Matrix;
public getBaseMatrix(): Matrix;
public getWorldMatrix(): Matrix;
public getInvertedAbsoluteTransform(): Matrix;
public getAbsoluteMatrix(): Matrix;
public updateMatrix(matrix: Matrix): void;
private _updateDifferenceMatrix();
public markAsDirty(): void;
}
}
declare module BABYLON {
class Skeleton {
public name: string;
public id: string;
public bones: Bone[];
private _scene;
private _isDirty;
private _transformMatrices;
private _animatables;
private _identity;
constructor(name: string, id: string, scene: Scene);
public getTransformMatrices(): Float32Array;