babylon.manager.d.ts 129 KB

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