babylon.manager.d.ts 130 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697
  1. declare module BABYLON {
  2. /**
  3. * Babylon scene manager class
  4. * @class SceneManager - All rights reserved (c) 2020 Mackey Kinard
  5. */
  6. class SceneManager {
  7. /** Gets the toolkit framework version number */
  8. static get Version(): string;
  9. /** Gets the toolkit framework copyright notice */
  10. static get Copyright(): string;
  11. /** Pauses the main page render loop */
  12. static PauseRenderLoop: boolean;
  13. /** Register handler that is triggered when the fonts have been loaded (engine.html) */
  14. static OnFontsReadyObservable: Observable<Engine>;
  15. /** Register handler that is triggered when then engine has been resized (engine.html) */
  16. static OnEngineResizeObservable: Observable<Engine>;
  17. /** Register handler that is triggered when the scene has been loaded (engine.html) */
  18. static OnLoadCompleteObservable: Observable<Engine>;
  19. /** Registers an handler for window state show scene loader function (engine.html) */
  20. static RegisterOnShowSceneLoader(func: (show: boolean) => void): void;
  21. /** Registers an handler for window socket disconnect event (engine.html) */
  22. static RegisterOnUpdateSceneLoader(func: (status: string, details: string, state: number) => void): void;
  23. /** Registers an handler for window state show scene loader function (engine.html) */
  24. static RegisterOnTickSceneLoader(func: (percent: number) => void): void;
  25. /** Loads a babylon scene file using the page loader window hooks (engine.html) */
  26. static LoadSceneFile(sceneFile: string, queryString?: string): void;
  27. /** Shows the top page scene loader (engine.html) */
  28. static ShowParentLoader(show: boolean): void;
  29. /** Get the system render quality setting. */
  30. static GetRenderQuality(): BABYLON.RenderQuality;
  31. /** Set the system render quality setting. */
  32. static SetRenderQuality(quality: BABYLON.RenderQuality): void;
  33. /** Get an item from top window local storage. */
  34. static GetLocalStorageItem(key: string): string;
  35. /** Set an item to top window local storage. */
  36. static SetLocalStorageItem(key: string, value: string): void;
  37. /** Store data object in the window state cache */
  38. static SetWindowState(name: string, data: any): void;
  39. /** Retrieve data object from the window state cache */
  40. static GetWindowState<T>(name: string): T;
  41. /** Post a safe message to top or local window */
  42. static PostWindowMessage(message: any, targetOrigin: string, transfer?: Transferable[]): void;
  43. private static SceneParsingEnabled;
  44. /** Enable scene loader parsing plugin */
  45. static EnableSceneParsing(enabled: boolean): void;
  46. /** Is scene loader parsing plugin enabled */
  47. static IsSceneParsingEnabled(): boolean;
  48. private static AdvDynamicTexture;
  49. /** Get the default fullscreen user interface advanced dynamic texture */
  50. static GetFullscreenUI(scene: BABYLON.Scene): BABYLON.GUI.AdvancedDynamicTexture;
  51. /** Get the scene default ambient skybox mesh */
  52. static GetAmbientSkybox(scene: BABYLON.Scene): BABYLON.AbstractMesh;
  53. /** Get the scene default intenisty factor */
  54. static GetIntensityFactor(): number;
  55. /** Are scene manager debugging services available. */
  56. static IsDebugMode(): boolean;
  57. /** Send log data directly to the console. */
  58. static ConsoleLog(...data: any[]): void;
  59. /** Send info data directly to the console. */
  60. static ConsoleInfo(...data: any[]): void;
  61. /** Send warning data directly to the console. */
  62. static ConsoleWarn(...data: any[]): void;
  63. /** Send error data directly to the console. */
  64. static ConsoleError(...data: any[]): void;
  65. /** Logs a message to the console using the babylon logging system. */
  66. static LogMessage(message: string): void;
  67. /** Logs a warning to the console using babylon logging system. */
  68. static LogWarning(warning: string): void;
  69. /** Logs a error to the console using babylon logging system. */
  70. static LogError(error: string): void;
  71. /** Are unversial windows platform services available. */
  72. static IsWindows(): boolean;
  73. /** Are mobile cordova platform services available. */
  74. static IsCordova(): boolean;
  75. /** Are web assembly platform services available. */
  76. static IsWebAssembly(): boolean;
  77. /** Is oculus browser platform agent. */
  78. static IsOculusBrowser(): boolean;
  79. /** Is samsung browser platform agent. */
  80. static IsSamsungBrowser(): boolean;
  81. /** Is windows phone platform agent. */
  82. static IsWindowsPhone(): boolean;
  83. /** Is blackberry web platform agent. */
  84. static IsBlackBerry(): boolean;
  85. /** Is opera web platform agent. */
  86. static IsOperaMini(): boolean;
  87. /** Is android web platform agent. */
  88. static IsAndroid(): boolean;
  89. /** Is web os platform agent. */
  90. static IsWebOS(): boolean;
  91. /** Is ios web platform agent. */
  92. static IsIOS(): boolean;
  93. /** Is iphone web platform agent. */
  94. static IsIPHONE(): boolean;
  95. /** Is ipad web platform agent. */
  96. static IsIPAD(): boolean;
  97. /** Is ipod web platform agent. */
  98. static IsIPOD(): boolean;
  99. /** Is internet explorer 11 platform agent. */
  100. static IsIE11(): boolean;
  101. /** Is mobile web platform agent. */
  102. static IsMobile(): boolean;
  103. /** Are playstation services available. */
  104. static IsPlaystation(): boolean;
  105. /** Are xbox console services available. */
  106. static IsXboxConsole(): boolean;
  107. /** Are xbox live platform services available. */
  108. static IsXboxLive(): boolean;
  109. /** Get the current time in seconds */
  110. static GetTime(): number;
  111. /** Get the total game time in seconds */
  112. static GetGameTime(): number;
  113. /** Get the current delta time in seconds */
  114. static GetDeltaSeconds(scene: BABYLON.Scene): number;
  115. /** Get the delta time animation ratio multiplier */
  116. static GetAnimationRatio(scene: BABYLON.Scene): number;
  117. /** Delays a function call using request animation frames. Returns a handle object */
  118. static SetTimeout(timeout: number, func: () => void): any;
  119. /** Calls request animation frame delay with handle to cancel pending timeout call */
  120. static ClearTimeout(handle: any): void;
  121. /** Repeats a function call using request animation frames. Retuns a handle object */
  122. static SetInterval(interval: number, func: () => void): any;
  123. /** Calls request animation frame repeast with handle to clear pending interval call. */
  124. static ClearInterval(handle: any): void;
  125. /** Run a function on the next render loop. */
  126. static RunOnce(scene: BABYLON.Scene, func: () => void, timeout?: number): void;
  127. /** Popup debug layer in window. */
  128. static PopupDebug(scene: BABYLON.Scene): void;
  129. /** Toggle debug layer on and off. */
  130. static ToggleDebug(scene: BABYLON.Scene, embed?: boolean, parent?: HTMLElement): void;
  131. /** Disposes entire scene and release all resources */
  132. static DisposeScene(scene: BABYLON.Scene, clearColor?: BABYLON.Color4): void;
  133. /** Safely destroy transform node */
  134. static SafeDestroy(transform: BABYLON.TransformNode, delay?: number, disable?: boolean): void;
  135. /** Open alert message dialog. */
  136. static AlertMessage(text: string, title?: string): any;
  137. /** Gets the names query string from page url. */
  138. static GetQueryStringParam(name: string, url: string): string;
  139. /** Gets the current engine WebGL version string info. */
  140. static GetWebGLVersionString(scene: BABYLON.Scene): string;
  141. /** Gets the current engine WebGL version number info. */
  142. static GetWebGLVersionNumber(scene: BABYLON.Scene): number;
  143. /** Get the root url the last scene properties was loaded from */
  144. static GetRootUrl(scene: BABYLON.Scene): string;
  145. /** Sets the root url the last scene properties was loaded from */
  146. static SetRootUrl(scene: BABYLON.Scene, url: string): void;
  147. /** Get the file name the last scene properties was loaded from */
  148. static GetSceneFile(scene: BABYLON.Scene): string;
  149. /** Sets the file name the last scene properties was loaded from */
  150. static SetSceneFile(scene: BABYLON.Scene, fileName: string): void;
  151. /** Get the right hand loader flag the last scene properties was loaded from */
  152. static GetRightHanded(scene: BABYLON.Scene): boolean;
  153. /** Sets the right hand loader flag the last scene properties was loaded from */
  154. static SetRightHanded(scene: BABYLON.Scene, righty: boolean): void;
  155. /** Set the Windows Runtime preferred launch windowing mode. (Example: Windows.UI.ViewManagement.ApplicationViewWindowingMode.fullScreen = 1) */
  156. static SetWindowsLaunchMode(mode?: number): void;
  157. /** Show the default page error message. */
  158. static ShowPageErrorMessage(message: string, title?: string, timeout?: number): void;
  159. /** Quit the Windows Runtime host application. */
  160. static QuitWindowsApplication(): void;
  161. /** Loads a file as text (IFileRequest) */
  162. static LoadTextFile(url: string, onSuccess: (data: string) => void, onProgress?: (data: any) => void, onError?: (request?: WebRequest, exception?: any) => void): BABYLON.IFileRequest;
  163. /** Load a text based file */
  164. static LoadTextFileAsync(url: string): Promise<string>;
  165. /** Post data to server (XmlHttpRequest) */
  166. static PostDataToServer(url: string, data: string | Document | Blob | ArrayBufferView | ArrayBuffer | FormData | URLSearchParams | ReadableStream<Uint8Array>, contentType?: string, onSuccess?: (status: int) => void, onFailure?: (reason: any) => void): XMLHttpRequest;
  167. /** Post data to server asynchronously */
  168. static PostDataToServerAsync(url: string, data: string | Document | Blob | ArrayBufferView | ArrayBuffer | FormData | URLSearchParams | ReadableStream<Uint8Array>, contentType?: string): Promise<number>;
  169. /** Shows the default page scene loader. */
  170. static ShowDefaultLoader(show: boolean): void;
  171. /** Update the default page scene loader status. */
  172. static UpdateLoaderStatus(status: string, details: string, state: number): void;
  173. /** Gets all the created engine instances */
  174. static GetEngineInstances(): BABYLON.Engine[];
  175. /** Get the last create engine instance */
  176. static GetLastCreatedEngine(): BABYLON.Engine;
  177. /** Get the last created scene instance */
  178. static GetLastCreatedScene(): BABYLON.Scene;
  179. /** Get managed asset container. */
  180. static GetAssetContainer(scene: BABYLON.Scene, name: string): BABYLON.AssetContainer;
  181. /** Set managed asset container. */
  182. static SetAssetContainer(scene: BABYLON.Scene, name: string, container: BABYLON.AssetContainer): void;
  183. /** Clear all managed asset containers. */
  184. static ClearAssetContainers(scene: BABYLON.Scene): void;
  185. /** Gets the specified mesh by name from scene. */
  186. static GetMesh(scene: BABYLON.Scene, name: string): BABYLON.Mesh;
  187. /** Gets the specified mesh by id from scene. */
  188. static GetMeshByID(scene: BABYLON.Scene, id: string): BABYLON.Mesh;
  189. /** Gets the specified abstract mesh by name from scene. */
  190. static GetAbstractMesh(scene: BABYLON.Scene, name: string): BABYLON.AbstractMesh;
  191. /** Gets the specified abstract mesh by id from scene. */
  192. static GetAbstractMeshByID(scene: BABYLON.Scene, id: string): BABYLON.AbstractMesh;
  193. /** Gets the specified transform node by name from scene. */
  194. static GetTransformNode(scene: BABYLON.Scene, name: string): BABYLON.TransformNode;
  195. /** Gets the specified transform node by id from scene. */
  196. static GetTransformNodeByID(scene: BABYLON.Scene, id: string): BABYLON.TransformNode;
  197. /** Gets the transform node primitive meshes. */
  198. static GetPrimitiveMeshes(transform: TransformNode): BABYLON.AbstractMesh[];
  199. /** Gets the specified transform node primary layer index. */
  200. static GetTransformLayer(transform: BABYLON.TransformNode): number;
  201. /** Gets the specified transform node primary tag name. */
  202. static GetTransformTag(transform: BABYLON.TransformNode): string;
  203. /** Check if the transform has the specified query tag match */
  204. static HasTransformTags(transform: BABYLON.TransformNode, query: string): boolean;
  205. /** Are half or full texture floats supported */
  206. static TextureFloatSupported(scene: BABYLON.Scene): boolean;
  207. /** Registers an on pick trigger click action */
  208. static RegisterClickAction(scene: BABYLON.Scene, mesh: BABYLON.AbstractMesh, func: () => void): BABYLON.IAction;
  209. /** Unregisters an on pick trigger click action */
  210. static UnregisterClickAction(mesh: BABYLON.AbstractMesh, action: BABYLON.IAction): boolean;
  211. /** Starts a targeted float animation for tweening. */
  212. static StartTweenAnimation(scene: BABYLON.Scene, name: string, targetObject: any, targetProperty: string, startValue: number, endValue: number, speedRatio?: number, frameRate?: number, loopMode?: number, easingFunction?: BABYLON.EasingFunction, onAnimationComplete?: () => void): BABYLON.Animatable;
  213. /** Get first material with name. (Uses starts with text searching) */
  214. static GetMaterialWithName(scene: BABYLON.Scene, name: string): BABYLON.Material;
  215. /** Get all materials with name. (Uses starts with text searching) */
  216. static GetAllMaterialsWithName(scene: BABYLON.Scene, name: string): BABYLON.Material[];
  217. /** Instantiate the specified prefab asset hierarchy into the scene. (Cloned Hierarchy) */
  218. static InstantiatePrefab(container: BABYLON.AssetContainer, prefabName: string, newName: string, makeNewMaterials?: boolean, cloneAnimations?: boolean): BABYLON.TransformNode;
  219. /** Clones the specified transform node asset into the scene. (Transform Node) */
  220. static CloneTransformNode(container: BABYLON.AssetContainer, nodeName: string, cloneName: string): BABYLON.TransformNode;
  221. /** Clones the specified abstract mesh asset into the scene. (Abtract Mesh) */
  222. static CloneAbstractMesh(container: BABYLON.AssetContainer, nodeName: string, cloneName: string): BABYLON.AbstractMesh;
  223. /** Creates an instance of the specified mesh asset into the scene. (Mesh Instance) */
  224. static CreateInstancedMesh(container: BABYLON.AssetContainer, meshName: string, instanceName: string): BABYLON.InstancedMesh;
  225. /** Registers a script componment with the scene manager. */
  226. static RegisterScriptComponent(instance: BABYLON.ScriptComponent, alias: string, validate?: boolean): void;
  227. /** Destroys a script component instance. */
  228. static DestroyScriptComponent(instance: BABYLON.ScriptComponent): void;
  229. /** Finds a script component on the transform with the specfied class name. */
  230. static FindScriptComponent<T extends BABYLON.ScriptComponent>(transform: BABYLON.TransformNode, klass: string): T;
  231. /** Finds all script components on the transform with the specfied class name. */
  232. static FindAllScriptComponents<T extends BABYLON.ScriptComponent>(transform: BABYLON.TransformNode, klass: string): T[];
  233. /** Finds the transform object metedata in the scene. */
  234. static FindSceneMetadata(transform: BABYLON.TransformNode): any;
  235. /** Finds the specfied camera rig in the scene. */
  236. static FindSceneCameraRig(transform: BABYLON.TransformNode): BABYLON.FreeCamera;
  237. /** Finds the specfied light rig in the scene. */
  238. static FindSceneLightRig(transform: BABYLON.TransformNode): BABYLON.Light;
  239. /** Finds all transforms with the specified script component. */
  240. static FindTransformsWithScript(scene: BABYLON.Scene, klass: string): BABYLON.TransformNode;
  241. /** Finds all transforms with the specified script component. */
  242. static FindAllTransformsWithScript(scene: BABYLON.Scene, klass: string): BABYLON.TransformNode[];
  243. /** Finds the specfied child transform in the scene. */
  244. static FindChildTransformNode(parent: BABYLON.TransformNode, name: string, searchType?: BABYLON.SearchType, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  245. /** Finds the first child transform with matching tags. */
  246. static FindChildTransformWithTags(parent: BABYLON.TransformNode, query: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  247. /** Finds all child transforms with matching tags. */
  248. static FindAllChildTransformsWithTags(parent: BABYLON.TransformNode, query: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode[];
  249. /** Finds the first child transform with the specified script component. */
  250. static FindChildTransformWithScript(parent: BABYLON.TransformNode, klass: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  251. /** Finds all child transforms with the specified script component. */
  252. static FindAllChildTransformsWithScript(parent: BABYLON.TransformNode, klass: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode[];
  253. /** Searches all nodes for the instance of the specified script component. */
  254. static SearchForScriptComponentByName<T extends BABYLON.ScriptComponent>(scene: BABYLON.Scene, klass: string): T;
  255. /** Searches all nodes for all instances of the specified script component. */
  256. static SearchForAllScriptComponentsByName<T extends BABYLON.ScriptComponent>(scene: BABYLON.Scene, klass: string): T[];
  257. /** Moves entity using vector position with camera collisions. */
  258. static MoveWithCollisions(entity: BABYLON.AbstractMesh, velocity: BABYLON.Vector3): void;
  259. /** Moves entity using vector position using translations. */
  260. static MoveWithTranslation(entity: BABYLON.TransformNode, velocity: BABYLON.Vector3): void;
  261. /** Turns entity using quaternion rotations in radians. */
  262. static TurnWithRotation(entity: BABYLON.TransformNode, radians: number, space?: BABYLON.Space): void;
  263. /** Callback to setup ammo.js plugin properties when activated on the scene. */
  264. static OnSetupPhysicsPlugin: (scene: BABYLON.Scene, plugin: BABYLON.AmmoJSPlugin) => void;
  265. /** Get ammo.js total memory heap size */
  266. static GetPhysicsHeapSize(): number;
  267. /** Confiures ammo.js physcis engine advanced sweeping and collision detection options on the scene. */
  268. static ConfigurePhysicsEngine(scene: BABYLON.Scene, deltaWorldStep?: boolean, maxPhysicsStep?: number, maxWorldSweep?: number, ccdEnabled?: boolean, ccdPenetration?: number, gravityLevel?: BABYLON.Vector3): void;
  269. /** Gets the current ammo.js physics world. */
  270. static GetPhysicsEngine(scene: BABYLON.Scene): BABYLON.IPhysicsEngine;
  271. /** Gets the current ammo.js physics world. */
  272. static GetPhysicsWorld(scene: BABYLON.Scene): any;
  273. private static TempVRayDest;
  274. private static TempVRayOrigin;
  275. private static TempShapeVector;
  276. private static TempPhysicsWorld;
  277. private static TempTransformFrom;
  278. private static TempTransformTo;
  279. private static TempCastEndPoint;
  280. private static TempRaycastResult;
  281. private static ClosestRayResultCallback;
  282. private static ClosestConvexResultCallback;
  283. /** Perform a ammo.js physics world ray testing direction length with optional group filter mask. */
  284. static PhysicsRaycast(scene: BABYLON.Scene, origin: BABYLON.Vector3, direction: BABYLON.Vector3, length: number, group?: number, mask?: number): BABYLON.Nullable<BABYLON.RaycastHitResult>;
  285. /** Perform a ammo.js physics world ray testing destination point with optional group filter mask. */
  286. static PhysicsRaycastToPoint(scene: BABYLON.Scene, origin: BABYLON.Vector3, destination: BABYLON.Vector3, group?: number, mask?: number): BABYLON.Nullable<BABYLON.RaycastHitResult>;
  287. /** Perform a ammo.js physics world shape testing direction length with optional group filter mask. */
  288. static PhysicsShapecast(scene: BABYLON.Scene, btConvexShape: any, origin: BABYLON.Vector3, direction: BABYLON.Vector3, length: number, group?: number, mask?: number): BABYLON.Nullable<BABYLON.RaycastHitResult>;
  289. /** Perform a ammo.js physics world shape testing diestination point with optional group filter mask. */
  290. static PhysicsShapecastToPoint(scene: BABYLON.Scene, btConvexShape: any, origin: BABYLON.Vector3, destination: BABYLON.Vector3, group?: number, mask?: number): BABYLON.Nullable<BABYLON.RaycastHitResult>;
  291. /** Creates a validated entity parent child physics impostor */
  292. static CreatePhysicsImpostor(scene: BABYLON.Scene, entity: BABYLON.AbstractMesh, type: number, options: BABYLON.PhysicsImpostorParameters, reparent?: boolean): void;
  293. /** Gets the physics impostor type as a string. */
  294. static GetPhysicsImposterType(type: number): string;
  295. /** Creates a ammo.js physics box collision shape */
  296. static CreatePhysicsBoxShape(halfextents: BABYLON.Vector3): any;
  297. /** Creates a ammo.js physics sphere collision shape */
  298. static CreatePhysicsSphereShape(radius: number): any;
  299. /** Creates a ammo.js physics capsule collision shape */
  300. static CreatePhysicsCapsuleShape(radius: number, height: number): any;
  301. /** Creates a ammo.js physics compound collision shape */
  302. static CreatePhysicsCompoundShape(enableDynamicAabbTree?: boolean): any;
  303. /** Creates a ammo.js physics empty concave collision shape */
  304. static CreatePhysicsEmptyShape(): any;
  305. static MAX_AGENT_COUNT: number;
  306. static MAX_AGENT_RADIUS: number;
  307. private static NavigationMesh;
  308. private static CrowdInterface;
  309. private static PluginInstance;
  310. /** Register handler that is triggered when the audio clip is ready */
  311. static OnNavMeshReadyObservable: Observable<Mesh>;
  312. /** Get recast total memory heap size */
  313. static GetRecastHeapSize(): number;
  314. /** Gets the recast navigation plugin tools. (Singleton Instance) */
  315. static GetNavigationTools(): BABYLON.RecastJSPlugin;
  316. /** Gets the recast navigation crowd interface. (Singleton Instance) */
  317. static GetCrowdInterface(scene: BABYLON.Scene): BABYLON.ICrowd;
  318. /** Has the recast baked navigation data. (Navigation Helper) */
  319. static HasNavigationData(): boolean;
  320. /** Gets the current recast navigation mesh. (Navigation Helper) */
  321. static GetNavigationMesh(): BABYLON.Mesh;
  322. /** Bake the recast navigation mesh from geometry. (Navigation Helper) */
  323. static BakeNavigationMesh(scene: BABYLON.Scene, meshes: BABYLON.Mesh[], properties: BABYLON.INavMeshParameters, debug?: boolean, color?: BABYLON.Color3): BABYLON.Mesh;
  324. /** Load the recast navigation mesh binary data. (Navigation Helper) */
  325. static LoadNavigationMesh(scene: BABYLON.Scene, data: Uint8Array, debug?: boolean, color?: BABYLON.Color3, timeSteps?: number): BABYLON.Mesh;
  326. /** Save the recast navigation mesh binary data. (Navigation Helper) */
  327. static SaveNavigationMesh(): Uint8Array;
  328. /** Computes a recast navigation path. (Navigation Helper) */
  329. static ComputeNavigationPath(start: BABYLON.Vector3, end: BABYLON.Vector3, closetPoint?: boolean): BABYLON.Vector3[];
  330. /** Animate movement along a navigation path. (Navigation Helper) */
  331. static MoveAlongNavigationPath(scene: BABYLON.Scene, agent: BABYLON.TransformNode, path: BABYLON.Vector3[], speed?: number, easing?: BABYLON.EasingFunction, callback?: () => void): BABYLON.Animation;
  332. /** Global gamepad manager */
  333. static GamepadManager: BABYLON.GamepadManager;
  334. /** Global gamepad connect event handler */
  335. static GamepadConnected: (pad: BABYLON.Gamepad, state: BABYLON.EventState) => void;
  336. /** Global gamepad disconnect event handler */
  337. static GamepadDisconnected: (pad: BABYLON.Gamepad, state: BABYLON.EventState) => void;
  338. /** Enable user input state in the scene. */
  339. static EnableUserInput(scene: BABYLON.Scene, options?: {
  340. pointerLock?: boolean;
  341. preventDefault?: boolean;
  342. useCapture?: boolean;
  343. enableVirtualJoystick?: boolean;
  344. disableRightStick?: boolean;
  345. }): void;
  346. /** Disables user input state in the scene. */
  347. static DisableUserInput(scene: BABYLON.Scene, useCapture?: boolean): void;
  348. /** Toggle full screen scene mode. */
  349. static ToggleFullscreenMode(scene: BABYLON.Scene, requestPointerLock?: boolean): void;
  350. /** Enter full screen scene mode. */
  351. static EnterFullscreenMode(scene: BABYLON.Scene, requestPointerLock?: boolean): void;
  352. /** Exit full screen scene mode. */
  353. static ExitFullscreenMode(scene: BABYLON.Scene): void;
  354. /** Locks user pointer state in the scene. */
  355. static LockMousePointer(scene: BABYLON.Scene, lock: boolean): void;
  356. private static PointerLockedFlag;
  357. static IsPointerLocked(): boolean;
  358. private static LockMousePointerObserver;
  359. static IsPointerLockHandled(): boolean;
  360. /** Get user input state from the scene. */
  361. static GetUserInput(input: BABYLON.UserInputAxis, player?: BABYLON.PlayerNumber): number;
  362. /** Set a keyboard up event handler. */
  363. static OnKeyboardUp(callback: (keycode: number) => void): void;
  364. /** Set a keyboard down event handler. */
  365. static OnKeyboardDown(callback: (keycode: number) => void): void;
  366. /** Set a keyboard press event handler. */
  367. static OnKeyboardPress(keycode: number, callback: () => void): void;
  368. /** Get the specified keyboard input by keycode. */
  369. static GetKeyboardInput(keycode: number): boolean;
  370. /** Set a pointer up event handler. */
  371. static OnPointerUp(callback: (button: number) => void): void;
  372. /** Set a pointer down event handler. */
  373. static OnPointerDown(callback: (button: number) => void): void;
  374. /** Set a pointer press event handler. */
  375. static OnPointerPress(button: number, callback: () => void): void;
  376. /** Get the specified pointer input by button. */
  377. static GetPointerInput(button: number): boolean;
  378. /** Get left virtual joystick. */
  379. static GetLeftJoystick(): BABYLON.VirtualJoystick;
  380. /** Get right virtual joystick. */
  381. static GetRightJoystick(): BABYLON.VirtualJoystick;
  382. /** Get joystick button pressed. */
  383. static GetJoystickPress(button: number): boolean;
  384. /** Dispose virtual joystick setup. */
  385. static DisposeVirtualJoysticks(): void;
  386. /** Set on gamepad button up event handler. */
  387. static OnGamepadButtonUp(callback: (button: number) => void, player?: BABYLON.PlayerNumber): void;
  388. /** Set on gamepad button down event handler. */
  389. static OnGamepadButtonDown(callback: (button: number) => void, player?: BABYLON.PlayerNumber): void;
  390. /** Set on gamepad button press event handler. */
  391. static OnGamepadButtonPress(button: number, callback: () => void, player?: BABYLON.PlayerNumber): void;
  392. /** Get the specified gamepad input by button. */
  393. static GetGamepadButtonInput(button: number, player?: BABYLON.PlayerNumber): boolean;
  394. /** Set on gamepad direction pad up event handler. */
  395. static OnGamepadDirectionUp(callback: (direction: number) => void, player?: BABYLON.PlayerNumber): void;
  396. /** Set on gamepad direction pad down event handler. */
  397. static OnGamepadDirectionDown(callback: (direction: number) => void, player?: BABYLON.PlayerNumber): void;
  398. /** Set on gamepad direction pad press event handler. */
  399. static OnGamepadDirectionPress(direction: number, callback: () => void, player?: BABYLON.PlayerNumber): void;
  400. /** Get the specified gamepad direction input by number. */
  401. static GetGamepadDirectionInput(direction: number, player?: BABYLON.PlayerNumber): boolean;
  402. /** Set on gamepad trigger left event handler. */
  403. static OnGamepadTriggerLeft(callback: (value: number) => void, player?: BABYLON.PlayerNumber): void;
  404. /** Set on gamepad trigger right event handler. */
  405. static OnGamepadTriggerRight(callback: (value: number) => void, player?: BABYLON.PlayerNumber): void;
  406. /** Get the specified gamepad trigger input by number. */
  407. static GetGamepadTriggerInput(trigger: number, player?: BABYLON.PlayerNumber): number;
  408. /** Get the specified gamepad type. */
  409. static GetGamepadType(player?: BABYLON.PlayerNumber): BABYLON.GamepadType;
  410. /** Get the specified gamepad. */
  411. static GetGamepad(player?: BABYLON.PlayerNumber): BABYLON.Gamepad;
  412. private static input;
  413. private static keymap;
  414. private static wheel;
  415. private static mousex;
  416. private static mousey;
  417. private static vertical;
  418. private static horizontal;
  419. private static mousex2;
  420. private static mousey2;
  421. private static vertical2;
  422. private static horizontal2;
  423. private static mousex3;
  424. private static mousey3;
  425. private static vertical3;
  426. private static horizontal3;
  427. private static mousex4;
  428. private static mousey4;
  429. private static vertical4;
  430. private static horizontal4;
  431. private static a_mousex;
  432. private static x_wheel;
  433. private static x_mousex;
  434. private static x_mousey;
  435. private static x_vertical;
  436. private static x_horizontal;
  437. private static k_mousex;
  438. private static k_mousey;
  439. private static k_vertical;
  440. private static k_horizontal;
  441. private static j_mousex;
  442. private static j_mousey;
  443. private static j_vertical;
  444. private static j_horizontal;
  445. private static g_mousex1;
  446. private static g_mousey1;
  447. private static g_vertical1;
  448. private static g_horizontal1;
  449. private static g_mousex2;
  450. private static g_mousey2;
  451. private static g_vertical2;
  452. private static g_horizontal2;
  453. private static g_mousex3;
  454. private static g_mousey3;
  455. private static g_vertical3;
  456. private static g_horizontal3;
  457. private static g_mousex4;
  458. private static g_mousey4;
  459. private static g_vertical4;
  460. private static g_horizontal4;
  461. private static mouseButtonPress;
  462. private static mouseButtonDown;
  463. private static mouseButtonUp;
  464. private static keyButtonPress;
  465. private static keyButtonDown;
  466. private static keyButtonUp;
  467. private static leftJoystick;
  468. private static rightJoystick;
  469. private static virtualJoystick;
  470. private static previousPosition;
  471. private static preventDefault;
  472. private static rightHanded;
  473. private static gamepad1;
  474. private static gamepad1Type;
  475. private static gamepad1ButtonPress;
  476. private static gamepad1ButtonDown;
  477. private static gamepad1ButtonUp;
  478. private static gamepad1DpadPress;
  479. private static gamepad1DpadDown;
  480. private static gamepad1DpadUp;
  481. private static gamepad1LeftTrigger;
  482. private static gamepad1RightTrigger;
  483. private static gamepad2;
  484. private static gamepad2Type;
  485. private static gamepad2ButtonPress;
  486. private static gamepad2ButtonDown;
  487. private static gamepad2ButtonUp;
  488. private static gamepad2DpadPress;
  489. private static gamepad2DpadDown;
  490. private static gamepad2DpadUp;
  491. private static gamepad2LeftTrigger;
  492. private static gamepad2RightTrigger;
  493. private static gamepad3;
  494. private static gamepad3Type;
  495. private static gamepad3ButtonPress;
  496. private static gamepad3ButtonDown;
  497. private static gamepad3ButtonUp;
  498. private static gamepad3DpadPress;
  499. private static gamepad3DpadDown;
  500. private static gamepad3DpadUp;
  501. private static gamepad3LeftTrigger;
  502. private static gamepad3RightTrigger;
  503. private static gamepad4;
  504. private static gamepad4Type;
  505. private static gamepad4ButtonPress;
  506. private static gamepad4ButtonDown;
  507. private static gamepad4ButtonUp;
  508. private static gamepad4DpadPress;
  509. private static gamepad4DpadDown;
  510. private static gamepad4DpadUp;
  511. private static gamepad4LeftTrigger;
  512. private static gamepad4RightTrigger;
  513. private static debugLayerVisible;
  514. private static tickKeyboardInput;
  515. private static updateUserInput;
  516. private static resetUserInput;
  517. private static resetKeyMapHandler;
  518. private static inputKeyDownHandler;
  519. private static inputKeyUpHandler;
  520. private static inputPointerWheelHandler;
  521. private static inputPointerDownHandler;
  522. private static inputPointerUpHandler;
  523. private static inputPointerMoveHandler;
  524. private static inputVirtualJoysticks;
  525. private static inputOneButtonDownHandler;
  526. private static inputOneButtonUpHandler;
  527. private static inputOneXboxDPadDownHandler;
  528. private static inputOneShockDPadDownHandler;
  529. private static inputOneXboxDPadUpHandler;
  530. private static inputOneShockDPadUpHandler;
  531. private static inputOneXboxLeftTriggerHandler;
  532. private static inputOneXboxRightTriggerHandler;
  533. private static inputOneLeftStickHandler;
  534. private static inputOneRightStickHandler;
  535. private static inputTwoButtonDownHandler;
  536. private static inputTwoButtonUpHandler;
  537. private static inputTwoXboxDPadDownHandler;
  538. private static inputTwoShockDPadDownHandler;
  539. private static inputTwoXboxDPadUpHandler;
  540. private static inputTwoShockDPadUpHandler;
  541. private static inputTwoXboxLeftTriggerHandler;
  542. private static inputTwoXboxRightTriggerHandler;
  543. private static inputTwoLeftStickHandler;
  544. private static inputTwoRightStickHandler;
  545. private static inputThreeButtonDownHandler;
  546. private static inputThreeButtonUpHandler;
  547. private static inputThreeXboxDPadDownHandler;
  548. private static inputThreeShockDPadDownHandler;
  549. private static inputThreeXboxDPadUpHandler;
  550. private static inputThreeShockDPadUpHandler;
  551. private static inputThreeXboxLeftTriggerHandler;
  552. private static inputThreeXboxRightTriggerHandler;
  553. private static inputThreeLeftStickHandler;
  554. private static inputThreeRightStickHandler;
  555. private static inputFourButtonDownHandler;
  556. private static inputFourButtonUpHandler;
  557. private static inputFourXboxDPadDownHandler;
  558. private static inputFourShockDPadDownHandler;
  559. private static inputFourXboxDPadUpHandler;
  560. private static inputFourShockDPadUpHandler;
  561. private static inputFourXboxLeftTriggerHandler;
  562. private static inputFourXboxRightTriggerHandler;
  563. private static inputFourLeftStickHandler;
  564. private static inputFourRightStickHandler;
  565. private static inputManagerGamepadConnected;
  566. private static inputManagerGamepadDisconnected;
  567. private static inputManagerLeftControllerMainButton;
  568. private static inputManagerLeftControllerPadState;
  569. private static inputManagerLeftControllerPadValues;
  570. private static inputManagerLeftControllerAuxButton;
  571. private static inputManagerLeftControllerTriggered;
  572. private static inputManagerRightControllerMainButton;
  573. private static inputManagerRightControllerPadState;
  574. private static inputManagerRightControllerPadValues;
  575. private static inputManagerRightControllerAuxButton;
  576. private static inputManagerRightControllerTriggered;
  577. private static inputManagerControllerConnected;
  578. }
  579. }
  580. /**
  581. * Babylon Scene Manager Alias
  582. */
  583. declare const SM: typeof BABYLON.SceneManager;
  584. declare module BABYLON {
  585. /**
  586. * Babylon metadata parser class (Internal use only)
  587. * @class MetadataParser - All rights reserved (c) 2020 Mackey Kinard
  588. */
  589. class MetadataParser {
  590. private _physicList;
  591. private _shadowList;
  592. private _freezeList;
  593. private _scriptList;
  594. private _babylonScene;
  595. constructor(scene: BABYLON.Scene);
  596. /** Parse the scene component metadata. Note: Internal use only */
  597. parseSceneComponents(entity: BABYLON.TransformNode): void;
  598. /** Post process pending scene components. Note: Internal use only */
  599. postProcessSceneComponents(): void;
  600. private static DoParseSceneComponents;
  601. private static DoProcessPendingScripts;
  602. private static DoProcessPendingShadows;
  603. private static DoProcessPendingPhysics;
  604. private static DoProcessPendingFreezes;
  605. private static SetupCameraComponent;
  606. private static SetupLightComponent;
  607. }
  608. }
  609. /**
  610. * RequestAnimationFrame() Original Shim By: Paul Irish (Internal use only)
  611. * http://paulirish.com/2011/requestanimationframe-for-smart-animating/
  612. * @class TimerPlugin - All rights reserved (c) 2020 Mackey Kinard
  613. */
  614. declare var TimerPlugin: any;
  615. declare module BABYLON {
  616. /**
  617. * Babylon script component class
  618. * @class ScriptComponent - All rights reserved (c) 2020 Mackey Kinard
  619. */
  620. abstract class ScriptComponent {
  621. private _update;
  622. private _late;
  623. private _after;
  624. private _lateUpdate;
  625. private _properties;
  626. private _awoken;
  627. private _started;
  628. private _scene;
  629. private _transform;
  630. private _registeredClassname;
  631. /** Gets the current scene object */
  632. get scene(): BABYLON.Scene;
  633. /** Gets the transform node entity */
  634. get transform(): BABYLON.TransformNode;
  635. constructor(transform: BABYLON.TransformNode, scene: BABYLON.Scene, properties?: any);
  636. /** Sets the script component property bag value */
  637. protected setProperty(name: string, propertyValue: any): void;
  638. /** Gets the script component property bag value */
  639. protected getProperty<T>(name: string, defaultValue?: T): T;
  640. /** Gets the registered script component class name */
  641. getClassName(): string;
  642. /** Get the current time in seconds */
  643. getTime(): number;
  644. /** Get the total game time in seconds */
  645. getGameTime(): number;
  646. /** Get the current delta time in seconds */
  647. getDeltaSeconds(): number;
  648. /** Get the delta time animation ratio multiplier */
  649. getAnimationRatio(): number;
  650. /** Gets the safe transform mesh entity */
  651. getTransformMesh(): BABYLON.Mesh;
  652. /** Gets the safe transform abstract mesh entity */
  653. getAbstractMesh(): BABYLON.AbstractMesh;
  654. /** Gets the safe transform instanced mesh entity */
  655. getInstancedMesh(): BABYLON.InstancedMesh;
  656. /** Gets the transform primitive meshes */
  657. getPrimitiveMeshes(): BABYLON.AbstractMesh[];
  658. /** Get the transform object metedata in the scene. */
  659. getMetadata(): any;
  660. /** Get a script component on the transform with the specfied class name. */
  661. getComponent<T extends BABYLON.ScriptComponent>(klass: string): T;
  662. /** Get all script components on the transform with the specfied class name. */
  663. getComponents<T extends BABYLON.ScriptComponent>(klass: string): T[];
  664. /** Gets the attached transform light rig */
  665. getLightRig(): BABYLON.Light;
  666. /** Gets the attached transform camera rig */
  667. getCameraRig(): BABYLON.FreeCamera;
  668. /** Gets a script component transform primary tag name. */
  669. getTransformTag(): string;
  670. /** Check if the transform has the specified query tag match */
  671. hasTransformTags(query: string): boolean;
  672. /** Get the specfied child transform in the scene. */
  673. getChildNode(name: string, searchType?: BABYLON.SearchType, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  674. /** Get the first child transform with matching tags. */
  675. getChildWithTags(query: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  676. /** Get all child transforms with matching tags. */
  677. getChildrenWithTags(query: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode[];
  678. /** Get the first child transform with the specified script component. */
  679. getChildWithScript(klass: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  680. /** Get all child transforms with the specified script component. */
  681. getChildrenWithScript(klass: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode[];
  682. /** Register handler that is triggered after the scene has rendered and is ready to go */
  683. registerOnSceneReady(func: (eventData: BABYLON.Scene, eventState: BABYLON.EventState) => void): void;
  684. /** Registers an on pick tricgger click action */
  685. registerOnClickAction(func: () => void): BABYLON.IAction;
  686. /** Unregisters an on pick tricgger click action */
  687. unregisterOnClickAction(action: BABYLON.IAction): boolean;
  688. /** Register handler that is triggered after each physics fixed update step */
  689. registerOnFixedUpdate(func: (impostor: BABYLON.PhysicsImpostor) => void): boolean;
  690. /** Unregister observer that is triggered after each physics fixed update step */
  691. unregisterOnFixedUpdate(func: (impostor: BABYLON.PhysicsImpostor) => void): boolean;
  692. /** Register handler that is triggered when the a volume has entered */
  693. onTriggerEnterObservable: Observable<AbstractMesh>;
  694. /** Register handler that is triggered when the a volume contact is active */
  695. onTriggerStayObservable: Observable<AbstractMesh>;
  696. /** Register handler that is triggered when the a volume contact has exited */
  697. onTriggerExitObservable: Observable<AbstractMesh>;
  698. private triggerMesh;
  699. private triggerVolumeList;
  700. useTriggerVolumePrecision: boolean;
  701. includeTriggerVolumeDescendants: boolean;
  702. getTriggerVolumeList(): BABYLON.TriggerVolume[];
  703. resetTriggerVolumeList(): void;
  704. registerTriggerVolume(volume: BABYLON.AbstractMesh): void;
  705. unregisterTriggerVolume(volume: BABYLON.AbstractMesh): void;
  706. private registerComponentInstance;
  707. private destroyComponentInstance;
  708. private static RegisterInstance;
  709. private static UpdateInstance;
  710. private static LateInstance;
  711. private static AfterInstance;
  712. private static DestroyInstance;
  713. private static ParseAutoProperties;
  714. private static UnpackObjectProperty;
  715. }
  716. }
  717. declare module BABYLON {
  718. /**
  719. * Babylon universal shader defines pro class
  720. * @class UniversalShaderDefines - All rights reserved (c) 2020 Mackey Kinard
  721. */
  722. class UniversalShaderDefines {
  723. private _defines;
  724. constructor();
  725. getDefines(): any;
  726. defineBoolean(name: string): void;
  727. defineNumeric(name: string, value: number): void;
  728. static ShaderIndexer: number;
  729. }
  730. /**
  731. * Babylon universal albedo chunks pro class
  732. * @class UniversalAlbedoChunks - All rights reserved (c) 2020 Mackey Kinard
  733. */
  734. class UniversalAlbedoChunks {
  735. constructor();
  736. Vertex_Begin: string;
  737. Vertex_Definitions: string;
  738. Vertex_MainBegin: string;
  739. Vertex_Before_PositionUpdated: string;
  740. Vertex_Before_NormalUpdated: string;
  741. Vertex_After_WorldPosComputed: string;
  742. Vertex_MainEnd: string;
  743. Fragment_Begin: string;
  744. Fragment_Definitions: string;
  745. Fragment_MainBegin: string;
  746. Fragment_Custom_Albedo: string;
  747. Fragment_Custom_Alpha: string;
  748. Fragment_Before_Lights: string;
  749. Fragment_Before_Fog: string;
  750. Fragment_Before_FragColor: string;
  751. Fragment_MetallicRoughness: string;
  752. Fragment_MicroSurface: string;
  753. }
  754. /**
  755. * Babylon universal albedo material pro class
  756. * @class UniversalAlbedoMaterial - All rights reserved (c) 2020 Mackey Kinard
  757. */
  758. class UniversalAlbedoMaterial extends BABYLON.PBRMaterial {
  759. protected universalMaterial: boolean;
  760. protected locals: BABYLON.UniversalShaderDefines;
  761. protected terrainInfo: any;
  762. private _defines;
  763. private _uniforms;
  764. private _samplers;
  765. private _attributes;
  766. private _textures;
  767. private _vectors4;
  768. private _floats;
  769. private _createdShaderName;
  770. protected enableShaderChunks: boolean;
  771. protected materialShaderChunks: BABYLON.UniversalAlbedoChunks;
  772. protected updateShaderChunks(): void;
  773. constructor(name: string, scene: Scene);
  774. getClassName(): string;
  775. getShaderName(): string;
  776. getShaderChunk(): string;
  777. getShaderDefines(): BABYLON.PBRMaterialDefines;
  778. getCustomAttributes(): string[];
  779. getTexture(name: string): BABYLON.Texture;
  780. getVector4(name: string): BABYLON.Vector4;
  781. getFloat(name: string): number;
  782. setTexture(name: string, texture: BABYLON.Texture, initialize?: boolean): BABYLON.UniversalAlbedoMaterial;
  783. setVector4(name: string, value: BABYLON.Vector4, initialize?: boolean): BABYLON.UniversalAlbedoMaterial;
  784. setFloat(name: string, value: number, initialize?: boolean): BABYLON.UniversalAlbedoMaterial;
  785. addAttribute(attributeName: string): void;
  786. checkUniform(uniformName: string): void;
  787. checkSampler(samplerName: string): void;
  788. getAnimatables(): IAnimatable[];
  789. getActiveTextures(): BaseTexture[];
  790. hasTexture(texture: BaseTexture): boolean;
  791. dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
  792. clone(cloneName: string): BABYLON.UniversalAlbedoMaterial;
  793. serialize(): any;
  794. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): BABYLON.UniversalAlbedoMaterial;
  795. protected customShaderChunkResolve(): void;
  796. private _buildCustomShader;
  797. private _createShaderChunks;
  798. private _attachAfterBind;
  799. }
  800. /**
  801. * Babylon universal terrain material pro class
  802. * @class UniversalTerrainMaterial
  803. */
  804. class UniversalTerrainMaterial extends BABYLON.UniversalAlbedoMaterial {
  805. constructor(name: string, scene: BABYLON.Scene);
  806. getClassName(): string;
  807. getShaderName(): string;
  808. getShaderChunk(): string;
  809. protected updateShaderChunks(): void;
  810. private formatTerrainVertexDefintions;
  811. private formatTerrainVertexMainEnd;
  812. private formatTerrainFragmentDefintions;
  813. private formatTerrainFragmentUpdateColor;
  814. }
  815. }
  816. declare module BABYLON {
  817. /**
  818. * Babylon system class
  819. * @class System - All rights reserved (c) 2020 Mackey Kinard
  820. */
  821. enum System {
  822. Deg2Rad,
  823. Rad2Deg,
  824. Epsilon = 0.00001,
  825. EpsilonNormalSqrt = 1e-15,
  826. Kph2Mph = 0.621371,
  827. Mph2Kph = 1.60934,
  828. Mps2Kph = 3.6,
  829. Meter2Inch = 39.3701,
  830. Inch2Meter = 0.0254,
  831. Gravity = 9.81,
  832. Gravity3G = 29.400000000000002,
  833. SkidFactor = 0.25,
  834. MaxInteger = 2147483647,
  835. WalkingVelocity = 4.4,
  836. TerminalVelocity = 55,
  837. SmoothDeltaFactor = 0.2,
  838. ToLinearSpace = 2.2,
  839. ToGammaSpace = 0.45454545454545453
  840. }
  841. enum Handedness {
  842. Default = -1,
  843. Right = 0,
  844. Left = 1
  845. }
  846. enum SearchType {
  847. ExactMatch = 0,
  848. StartsWith = 1,
  849. EndsWith = 2,
  850. IndexOf = 3
  851. }
  852. enum PlayerNumber {
  853. None = 0,
  854. One = 1,
  855. Two = 2,
  856. Three = 3,
  857. Four = 4
  858. }
  859. enum PlayerControl {
  860. FirstPerson = 0,
  861. ThirdPerson = 1
  862. }
  863. enum RenderQuality {
  864. High = 0,
  865. Medium = 1,
  866. Low = 2
  867. }
  868. enum GamepadType {
  869. None = -1,
  870. Generic = 0,
  871. Xbox360 = 1,
  872. DualShock = 2,
  873. PoseController = 3
  874. }
  875. enum JoystickButton {
  876. Left = 0,
  877. Right = 1
  878. }
  879. enum Xbox360Trigger {
  880. Left = 0,
  881. Right = 1
  882. }
  883. enum MovementType {
  884. DirectVelocity = 0,
  885. AppliedForces = 1
  886. }
  887. enum CollisionContact {
  888. Top = 0,
  889. Left = 1,
  890. Right = 2,
  891. Bottom = 3
  892. }
  893. enum IntersectionPrecision {
  894. AABB = 0,
  895. OBB = 1
  896. }
  897. enum CollisionFilters {
  898. DefaultFilter = 1,
  899. StaticFilter = 2,
  900. KinematicFilter = 4,
  901. DebrisFilter = 8,
  902. SensorTrigger = 16,
  903. CharacterFilter = 32,
  904. GroundFilter = 64,
  905. AllFilter = -1
  906. }
  907. enum CollisionState {
  908. ACTIVE_TAG = 1,
  909. ISLAND_SLEEPING = 2,
  910. WANTS_DEACTIVATION = 3,
  911. DISABLE_DEACTIVATION = 4,
  912. DISABLE_SIMULATION = 5
  913. }
  914. enum CollisionFlags {
  915. CF_STATIC_OBJECT = 1,
  916. CF_KINEMATIC_OBJECT = 2,
  917. CF_NO_CONTACT_RESPONSE = 4,
  918. CF_CUSTOM_MATERIAL_CALLBACK = 8,
  919. CF_CHARACTER_OBJECT = 16,
  920. CF_DISABLE_VISUALIZE_OBJECT = 32,
  921. CF_DISABLE_SPU_COLLISION_PROCESSING = 64,
  922. CF_HAS_CONTACT_STIFFNESS_DAMPING = 128,
  923. CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR = 256,
  924. CF_HAS_FRICTION_ANCHOR = 512,
  925. CF_HAS_COLLISION_SOUND_TRIGGER = 1024
  926. }
  927. enum UserInputPointer {
  928. Left = 0,
  929. Middle = 1,
  930. Right = 2
  931. }
  932. enum UserInputAxis {
  933. Horizontal = 0,
  934. Vertical = 1,
  935. ClientX = 2,
  936. ClientY = 3,
  937. MouseX = 4,
  938. MouseY = 5,
  939. Wheel = 6
  940. }
  941. enum UserInputKey {
  942. BackSpace = 8,
  943. Tab = 9,
  944. Enter = 13,
  945. Shift = 16,
  946. Ctrl = 17,
  947. Alt = 18,
  948. Pause = 19,
  949. Break = 19,
  950. CapsLock = 20,
  951. Escape = 27,
  952. SpaceBar = 32,
  953. PageUp = 33,
  954. PageDown = 34,
  955. End = 35,
  956. Home = 36,
  957. LeftArrow = 37,
  958. UpArrow = 38,
  959. RightArrow = 39,
  960. DownArrow = 40,
  961. Insert = 45,
  962. Delete = 46,
  963. Num0 = 48,
  964. Num1 = 49,
  965. Num2 = 50,
  966. Num3 = 51,
  967. Num4 = 52,
  968. Num5 = 53,
  969. Num6 = 54,
  970. Num7 = 55,
  971. Num8 = 56,
  972. Num9 = 57,
  973. A = 65,
  974. B = 66,
  975. C = 67,
  976. D = 68,
  977. E = 69,
  978. F = 70,
  979. G = 71,
  980. H = 72,
  981. I = 73,
  982. J = 74,
  983. K = 75,
  984. L = 76,
  985. M = 77,
  986. N = 78,
  987. O = 79,
  988. P = 80,
  989. Q = 81,
  990. R = 82,
  991. S = 83,
  992. T = 84,
  993. U = 85,
  994. V = 86,
  995. W = 87,
  996. X = 88,
  997. Y = 89,
  998. Z = 90,
  999. LeftWindowKey = 91,
  1000. RightWindowKey = 92,
  1001. SelectKey = 93,
  1002. Numpad0 = 96,
  1003. Numpad1 = 97,
  1004. Numpad2 = 98,
  1005. Numpad3 = 99,
  1006. Numpad4 = 100,
  1007. Numpad5 = 101,
  1008. Numpad6 = 102,
  1009. Numpad7 = 103,
  1010. Numpad8 = 104,
  1011. Numpad9 = 105,
  1012. Multiply = 106,
  1013. Add = 107,
  1014. Subtract = 109,
  1015. DecimalPoint = 110,
  1016. Divide = 111,
  1017. F1 = 112,
  1018. F2 = 113,
  1019. F3 = 114,
  1020. F4 = 115,
  1021. F5 = 116,
  1022. F6 = 117,
  1023. F7 = 118,
  1024. F8 = 119,
  1025. F9 = 120,
  1026. F10 = 121,
  1027. F11 = 122,
  1028. F12 = 123,
  1029. NumLock = 144,
  1030. ScrollLock = 145,
  1031. SemiColon = 186,
  1032. EqualSign = 187,
  1033. Comma = 188,
  1034. Dash = 189,
  1035. Period = 190,
  1036. ForwardSlash = 191,
  1037. GraveAccent = 192,
  1038. OpenBracket = 219,
  1039. BackSlash = 220,
  1040. CloseBraket = 221,
  1041. SingleQuote = 222
  1042. }
  1043. interface UserInputPress {
  1044. index: number;
  1045. action: () => void;
  1046. }
  1047. type UserInputAction = (index: number) => void;
  1048. class UserInputOptions {
  1049. static KeyboardSmoothing: boolean;
  1050. static KeyboardMoveSensibility: number;
  1051. static KeyboardMoveDeadZone: number;
  1052. static GamepadDeadStickValue: number;
  1053. static GamepadLStickXInverted: boolean;
  1054. static GamepadLStickYInverted: boolean;
  1055. static GamepadRStickXInverted: boolean;
  1056. static GamepadRStickYInverted: boolean;
  1057. static GamepadLStickSensibility: number;
  1058. static GamepadRStickSensibility: number;
  1059. static JoystickRightHandleColor: string;
  1060. static JoystickLeftSensibility: number;
  1061. static JoystickRightSensibility: number;
  1062. static JoystickDeadStickValue: number;
  1063. static PointerAngularSensibility: number;
  1064. static PointerWheelDeadZone: number;
  1065. static PointerMouseDeadZone: number;
  1066. static UseArrowKeyRotation: boolean;
  1067. static UseCanvasElement: boolean;
  1068. }
  1069. /**
  1070. * Unity Export Interfaces
  1071. */
  1072. interface IUnityTransform {
  1073. type: string;
  1074. id: string;
  1075. tag: string;
  1076. name: string;
  1077. layer: number;
  1078. }
  1079. interface IUnityCurve {
  1080. type: string;
  1081. length: number;
  1082. prewrapmode: string;
  1083. postwrapmode: string;
  1084. animation: any;
  1085. }
  1086. interface IUnityMaterial {
  1087. type: string;
  1088. id: string;
  1089. name: string;
  1090. shader: string;
  1091. gltf: number;
  1092. }
  1093. interface IUnityTexture {
  1094. type: string;
  1095. name: string;
  1096. width: number;
  1097. height: number;
  1098. filename: string;
  1099. wrapmode: string;
  1100. filtermode: string;
  1101. anisolevel: number;
  1102. }
  1103. interface IUnityCubemap {
  1104. type: string;
  1105. name: string;
  1106. info: any;
  1107. width: number;
  1108. height: number;
  1109. filename: string;
  1110. extension: string;
  1111. wrapmode: string;
  1112. filtermode: string;
  1113. anisolevel: number;
  1114. texelsizex: number;
  1115. texelsizey: number;
  1116. dimension: number;
  1117. format: number;
  1118. mipmapbias: number;
  1119. mipmapcount: number;
  1120. }
  1121. interface IUnityAudioClip {
  1122. type: string;
  1123. name: string;
  1124. filename: string;
  1125. length: number;
  1126. channels: number;
  1127. frequency: number;
  1128. samples: number;
  1129. }
  1130. interface IUnityVideoClip {
  1131. type: string;
  1132. name: string;
  1133. filename: string;
  1134. length: number;
  1135. width: number;
  1136. height: number;
  1137. framerate: number;
  1138. framecount: number;
  1139. audiotracks: number;
  1140. }
  1141. interface IUnityFontAsset {
  1142. type: string;
  1143. filename: string;
  1144. format: string;
  1145. }
  1146. interface IUnityTextAsset {
  1147. type: string;
  1148. filename: string;
  1149. base64: string;
  1150. }
  1151. interface IUnityDefaultAsset {
  1152. type: string;
  1153. filename: string;
  1154. base64: string;
  1155. }
  1156. interface IUnityVector2 {
  1157. x: number;
  1158. y: number;
  1159. }
  1160. interface IUnityVector3 {
  1161. x: number;
  1162. y: number;
  1163. z: number;
  1164. }
  1165. interface IUnityVector4 {
  1166. x: number;
  1167. y: number;
  1168. z: number;
  1169. w: number;
  1170. }
  1171. interface IUnityColor {
  1172. r: number;
  1173. g: number;
  1174. b: number;
  1175. a: number;
  1176. }
  1177. /**
  1178. * Trigger Volume State
  1179. * @class TriggerVolume - All rights reserved (c) 2020 Mackey Kinard
  1180. */
  1181. class TriggerVolume {
  1182. mesh: BABYLON.AbstractMesh;
  1183. state: number;
  1184. }
  1185. /**
  1186. * Event Message Bus (Use Static Singleton Pattern)
  1187. * @class EventMessageBus - All rights reserved (c) 2020 Mackey Kinard
  1188. */
  1189. class EventMessageBus {
  1190. AddListener<T>(messageName: string, handler: (data: T) => void): void;
  1191. RemoveListener(messageName: string, handler: (data: any) => void): void;
  1192. RaiseMessage(messageName: string, data?: any): void;
  1193. private ListenerDictionary;
  1194. }
  1195. /**
  1196. * Prefab Object Pool (Use Static Singleton Pattern)
  1197. * @class PrefabObjectPool - All rights reserved (c) 2020 Mackey Kinard
  1198. */
  1199. class PrefabObjectPool {
  1200. private assetContainer;
  1201. private prefabName;
  1202. private makeNewMaterials;
  1203. private cloneAnimations;
  1204. constructor(container: BABYLON.AssetContainer, prefabName: string, makeNewMaterials?: boolean, cloneAnimations?: boolean);
  1205. /** Get a prefab instance from the object pool or create a new one if none available */
  1206. GetInstance(position?: BABYLON.Vector3, rotation?: BABYLON.Quaternion): BABYLON.TransformNode;
  1207. /** Return the prefab instance to the available object pool state */
  1208. ReturnInstance(instance: BABYLON.TransformNode): void;
  1209. /** Pre populate the prefab object pool by the specified count */
  1210. PrePopulatePool(count: number): void;
  1211. private AvailableInstances;
  1212. private CreateNewInstance;
  1213. }
  1214. /**
  1215. * Physics Raycast Classes
  1216. * @class RaycastHitResult - All rights reserved (c) 2020 Mackey Kinard
  1217. */
  1218. class RaycastHitResult {
  1219. private _hit;
  1220. private _dest;
  1221. private _origin;
  1222. private _hitPoint;
  1223. private _hitNormal;
  1224. private _hitDistance;
  1225. private _collisionObject;
  1226. get hasHit(): boolean;
  1227. get hitPoint(): BABYLON.Vector3;
  1228. get hitNormal(): BABYLON.Vector3;
  1229. get hitDistance(): number;
  1230. get collisionObject(): any;
  1231. get rayDestination(): BABYLON.Vector3;
  1232. get rayOrigin(): BABYLON.Vector3;
  1233. constructor();
  1234. reset(origin: BABYLON.Vector3, destination: BABYLON.Vector3): void;
  1235. update(hit: boolean, pointX: number, pointY: number, pointZ: number, normalX: number, normalY: number, normalZ: number, collisionObject?: any): void;
  1236. }
  1237. /**
  1238. * Lines Mesh Render Classes
  1239. * @class LinesMeshRenderer - All rights reserved (c) 2020 Mackey Kinard
  1240. */
  1241. class LinesMeshRenderer {
  1242. private _numPoints;
  1243. private _pointMesh;
  1244. private _pointSize;
  1245. private _pointType;
  1246. private _linesName;
  1247. private _linesMesh;
  1248. private _babylonScene;
  1249. get pointMesh(): BABYLON.Mesh;
  1250. get linesMesh(): BABYLON.LinesMesh;
  1251. constructor(name: string, scene: BABYLON.Scene, pointType?: number, pointSize?: number);
  1252. dispose(doNotRecurse?: boolean): void;
  1253. hidePoint(hide?: boolean): void;
  1254. drawPoint(position: BABYLON.Vector3): void;
  1255. drawLine(points: BABYLON.Vector3[], color?: BABYLON.Color3): void;
  1256. }
  1257. /**
  1258. * Babylon Utility Classes
  1259. * @class Utilities - All rights reserved (c) 2020 Mackey Kinard
  1260. */
  1261. class Utilities {
  1262. private static UpVector;
  1263. private static AuxVector;
  1264. private static ZeroVector;
  1265. private static TempMatrix;
  1266. private static TempVector2;
  1267. private static TempVector3;
  1268. private static TempQuaternion;
  1269. private static PrintElement;
  1270. private static LoadingState;
  1271. static IsLayerMasked(mask: number, layer: number): boolean;
  1272. static GetLoadingState(): number;
  1273. static MoveTowardsVector2(current: BABYLON.Vector2, target: BABYLON.Vector2, maxDelta: number): BABYLON.Vector2;
  1274. static MoveTowardsVector2ToRef(current: BABYLON.Vector2, target: BABYLON.Vector2, maxDelta: number, result: BABYLON.Vector2): void;
  1275. static MoveTowardsVector3(current: BABYLON.Vector3, target: BABYLON.Vector3, maxDelta: number): BABYLON.Vector3;
  1276. static MoveTowardsVector3ToRef(current: BABYLON.Vector3, target: BABYLON.Vector3, maxDelta: number, result: BABYLON.Vector3): void;
  1277. static MoveTowardsVector4(current: BABYLON.Vector4, target: BABYLON.Vector4, maxDelta: number): BABYLON.Vector4;
  1278. static MoveTowardsVector4ToRef(current: BABYLON.Vector4, target: BABYLON.Vector4, maxDelta: number, result: BABYLON.Vector4): void;
  1279. /** Clamps a vector2 magnitude to a max length. */
  1280. static ClampMagnitudeVector2(vector: BABYLON.Vector2, length: number): BABYLON.Vector2;
  1281. /** Clamps a vector2 magnitude to a max length. */
  1282. static ClampMagnitudeVector2ToRef(vector: BABYLON.Vector2, length: number, result: BABYLON.Vector2): void;
  1283. /** Clamps a vector3 magnitude to a max length. */
  1284. static ClampMagnitudeVector3(vector: BABYLON.Vector3, length: number): BABYLON.Vector3;
  1285. /** Clamps a vector3 magnitude to a max length. */
  1286. static ClampMagnitudeVector3ToRef(vector: BABYLON.Vector3, length: number, result: BABYLON.Vector3): void;
  1287. /** Zero pad a number to string */
  1288. static ZeroPad(num: number, places: number): string;
  1289. /** TODO */
  1290. static LerpLog(a: number, b: number, t: number): number;
  1291. /** TODO */
  1292. static LerpExp(a: number, b: number, t: number): number;
  1293. static LerpClamp(a: number, b: number, t: number): number;
  1294. /** TODO */
  1295. static LerpUnclamp(a: number, b: number, t: number): number;
  1296. /** Returns the angle in degrees between the from and to vectors. */
  1297. static GetAngle(from: BABYLON.Vector3, to: BABYLON.Vector3): number;
  1298. /** TODO */
  1299. static ClampAngle(angle: number, min: number, max: number): number;
  1300. /** Gradually changes a number towards a desired goal over time. (Note: Uses currentVelocity.x as output variable) */
  1301. static SmoothDamp(current: number, target: number, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector2): number;
  1302. /** Gradually changes an angle given in degrees towards a desired goal angle over time. (Note: Uses currentVelocity.x as output variable) */
  1303. static SmoothDampAngle(current: number, target: number, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector2): number;
  1304. /** Gradually changes a vector towards a desired goal over time. (Note: Uses currentVelocity.xy as output variable) */
  1305. static SmoothDampVector2(current: BABYLON.Vector2, target: BABYLON.Vector2, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector2): BABYLON.Vector2;
  1306. /** Gradually changes a vector result towards a desired goal over time. (Note: Uses currentVelocity.xy as output variable) */
  1307. static SmoothDampVector2ToRef(current: BABYLON.Vector2, target: BABYLON.Vector2, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector2, result: BABYLON.Vector2): void;
  1308. /** Gradually changes a vector towards a desired goal over time. (Note: Uses currentVelocity.xyz as output variable) */
  1309. static SmoothDampVector3(current: BABYLON.Vector3, target: BABYLON.Vector3, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector3): BABYLON.Vector3;
  1310. /** Gradually changes a vector result towards a desired goal over time. (Note: Uses currentVelocity.xyz as output variable) */
  1311. static SmoothDampVector3ToRef(current: BABYLON.Vector3, target: BABYLON.Vector3, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector3, result: BABYLON.Vector3): void;
  1312. /** Returns a new Matrix as a rotation matrix from the Euler angles in degrees (x, y, z). */
  1313. static ToMatrix(x: number, y: number, z: number): BABYLON.Matrix;
  1314. /** Sets a Matrix result as a rotation matrix from the Euler angles in degrees (x, y, z). */
  1315. static ToMatrixToRef(x: number, y: number, z: number, result: BABYLON.Matrix): void;
  1316. /** Set the passed matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue". */
  1317. static FastMatrixLerp(startValue: BABYLON.Matrix, endValue: BABYLON.Matrix, gradient: number, result: BABYLON.Matrix): void;
  1318. /** Set the passed matrix "result" as the spherical interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue". */
  1319. static FastMatrixSlerp(startValue: BABYLON.Matrix, endValue: BABYLON.Matrix, gradient: number, result: BABYLON.Matrix): void;
  1320. /** Returns a new Vector Euler in degress set from the passed qauternion. */
  1321. static ToEuler(quaternion: BABYLON.Quaternion): BABYLON.Vector3;
  1322. /** Sets a Vector Euler result in degress set from the passed qauternion. */
  1323. static ToEulerToRef(quaternion: BABYLON.Quaternion, result: BABYLON.Vector3): void;
  1324. /** Returns a new Quaternion set from the passed Euler float angles in degrees (x, y, z). */
  1325. static FromEuler(x: number, y: number, z: number): BABYLON.Quaternion;
  1326. /** Sets a Quaternion result set from the passed Euler float angles in degrees (x, y, z). */
  1327. static FromEulerToRef(x: number, y: number, z: number, result: BABYLON.Quaternion): void;
  1328. /** Computes the difference in quaternion values */
  1329. static QuaternionDiff(value1: BABYLON.Quaternion, value2: BABYLON.Quaternion): BABYLON.Quaternion;
  1330. /** Computes the difference in quaternion values to a result value */
  1331. static QuaternionDiffToRef(value1: BABYLON.Quaternion, value2: BABYLON.Quaternion, result: BABYLON.Quaternion): void;
  1332. /** Multplies a quaternion by a vector (rotates vector) */
  1333. static RotateVector(vec: BABYLON.Vector3, quat: BABYLON.Quaternion): BABYLON.Vector3;
  1334. /** Multplies a quaternion by a vector (rotates vector) */
  1335. static RotateVectorToRef(vec: BABYLON.Vector3, quat: BABYLON.Quaternion, result: BABYLON.Vector3): void;
  1336. /** Returns a new Quaternion set from the passed vector direction. */
  1337. static LookRotation(direction: BABYLON.Vector3): BABYLON.Quaternion;
  1338. /** Returns a new Quaternion set from the passed vector direction. */
  1339. static LookRotationToRef(direction: BABYLON.Vector3, result: BABYLON.Quaternion): void;
  1340. /** Returns a new vector3 degrees converted from radions */
  1341. static Vector3Rad2Deg(vector: BABYLON.Vector3): BABYLON.Vector3;
  1342. /** Sets a vector3 result degrees converted from radions */
  1343. static Vector3Rad2DegToRef(vector: BABYLON.Vector3, result: BABYLON.Vector3): void;
  1344. /** Multiply the quaternion by a vector */
  1345. static MultiplyQuaternionByVector(quaternion: BABYLON.Quaternion, vector: BABYLON.Vector3): BABYLON.Vector3;
  1346. /** Multiply the quaternion by a vector to result */
  1347. static MultiplyQuaternionByVectorToRef(quaternion: BABYLON.Quaternion, vector: BABYLON.Vector3, result: BABYLON.Vector3): void;
  1348. /** Validate and switch Quaternion rotation to Euler rotation. */
  1349. static ValidateTransformRotation(transform: BABYLON.TransformNode): void;
  1350. /** Validate and switch Euler rotation to Quaternion rotation. */
  1351. static ValidateTransformQuaternion(transform: BABYLON.TransformNode): void;
  1352. /** Get the smoothed keyboard input value */
  1353. static GetKeyboardInputValue(scene: BABYLON.Scene, currentValue: number, targetValue: number): number;
  1354. /** TODO */
  1355. static DownloadEnvironment(cubemap: BABYLON.CubeTexture, success?: () => void, failure?: () => void): void;
  1356. static HasOwnProperty(object: any, property: string): boolean;
  1357. static GetFilenameFromUrl(url: string): string;
  1358. static GetUrlParameter(key: string): string;
  1359. static CreateFontFace(scene: BABYLON.Scene, family: string, asset: BABYLON.IUnityFontAsset, descriptors?: FontFaceDescriptors, oncomplete?: (fontFace: FontFace) => void): FontFace;
  1360. static CreateFontFaceElement(scene: BABYLON.Scene, family: string, asset: BABYLON.IUnityFontAsset, options?: string): HTMLStyleElement;
  1361. /** TODO */
  1362. static PrintToScreen(text: string, color?: string): void;
  1363. private static TmpHullMatrix;
  1364. private static TmpAmmoVectorA;
  1365. private static TmpAmmoVectorB;
  1366. private static TmpAmmoVectorC;
  1367. private static TmpAmmoVectorD;
  1368. static AddMeshVerts(btTriangleMesh: any, topLevelObject: BABYLON.IPhysicsEnabledObject, object: BABYLON.IPhysicsEnabledObject, scaling?: boolean): number;
  1369. static AddHullVerts(btConvexHullShape: any, topLevelObject: BABYLON.IPhysicsEnabledObject, object: BABYLON.IPhysicsEnabledObject, scaling?: boolean): number;
  1370. static CreateImpostorCustomShape(scene: BABYLON.Scene, impostor: BABYLON.PhysicsImpostor, type: number, showDebugColliders?: boolean, colliderVisibility?: number): any;
  1371. static ShowDebugColliders(): boolean;
  1372. static ColliderVisibility(): number;
  1373. static CollisionWireframe(): boolean;
  1374. static GetColliderMaterial(scene: BABYLON.Scene): BABYLON.Material;
  1375. /** TODO */
  1376. static GetDirectTargetAngle(transform: BABYLON.TransformNode, worldSpaceTarget: BABYLON.Vector3): number;
  1377. /** TODO */
  1378. static GetSmoothTargetAngle(transform: BABYLON.TransformNode, worldSpaceTarget: BABYLON.Vector3): number;
  1379. /** TODO */
  1380. static CalculatCatmullRom(p0: BABYLON.Vector3, p1: BABYLON.Vector3, p2: BABYLON.Vector3, p3: BABYLON.Vector3, i: number): BABYLON.Vector3;
  1381. /** TODO */
  1382. static CalculatCatmullRomToRef(p0: BABYLON.Vector3, p1: BABYLON.Vector3, p2: BABYLON.Vector3, p3: BABYLON.Vector3, i: number, result: BABYLON.Vector3): void;
  1383. /** TODO */
  1384. static StartsWith(source: string, word: string): boolean;
  1385. /** TODO */
  1386. static EndsWith(source: string, word: string): boolean;
  1387. /** TODO */
  1388. static ReplaceAll(source: string, word: string, replace: string): string;
  1389. /** TODO */
  1390. static IsNullOrEmpty(source: string): boolean;
  1391. /** TODO */
  1392. static SafeStringPush(array: string[], value: string): void;
  1393. /** TODO */
  1394. static ParseColor3(source: BABYLON.IUnityColor, defaultValue?: BABYLON.Color3, toLinearSpace?: boolean): BABYLON.Color3;
  1395. /** TODO */
  1396. static ParseColor4(source: BABYLON.IUnityColor, defaultValue?: BABYLON.Color4, toLinearSpace?: boolean): BABYLON.Color4;
  1397. /** TODO */
  1398. static ParseVector2(source: BABYLON.IUnityVector2, defaultValue?: BABYLON.Vector2): BABYLON.Vector2;
  1399. /** TODO */
  1400. static ParseVector3(source: BABYLON.IUnityVector3, defaultValue?: BABYLON.Vector3): BABYLON.Vector3;
  1401. /** TODO */
  1402. static ParseVector4(source: BABYLON.IUnityVector4, defaultValue?: BABYLON.Vector4): BABYLON.Vector4;
  1403. /** TODO */
  1404. static ParseSound(source: BABYLON.IUnityAudioClip, scene: BABYLON.Scene, name: string, callback?: Nullable<() => void>, options?: BABYLON.ISoundOptions): BABYLON.Sound;
  1405. /** TODO */
  1406. static ParseTexture(source: BABYLON.IUnityTexture, scene: BABYLON.Scene, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message?: string, exception?: any) => void>, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob>, deleteBuffer?: boolean, format?: number): BABYLON.Texture;
  1407. static ParseCubemap(source: BABYLON.IUnityCubemap, scene: BABYLON.Scene): BABYLON.CubeTexture;
  1408. /** TODO */
  1409. static ParseTextAsset(source: BABYLON.IUnityTextAsset, defaultValue?: string): string;
  1410. /** TODO */
  1411. static ParseJsonAsset<T>(source: BABYLON.IUnityTextAsset, defaultValue?: string, reviver?: (this: any, key: string, value: any) => any): T;
  1412. /** TODO */
  1413. static ParseTransformByID(source: BABYLON.IUnityTransform, scene: BABYLON.Scene, defaultValue?: BABYLON.TransformNode): BABYLON.TransformNode;
  1414. static ParseTransformByName(source: BABYLON.IUnityTransform, scene: BABYLON.Scene, defaultValue?: BABYLON.TransformNode): BABYLON.TransformNode;
  1415. /** TODO */
  1416. static ParseChildTransform(parent: BABYLON.TransformNode, source: BABYLON.IUnityTransform, defaultValue?: BABYLON.TransformNode): BABYLON.TransformNode;
  1417. /** Gets the transform node abosulte position */
  1418. static GetAbsolutePosition(transform: BABYLON.TransformNode, offsetPosition?: BABYLON.Vector3, computeMatrix?: boolean): BABYLON.Vector3;
  1419. /** Gets the transform node abosulte position */
  1420. static GetAbsolutePositionToRef(transform: BABYLON.TransformNode, result: BABYLON.Vector3, offsetPosition?: BABYLON.Vector3, computeMatrix?: boolean): void;
  1421. /** Transforms position from local space to world space. (Using TransformCoordinates) */
  1422. static TransformPoint(owner: BABYLON.TransformNode | BABYLON.Camera, position: BABYLON.Vector3, computeMatrix?: boolean): BABYLON.Vector3;
  1423. /** Inverse transforms position from world space to local space. (Using TransformCoordinates) */
  1424. static InverseTransformPoint(owner: BABYLON.TransformNode | BABYLON.Camera, position: BABYLON.Vector3, computeMatrix?: boolean): BABYLON.Vector3;
  1425. /** Transforms position from local space to world space. (Using TransformCoordinates) */
  1426. static TransformPointToRef(owner: BABYLON.TransformNode | BABYLON.Camera, position: BABYLON.Vector3, result: BABYLON.Vector3, computeMatrix?: boolean): void;
  1427. /** Inverse transforms position from world space to local space. (Using TransformCoordinates) */
  1428. static InverseTransformPointToRef(owner: BABYLON.TransformNode | BABYLON.Camera, position: BABYLON.Vector3, result: BABYLON.Vector3, computeMatrix?: boolean): void;
  1429. /** Transforms direction from local space to world space. (Using TransformNormal) */
  1430. static TransformDirection(owner: BABYLON.TransformNode | BABYLON.Camera, direction: BABYLON.Vector3, computeMatrix?: boolean): BABYLON.Vector3;
  1431. /** Inverse transforms direction from world space to local space. (Using TransformNormal) */
  1432. static InverseTransformDirection(owner: BABYLON.TransformNode | BABYLON.Camera, direction: BABYLON.Vector3, computeMatrix?: boolean): BABYLON.Vector3;
  1433. /** Transforms direction from local space to world space. (Using TransformNormal) */
  1434. static TransformDirectionToRef(owner: BABYLON.TransformNode | BABYLON.Camera, direction: BABYLON.Vector3, result: BABYLON.Vector3, computeMatrix?: boolean): void;
  1435. /** Inverse transforms direction from world space to local space. (Using TransformNormal) */
  1436. static InverseTransformDirectionToRef(owner: BABYLON.TransformNode | BABYLON.Camera, direction: BABYLON.Vector3, result: BABYLON.Vector3, computeMatrix?: boolean): void;
  1437. /** Recomputes the meshes bounding center pivot point */
  1438. static RecomputeCenterPivotPoint(owner: BABYLON.AbstractMesh): void;
  1439. /** Gets any direction vector of the owner in world space. */
  1440. static GetDirectionVector(owner: BABYLON.TransformNode | BABYLON.Camera, vector: BABYLON.Vector3): BABYLON.Vector3;
  1441. /** Gets any direction vector of the owner in world space. */
  1442. static GetDirectionVectorToRef(owner: BABYLON.TransformNode | BABYLON.Camera, vector: BABYLON.Vector3, result: BABYLON.Vector3): void;
  1443. /** Gets the blue axis of the owner in world space. */
  1444. static GetForwardVector(owner: BABYLON.TransformNode | BABYLON.Camera): BABYLON.Vector3;
  1445. /** Gets the blue axis of the owner in world space. */
  1446. static GetForwardVectorToRef(owner: BABYLON.TransformNode | BABYLON.Camera, result: BABYLON.Vector3): void;
  1447. /** Gets the red axis of the owner in world space. */
  1448. static GetRightVector(owner: BABYLON.TransformNode | BABYLON.Camera): BABYLON.Vector3;
  1449. /** Gets the red axis of the owner in world space. */
  1450. static GetRightVectorToRef(owner: BABYLON.TransformNode | BABYLON.Camera, result: BABYLON.Vector3): void;
  1451. /** Gets the green axis of the owner in world space. */
  1452. static GetUpVector(owner: BABYLON.TransformNode | BABYLON.Camera): BABYLON.Vector3;
  1453. /** Gets the green axis of the owner in world space. */
  1454. static GetUpVectorToRef(owner: BABYLON.TransformNode | BABYLON.Camera, result: BABYLON.Vector3): void;
  1455. /** Blend float buffer values */
  1456. static BlendFloatValue(source: number, value: number, weight: number): number;
  1457. /** Blend vector2 buffer values */
  1458. static BlendVector2Value(source: BABYLON.Vector2, value: BABYLON.Vector2, weight: number): void;
  1459. /** Blend vector3 buffer values */
  1460. static BlendVector3Value(source: BABYLON.Vector3, value: BABYLON.Vector3, weight: number): void;
  1461. /** Blend quaternion buffer values */
  1462. static BlendQuaternionValue(source: BABYLON.Quaternion, value: BABYLON.Quaternion, weight: number): void;
  1463. /** Set animation target property */
  1464. static SetAnimationTargetProperty(animation: BABYLON.Animation, property: string): void;
  1465. /** Gets the float "result" as the sampled key frame value for the specfied animation track. */
  1466. static SampleAnimationFloat(animation: BABYLON.Animation, frame: number): number;
  1467. /** Set the passed vector2 "result" as the sampled key frame value for the specfied animation track. */
  1468. static SampleAnimationVector2(animation: BABYLON.Animation, frame: number): BABYLON.Vector2;
  1469. /** Set the passed vector3 "result" as the sampled key frame value for the specfied animation track. */
  1470. static SampleAnimationVector3(animation: BABYLON.Animation, frame: number): BABYLON.Vector3;
  1471. /** Set the passed quaternion "result" as the sampled key frame value for the specfied animation track. */
  1472. static SampleAnimationQuaternion(animation: BABYLON.Animation, frame: number): BABYLON.Quaternion;
  1473. /** Set the passed matrix "result" as the sampled key frame value for the specfied animation track. */
  1474. static SampleAnimationMatrix(animation: BABYLON.Animation, frame: number): BABYLON.Matrix;
  1475. /** Creates a targeted float animation for tweening. */
  1476. static CreateFloatAnimation(name: string, targetProperty: string, startValue: number, endValue: number, frameRate?: number, loopMode?: number): BABYLON.Animation;
  1477. /** Gets the last key frame index value. */
  1478. static GetLastKeyFrameIndex(animation: BABYLON.Animation): number;
  1479. /** Private internal frame interpolation helper */
  1480. private static InterpolateAnimation;
  1481. /** Initialize default shader material properties */
  1482. static InitializeShaderMaterial(material: BABYLON.ShaderMaterial, binding?: boolean): void;
  1483. /** Transforms position from world space into screen space. */
  1484. static WorldToScreenPoint(scene: BABYLON.Scene, position: BABYLON.Vector3, camera?: BABYLON.Camera): BABYLON.Vector3;
  1485. /** Transforms a point from screen space into world space. */
  1486. static ScreenToWorldPoint(scene: BABYLON.Scene, position: BABYLON.Vector3): BABYLON.Vector3;
  1487. /** TODO */
  1488. static ConvertAmmoVector3(btVector: any): BABYLON.Vector3;
  1489. /** TODO */
  1490. static ConvertAmmoVector3ToRef(btVector: any, result: BABYLON.Vector3): void;
  1491. /** TODO */
  1492. static ConvertAmmoQuaternion(btVector: any): BABYLON.Quaternion;
  1493. /** TODO */
  1494. static ConvertAmmoQuaternionToRef(btQuaternion: any, result: BABYLON.Quaternion): void;
  1495. static CloneSkeletonPrefab(scene: BABYLON.Scene, skeleton: BABYLON.Skeleton, name: string, id?: string, root?: BABYLON.TransformNode): BABYLON.Skeleton;
  1496. /** Get all loaded scene transform nodes. */
  1497. static GetSceneTransforms(scene: BABYLON.Scene): BABYLON.TransformNode[];
  1498. /** Parse scene component metadata. */
  1499. static ParseSceneComponents(scene: BABYLON.Scene, transforms: BABYLON.TransformNode[]): void;
  1500. /**
  1501. * Gets the specified asset container mesh.
  1502. * @param container defines the asset container
  1503. * @param meshName defines the mesh name to get
  1504. * @returns the mesh from the container
  1505. */
  1506. static GetAssetContainerMesh(container: BABYLON.AssetContainer, meshName: string): BABYLON.Mesh;
  1507. /**
  1508. * Gets the specified asset container transform node.
  1509. * @param container defines the asset container
  1510. * @param nodeName defines the transform node name to get
  1511. * @returns the transform node from the container
  1512. */
  1513. static GetAssetContainerNode(container: BABYLON.AssetContainer, nodeName: string): BABYLON.TransformNode;
  1514. /**
  1515. * Clones the specified asset container item.
  1516. * Associcated skeletons and animation groups will all be cloned. (Internal Use Only)
  1517. * @param container defines the asset container
  1518. * @param assetName defines the asset item name to clone
  1519. * @param nameFunction defines an optional function used to get new names for clones
  1520. * @param cloneAnimations defines an option to clone any animation groups (true by default)
  1521. * @param makeNewMaterials defines an optional boolean that defines if materials must be cloned as well (false by default)
  1522. * @returns the transform node that was duplicated
  1523. */
  1524. static CloneAssetContainerItem(container: BABYLON.AssetContainer, assetName: string, nameFunction?: (sourceName: string) => string, makeNewMaterials?: boolean, cloneAnimations?: boolean): BABYLON.TransformNode;
  1525. static InstantiateHierarchy(node: BABYLON.TransformNode, newParent?: BABYLON.Nullable<BABYLON.TransformNode>, onNewNodeCreated?: (source: BABYLON.TransformNode, clone: BABYLON.TransformNode) => void): BABYLON.Nullable<BABYLON.TransformNode>;
  1526. static InstantiateNodeHierarchy(node: BABYLON.TransformNode, newParent?: BABYLON.Nullable<BABYLON.TransformNode>, onNewNodeCreated?: (source: BABYLON.TransformNode, clone: BABYLON.TransformNode) => void): BABYLON.Nullable<BABYLON.TransformNode>;
  1527. static InstantiateMeshHierarchy(mesh: BABYLON.Mesh, newParent: BABYLON.Nullable<BABYLON.TransformNode>, createInstance: boolean, onNewNodeCreated?: (source: BABYLON.TransformNode, clone: BABYLON.TransformNode) => void): BABYLON.Nullable<BABYLON.TransformNode>;
  1528. /** Computes the transition duration blending speed */
  1529. static ComputeBlendingSpeed(rate: number, duration: number, dampen?: boolean): number;
  1530. static CalculateCameraDistance(farClipPlane: number, lodPercent: number, clipPlaneScale?: number): number;
  1531. /** TODO */
  1532. static InstantiateClass(className: string): any;
  1533. /** TODO */
  1534. static GetSimpleClassName(obj: any): string;
  1535. /** TODO */
  1536. static DisposeEntity(entity: BABYLON.AbstractMesh): void;
  1537. /** TODO */
  1538. static SearchTransformNodes(name: string, nodes: BABYLON.Node[], searchType?: BABYLON.SearchType): BABYLON.Node;
  1539. /** TODO */
  1540. static SearchTransformNodeForTags(query: string, nodes: BABYLON.Node[]): BABYLON.Node;
  1541. /** TODO */
  1542. static SearchAllTransformNodesForTags(query: string, nodes: BABYLON.Node[]): BABYLON.Node[];
  1543. /** TODO */
  1544. static SearchTransformNodeForScript(klass: string, nodes: BABYLON.Node[]): BABYLON.Node;
  1545. /** TODO */
  1546. static SearchAllTransformNodesForScript(klass: string, nodes: BABYLON.Node[]): BABYLON.Node[];
  1547. /** TODO */
  1548. static CreateGuid(suffix?: string): string;
  1549. /** TODO */
  1550. static ValidateTransformGuid(node: TransformNode): void;
  1551. /** TODO */
  1552. static RegisterInstancedMeshBuffers(mesh: BABYLON.Mesh): void;
  1553. /** TODO */
  1554. static CloneValue(source: any, destinationObject: any): any;
  1555. /** TODO */
  1556. static CloneEntityMetadata(source: any): any;
  1557. /** TODO */
  1558. static DeepCopyProperties(source: any, destination: any, doNotCopyList?: string[], mustCopyList?: string[]): void;
  1559. /** TODO */
  1560. static ValidateTransformMetadata(transform: BABYLON.TransformNode): void;
  1561. }
  1562. }
  1563. /**
  1564. * Babylon Utilties Alias
  1565. */
  1566. declare const UTIL: typeof BABYLON.Utilities;
  1567. declare const CVTOOLS_NAME = "CVTOOLS_unity_metadata";
  1568. declare const CVTOOLS_MESH = "CVTOOLS_babylon_mesh";
  1569. declare const CVTOOLS_HAND = "CVTOOLS_left_handed";
  1570. /**
  1571. * Babylon Toolkit Editor - Loader Class
  1572. * @class CVTOOLS_unity_metadata - All rights reserved (c) 2020 Mackey Kinard
  1573. * [Specification](https://github.com/MackeyK24/glTF/tree/master/extensions/2.0/Vendor/CVTOOLS_unity_metadata)
  1574. */
  1575. declare class CVTOOLS_unity_metadata implements BABYLON.GLTF2.IGLTFLoaderExtension {
  1576. /** The name of this extension. */
  1577. readonly name = "CVTOOLS_unity_metadata";
  1578. /** Defines whether this extension is enabled. */
  1579. enabled: boolean;
  1580. private static LastRootUrl;
  1581. private static LastParseScene;
  1582. private static LastBabylonScene;
  1583. private _loader;
  1584. private _parserList;
  1585. private _masterList;
  1586. private _detailList;
  1587. private _shaderList;
  1588. private _materialMap;
  1589. private _lightmapMap;
  1590. private _reflectionMap;
  1591. private _activeMeshes;
  1592. private _parseScene;
  1593. private _leftHanded;
  1594. private _disposeRoot;
  1595. private _sceneParsed;
  1596. private _rootUrl;
  1597. /** @hidden */
  1598. constructor(loader: BABYLON.GLTF2.GLTFLoader);
  1599. /** @hidden */
  1600. dispose(): void;
  1601. /** @hidden */
  1602. onLoading(): void;
  1603. /** @hidden */
  1604. loadSceneAsync(context: string, scene: BABYLON.GLTF2.IScene): BABYLON.Nullable<Promise<void>>;
  1605. /** @hidden */
  1606. onReady(): void;
  1607. private _processActiveMeshes;
  1608. private _processUnityMeshes;
  1609. /** @hidden */
  1610. loadNodeAsync(context: string, node: BABYLON.GLTF2.INode, assign: (babylonMesh: BABYLON.TransformNode) => void): BABYLON.Nullable<Promise<BABYLON.TransformNode>>;
  1611. /** @hidden */
  1612. loadMaterialPropertiesAsync(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
  1613. private _getCachedLightmapByIndex;
  1614. private _getCachedMaterialByIndex;
  1615. private _getCachedCubemapByUrl;
  1616. /** @hidden */
  1617. createMaterial(context: string, material: BABYLON.GLTF2.IMaterial, babylonDrawMode: number): BABYLON.Nullable<BABYLON.Material>;
  1618. /** @hidden */
  1619. _loadSkinAsync(context: string, node: BABYLON.GLTF2.INode, skin: BABYLON.GLTF2.ISkin): Promise<void>;
  1620. /** @hidden */
  1621. loadAnimationAsync(context: string, animation: BABYLON.GLTF2.IAnimation): Promise<BABYLON.AnimationGroup>;
  1622. /** @hidden */
  1623. _loadMeshPrimitiveAsync(context: string, name: string, node: BABYLON.GLTF2.INode, mesh: BABYLON.GLTF2.IMesh, primitive: BABYLON.GLTF2.IMeshPrimitive, assign: (babylonMesh: BABYLON.AbstractMesh) => void): Promise<BABYLON.AbstractMesh>;
  1624. private _setupBabylonMesh;
  1625. private _processLevelOfDetail;
  1626. private _setupBabylonMaterials;
  1627. private _processShaderMaterials;
  1628. private preProcessSceneProperties;
  1629. private postProcessSceneProperties;
  1630. private _preloadRawMaterialsAsync;
  1631. private _parseMultiMaterialAsync;
  1632. private _parseShaderMaterialPropertiesAsync;
  1633. private _parseDiffuseMaterialPropertiesAsync;
  1634. private _parseCommonConstantProperties;
  1635. }
  1636. /**
  1637. * Babylon Toolkit Editor - Loader Class
  1638. * @class CVTOOLS_babylon_mesh - All rights reserved (c) 2020 Mackey Kinard
  1639. * [Specification](https://github.com/MackeyK24/glTF/tree/master/extensions/2.0/Vendor/CVTOOLS_unity_metadata)
  1640. */
  1641. declare class CVTOOLS_babylon_mesh implements BABYLON.GLTF2.IGLTFLoaderExtension {
  1642. /** The name of this extension. */
  1643. readonly name = "CVTOOLS_babylon_mesh";
  1644. /** Defines whether this extension is enabled. */
  1645. enabled: boolean;
  1646. private _loader;
  1647. /** @hidden */
  1648. constructor(loader: BABYLON.GLTF2.GLTFLoader);
  1649. /** @hidden */
  1650. dispose(): void;
  1651. }
  1652. /**
  1653. * Babylon Toolkit Editor - Loader Class
  1654. * @class CVTOOLS_left_handed - All rights reserved (c) 2020 Mackey Kinard
  1655. * [Specification](https://github.com/MackeyK24/glTF/tree/master/extensions/2.0/Vendor/CVTOOLS_unity_metadata)
  1656. */
  1657. declare class CVTOOLS_left_handed implements BABYLON.GLTF2.IGLTFLoaderExtension {
  1658. /** The name of this extension. */
  1659. readonly name = "CVTOOLS_left_handed";
  1660. /** Defines whether this extension is enabled. */
  1661. enabled: boolean;
  1662. private _loader;
  1663. /** @hidden */
  1664. constructor(loader: BABYLON.GLTF2.GLTFLoader);
  1665. /** @hidden */
  1666. dispose(): void;
  1667. }
  1668. declare module BABYLON {
  1669. /**
  1670. * Babylon animation state pro class (Unity Style Mechanim Animation System)
  1671. * @class AnimationState - All rights reserved (c) 2020 Mackey Kinard
  1672. */
  1673. class AnimationState extends BABYLON.ScriptComponent {
  1674. private static FPS;
  1675. private static TIME;
  1676. private static EXIT;
  1677. private static MOTION;
  1678. private _frametime;
  1679. private _layercount;
  1680. private _updatemode;
  1681. private _hasrootmotion;
  1682. private _processmotion;
  1683. private _initialtargetblending;
  1684. private _hastransformhierarchy;
  1685. private _leftfeetbottomheight;
  1686. private _rightfeetbottomheight;
  1687. private _runtimecontroller;
  1688. private _executed;
  1689. private _checkers;
  1690. private _source;
  1691. private _machine;
  1692. private _deltaPosition;
  1693. private _deltaRotation;
  1694. private _deltaAngleY;
  1695. private _positionWeight;
  1696. private _rootBoneWeight;
  1697. private _rotationWeight;
  1698. private _rootQuatWeight;
  1699. private _positionHolder;
  1700. private _rootBoneHolder;
  1701. private _rotationHolder;
  1702. private _rootQuatHolder;
  1703. private _rootMotionMatrix;
  1704. private _rootMotionScaling;
  1705. private _rootMotionRotation;
  1706. private _rootMotionPosition;
  1707. private _lastMotionRotation;
  1708. private _lastMotionPosition;
  1709. private _quatRotationDiff;
  1710. private _quatRotateVector;
  1711. private _dirtyMotionMatrix;
  1712. private _dirtyBlenderMatrix;
  1713. private _targetPosition;
  1714. private _targetRotation;
  1715. private _targetScaling;
  1716. private _updateMatrix;
  1717. private _blenderMatrix;
  1718. private _blendWeights;
  1719. private _data;
  1720. private _anims;
  1721. private _numbers;
  1722. private _booleans;
  1723. private _triggers;
  1724. private _parameters;
  1725. speedRatio: number;
  1726. applyRootMotion: boolean;
  1727. enableAnimation: boolean;
  1728. hasRootMotion(): boolean;
  1729. getAnimationTime(): number;
  1730. getDeltaPosition(): BABYLON.Vector3;
  1731. getDeltaRotation(): BABYLON.Quaternion;
  1732. getRuntimeController(): string;
  1733. protected m_avatarMask: Map<string, number>;
  1734. protected m_defaultGroup: BABYLON.AnimationGroup;
  1735. protected m_animationTargets: BABYLON.TargetedAnimation[];
  1736. protected awake(): void;
  1737. protected late(): void;
  1738. protected destroy(): void;
  1739. /** Register handler that is triggered when the animation ik setup has been triggered */
  1740. onAnimationIKObservable: Observable<number>;
  1741. /** Register handler that is triggered when the animation end has been triggered */
  1742. onAnimationEndObservable: Observable<number>;
  1743. /** Register handler that is triggered when the animation loop has been triggered */
  1744. onAnimationLoopObservable: Observable<number>;
  1745. /** Register handler that is triggered when the animation event has been triggered */
  1746. onAnimationEventObservable: Observable<IAnimatorEvent>;
  1747. /** Register handler that is triggered when the animation frame has been updated */
  1748. onAnimationUpdateObservable: Observable<TransformNode>;
  1749. playAnimation(state: string, transitionDuration?: number, animationLayer?: number, frameRate?: number): boolean;
  1750. getBool(name: string): boolean;
  1751. setBool(name: string, value: boolean): void;
  1752. getFloat(name: string): float;
  1753. setFloat(name: string, value: float): void;
  1754. getInteger(name: string): int;
  1755. setInteger(name: string, value: int): void;
  1756. getTrigger(name: string): boolean;
  1757. setTrigger(name: string): void;
  1758. resetTrigger(name: string): void;
  1759. private getMachineState;
  1760. private setMachineState;
  1761. getCurrentState(layer: number): BABYLON.MachineState;
  1762. getAnimationGroup(name: string): BABYLON.AnimationGroup;
  1763. getAnimationGroups(): Map<string, BABYLON.AnimationGroup>;
  1764. setAnimationGroups(groups: BABYLON.AnimationGroup[], remapTargets?: boolean): void;
  1765. getRootMotionAngle(): number;
  1766. getRootMotionSpeed(): number;
  1767. getForwardMoveSpeed(absolute?: boolean): number;
  1768. private awakeStateMachine;
  1769. private lateStateMachine;
  1770. private destroyStateMachine;
  1771. private updateAnimationState;
  1772. private updateAnimationCurves;
  1773. private updateAnimationTargets;
  1774. private updateBlendableTargets;
  1775. private finalizeAnimationTargets;
  1776. private checkStateMachine;
  1777. private checkStateTransitions;
  1778. private setCurrentAnimationState;
  1779. private checkAvatarTransformPath;
  1780. private filterTargetAvatarMask;
  1781. private sortWeightedBlendingList;
  1782. private computeWeightedFrameRatio;
  1783. private setupTreeBranches;
  1784. private parseTreeBranches;
  1785. private parse1DSimpleTreeBranches;
  1786. private parse2DSimpleDirectionalTreeBranches;
  1787. private parse2DFreeformDirectionalTreeBranches;
  1788. private parse2DFreeformCartesianTreeBranches;
  1789. }
  1790. class BlendTreeValue {
  1791. source: BABYLON.IBlendTreeChild;
  1792. motion: string;
  1793. posX: number;
  1794. posY: number;
  1795. weight: number;
  1796. constructor(config: {
  1797. source: BABYLON.IBlendTreeChild;
  1798. motion: string;
  1799. posX?: number;
  1800. posY?: number;
  1801. weight?: number;
  1802. });
  1803. }
  1804. class BlendTreeUtils {
  1805. static ClampValue(num: number, min: number, max: number): number;
  1806. static GetSignedAngle(a: BABYLON.Vector2, b: BABYLON.Vector2): number;
  1807. static GetLinearInterpolation(x0: number, y0: number, x1: number, y1: number, x: number): number;
  1808. static GetRightNeighbourIndex(inputX: number, blendTreeArray: BABYLON.BlendTreeValue[]): number;
  1809. }
  1810. class BlendTreeSystem {
  1811. static Calculate1DSimpleBlendTree(inputX: number, blendTreeArray: BABYLON.BlendTreeValue[]): void;
  1812. static Calculate2DFreeformDirectional(inputX: number, inputY: number, blendTreeArray: BABYLON.BlendTreeValue[]): void;
  1813. static Calculate2DFreeformCartesian(inputX: number, inputY: number, blendTreeArray: BABYLON.BlendTreeValue[]): void;
  1814. private static TempVector2_IP;
  1815. private static TempVector2_POSI;
  1816. private static TempVector2_POSJ;
  1817. private static TempVector2_POSIP;
  1818. private static TempVector2_POSIJ;
  1819. }
  1820. class MachineState {
  1821. hash: number;
  1822. name: string;
  1823. tag: string;
  1824. time: number;
  1825. type: BABYLON.MotionType;
  1826. rate: number;
  1827. length: number;
  1828. layer: string;
  1829. layerIndex: number;
  1830. played: number;
  1831. machine: string;
  1832. motionid: number;
  1833. interrupted: boolean;
  1834. apparentSpeed: number;
  1835. averageAngularSpeed: number;
  1836. averageDuration: number;
  1837. averageSpeed: number[];
  1838. cycleOffset: number;
  1839. cycleOffsetParameter: string;
  1840. cycleOffsetParameterActive: boolean;
  1841. iKOnFeet: boolean;
  1842. mirror: boolean;
  1843. mirrorParameter: string;
  1844. irrorParameterActive: boolean;
  1845. speed: number;
  1846. speedParameter: string;
  1847. speedParameterActive: boolean;
  1848. blendtree: BABYLON.IBlendTree;
  1849. transitions: BABYLON.ITransition[];
  1850. behaviours: BABYLON.IBehaviour[];
  1851. events: BABYLON.IAnimatorEvent[];
  1852. constructor();
  1853. }
  1854. class TransitionCheck {
  1855. result: string;
  1856. offest: number;
  1857. blending: number;
  1858. triggered: string[];
  1859. }
  1860. class AnimationMixer {
  1861. influenceBuffer: number;
  1862. positionBuffer: BABYLON.Vector3;
  1863. rotationBuffer: BABYLON.Quaternion;
  1864. scalingBuffer: BABYLON.Vector3;
  1865. originalMatrix: BABYLON.Matrix;
  1866. blendingFactor: number;
  1867. blendingSpeed: number;
  1868. rootPosition: BABYLON.Vector3;
  1869. rootRotation: BABYLON.Quaternion;
  1870. }
  1871. class BlendingWeights {
  1872. primary: BABYLON.IBlendTreeChild;
  1873. secondary: BABYLON.IBlendTreeChild;
  1874. }
  1875. enum MotionType {
  1876. Clip = 0,
  1877. Tree = 1
  1878. }
  1879. enum ConditionMode {
  1880. If = 1,
  1881. IfNot = 2,
  1882. Greater = 3,
  1883. Less = 4,
  1884. Equals = 6,
  1885. NotEqual = 7
  1886. }
  1887. enum InterruptionSource {
  1888. None = 0,
  1889. Source = 1,
  1890. Destination = 2,
  1891. SourceThenDestination = 3,
  1892. DestinationThenSource = 4
  1893. }
  1894. enum BlendTreeType {
  1895. Simple1D = 0,
  1896. SimpleDirectional2D = 1,
  1897. FreeformDirectional2D = 2,
  1898. FreeformCartesian2D = 3,
  1899. Direct = 4,
  1900. Clip = 5
  1901. }
  1902. enum BlendTreePosition {
  1903. Lower = 0,
  1904. Upper = 1
  1905. }
  1906. enum AnimatorParameterType {
  1907. Float = 1,
  1908. Int = 3,
  1909. Bool = 4,
  1910. Trigger = 9
  1911. }
  1912. interface IAnimatorEvent {
  1913. id: number;
  1914. clip: string;
  1915. time: number;
  1916. function: string;
  1917. intParameter: number;
  1918. floatParameter: number;
  1919. stringParameter: string;
  1920. objectIdParameter: string;
  1921. objectNameParameter: string;
  1922. }
  1923. interface IAvatarMask {
  1924. hash: number;
  1925. maskName: string;
  1926. maskType: string;
  1927. transformCount: number;
  1928. transformPaths: string[];
  1929. }
  1930. interface IAnimationLayer {
  1931. hash: number;
  1932. name: string;
  1933. index: number;
  1934. entry: string;
  1935. machine: string;
  1936. iKPass: boolean;
  1937. avatarMask: BABYLON.IAvatarMask;
  1938. blendingMode: number;
  1939. defaultWeight: number;
  1940. syncedLayerIndex: number;
  1941. syncedLayerAffectsTiming: boolean;
  1942. animationTime: number;
  1943. animationNormal: number;
  1944. animationFirstRun: boolean;
  1945. animationEndFrame: boolean;
  1946. animationLoopFrame: boolean;
  1947. animationLoopEvents: any;
  1948. animationStateMachine: BABYLON.MachineState;
  1949. }
  1950. interface IAnimationCurve {
  1951. length: number;
  1952. preWrapMode: string;
  1953. postWrapMode: string;
  1954. keyframes: BABYLON.IAnimationKeyframe[];
  1955. }
  1956. interface IAnimationKeyframe {
  1957. time: number;
  1958. value: number;
  1959. inTangent: number;
  1960. outTangent: number;
  1961. tangentMode: number;
  1962. }
  1963. interface IBehaviour {
  1964. hash: number;
  1965. name: string;
  1966. layerIndex: number;
  1967. properties: any;
  1968. }
  1969. interface ITransition {
  1970. hash: number;
  1971. anyState: boolean;
  1972. layerIndex: number;
  1973. machineLayer: string;
  1974. machineName: string;
  1975. canTransitionToSelf: boolean;
  1976. destination: string;
  1977. duration: number;
  1978. exitTime: number;
  1979. hasExitTime: boolean;
  1980. fixedDuration: boolean;
  1981. intSource: BABYLON.InterruptionSource;
  1982. isExit: boolean;
  1983. mute: boolean;
  1984. name: string;
  1985. offset: number;
  1986. orderedInt: boolean;
  1987. solo: boolean;
  1988. conditions: BABYLON.ICondition[];
  1989. }
  1990. interface ICondition {
  1991. hash: number;
  1992. mode: BABYLON.ConditionMode;
  1993. parameter: string;
  1994. threshold: number;
  1995. }
  1996. interface IBlendTree {
  1997. hash: number;
  1998. name: string;
  1999. state: string;
  2000. children: BABYLON.IBlendTreeChild[];
  2001. layerIndex: number;
  2002. apparentSpeed: number;
  2003. averageAngularSpeed: number;
  2004. averageDuration: number;
  2005. averageSpeed: number[];
  2006. blendParameterX: string;
  2007. blendParameterY: string;
  2008. blendType: BABYLON.BlendTreeType;
  2009. isAnimatorMotion: boolean;
  2010. isHumanMotion: boolean;
  2011. isLooping: boolean;
  2012. minThreshold: number;
  2013. maxThreshold: number;
  2014. useAutomaticThresholds: boolean;
  2015. valueParameterX: number;
  2016. valueParameterY: number;
  2017. }
  2018. interface IBlendTreeChild {
  2019. hash: number;
  2020. layerIndex: number;
  2021. cycleOffset: number;
  2022. directBlendParameter: string;
  2023. apparentSpeed: number;
  2024. averageAngularSpeed: number;
  2025. averageDuration: number;
  2026. averageSpeed: number[];
  2027. mirror: boolean;
  2028. type: BABYLON.MotionType;
  2029. motion: string;
  2030. positionX: number;
  2031. positionY: number;
  2032. threshold: number;
  2033. timescale: number;
  2034. subtree: BABYLON.IBlendTree;
  2035. weight: number;
  2036. ratio: number;
  2037. track: BABYLON.AnimationGroup;
  2038. }
  2039. }
  2040. declare module BABYLON {
  2041. /**
  2042. * Babylon audio source manager pro class
  2043. * @class AudioSource - All rights reserved (c) 2020 Mackey Kinard
  2044. */
  2045. class AudioSource extends BABYLON.ScriptComponent {
  2046. private _audio;
  2047. private _name;
  2048. private _file;
  2049. private _loop;
  2050. private _mute;
  2051. private _volume;
  2052. private _pitch;
  2053. private _priority;
  2054. private _panstereo;
  2055. private _mindistance;
  2056. private _maxdistance;
  2057. private _rolloffmode;
  2058. private _rollofffactor;
  2059. private _playonawake;
  2060. private _spatialblend;
  2061. private _reverbzonemix;
  2062. private _lastmutedvolume;
  2063. private _bypasseffects;
  2064. private _bypassreverbzones;
  2065. private _bypasslistenereffects;
  2066. private _initializedReadyInstance;
  2067. getSoundClip(): BABYLON.Sound;
  2068. getAudioElement(): HTMLAudioElement;
  2069. /** Register handler that is triggered when the audio clip is ready */
  2070. onReadyObservable: Observable<Sound>;
  2071. protected awake(): void;
  2072. protected destroy(): void;
  2073. protected awakeAudioSource(): void;
  2074. protected destroyAudioSource(): void;
  2075. /**
  2076. * Gets the ready status for track
  2077. */
  2078. isReady(): boolean;
  2079. /**
  2080. * Gets the playing status for track
  2081. */
  2082. isPlaying(): boolean;
  2083. /**
  2084. * Gets the paused status for track
  2085. */
  2086. isPaused(): boolean;
  2087. /**
  2088. * Play the sound track
  2089. * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
  2090. * @param offset (optional) Start the sound at a specific time in seconds
  2091. * @param length (optional) Sound duration (in seconds)
  2092. */
  2093. play(time?: number, offset?: number, length?: number): boolean;
  2094. /**
  2095. * Pause the sound track
  2096. */
  2097. pause(): boolean;
  2098. /**
  2099. * Stop the sound track
  2100. * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
  2101. */
  2102. stop(time?: number): boolean;
  2103. /**
  2104. * Mute the sound track
  2105. * @param time (optional) Mute the sound after X seconds. Start immediately (0) by default.
  2106. */
  2107. mute(time?: number): boolean;
  2108. /**
  2109. * Unmute the sound track
  2110. * @param time (optional) Unmute the sound after X seconds. Start immediately (0) by default.
  2111. */
  2112. unmute(time?: number): boolean;
  2113. /**
  2114. * Gets the volume of the track
  2115. */
  2116. getVolume(): number;
  2117. /**
  2118. * Sets the volume of the track
  2119. * @param volume Define the new volume of the sound
  2120. * @param time Define time for gradual change to new volume
  2121. */
  2122. setVolume(volume: number, time?: number): boolean;
  2123. /**
  2124. * Gets the spatial sound option of the track
  2125. */
  2126. getSpatialSound(): boolean;
  2127. /**
  2128. * Gets the spatial sound option of the track
  2129. * @param value Define the value of the spatial sound
  2130. */
  2131. setSpatialSound(value: boolean): void;
  2132. /**
  2133. * Sets the sound track playback speed
  2134. * @param rate the audio playback rate
  2135. */
  2136. setPlaybackSpeed(rate: number): void;
  2137. /**
  2138. * Gets the current time of the track
  2139. */
  2140. getCurrentTrackTime(): number;
  2141. }
  2142. }
  2143. declare module BABYLON {
  2144. /**
  2145. * Babylon kinematic character controller pro class (Native Bullet Physics 2.82)
  2146. * @class CharacterController - All rights reserved (c) 2020 Mackey Kinard
  2147. */
  2148. class CharacterController extends BABYLON.ScriptComponent {
  2149. private static MARGIN_FACTOR;
  2150. private _abstractMesh;
  2151. private _avatarRadius;
  2152. private _avatarHeight;
  2153. private _centerOffset;
  2154. private _skinWidth;
  2155. private _stepOffset;
  2156. private _slopeLimit;
  2157. private _capsuleSegments;
  2158. private _minMoveDistance;
  2159. private _isPhysicsReady;
  2160. private _maxCollisions;
  2161. private _useGhostSweepTest;
  2162. private _tmpCollisionContacts;
  2163. updatePosition: boolean;
  2164. getInternalCharacter(): any;
  2165. getAvatarRadius(): number;
  2166. getAvatarHeight(): number;
  2167. getSkinWidth(): number;
  2168. getStepOffset(): number;
  2169. getUseSweepTest(): any;
  2170. getMinMoveDistance(): number;
  2171. setMinMoveDistance(distance: number): void;
  2172. getVerticalVelocity(): number;
  2173. getAddedMargin(): number;
  2174. setAddedMargin(margin: number): void;
  2175. setMaxJumpHeight(maxJumpHeight: number): void;
  2176. setFallingSpeed(fallSpeed: number): void;
  2177. getSlopeLimit(): number;
  2178. setSlopeLimit(slopeRadians: number): void;
  2179. setUpAxis(axis: number): void;
  2180. getGravity(): number;
  2181. setGravity(gravity: number): void;
  2182. isGrounded(): boolean;
  2183. isReady(): boolean;
  2184. canJump(): boolean;
  2185. protected m_character: any;
  2186. protected m_ghostShape: any;
  2187. protected m_ghostObject: any;
  2188. protected m_ghostCollision: any;
  2189. protected m_ghostTransform: any;
  2190. protected m_ghostPosition: any;
  2191. protected m_startPosition: any;
  2192. protected m_startTransform: any;
  2193. protected m_walkDirection: any;
  2194. protected m_warpPosition: any;
  2195. protected m_turningRate: number;
  2196. protected m_moveDeltaX: number;
  2197. protected m_moveDeltaZ: number;
  2198. protected m_physicsEngine: BABYLON.IPhysicsEngine;
  2199. protected m_collisionPosition: BABYLON.Vector3;
  2200. protected internalWarp(position: any): void;
  2201. protected internalJump(): void;
  2202. protected internalSetJumpSpeed(speed: number): void;
  2203. protected internalSetWalkDirection(direction: any): void;
  2204. protected internalSetVelocityForTimeInterval(velocity: any, interval: number): void;
  2205. protected awake(): void;
  2206. protected start(): void;
  2207. protected update(): void;
  2208. protected destroy(): void;
  2209. protected awakeMovementState(): void;
  2210. protected startMovementState(): void;
  2211. protected syncMovementState(): void;
  2212. protected updateMovementState(): void;
  2213. protected parseGhostCollisionContacts(): void;
  2214. protected destroyMovementState(): void;
  2215. /** Register handler that is triggered when the transform position has been updated */
  2216. onUpdatePositionObservable: Observable<TransformNode>;
  2217. /** Register handler that is triggered when the a collision contact has entered */
  2218. onCollisionEnterObservable: Observable<AbstractMesh>;
  2219. /** Register handler that is triggered when the a collision contact is active */
  2220. onCollisionStayObservable: Observable<AbstractMesh>;
  2221. /** Register handler that is triggered when the a collision contact has exited */
  2222. onCollisionExitObservable: Observable<AbstractMesh>;
  2223. /** Sets the maximum number of simultaneous contact notfications to dispatch per frame. Defaults value is 4. (Advanved Use Only) */
  2224. setMaxNotifications(max: number): void;
  2225. /** Sets character collision activation state using physics ghost object. (Advanved Use Only) */
  2226. setActivationState(state: number): void;
  2227. /** Gets character collision group filter using physics ghost object. (Advanved Use Only) */
  2228. getCollisionFilterGroup(): number;
  2229. /** Sets character collision group filter using physics ghost object. (Advanved Use Only) */
  2230. setCollisionFilterGroup(group: number): void;
  2231. /** Gets character collision mask filter using physics ghost object. (Advanved Use Only) */
  2232. getCollisionFilterMask(): number;
  2233. /** Sets the character collision mask filter using physics ghost object. (Advanved Use Only) */
  2234. setCollisionFilterMask(mask: number): void;
  2235. /** Gets the chracter contact processing threshold using physics ghost object. (Advanved Use Only) */
  2236. getContactProcessingThreshold(): number;
  2237. /** Sets character contact processing threshold using physics ghost object. (Advanved Use Only) */
  2238. setContactProcessingThreshold(threshold: number): void;
  2239. /** Manually set the position of the physics ghost object world transform. (Advanved Use Only) */
  2240. setGhostWorldPosition(position: BABYLON.Nullable<BABYLON.Vector3>): void;
  2241. /** Translates the kinematic character with the specfied movement velocity. */
  2242. move(velocity: BABYLON.Vector3): void;
  2243. /** Jumps the kinematic chacracter with the specified jump speed. */
  2244. jump(speed: number): void;
  2245. /** Warps the kinematic chacracter to the specified warp position. */
  2246. warp(position: BABYLON.Vector3): void;
  2247. }
  2248. }
  2249. declare module BABYLON {
  2250. /**
  2251. * Babylon navigation agent pro class (Unity Style Navigation Agent System)
  2252. * @class NavigationAgent - All rights reserved (c) 2020 Mackey Kinard
  2253. */
  2254. class NavigationAgent extends BABYLON.ScriptComponent {
  2255. private static TARGET_ANGLE_FACTOR;
  2256. private static ANGULAR_SPEED_RATIO;
  2257. private type;
  2258. private speed;
  2259. private baseOffset;
  2260. private avoidRadius;
  2261. private avoidHeight;
  2262. private acceleration;
  2263. private areaMask;
  2264. private autoRepath;
  2265. private autoBraking;
  2266. private autoTraverseOffMeshLink;
  2267. private avoidancePriority;
  2268. private obstacleAvoidanceType;
  2269. private distanceToTarget;
  2270. private moveDirection;
  2271. private resetPosition;
  2272. private lastPosition;
  2273. private currentPosition;
  2274. private currentVelocity;
  2275. private currentWaypoint;
  2276. heightOffset: number;
  2277. angularSpeed: number;
  2278. updatePosition: boolean;
  2279. distanceEpsilon: number;
  2280. velocityEpsilon: number;
  2281. stoppingDistance: number;
  2282. isNavigating(): boolean;
  2283. getAgentType(): number;
  2284. getAgentState(): number;
  2285. getAgentIndex(): number;
  2286. getAgentRadius(): number;
  2287. getAgentHeight(): number;
  2288. getAgentSpeed(): number;
  2289. getAgentOffset(): number;
  2290. getTargetDistance(): number;
  2291. protected m_agentState: number;
  2292. protected m_agentIndex: number;
  2293. protected m_agentGhost: BABYLON.TransformNode;
  2294. protected m_agentParams: BABYLON.IAgentParameters;
  2295. protected m_agentRotation: BABYLON.Quaternion;
  2296. protected m_agentMovement: BABYLON.Vector3;
  2297. protected m_agentDirection: BABYLON.Vector3;
  2298. protected m_agentQuaternion: BABYLON.Quaternion;
  2299. protected m_agentDestination: BABYLON.Vector3;
  2300. protected awake(): void;
  2301. protected update(): void;
  2302. protected destroy(): void;
  2303. /** Register handler that is triggered before the navigation update */
  2304. onPreUpdateObservable: Observable<TransformNode>;
  2305. /** Register handler that is triggered after the navigation update */
  2306. onPostUpdateObservable: Observable<TransformNode>;
  2307. /** Register handler that is triggered when the navigation is complete */
  2308. onNavCompleteObservable: Observable<TransformNode>;
  2309. private awakeNavigationAgent;
  2310. private updateNavigationAgent;
  2311. private destroyNavigationAgent;
  2312. /** Move agent relative to current position. */
  2313. move(offset: BABYLON.Vector3, closetPoint?: boolean): void;
  2314. /** Teleport agent to destination point. */
  2315. teleport(destination: BABYLON.Vector3, closetPoint?: boolean): void;
  2316. /** Sets agent current destination point. */
  2317. setDestination(destination: BABYLON.Vector3, closetPoint?: boolean, resetAgent?: boolean): void;
  2318. /** Gets agent current world space velocity. */
  2319. getAgentVelocity(): BABYLON.Vector3;
  2320. /** Gets agent current world space velocity. */
  2321. getAgentVelocityToRef(result: BABYLON.Vector3): void;
  2322. /** Gets agent current world space position. */
  2323. getAgentPosition(): BABYLON.Vector3;
  2324. /** Gets agent current world space position. */
  2325. getAgentPositionToRef(result: BABYLON.Vector3): void;
  2326. /** Gets agent current waypoint position. */
  2327. getAgentWaypoint(): BABYLON.Vector3;
  2328. /** Gets agent current waypoint position. */
  2329. getAgentWaypointToRef(result: BABYLON.Vector3): void;
  2330. /** Reset the agent to transform world space position. */
  2331. resetAgentPosition(): void;
  2332. /** Cancel current waypoint path navigation. */
  2333. cancelNavigation(): void;
  2334. }
  2335. /**
  2336. * Recast Detour Crowd Agent States
  2337. */
  2338. enum CrowdAgentState {
  2339. DT_CROWDAGENT_STATE_INVALID = 0,
  2340. DT_CROWDAGENT_STATE_WALKING = 1,
  2341. DT_CROWDAGENT_STATE_OFFMESH = 2
  2342. }
  2343. }
  2344. declare module BABYLON {
  2345. /**
  2346. * Babylon raycast vehicle controller pro class (Native Bullet Physics 2.82)
  2347. * @class RaycastVehicle - All rights reserved (c) 2020 Mackey Kinard
  2348. */
  2349. class RaycastVehicle {
  2350. private _centerMass;
  2351. private _chassisMesh;
  2352. private _tempVectorPos;
  2353. lockedWheelIndexes: number[];
  2354. getInternalVehicle(): any;
  2355. getUpAxis(): number;
  2356. getRightAxis(): number;
  2357. getForwardAxis(): number;
  2358. getForwardVector(): any;
  2359. getNumWheels(): number;
  2360. getWheelInfo(wheel: number): any;
  2361. resetSuspension(): void;
  2362. setPitchControl(pitch: number): void;
  2363. setEngineForce(power: number, wheel: number): void;
  2364. setBrakingForce(brake: number, wheel: number): void;
  2365. getWheelTransform(wheel: number): any;
  2366. updateWheelTransform(wheel: number, interpolate: boolean): void;
  2367. getUserConstraintType(): number;
  2368. setUserConstraintType(userConstraintType: number): void;
  2369. setUserConstraintId(uid: number): void;
  2370. getUserConstraintId(): number;
  2371. getRawCurrentSpeedKph(): number;
  2372. getRawCurrentSpeedMph(): number;
  2373. getAbsCurrentSpeedKph(): number;
  2374. getAbsCurrentSpeedMph(): number;
  2375. getVehicleTuningSystem(): any;
  2376. getChassisWorldTransform(): any;
  2377. protected m_vehicle: any;
  2378. protected m_vehicleTuning: any;
  2379. protected m_vehicleRaycaster: any;
  2380. protected m_vehicleColliders: any[];
  2381. protected m_tempTransform: any;
  2382. protected m_tempPosition: any;
  2383. protected m_wheelDirectionCS0: any;
  2384. protected m_wheelAxleCS: any;
  2385. constructor(entity: BABYLON.AbstractMesh, world: any, center: BABYLON.Vector3, defaultAngularFactor?: BABYLON.Vector3);
  2386. dispose(): void;
  2387. /** Gets the rigidbody raycast vehicle controller for the entity. Note: Wheel collider metadata informaion is required for raycast vehicle control. */
  2388. static GetInstance(scene: BABYLON.Scene, rigidbody: BABYLON.RigidbodyPhysics, defaultAngularFactor?: BABYLON.Vector3): BABYLON.RaycastVehicle;
  2389. /** Gets vehicle enable multi raycast flag using physics vehicle object. (Advanved Use Only) */
  2390. getEnableMultiRaycast(): boolean;
  2391. /** Sets vehicle enable multi raycast flag using physics vehicle object. (Advanved Use Only) */
  2392. setEnableMultiRaycast(flag: boolean): void;
  2393. /** Gets vehicle stable force using physics vehicle object. (Advanved Use Only) */
  2394. getStabilizingForce(): number;
  2395. /** Sets vehicle stable force using physics vehicle object. (Advanved Use Only) */
  2396. setStabilizingForce(force: number): void;
  2397. /** Gets vehicle smooth flying impulse force using physics vehicle object. (Advanved Use Only) */
  2398. getSmoothFlyingImpulse(): number;
  2399. /** Sets vehicle smooth flying impulse using physics vehicle object. (Advanved Use Only) */
  2400. setSmoothFlyingImpulse(impulse: number): void;
  2401. /** Gets vehicle track connection accel force using physics vehicle object. (Advanved Use Only) */
  2402. getTrackConnectionAccel(): number;
  2403. /** Sets vehicle track connection accel force using physics vehicle object. (Advanved Use Only) */
  2404. setTrackConnectionAccel(force: number): void;
  2405. /** Gets vehicle min wheel contact count using physics vehicle object. (Advanved Use Only) */
  2406. getMinimumWheelContacts(): number;
  2407. /** Sets vehicle min wheel contact count using physics vehicle object. (Advanved Use Only) */
  2408. setMinimumWheelContacts(force: number): void;
  2409. /** Gets vehicle interpolate mesh normals flag using physics raycaster object. (Advanved Use Only) */
  2410. getInterpolateNormals(): boolean;
  2411. /** Sets the vehicle interpolate mesh normals using physics raycaster object. (Advanved Use Only) */
  2412. setInterpolateNormals(flag: boolean): void;
  2413. /** Gets vehicle shape testing mode using physics raycaster object. (Advanved Use Only) */
  2414. getShapeTestingMode(): boolean;
  2415. /** Sets the vehicle shape testing mode using physics raycaster object. (Advanved Use Only) */
  2416. setShapeTestingMode(mode: boolean): void;
  2417. /** Gets vehicle shape testing size using physics raycaster object. (Advanved Use Only) */
  2418. getShapeTestingSize(): float;
  2419. /** Sets the vehicle shape testing mode using physics raycaster object. (Advanved Use Only) */
  2420. setShapeTestingSize(size: float): void;
  2421. /** Gets vehicle shape test point count using physics raycaster object. (Advanved Use Only) */
  2422. getShapeTestingCount(): float;
  2423. /** Sets the vehicle shape test point count using physics raycaster object. (Advanved Use Only) */
  2424. setShapeTestingCount(count: float): void;
  2425. /** Gets vehicle sweep penetration amount using physics raycaster object. (Advanved Use Only) */
  2426. getSweepPenetration(): float;
  2427. /** Sets the vehicle sweep penetration amount using physics raycaster object. (Advanved Use Only) */
  2428. setSweepPenetration(amount: float): void;
  2429. /** Gets vehicle collision group filter using physics raycaster object. (Advanved Use Only) */
  2430. getCollisionFilterGroup(): number;
  2431. /** Sets vehicle collision group filter using physics raycaster object. (Advanved Use Only) */
  2432. setCollisionFilterGroup(group: number): void;
  2433. /** Gets vehicle collision mask filter using physics raycaster object. (Advanved Use Only) */
  2434. getCollisionFilterMask(): number;
  2435. /** Sets the vehicle collision mask filter using physics raycaster object. (Advanved Use Only) */
  2436. setCollisionFilterMask(mask: number): void;
  2437. /** Gets the internal wheel index by id string. */
  2438. getWheelIndexByID(id: string): number;
  2439. /** Gets the internal wheel index by name string. */
  2440. getWheelIndexByName(name: string): number;
  2441. /** Gets the internal wheel collider information. */
  2442. getWheelColliderInfo(wheel: number): number;
  2443. /** Sets the internal wheel hub transform mesh by index. Used to rotate and bounce wheels. */
  2444. setWheelTransformMesh(wheel: number, transform: BABYLON.TransformNode): void;
  2445. getVisualSteeringAngle(wheel: number): number;
  2446. setVisualSteeringAngle(angle: number, wheel: number): void;
  2447. getPhysicsSteeringAngle(wheel: number): number;
  2448. setPhysicsSteeringAngle(angle: number, wheel: number): void;
  2449. protected setupWheelInformation(defaultAngularFactor?: BABYLON.Vector3): void;
  2450. protected updateWheelInformation(): void;
  2451. protected lockedWheelInformation(wheel: number): boolean;
  2452. protected deleteWheelInformation(): void;
  2453. }
  2454. }
  2455. declare module BABYLON {
  2456. /**
  2457. * Babylon realtime reflection system pro class (Unity Style Realtime Reflection Probes)
  2458. * @class RealtimeReflection - All rights reserved (c) 2020 Mackey Kinard
  2459. */
  2460. class RealtimeReflection extends BABYLON.ScriptComponent {
  2461. private static SKYBOX_FLAG;
  2462. private renderList;
  2463. private probeList;
  2464. private refreshMode;
  2465. private cullingMask;
  2466. private clearFlags;
  2467. private probeid;
  2468. private useProbeList;
  2469. private includeChildren;
  2470. private resolution;
  2471. private boxPos;
  2472. private boxSize;
  2473. private boxProjection;
  2474. getProbeList(): BABYLON.AbstractMesh[];
  2475. getRenderList(): BABYLON.AbstractMesh[];
  2476. protected awake(): void;
  2477. protected start(): void;
  2478. protected destroy(): void;
  2479. protected awakeRealtimReflections(): void;
  2480. protected startRealtimReflections(): void;
  2481. protected destroyRealtimReflections(): void;
  2482. }
  2483. }
  2484. declare module BABYLON {
  2485. /**
  2486. * Babylon full rigidbody physics pro class (Native Bullet Physics 2.82)
  2487. * @class RigidbodyPhysics - All rights reserved (c) 2020 Mackey Kinard
  2488. */
  2489. class RigidbodyPhysics extends BABYLON.ScriptComponent {
  2490. private static TempAmmoVector;
  2491. private static TempAmmoVectorAux;
  2492. private static TempCenterTransform;
  2493. private _abstractMesh;
  2494. private _isKinematic;
  2495. private _maxCollisions;
  2496. private _isPhysicsReady;
  2497. private _centerOfMass;
  2498. private _tmpLinearFactor;
  2499. private _tmpAngularFactor;
  2500. private _tmpCenterOfMass;
  2501. private _tmpGravityVector;
  2502. private _tmpCollisionContacts;
  2503. get isKinematic(): boolean;
  2504. get centerOfMass(): BABYLON.Vector3;
  2505. protected m_physicsWorld: any;
  2506. protected m_physicsEngine: BABYLON.IPhysicsEngine;
  2507. protected m_raycastVehicle: any;
  2508. protected awake(): void;
  2509. protected update(): void;
  2510. protected after(): void;
  2511. protected destroy(): void;
  2512. protected awakeRigidbodyState(): void;
  2513. protected updateRigidbodyState(): void;
  2514. protected afterRigidbodyState(): void;
  2515. protected destroyRigidbodyState(): void;
  2516. protected syncronizeVehicleController(): void;
  2517. protected parseBodyCollisionContacts(): void;
  2518. protected resetBodyCollisionContacts(): void;
  2519. /** Register handler that is triggered when the a collision contact has entered */
  2520. onCollisionEnterObservable: Observable<AbstractMesh>;
  2521. /** Register handler that is triggered when the a collision contact is active */
  2522. onCollisionStayObservable: Observable<AbstractMesh>;
  2523. /** Register handler that is triggered when the a collision contact has exited */
  2524. onCollisionExitObservable: Observable<AbstractMesh>;
  2525. /** Sets entity gravity value using physics impostor body. */
  2526. setGravity(gravity: BABYLON.Vector3): void;
  2527. /** Gets entity gravity value using physics impostor body. */
  2528. getGravity(): BABYLON.Nullable<BABYLON.Vector3>;
  2529. /** Gets entity gravity value using physics impostor body. */
  2530. getGravityToRef(result: BABYLON.Vector3): void;
  2531. /** Gets mass of entity using physics impostor. */
  2532. getMass(): number;
  2533. /** Sets mass to entity using physics impostor. */
  2534. setMass(mass: number): void;
  2535. /** Gets entity friction level using physics impostor. */
  2536. getFriction(): number;
  2537. /** Applies friction to entity using physics impostor. */
  2538. setFriction(friction: number): void;
  2539. /** Gets restitution of entity using physics impostor. */
  2540. getRestitution(): number;
  2541. /** Sets restitution to entity using physics impostor. */
  2542. setRestitution(restitution: number): void;
  2543. /** Gets entity linear velocity using physics impostor. */
  2544. getLinearVelocity(): BABYLON.Nullable<BABYLON.Vector3>;
  2545. /** Sets entity linear velocity using physics impostor. */
  2546. setLinearVelocity(velocity: BABYLON.Vector3): void;
  2547. /** Gets entity angular velocity using physics impostor. */
  2548. getAngularVelocity(): BABYLON.Nullable<BABYLON.Vector3>;
  2549. /** Sets entity angular velocity using physics impostor. */
  2550. setAngularVelocity(velocity: BABYLON.Vector3): void;
  2551. /** Gets the native physics world transform object using physics impostor body. (Advanved Use Only) */
  2552. getWorldTransform(): any;
  2553. /** Gets the entity world transform position using physics impostor body. (Advanved Use Only) */
  2554. getTransformPositionToRef(result: BABYLON.Vector3): void;
  2555. /** Gets the entity world transform rotation using physics impostor body. (Advanved Use Only) */
  2556. getTransformRotationToRef(result: BABYLON.Quaternion): void;
  2557. clearForces(): void;
  2558. applyTorque(torque: BABYLON.Vector3): void;
  2559. applyLocalTorque(torque: BABYLON.Vector3): void;
  2560. applyImpulse(impulse: BABYLON.Vector3, rel_pos: BABYLON.Vector3): void;
  2561. applyCentralImpulse(impulse: BABYLON.Vector3): void;
  2562. applyTorqueImpulse(torque: BABYLON.Vector3): void;
  2563. applyForce(force: BABYLON.Vector3, rel_pos: BABYLON.Vector3): void;
  2564. applyCentralForce(force: BABYLON.Vector3): void;
  2565. applyCentralLocalForce(force: BABYLON.Vector3): void;
  2566. /** gets rigidbody center of mass */
  2567. getCenterOfMassTransform(): BABYLON.Vector3;
  2568. /** Sets rigidbody center of mass */
  2569. setCenterOfMassTransform(center: BABYLON.Vector3): void;
  2570. /** Gets entity linear factor using physics impostor body. */
  2571. getLinearFactor(): BABYLON.Vector3;
  2572. /** Sets entity linear factor using physics impostor body. */
  2573. setLinearFactor(factor: BABYLON.Vector3): void;
  2574. /** Gets entity angular factor using physics impostor body. */
  2575. getAngularFactor(): BABYLON.Vector3;
  2576. /** Sets entity angular factor using physics impostor body. */
  2577. setAngularFactor(factor: BABYLON.Vector3): void;
  2578. /** Gets entity angular damping using physics impostor body. */
  2579. getAngularDamping(): number;
  2580. /** Gets entity linear damping using physics impostor body. */
  2581. getLinearDamping(): number;
  2582. /** Sets entity drag damping using physics impostor body. */
  2583. setDamping(linear: number, angular: number): void;
  2584. /** Sets entity sleeping threshold using physics impostor body. */
  2585. setSleepingThresholds(linear: number, angular: number): void;
  2586. /** Checks if rigidbody has wheel collider metadata for the entity. Note: Wheel collider metadata informaion is required for vehicle control. */
  2587. hasWheelColliders(): boolean;
  2588. /** Sets the maximum number of simultaneous contact notfications to dispatch per frame. Defaults value is 4. (Advanved Use Only) */
  2589. setMaxNotifications(max: number): void;
  2590. /** Sets entity collision activation state using physics impostor body. (Advanved Use Only) */
  2591. setActivationState(state: number): void;
  2592. /** Gets entity collision filter group using physics impostor body. (Advanved Use Only) */
  2593. getCollisionFilterGroup(): number;
  2594. /** Sets entity collision filter group using physics impostor body. (Advanved Use Only) */
  2595. setCollisionFilterGroup(group: number): void;
  2596. /** Gets entity collision filter mask using physics impostor body. (Advanved Use Only) */
  2597. getCollisionFilterMask(): number;
  2598. /** Sets entity collision filter mask using physics impostor body. (Advanved Use Only) */
  2599. setCollisionFilterMask(mask: number): void;
  2600. /** Gets the entity collision shape type using physics impostor body. (Advanved Use Only) */
  2601. getCollisionShapeType(): number;
  2602. /** Gets the entity collision shape margin using physics impostor body. (Advanved Use Only) */
  2603. getCollisionShapeMargin(): number;
  2604. /** Sets entity collision shape margin using physics impostor body. (Advanved Use Only) */
  2605. setCollisionShapeMargin(margin: number): void;
  2606. /** Gets the entity contact processing threshold using physics impostor body. (Advanved Use Only) */
  2607. getContactProcessingThreshold(): number;
  2608. /** Sets entity contact processing threshold using physics impostor body. (Advanved Use Only) */
  2609. setContactProcessingThreshold(threshold: number): void;
  2610. /** TODO */
  2611. static CreatePhysicsMetadata(mass: number, drag?: number, angularDrag?: number, centerMass?: Vector3): any;
  2612. /** TODO */
  2613. static CreateCollisionMetadata(type: string, trigger?: boolean, convexmesh?: boolean, restitution?: number, dynamicfriction?: number, staticfriction?: number): any;
  2614. /** TODO */
  2615. static CreatePhysicsProperties(mass: number, drag?: number, angularDrag?: number, useGravity?: boolean, isKinematic?: boolean): any;
  2616. /** TODO */
  2617. static SetupPhysicsComponent(scene: BABYLON.Scene, entity: BABYLON.AbstractMesh): void;
  2618. private static ConfigRigidbodyPhysics;
  2619. }
  2620. /**
  2621. * Babylon collision contact info pro class (Native Bullet Physics 2.82)
  2622. * @class CollisionContactInfo - All rights reserved (c) 2020 Mackey Kinard
  2623. */
  2624. class CollisionContactInfo {
  2625. mesh: BABYLON.AbstractMesh;
  2626. state: number;
  2627. reset: boolean;
  2628. }
  2629. }
  2630. declare module BABYLON {
  2631. /**
  2632. * Babylon shuriken particle system pro class (Unity Style Shuriken Particle System)
  2633. * @class ShurikenParticles - All rights reserved (c) 2020 Mackey Kinard
  2634. */
  2635. class ShurikenParticles extends BABYLON.ScriptComponent {
  2636. protected awake(): void;
  2637. protected start(): void;
  2638. protected update(): void;
  2639. protected late(): void;
  2640. protected after(): void;
  2641. protected destroy(): void;
  2642. }
  2643. }
  2644. declare module BABYLON {
  2645. /**
  2646. * Babylon window socket controller pro class (Socket.IO)
  2647. * @class SocketController - All rights reserved (c) 2020 Mackey Kinard
  2648. */
  2649. class SocketController {
  2650. /** Registers an handler for window socket connect event */
  2651. static RegisterOnSocketConnect(func: () => void): void;
  2652. /** Registers an handler for window socket disconnect event */
  2653. static RegisterOnSocketDisconnect(func: () => void): void;
  2654. /** Connects a window state socket */
  2655. static ConnectWindowSocket(connection: string): SocketIOClient.Socket;
  2656. /** Get the window state socket */
  2657. static GetWindowSocket(): SocketIOClient.Socket;
  2658. }
  2659. }
  2660. declare module BABYLON {
  2661. /**
  2662. * Babylon web video player pro class (Unity Style Shuriken Particle System)
  2663. * @class WebVideoPlayer - All rights reserved (c) 2020 Mackey Kinard
  2664. */
  2665. class WebVideoPlayer extends BABYLON.ScriptComponent {
  2666. getVideoMaterial(): BABYLON.StandardMaterial;
  2667. getVideoTexture(): BABYLON.VideoTexture;
  2668. getVideoElement(): HTMLVideoElement;
  2669. getVideoScreen(): BABYLON.AbstractMesh;
  2670. protected m_abstractMesh: BABYLON.AbstractMesh;
  2671. protected m_videoTexture: BABYLON.VideoTexture;
  2672. protected m_videoMaterial: BABYLON.StandardMaterial;
  2673. protected m_diffuseIntensity: number;
  2674. protected awake(): void;
  2675. protected destroy(): void;
  2676. protected awakeWebVideoPlayer(): void;
  2677. protected destroyWebVideoPlayer(): void;
  2678. /** Set web video player source */
  2679. setVideoSource(src: string | string[] | HTMLVideoElement, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number, settings?: BABYLON.VideoTextureSettings, volume?: number, speed?: number): void;
  2680. }
  2681. }