babylon.manager.d.ts 130 KB

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