babylon.manager.d.ts 130 KB

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