diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 6b61141..2c206b2 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -1,6 +1,7 @@ { "ExpandedNodes": [ - "" + "\\Source", + "\\Source\\Sketch360.XPlat.Android" ], "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/README.md b/README.md index e57bca0..935386d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,31 @@ -# Sketch 360 +# Sketch 360 a Microsoft Garage Project +A Cross Platform 360 Degree Panoramic Sketching App + +- Install from the [Google Play Marketplace](https://play.google.com/store/apps/details?id=com.microsoft.garage.sketch360app) +- Install from the [Microsoft Store](https://www.microsoft.com/en-us/p/sketch-360/9p89s2qlh11t) + +Sketch 360 was built by [Michael Scherotter](https://github.com/mscherotter) and [originally released](https://www.microsoft.com/en-us/garage/blog/2018/11/finally-a-way-to-sketch-360-degree-vr-scenes/) as a Microsoft Garage project in 2018 as a UWP app for Microsoft Windows as is available today for free in the [Microsoft Store](https://www.microsoft.com/en-us/p/sketch-360/9p89s2qlh11t). This is a new version of Sketch 360 built to take advantage of pen-enabled devices that have two screens like the [Microsoft Surface Duo](https://www.microsoft.com/en-us/surface/devices/surface-duo) but it should work on most Android devices as well. + +## Examples of Sketches created with Sketch 360 +- [360 Drawings](https://lightroom.adobe.com/shares/21b9e652ff4e46ef86130478cbb50abf) +- [360 Videos](https://studio.youtube.com/video/AImRmQYN_hk/edit) +- [Virtual Flight 360 Sketch](https://youtu.be/pTFVXD1v3zQ) +## Sketch 360 on the Microsoft Surface Duo +![Sketch 360 on the Microsoft Surface Duo](mobile.jpg) + +## Platforms +- ***Android**: Complete with enhancements for Microsoft Surface Duo (dual screen & pressure-sensitive pen support) +- **iOS**: In-progress +- **Windows**: In-progress but not prioritized as the native Windows version is already available. + +## Technology +- Xamarin Forms +- SkiaSharp +- Babylon JS ## Contributing [How to contribute](Contributing.md) -## Open Source [Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct) ## Trademarks diff --git a/Source/.editorconfig b/Source/.editorconfig new file mode 100644 index 0000000..68d0605 --- /dev/null +++ b/Source/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Don't use tabs for indentation. +[*] +indent_style = space +# (Please don't specify an indent_size here; that has too many unintended consequences.) + +# Code files +[*.{cs,csx,vb,vbx}] +indent_style = space +indent_size = 4 +insert_final_newline = false +charset = utf-8-bom +trim_trailing_whitespace = true \ No newline at end of file diff --git a/Source/.gitignore b/Source/.gitignore new file mode 100644 index 0000000..10145d2 --- /dev/null +++ b/Source/.gitignore @@ -0,0 +1,199 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# Visual Studio (>=2015) project-specific, machine local files +.vs/ + +# User-specific files +*.suo +*.user +*.sln.docstates +*.userprefs +*.ide-shm +*.ide-wal +*.dll +*.pdb +classes.zip +# ignore Xamarin.Android Resource.Designer.cs files +**/*.Droid/**/[Rr]esource.[Dd]esigner.cs +**/*.Android/**/[Rr]esource.[Dd]esigner.cs +**/Android/**/[Rr]esource.[Dd]esigner.cs +**/Droid/**/[Rr]esource.[Dd]esigner.cs + +# Xamarin Components +Components/ + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +x64/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +#NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml + +# NuGet Packages Directory +packages/ +*.nuget.targets +*.lock.json +*.nuget.props + +## TODO: If the tool you use requires repositories.config uncomment the next line +#!packages/repositories.config + +# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets +# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) +!packages/build/ + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +.DS_Store +*.bak + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +.vscode/settings.json \ No newline at end of file diff --git a/Source/EquirectangularGrid.png b/Source/EquirectangularGrid.png new file mode 100644 index 0000000..0cfefc6 Binary files /dev/null and b/Source/EquirectangularGrid.png differ diff --git a/Source/NuGet.config b/Source/NuGet.config new file mode 100644 index 0000000..04011ea --- /dev/null +++ b/Source/NuGet.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Source/Sketch360.XPlat.Android/BaseUrl.cs b/Source/Sketch360.XPlat.Android/BaseUrl.cs new file mode 100644 index 0000000..66b7157 --- /dev/null +++ b/Source/Sketch360.XPlat.Android/BaseUrl.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.IO; +using System.Reflection; + +[assembly: Xamarin.Forms.Dependency(typeof(Sketch360.XPlat.Droid.BaseUrl))] + +namespace Sketch360.XPlat.Droid +{ + public class BaseUrl : IBaseUrl + { + public string GetBase() + { + return "file:///android_asset/"; + } + + public Stream GetDrawableImageStream(string filename) + { + string resourceID = "Sketch360.XPlat.Droid.Resources.drawable." + filename; + + var assembly = typeof(BaseUrl).GetTypeInfo().Assembly; + + //var names = assembly.GetManifestResourceNames(); + + return assembly.GetManifestResourceStream(resourceID); + + } + } +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/CustomWebViewRenderer.cs b/Source/Sketch360.XPlat.Android/CustomWebViewRenderer.cs new file mode 100644 index 0000000..0fa3d7d --- /dev/null +++ b/Source/Sketch360.XPlat.Android/CustomWebViewRenderer.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Android.Content; +using Xamarin.Forms; +using Xamarin.Forms.Platform.Android; + + +[assembly: ExportRenderer(typeof(Xamarin.Forms.WebView), typeof(Sketch360.XPlat.Droid.CustomWebViewRenderer))] + +namespace Sketch360.XPlat.Droid +{ + /// + /// Custom WebView renderer that allows local file URLs + /// + public class CustomWebViewRenderer : WebViewRenderer + { + public CustomWebViewRenderer(Context context) : base(context) + { + } + + protected override void OnElementChanged(ElementChangedEventArgs e) + { + base.OnElementChanged(e); + + if (Control != null) + Control.Settings.AllowUniversalAccessFromFileURLs = true; + } + } +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/Equirectangular Grid.png b/Source/Sketch360.XPlat.Android/Equirectangular Grid.png new file mode 100644 index 0000000..0cfefc6 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Equirectangular Grid.png differ diff --git a/Source/Sketch360.XPlat.Android/InkCanvasRenderer.cs b/Source/Sketch360.XPlat.Android/InkCanvasRenderer.cs new file mode 100644 index 0000000..db40267 --- /dev/null +++ b/Source/Sketch360.XPlat.Android/InkCanvasRenderer.cs @@ -0,0 +1,33 @@ +using Android.Content; +using Android.Graphics; +using System; +using Xamarin.Forms; +using Xamarin.Forms.Platform.Android; + +[assembly: ExportRenderer(typeof(Sketch360.XPlat.InkCanvas), typeof(Sketch360.XPlat.Droid.InkCanvasRenderer))] + +namespace Sketch360.XPlat.Droid +{ + /// + /// InkCanvas renderer for Android + /// + public class InkCanvasRenderer : ViewRenderer + { + Paint _inkPaint = new Paint(); + + /// + /// Initializes a new instance of the InkCanvasRenderer class + /// + /// the context + public InkCanvasRenderer(Context context) : base(context) + { + } + + protected override void OnDraw(Canvas canvas) + { + if (canvas == null) throw new ArgumentNullException(nameof(canvas)); + + canvas.DrawText("InkCanvas", 100, 100, _inkPaint); + } + } +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/LayoutService.cs b/Source/Sketch360.XPlat.Android/LayoutService.cs new file mode 100644 index 0000000..d2af7d7 --- /dev/null +++ b/Source/Sketch360.XPlat.Android/LayoutService.cs @@ -0,0 +1,22 @@ +using Xamarin.Duo.Forms.Samples; +using Xamarin.Forms; +using Xamarin.Forms.Platform.Android; + +[assembly: Dependency(typeof(LayoutService))] +namespace Xamarin.Duo.Forms.Samples +{ + public class LayoutService : LayoutServiceBase, ILayoutService + { + public override Point? GetLocationOnScreen(VisualElement visualElement) + { + var view = Platform.GetRenderer(visualElement); + + if (view?.View == null) + return null; + + int[] location = new int[2]; + view.View.GetLocationOnScreen(location); + return new Point(view.View.Context.FromPixels(location[0]), view.View.Context.FromPixels(location[1])); + } + } +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/MainActivity.cs b/Source/Sketch360.XPlat.Android/MainActivity.cs new file mode 100644 index 0000000..866f4c9 --- /dev/null +++ b/Source/Sketch360.XPlat.Android/MainActivity.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using Android.App; +using Android.Content; +using Android.Content.PM; +using Android.OS; +using Android.Runtime; +//using Microsoft.AppCenter.Distribute; +using System.Threading.Tasks; +//using Xamarin.Duo.Forms.Samples; + +namespace Sketch360.XPlat.Droid +{ + /// + /// Android main activity + /// + [Activity(Label = "Sketch 360", Icon = "@drawable/logo", Theme = "@style/MainTheme", MainLauncher = true, + ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)] + [IntentFilter(new[] { Intent.ActionView, Intent.ActionMain, Intent.ActionEdit }, + //Categories = new[] { Intent.CategoryBrowsable, Intent.CategoryDefault, Intent.CategoryOpenable, Intent.CategoryLauncher}, + Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, + + DataMimeTypes = new[] { "application/x-sketch360", "application/octet-stream" }, + DataScheme = "file", + Label = "Sketch 360", + DataPathPatterns = new[] + { + "*.sketch360", + ".*\\.sketch360", + ".*\\..*\\.sketch360", + ".*\\..*\\..*\\.sketch360", + ".*\\..*\\..*\\..*\\.sketch360" + }, + Icon = "@drawable/logo", + DataHost = "*")] + public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity + { + internal static MainActivity Instance { get; private set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "")] + protected override void OnCreate(Bundle savedInstanceState) + { + global::Xamarin.Forms.DualScreen.DualScreenService.Init(this); + Remote.MainActivity = this; + TabLayoutResource = Resource.Layout.Tabbar; + ToolbarResource = Resource.Layout.Toolbar; + + Instance = this; + + base.OnCreate(savedInstanceState); + + Xamarin.Essentials.Platform.Init(this, savedInstanceState); + + global::Xamarin.Forms.Forms.Init(this, savedInstanceState); + + //Distribute.SetEnabledForDebuggableBuild(true); + + LoadApplication(new App()); + + //enable Android webview debugging + global::Android.Webkit.WebView.SetWebContentsDebuggingEnabled(true); + } + + public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults) + { + Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); + + base.OnRequestPermissionsResult(requestCode, permissions, grantResults); + } + + protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) + { + base.OnActivityResult(requestCode, resultCode, data); + + if (requestCode == 101) + { + switch (resultCode) + { + case Result.Ok: + if (data != null && data.Data != null) + { + _fileName?.SetResult(data.Data); + } + else + _fileName?.SetResult(null); + + break; + default: + _fileName?.SetResult(null); + break; + } + } + } + + TaskCompletionSource _fileName; + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "")] + public Task OpenSaveFileDialog(string currentFileName) + { + Intent intent = new Intent(Intent.ActionCreateDocument); + intent.AddCategory(Intent.CategoryOpenable); + intent.SetType("application/octet-stream"); + intent.PutExtra(Intent.ExtraTitle, currentFileName); + _fileName = new TaskCompletionSource(); + StartActivityForResult(intent, 101); + return _fileName.Task; + } + } +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/OffscreenRenderer.cs b/Source/Sketch360.XPlat.Android/OffscreenRenderer.cs new file mode 100644 index 0000000..4b8f538 --- /dev/null +++ b/Source/Sketch360.XPlat.Android/OffscreenRenderer.cs @@ -0,0 +1,40 @@ +using Android.Graphics; +using Sketch360.XPlat.Data; +using SkiaSharp; +using System; +using System.Collections.Generic; +using Xamarin.Forms; + +[assembly: Dependency(typeof(Sketch360.XPlat.Droid.OffscreenRenderer))] + +namespace Sketch360.XPlat.Droid +{ + public class OffscreenRenderer : IOffscreenRenderer + { + public void Render(float width, float height, IEnumerable strokes) + { + using (var bitmap = Bitmap.CreateBitmap((int) width, (int) height, Bitmap.Config.Argb8888)) + { + try + { + using (var surface = SKSurface.Create((int) width, (int) height, SKColorType.Rgba8888, SKAlphaType.Premul, bitmap.LockPixels(), (int) width * 4)) + { + var skcanvas = surface.Canvas; + + skcanvas.Draw(strokes); + } + } + catch(Exception e) + { + + } + finally + { + bitmap.UnlockPixels(); + } + + //bitmap. + } + } + } +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/PhotoLibrary.cs b/Source/Sketch360.XPlat.Android/PhotoLibrary.cs new file mode 100644 index 0000000..ca3b66f --- /dev/null +++ b/Source/Sketch360.XPlat.Android/PhotoLibrary.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Android; +using Android.Content; +using Android.Content.PM; +using Android.Media; +using Android.Provider; +using Android.Support.V4.App; +using Sketch360.XPlat.Interfaces; +using System; +using System.IO; +using System.Threading.Tasks; +using Xamarin.Essentials; +using Xamarin.Forms; +using System.Linq; +using Microsoft.AppCenter.Crashes; + +[assembly: Dependency(typeof(Sketch360.XPlat.Droid.PhotoLibrary))] + +namespace Sketch360.XPlat.Droid +{ + /// + /// Android Photo library + /// + public class PhotoLibrary : IPhotoLibrary + { + #region Constants + /// + /// XMP Metadata with equirectangular Projection property + /// + private const string Xmp = "equirectangular"; + #endregion + + #region Methods + /// + /// Save a photo to the photo library with equirectangular metadata. + /// + /// + /// + /// + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "")] + public async Task SavePhotoAsync(byte[] data, string folder, string filename, Page page) + { + try + { + if (!(await RequestPermissionsAsync(page).ConfigureAwait(false))) + { + return false; + } + + string tempFilename = await SaveToTempFileAsync(data, filename).ConfigureAwait(false); + + AddExifData(tempFilename); + + var uri = await WriteContentValuesAsync(tempFilename, filename, "image/jpeg").ConfigureAwait(false); + + System.IO.File.Delete(tempFilename); + + var newFilename = GetPath(uri); + + await LaunchFileAsync(newFilename).ConfigureAwait(false); + } + catch (Exception e) + { + Crashes.TrackError(e); + + return false; + } + + return true; + } + + private static async Task RequestPermissionsAsync(Page page) + { + Task[] permissions = new[] + { + new Permissions.StorageWrite().RequestAsync(), + new Permissions.Photos().RequestAsync(), + }; + + var results = await Task.WhenAll(permissions).ConfigureAwait(false); + + if(results.Any(x => x != PermissionStatus.Granted)) + { + if (page != null) + { + await page.DisplayAlert( + Resources.AndroidResources.PermissionsTitle, + Resources.AndroidResources.PermssionsMessage, + Resources.AndroidResources.OK).ConfigureAwait(false); + } + + return false; + } + + return true; + } + + static string GetPath(Android.Net.Uri uri) + { + string path = null; + +#pragma warning disable CS0618 // Type or member is obsolete + String[] projection = { MediaStore.MediaColumns.Data }; +#pragma warning restore CS0618 // Type or member is obsolete + + var metaCursor = MainActivity.Instance.ContentResolver.Query(uri, projection, null, null, null); + if (metaCursor != null) + { + using (metaCursor) + { + if (metaCursor.MoveToFirst()) + { + path = metaCursor.GetString(0); + } + } + } + + return path; + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "")] + public async Task SaveSketchAsync(byte[] data, string folder, string filename, Page page) + { + bool result; + try + { + if (!(await RequestPermissionsAsync(page).ConfigureAwait(false))) + { + return false; + } + + var tempFilename = await SaveToTempFileAsync(data, filename).ConfigureAwait(false); + + var urilocation = await WriteDownloadValuesAsync(tempFilename, filename, "application/x-sketch360").ConfigureAwait(false); + + result = urilocation != null; + + //var documentsDirectory = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDownloads); + + //var fullPath = await WriteToFolderAsync(data, filename, documentsDirectory).ConfigureAwait(false); + + + //MediaScannerConnection.ScanFile(MainActivity.Instance, + // new string[] { fullPath }, + // new string[] { "application/x-sketch360" }, null); + + + //var fullPath = await WriteToSpecialFolderAsync(tempFilename, filename, Environment.SpecialFolder.MyDocuments).ConfigureAwait(false); + + System.IO.File.Delete(tempFilename); + + //await LaunchFileAsync(fullPath).ConfigureAwait(false); + } + catch (Exception e) + { + Crashes.TrackError(e); + + return false; + } + + return result; + } + #endregion + + #region Implementation + //private static async Task WriteToSpecialFolderAsync(string tempFilename, string filename, Java.IO.File folder) + //{ + // folder.Mkdirs(); + + // var filePath = Path.Combine(folder.AbsolutePath, filename); + + // var data = System.IO.File.ReadAllBytes(tempFilename); + + // using (var stream = new Java.IO.FileOutputStream(filePath)) + // { + // await stream.WriteAsync(data).ConfigureAwait(false); + // } + + // return filePath; + // //var folder = System.Environment.GetFolderPath(specialFolder); + + // // System.IO.Directory.CreateDirectory(folder); + + // // var myPicturesFilename = Path.Combine(folder, filename); + + // // using (var stream = System.IO.File.Create(myPicturesFilename)) + // // using (var tempStream = System.IO.File.OpenRead(tempFilename)) + // // { + // // await tempStream.CopyToAsync(stream).ConfigureAwait(false); + // // } + + // // return myPicturesFilename; + //} + //private static async Task WriteToSpecialFolderAsync(string tempFilename, string filename, Environment.SpecialFolder specialFolder) + //{ + // var folder = System.Environment.GetFolderPath(specialFolder); + + // System.IO.Directory.CreateDirectory(folder); + + // var myPicturesFilename = Path.Combine(folder, filename); + + // using (var stream = System.IO.File.Create(myPicturesFilename)) + // using (var tempStream = System.IO.File.OpenRead(tempFilename)) + // { + // await tempStream.CopyToAsync(stream).ConfigureAwait(false); + // } + + // return myPicturesFilename; + //} + + //private static async Task WriteToFolderAsync(byte[] data, string filename, Java.IO.File folder) + //{ + // folder.Mkdirs(); + + // var filePath = Path.Combine(folder.AbsolutePath, filename); + + // using (var stream = new Java.IO.FileOutputStream(filePath)) + // { + // await stream.WriteAsync(data).ConfigureAwait(false); + // } + + // return filePath; + //} + + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "")] + private static async Task LaunchFileAsync(string filename) + { + //var fullPath = $"/storage/emulated/0/DCIM/Sketch360/{filename}"; + + var request = new OpenFileRequest + { + + File = new ReadOnlyFile(filename) + }; + + try + { + await Launcher.OpenAsync(request).ConfigureAwait(false); + } + catch (Exception e) + { + Crashes.TrackError(e); + } + } + + private static async Task SaveToTempFileAsync(byte[] data, string filename) + { + var tempFilename = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), filename); + + using (var stream = System.IO.File.Create(tempFilename)) + { + await stream.WriteAsync(data).ConfigureAwait(false); + } + + return tempFilename; + } + + public void AddExifData(string filename) + { + using var exif = new ExifInterface(filename); + + exif.SetAttribute(ExifInterface.TagXmp, Xmp); + + exif.SetAttribute(ExifInterface.TagSoftware, "Sketch 360"); + + exif.SaveAttributes(); + } + + private static async Task WriteDownloadValuesAsync(string tempfilename, string filename, string mimeType) + { + using var stream = System.IO.File.OpenRead(tempfilename); + using var contentValues = new ContentValues(); + contentValues.Put(MediaStore.DownloadColumns.DisplayName, filename); + contentValues.Put(MediaStore.DownloadColumns.MimeType, mimeType); + + + var uri = await MainActivity.Instance.OpenSaveFileDialog(filename).ConfigureAwait(true); + + //var uri = MainActivity.Instance.ContentResolver.Insert(MediaStore.Downloads.ExternalContentUri, contentValues); + + if (uri == null) return null; + + using (var outputStream = MainActivity.Instance.ContentResolver.OpenOutputStream(uri)) + { + await stream.CopyToAsync(outputStream).ConfigureAwait(false); + } + + return uri; + } + + private static async Task WriteContentValuesAsync(string tempfilename, string filename, string mimeType) + { + using var stream = System.IO.File.OpenRead(tempfilename); + using var contentValues = new ContentValues(); + contentValues.Put(MediaStore.MediaColumns.DisplayName, filename); + contentValues.Put(MediaStore.MediaColumns.MimeType, mimeType); + + var uri = MainActivity.Instance.ContentResolver.Insert(MediaStore.Images.Media.ExternalContentUri, contentValues); + + if (uri == null) return null; + + using (var outputStream = MainActivity.Instance.ContentResolver.OpenOutputStream(uri)) + { + await stream.CopyToAsync(outputStream).ConfigureAwait(false); + } + + return uri; + } + #endregion + } +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/Properties/AndroidManifest.xml b/Source/Sketch360.XPlat.Android/Properties/AndroidManifest.xml new file mode 100644 index 0000000..d8d97ad --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Properties/AndroidManifest.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/Properties/AssemblyInfo.cs b/Source/Sketch360.XPlat.Android/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fbb01ac --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using Android.App; +using System.Reflection; +using System.Resources; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Sketch 360")] +[assembly: AssemblyDescription("360 sketching")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Garage")] +[assembly: AssemblyProduct("Sketch360.XPlat.Android")] +[assembly: AssemblyCopyright("Copyright © 2020 Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + +// Add some common permissions, these can be removed if not needed +[assembly: UsesPermission(Android.Manifest.Permission.Internet)] +[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] +[assembly: UsesPermission(Android.Manifest.Permission.ReadExternalStorage)] +[assembly: NeutralResourcesLanguage("en-US")] \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/Remote.cs b/Source/Sketch360.XPlat.Android/Remote.cs new file mode 100644 index 0000000..a5c3dae --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Remote.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Android.App; +using Android.Content; +using Android.Webkit; +using Android.Widget; +using Microsoft.ConnectedDevices; +using Sketch360.XPlat.Data; +using Sketch360.XPlat.Interfaces; +using System; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; + +[assembly: Xamarin.Forms.Dependency(typeof(Sketch360.XPlat.Droid.Remote))] + +namespace Sketch360.XPlat.Droid +{ + /// + /// Remote system using Project Rome to send data to other systems + /// + public sealed class Remote : IRemote, IDisposable + { + const string AppId = "f2d1007c-dbd7-4d32-a488-93a6bdbc12b9"; + + private WebView _webView; + internal Dialog _authDialog; + private RemoteSystemWatcher _remoteSystemWatcher; + + public Remote() + { + RemoteSystems = new ObservableCollection(); + } + + public static MainActivity MainActivity { get; set; } + + public ObservableCollection RemoteSystems { get; private set; } + + public async Task ConnectAsync() + { + Platform.FetchAuthCode += Platform_FetchAuthCode; + + if (await Platform.InitializeAsync(MainActivity, AppId).ConfigureAwait(false)) + { + DiscoverDevices(); + + return true; + } + + return false; + } + + public void DiscoverDevices() + { + _remoteSystemWatcher = RemoteSystem.CreateWatcher(); + + _remoteSystemWatcher.RemoteSystemAdded += RemoteSystemAdded; + _remoteSystemWatcher.RemoteSystemRemoved += RemoteSystemRemoved; + _remoteSystemWatcher.RemoteSystemUpdated += RemoteSystemUpdated; + + _remoteSystemWatcher.Start(); + } + + private void RemoteSystemUpdated(RemoteSystemWatcher watcher, RemoteSystemUpdatedEventArgs args) + { + } + + private void RemoteSystemRemoved(RemoteSystemWatcher watcher, RemoteSystemRemovedEventArgs args) + { + MainActivity.RunOnUiThread(delegate + { + var itemToRemove = (from item in RemoteSystems + where item.Id == args.P0 + select item).FirstOrDefault(); + + if (itemToRemove != null) + { + RemoteSystems.Remove(itemToRemove); + } + }); + } + + private void RemoteSystemAdded(RemoteSystemWatcher watcher, RemoteSystemAddedEventArgs args) + { + MainActivity.RunOnUiThread(delegate + { + RemoteSystems.Add(new RemoteSystemInfo + { + DisplayName = args.P0.DisplayName, + Id = args.P0.Id, + Kind = args.P0.Kind.ToString() + }); + }); + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "")] + private void Platform_FetchAuthCode(string oauthUrl) + { + _authDialog = new Dialog(MainActivity); + + var linearLayout = new LinearLayout(_authDialog.Context); + _webView = new WebView(_authDialog.Context); + linearLayout.AddView(_webView); + _authDialog.SetContentView(linearLayout); + + _webView.SetWebChromeClient(new WebChromeClient()); + _webView.Settings.JavaScriptEnabled = true; + _webView.Settings.DomStorageEnabled = true; + _webView.LoadUrl(oauthUrl); + + _webView.SetWebViewClient(new MsaWebViewClient(MainActivity, _authDialog)); + _authDialog.Show(); + _authDialog.SetCancelable(true); + } + + /// + /// Dispose of the auth dialog and webview + /// + public void Dispose() + { + if (_authDialog != null) + { + _authDialog.Dispose(); + _authDialog = null; + } + + if (_webView != null) + { + _webView.Dispose(); + _webView = null; + } + } + + internal class MsaWebViewClient : WebViewClient + { + bool authComplete; + + private readonly MainActivity _parentActivity; + private readonly Dialog _authDialog; + + public MsaWebViewClient(MainActivity activity, Dialog authDialog) + { + _parentActivity = activity; + _authDialog = authDialog; + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "")] + public override void OnPageFinished(WebView view, string url) + { + base.OnPageFinished(view, url); + if (url.Contains("?code=", StringComparison.InvariantCultureIgnoreCase) && !authComplete) + { + authComplete = true; + + var uri = Android.Net.Uri.Parse(url); + string token = uri.GetQueryParameter("code"); + _authDialog.Dismiss(); + Platform.SetAuthCode(token); + } + else if (url.Contains("error=access_denied", StringComparison.InvariantCultureIgnoreCase)) + { + authComplete = true; + //Console.WriteLine("Page finished failed with ACCESS_DENIED_HERE"); + Intent resultIntent = new Intent(); + _parentActivity.SetResult(0, resultIntent); + _authDialog.Dismiss(); + } + + } + } + } +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/Resources/AndroidResources.Designer.cs b/Source/Sketch360.XPlat.Android/Resources/AndroidResources.Designer.cs new file mode 100644 index 0000000..f52cf2f --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Resources/AndroidResources.Designer.cs @@ -0,0 +1,90 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sketch360.XPlat.Droid.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AndroidResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AndroidResources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sketch360.XPlat.Droid.Resources.AndroidResources", typeof(AndroidResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to OK. + /// + public static string OK { + get { + return ResourceManager.GetString("OK", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sketch 360 Permissions. + /// + public static string PermissionsTitle { + get { + return ResourceManager.GetString("PermissionsTitle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to In Settings/Apps & notifications/Sketch 360/Permissions, select the Storage permission and check Allow to enable Sketch 360 to save files on this device, then try saving again.. + /// + public static string PermssionsMessage { + get { + return ResourceManager.GetString("PermssionsMessage", resourceCulture); + } + } + } +} diff --git a/Source/Sketch360.XPlat.Android/Resources/AndroidResources.resx b/Source/Sketch360.XPlat.Android/Resources/AndroidResources.resx new file mode 100644 index 0000000..7fd4c2b --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Resources/AndroidResources.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + OK + + + Sketch 360 Permissions + + + In Settings/Apps & notifications/Sketch 360/Permissions, select the Storage permission and check Allow to enable Sketch 360 to save files on this device, then try saving again. + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/BackButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/BackButton.png new file mode 100644 index 0000000..a7ff913 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/BackButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/DrawButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/DrawButton.png new file mode 100644 index 0000000..2db17d1 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/DrawButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/DrawingViewButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/DrawingViewButton.png new file mode 100644 index 0000000..c6a2337 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/DrawingViewButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/DrawingViewCarousel.png b/Source/Sketch360.XPlat.Android/Resources/drawable/DrawingViewCarousel.png new file mode 100644 index 0000000..ca55551 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/DrawingViewCarousel.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/EquirectangularGrid.png b/Source/Sketch360.XPlat.Android/Resources/drawable/EquirectangularGrid.png new file mode 100644 index 0000000..0cfefc6 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/EquirectangularGrid.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/EraserButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/EraserButton.png new file mode 100644 index 0000000..eb758df Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/EraserButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/FrontBackButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/FrontBackButton.png new file mode 100644 index 0000000..04c1181 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/FrontBackButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/LeftRightButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/LeftRightButton.png new file mode 100644 index 0000000..1796606 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/LeftRightButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/Logo.png b/Source/Sketch360.XPlat.Android/Resources/drawable/Logo.png new file mode 100644 index 0000000..8b6798c Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/Logo.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/MenuButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/MenuButton.png new file mode 100644 index 0000000..100e6c7 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/MenuButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/PaletteButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/PaletteButton.png new file mode 100644 index 0000000..cc03a9d Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/PaletteButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/PanZoomButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/PanZoomButton.png new file mode 100644 index 0000000..38bd4ac Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/PanZoomButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/PenSizeButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/PenSizeButton.png new file mode 100644 index 0000000..5fb4edc Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/PenSizeButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/RedoButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/RedoButton.png new file mode 100644 index 0000000..874342c Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/RedoButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/SphericalViewCarousel.png b/Source/Sketch360.XPlat.Android/Resources/drawable/SphericalViewCarousel.png new file mode 100644 index 0000000..efc2b7b Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/SphericalViewCarousel.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/StencilButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/StencilButton.png new file mode 100644 index 0000000..4904814 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/StencilButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/TouchDrawing.png b/Source/Sketch360.XPlat.Android/Resources/drawable/TouchDrawing.png new file mode 100644 index 0000000..2d136ee Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/TouchDrawing.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/UndoButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/UndoButton.png new file mode 100644 index 0000000..ccc62bb Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/UndoButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/VerticalLinesButton.png b/Source/Sketch360.XPlat.Android/Resources/drawable/VerticalLinesButton.png new file mode 100644 index 0000000..a12d973 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/VerticalLinesButton.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/View360Button.png b/Source/Sketch360.XPlat.Android/Resources/drawable/View360Button.png new file mode 100644 index 0000000..c3952a8 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/View360Button.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/drawable/export360Degree.png b/Source/Sketch360.XPlat.Android/Resources/drawable/export360Degree.png new file mode 100644 index 0000000..6a907e4 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/drawable/export360Degree.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/layout/Tabbar.xml b/Source/Sketch360.XPlat.Android/Resources/layout/Tabbar.xml new file mode 100644 index 0000000..ad1f87d --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Resources/layout/Tabbar.xml @@ -0,0 +1,11 @@ + + diff --git a/Source/Sketch360.XPlat.Android/Resources/layout/Toolbar.xml b/Source/Sketch360.XPlat.Android/Resources/layout/Toolbar.xml new file mode 100644 index 0000000..aabd0a3 --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Resources/layout/Toolbar.xml @@ -0,0 +1,9 @@ + + diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-anydpi-v26/icon.xml b/Source/Sketch360.XPlat.Android/Resources/mipmap-anydpi-v26/icon.xml new file mode 100644 index 0000000..88d1d0a --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Resources/mipmap-anydpi-v26/icon.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-anydpi-v26/icon_round.xml b/Source/Sketch360.XPlat.Android/Resources/mipmap-anydpi-v26/icon_round.xml new file mode 100644 index 0000000..88d1d0a --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Resources/mipmap-anydpi-v26/icon_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-hdpi/icon.png b/Source/Sketch360.XPlat.Android/Resources/mipmap-hdpi/icon.png new file mode 100644 index 0000000..5ca9b91 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/mipmap-hdpi/icon.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-hdpi/launcher_foreground.png b/Source/Sketch360.XPlat.Android/Resources/mipmap-hdpi/launcher_foreground.png new file mode 100644 index 0000000..965d500 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/mipmap-hdpi/launcher_foreground.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-mdpi/icon.png b/Source/Sketch360.XPlat.Android/Resources/mipmap-mdpi/icon.png new file mode 100644 index 0000000..078cd59 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/mipmap-mdpi/icon.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-mdpi/launcher_foreground.png b/Source/Sketch360.XPlat.Android/Resources/mipmap-mdpi/launcher_foreground.png new file mode 100644 index 0000000..2ad4e12 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/mipmap-mdpi/launcher_foreground.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-xhdpi/icon.png b/Source/Sketch360.XPlat.Android/Resources/mipmap-xhdpi/icon.png new file mode 100644 index 0000000..4885eda Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/mipmap-xhdpi/icon.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-xhdpi/launcher_foreground.png b/Source/Sketch360.XPlat.Android/Resources/mipmap-xhdpi/launcher_foreground.png new file mode 100644 index 0000000..b11e5c9 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/mipmap-xhdpi/launcher_foreground.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-xxhdpi/icon.png b/Source/Sketch360.XPlat.Android/Resources/mipmap-xxhdpi/icon.png new file mode 100644 index 0000000..4efdf00 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/mipmap-xxhdpi/icon.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-xxhdpi/launcher_foreground.png b/Source/Sketch360.XPlat.Android/Resources/mipmap-xxhdpi/launcher_foreground.png new file mode 100644 index 0000000..bb984c6 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/mipmap-xxhdpi/launcher_foreground.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-xxxhdpi/icon.png b/Source/Sketch360.XPlat.Android/Resources/mipmap-xxxhdpi/icon.png new file mode 100644 index 0000000..d0597f0 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/mipmap-xxxhdpi/icon.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png b/Source/Sketch360.XPlat.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png new file mode 100644 index 0000000..aef3e77 Binary files /dev/null and b/Source/Sketch360.XPlat.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png differ diff --git a/Source/Sketch360.XPlat.Android/Resources/values/colors.xml b/Source/Sketch360.XPlat.Android/Resources/values/colors.xml new file mode 100644 index 0000000..d9f6e0b --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Resources/values/colors.xml @@ -0,0 +1,7 @@ + + + #FFFFFF + #3F51B5 + #303F9F + #FF4081 + diff --git a/Source/Sketch360.XPlat.Android/Resources/values/styles.xml b/Source/Sketch360.XPlat.Android/Resources/values/styles.xml new file mode 100644 index 0000000..17a2eb0 --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Resources/values/styles.xml @@ -0,0 +1,30 @@ + + + + + + + + + diff --git a/Source/Sketch360.XPlat.Android/Sketch360.XPlat.Android.csproj b/Source/Sketch360.XPlat.Android/Sketch360.XPlat.Android.csproj new file mode 100644 index 0000000..5ebe8b5 --- /dev/null +++ b/Source/Sketch360.XPlat.Android/Sketch360.XPlat.Android.csproj @@ -0,0 +1,271 @@ + + + + Debug + AnyCPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6} + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {c9e5eea5-ca05-42a1-839b-61506e0a37df} + Library + Sketch360.XPlat.Droid + Sketch360.XPlat.Android + True + Resources\Resource.designer.cs + Resource + Properties\AndroidManifest.xml + Resources + Assets + false + v10.0 + true + true + Xamarin.Android.Net.AndroidClientHandler + + + 8.0 + + + true + portable + false + bin\Debug + DEBUG; + prompt + 4 + None + + + + true + portable + true + bin\Release + prompt + 4 + true + false + armeabi-v7a;x86_64;arm64-v8a + false + + + + + + + + + + + + + 3.4.3 + + + 3.4.3 + + + 3.3.1 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 0.8.0 + + + 2.80.2 + + + 28.0.0.3 + + + 0.0.3.4 + + + + + + 4.8.0.1560 + + + + + + + + + + + + True + True + AndroidResources.resx + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:UpdateGeneratedFiles + + + + + {DA1D6F34-3FD1-4842-8FBF-D73F820D04FC} + Sketch360.XPlat + + + + + Assets\babylon.gui.js + + + Assets\spherical.css + + + Assets\spherical.gui.js + + + Assets\spherical.html + + + Assets\spherical.js + + + Assets\TiltRotate.png + + + + + + PublicResXFileCodeGenerator + AndroidResources.Designer.cs + + + + + MSBuild:UpdateGeneratedFiles + + + + + + + + + + + + + + + + + + + + + + + MSBuild:UpdateGeneratedFiles + + + + + MSBuild:UpdateGeneratedFiles + + + + + + + + + + + + + + + + + + + + Assets\babylon.4.1.gui.js + + + Assets\babylon.4.1.js + + + + + + + + MSBuild:UpdateGeneratedFiles + + + + + Assets\about.html + + + + + Assets\EquirectangularGrid.png + + + + + Assets\garage.png + + + + + Assets\ui.png + + + + + Assets\about.css + + + + + Assets\about.js + + + + + Assets\grid.jpg + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.Android/ZoomableScrollViewRenderer.cs b/Source/Sketch360.XPlat.Android/ZoomableScrollViewRenderer.cs new file mode 100644 index 0000000..78fd6cb --- /dev/null +++ b/Source/Sketch360.XPlat.Android/ZoomableScrollViewRenderer.cs @@ -0,0 +1,72 @@ +using Android.Content; +using Android.Widget; +using Sketch360.XPlat; +using System; +using Xamarin.Forms; +using Xamarin.Forms.Platform.Android; + +[assembly: ExportRenderer( + typeof(ZoomableScrollView), + typeof(Sketch360.XPlat.Droid.ZoomableScrollViewerRenderer))] + +namespace Sketch360.XPlat.Droid +{ + /// + /// ZoomableScrollView UWP Renderer + /// + public class ZoomableScrollViewerRenderer : ScrollViewRenderer + { + public ZoomableScrollViewerRenderer(Context context) : + base(context) + { + + } + #region Methods + /// + /// On element changed + /// + /// the element changed event arguments + protected override void OnElementChanged(VisualElementChangedEventArgs e) + { + if (e == null) throw new ArgumentNullException(nameof(e)); + + base.OnElementChanged(e); + + if (e.OldElement != null) + { + e.OldElement.PropertyChanged -= NewElement_PropertyChanged; + } + + if (e.NewElement != null) + { + if (e.NewElement is IZoomableScrollView zoomable) + { + e.NewElement.PropertyChanged += NewElement_PropertyChanged; + + UpdateZoomMode(zoomable); + } + } + } + #endregion + + #region Implementation + private void NewElement_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == nameof(IZoomableScrollView.IsZoomEnabled)) + { + UpdateZoomMode(sender as IZoomableScrollView); + } + } + + private void UpdateZoomMode(IZoomableScrollView zoomableScrollView) + { + if (zoomableScrollView.IsZoomEnabled) + { + } + else + { + } + } + #endregion + } +} diff --git a/Source/Sketch360.XPlat.Android/environment.txt.txt b/Source/Sketch360.XPlat.Android/environment.txt.txt new file mode 100644 index 0000000..6edcea0 --- /dev/null +++ b/Source/Sketch360.XPlat.Android/environment.txt.txt @@ -0,0 +1 @@ +MONO_LOG_LEVEL=error \ No newline at end of file diff --git a/Source/Sketch360.XPlat.UWP/App.xaml b/Source/Sketch360.XPlat.UWP/App.xaml new file mode 100644 index 0000000..86507ae --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/Source/Sketch360.XPlat.UWP/App.xaml.cs b/Source/Sketch360.XPlat.UWP/App.xaml.cs new file mode 100644 index 0000000..8df6092 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/App.xaml.cs @@ -0,0 +1,90 @@ +using System; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Navigation; + +namespace Sketch360.XPlat.UWP +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + sealed partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + this.Suspending += OnSuspending; + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs e) + { + if (e == null) throw new ArgumentNullException(nameof(e)); + + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (!(Window.Current.Content is Frame rootFrame)) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + rootFrame.NavigationFailed += OnNavigationFailed; + + Xamarin.Forms.Forms.Init(e); + + if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) + { + //TODO: Load state from previously suspended application + } + + // Place the frame in the current Window + Window.Current.Content = rootFrame; + } + + if (rootFrame.Content == null) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame.Navigate(typeof(MainPage), e.Arguments); + } + // Ensure the current window is active + Window.Current.Activate(); + } + + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } + + /// + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// + /// The source of the suspend request. + /// Details about the suspend request. + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + //TODO: Save application state and stop any background activity + deferral.Complete(); + } + } +} diff --git a/Source/Sketch360.XPlat.UWP/Assets/LargeTile.scale-100.png b/Source/Sketch360.XPlat.UWP/Assets/LargeTile.scale-100.png new file mode 100644 index 0000000..c3e93b0 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/LargeTile.scale-100.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/LargeTile.scale-200.png b/Source/Sketch360.XPlat.UWP/Assets/LargeTile.scale-200.png new file mode 100644 index 0000000..2709372 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/LargeTile.scale-200.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/LargeTile.scale-400.png b/Source/Sketch360.XPlat.UWP/Assets/LargeTile.scale-400.png new file mode 100644 index 0000000..ff03199 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/LargeTile.scale-400.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/SmallTile.scale-100.png b/Source/Sketch360.XPlat.UWP/Assets/SmallTile.scale-100.png new file mode 100644 index 0000000..4110853 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/SmallTile.scale-100.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/SmallTile.scale-200.png b/Source/Sketch360.XPlat.UWP/Assets/SmallTile.scale-200.png new file mode 100644 index 0000000..c635095 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/SmallTile.scale-200.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/SmallTile.scale-400.png b/Source/Sketch360.XPlat.UWP/Assets/SmallTile.scale-400.png new file mode 100644 index 0000000..e28c052 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/SmallTile.scale-400.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/SplashScreen.scale-100.png b/Source/Sketch360.XPlat.UWP/Assets/SplashScreen.scale-100.png new file mode 100644 index 0000000..eacdf20 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/SplashScreen.scale-100.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/SplashScreen.scale-200.png b/Source/Sketch360.XPlat.UWP/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000..caa5fc9 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/SplashScreen.scale-200.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/SplashScreen.scale-400.png b/Source/Sketch360.XPlat.UWP/Assets/SplashScreen.scale-400.png new file mode 100644 index 0000000..16d9784 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/SplashScreen.scale-400.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square150x150Logo.scale-100.png b/Source/Sketch360.XPlat.UWP/Assets/Square150x150Logo.scale-100.png new file mode 100644 index 0000000..c1709f2 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square150x150Logo.scale-100.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square150x150Logo.scale-200.png b/Source/Sketch360.XPlat.UWP/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..48732ff Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square150x150Logo.scale-200.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square150x150Logo.scale-400.png b/Source/Sketch360.XPlat.UWP/Assets/Square150x150Logo.scale-400.png new file mode 100644 index 0000000..95456be Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square150x150Logo.scale-400.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png new file mode 100644 index 0000000..0c6fd15 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png new file mode 100644 index 0000000..6635c80 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png new file mode 100644 index 0000000..ee58ea6 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.scale-100.png b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.scale-100.png new file mode 100644 index 0000000..06fc87c Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.scale-100.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.scale-200.png b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..eaf2757 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.scale-200.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.scale-400.png b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.scale-400.png new file mode 100644 index 0000000..8a4ee54 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.scale-400.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.targetsize-16.png b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.targetsize-16.png new file mode 100644 index 0000000..0c6fd15 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.targetsize-16.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.targetsize-256.png b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.targetsize-256.png new file mode 100644 index 0000000..6635c80 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.targetsize-256.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.targetsize-48.png b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.targetsize-48.png new file mode 100644 index 0000000..ee58ea6 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Square44x44Logo.targetsize-48.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.backup.png b/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.backup.png new file mode 100644 index 0000000..a197aaf Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.backup.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.scale-100.png b/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.scale-100.png new file mode 100644 index 0000000..4fbbc70 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.scale-100.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.scale-200.png b/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.scale-200.png new file mode 100644 index 0000000..29db501 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.scale-200.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.scale-400.png b/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.scale-400.png new file mode 100644 index 0000000..383ad6e Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/StoreLogo.scale-400.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Wide310x150Logo.scale-100.png b/Source/Sketch360.XPlat.UWP/Assets/Wide310x150Logo.scale-100.png new file mode 100644 index 0000000..476954a Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Wide310x150Logo.scale-100.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Wide310x150Logo.scale-200.png b/Source/Sketch360.XPlat.UWP/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..eacdf20 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Wide310x150Logo.scale-200.png differ diff --git a/Source/Sketch360.XPlat.UWP/Assets/Wide310x150Logo.scale-400.png b/Source/Sketch360.XPlat.UWP/Assets/Wide310x150Logo.scale-400.png new file mode 100644 index 0000000..caa5fc9 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Assets/Wide310x150Logo.scale-400.png differ diff --git a/Source/Sketch360.XPlat.UWP/BaseUrl.cs b/Source/Sketch360.XPlat.UWP/BaseUrl.cs new file mode 100644 index 0000000..c7a6417 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/BaseUrl.cs @@ -0,0 +1,32 @@ +using System.IO; +using Xamarin.Forms; + +[assembly: Dependency(typeof(Sketch360.XPlat.UWP.BaseUrl))] + +namespace Sketch360.XPlat.UWP +{ + /// + /// UWP Base URL + /// + public class BaseUrl : IBaseUrl + { + /// + /// Gets an appx package url scheme + /// + /// an appx url scheme + public string GetBase() + { + return "ms-appx-web:///html/"; + } + + /// + /// Gets the drawable image stream for UWP. + /// + /// the filename + /// a image stream + public Stream GetDrawableImageStream(string filename) + { + throw new System.NotImplementedException(); + } + } +} diff --git a/Source/Sketch360.XPlat.UWP/Equirectangular Grid.png b/Source/Sketch360.XPlat.UWP/Equirectangular Grid.png new file mode 100644 index 0000000..0cfefc6 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/Equirectangular Grid.png differ diff --git a/Source/Sketch360.XPlat.UWP/InkCanvasViewRenderer.cs b/Source/Sketch360.XPlat.UWP/InkCanvasViewRenderer.cs new file mode 100644 index 0000000..dc61ebd --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/InkCanvasViewRenderer.cs @@ -0,0 +1,71 @@ +using System; +using Xamarin.Forms.Inking.Views; +using Xamarin.Forms.Platform.UWP; + +[assembly: ExportRenderer( + typeof(InkCanvasView), + typeof(Sketch360.XPlat.UWP.InkCanvasViewRenderer))] + +namespace Sketch360.XPlat.UWP +{ + /// + /// UWP InkCanvasView renderer using the native UWP InkCanvas + /// + public class InkCanvasViewRenderer : ViewRenderer + { + #region Methods + /// + /// Create the UWP InkCanvas + /// + /// the element changed event arguments + protected override void OnElementChanged(ElementChangedEventArgs e) + { + if (e == null) throw new ArgumentNullException(nameof(e)); + + base.OnElementChanged(e); + + if (e.OldElement != null) + { + Control.InkCanvas.InkPresenter.StrokesCollected -= InkPresenter_StrokesCollected; + Control.InkCanvas.InkPresenter.StrokesErased -= InkPresenter_StrokesErased; + } + + if (e.NewElement != null) + { + if (Control == null) + { + var scrollingInkCanvas = new ScrollingInkCanvas(); + + scrollingInkCanvas.InkCanvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Pen | Windows.UI.Core.CoreInputDeviceTypes.Touch | Windows.UI.Core.CoreInputDeviceTypes.Mouse; + scrollingInkCanvas.InkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected; + scrollingInkCanvas.InkCanvas.InkPresenter.StrokesErased += InkPresenter_StrokesErased; + + SetNativeControl(scrollingInkCanvas); + + if (e.NewElement.InkPresenter is UWPInkPresenter uwp) + { + uwp.InkCanvas = scrollingInkCanvas.InkCanvas; + } + } + } + } + #endregion + + #region Implementation + + private void InkPresenter_StrokesErased(Windows.UI.Input.Inking.InkPresenter sender, Windows.UI.Input.Inking.InkStrokesErasedEventArgs args) + { + var strokes = args.Strokes.ToXInkStrokeList(); + + Element.InkPresenter.TriggerStrokesErased(strokes); + } + + private void InkPresenter_StrokesCollected(Windows.UI.Input.Inking.InkPresenter sender, Windows.UI.Input.Inking.InkStrokesCollectedEventArgs args) + { + var strokes = args.Strokes.ToXInkStrokeList(); + + Element.InkPresenter.TriggerStrokesCollected(strokes); + } + #endregion + } +} diff --git a/Source/Sketch360.XPlat.UWP/MainPage.xaml b/Source/Sketch360.XPlat.UWP/MainPage.xaml new file mode 100644 index 0000000..eba2bfd --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/MainPage.xaml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.UWP/MainPage.xaml.cs b/Source/Sketch360.XPlat.UWP/MainPage.xaml.cs new file mode 100644 index 0000000..32347e6 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/MainPage.xaml.cs @@ -0,0 +1,21 @@ +namespace Sketch360.XPlat.UWP +{ + /// + /// Xamarin Forms MainPage class + /// + public sealed partial class MainPage + { + /// + /// Initializes a new instance of the MainPage class. + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "")] + public MainPage() + { + this.InitializeComponent(); + + var app = new Sketch360.XPlat.App(); + + LoadApplication(app); + } + } +} diff --git a/Source/Sketch360.XPlat.UWP/Package.appxmanifest b/Source/Sketch360.XPlat.UWP/Package.appxmanifest new file mode 100644 index 0000000..389a6a6 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/Package.appxmanifest @@ -0,0 +1,55 @@ + + + + + + + + + + Sketch360.XPlat.UWP + 110fce08-04b0-4755-a169-63d8e7b7b04b + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.UWP/Properties/AssemblyInfo.cs b/Source/Sketch360.XPlat.UWP/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1bd110b --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/Properties/AssemblyInfo.cs @@ -0,0 +1,31 @@ +using System.Resources; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Sketch 360")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Garage")] +[assembly: AssemblyProduct("Sketch360.XPlat.UWP")] +[assembly: AssemblyCopyright("Copyright © Microsoft Copr. 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: ComVisible(false)] +[assembly: NeutralResourcesLanguage("en-US")] diff --git a/Source/Sketch360.XPlat.UWP/Properties/Default.rd.xml b/Source/Sketch360.XPlat.UWP/Properties/Default.rd.xml new file mode 100644 index 0000000..7c40ffe --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/Properties/Default.rd.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.UWP/ScrollingInkCanvas.xaml b/Source/Sketch360.XPlat.UWP/ScrollingInkCanvas.xaml new file mode 100644 index 0000000..5b15334 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/ScrollingInkCanvas.xaml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + diff --git a/Source/Sketch360.XPlat.UWP/ScrollingInkCanvas.xaml.cs b/Source/Sketch360.XPlat.UWP/ScrollingInkCanvas.xaml.cs new file mode 100644 index 0000000..0f371dd --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/ScrollingInkCanvas.xaml.cs @@ -0,0 +1,23 @@ +using Windows.UI.Xaml.Controls; + +namespace Sketch360.XPlat.UWP +{ + /// + /// Scrolling ink canvas + /// + public sealed partial class ScrollingInkCanvas : UserControl + { + /// + /// Initializes a new instance of the ScrollingInkCanvas class. + /// + public ScrollingInkCanvas() + { + this.InitializeComponent(); + } + + /// + /// Gets the ink canvas + /// + public InkCanvas InkCanvas => InkCanvasControl; + } +} diff --git a/Source/Sketch360.XPlat.UWP/Services/HingeService.cs b/Source/Sketch360.XPlat.UWP/Services/HingeService.cs new file mode 100644 index 0000000..78f7ee4 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/Services/HingeService.cs @@ -0,0 +1,28 @@ +using System; +using System.ComponentModel; +using Xamarin.Duo.Forms.Samples; +using Xamarin.Forms; + +[assembly: Dependency(typeof(Sketch360.XPlat.UWP.Services.HingeService))] + +namespace Sketch360.XPlat.UWP.Services +{ + public sealed class HingeService : IHingeService + { + public bool IsSpanned => false; + + public bool IsLandscape => true; + + public event EventHandler OnHingeUpdated; + public event PropertyChangedEventHandler PropertyChanged; + + public void Dispose() + { + } + + public Rectangle GetHinge() + { + return Rectangle.Zero; + } + } +} diff --git a/Source/Sketch360.XPlat.UWP/Services/LayoutService.cs b/Source/Sketch360.XPlat.UWP/Services/LayoutService.cs new file mode 100644 index 0000000..047b237 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/Services/LayoutService.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using Xamarin.Duo.Forms.Samples; +using Xamarin.Forms; + +[assembly: Dependency(typeof(Sketch360.XPlat.UWP.Services.LayoutService))] + +namespace Sketch360.XPlat.UWP.Services +{ + public sealed class LayoutService : ILayoutService + { + private readonly Dictionary _layoutGuides = new Dictionary(); + + public IReadOnlyDictionary LayoutGuides => _layoutGuides; + + public event EventHandler LayoutGuideChanged; + + public void AddLayoutGuide(string name, Rectangle location) + { + } + + public Point? GetLocationOnScreen(VisualElement visualElement) + { + return null; + } + } +} diff --git a/Source/Sketch360.XPlat.UWP/Sketch360.XPlat.UWP.GeneratedMSBuildEditorConfig.editorconfig b/Source/Sketch360.XPlat.UWP/Sketch360.XPlat.UWP.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..4e34004 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/Sketch360.XPlat.UWP.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,36 @@ +is_global = true +build_property.TargetFramework = +build_property.TargetFramework = +build_property.TargetFramework = +build_property.TargetFramework = +build_property.TargetFramework = +build_property.TargetPlatformMinVersion = 10.0.17134.0 +build_property.TargetPlatformMinVersion = 10.0.17134.0 +build_property.TargetPlatformMinVersion = 10.0.17134.0 +build_property.TargetPlatformMinVersion = 10.0.17134.0 +build_property.TargetPlatformMinVersion = 10.0.17134.0 +build_property.UsingMicrosoftNETSdkWeb = +build_property.UsingMicrosoftNETSdkWeb = +build_property.UsingMicrosoftNETSdkWeb = +build_property.UsingMicrosoftNETSdkWeb = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} +build_property.ProjectTypeGuids = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} +build_property.ProjectTypeGuids = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} +build_property.ProjectTypeGuids = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} +build_property.ProjectTypeGuids = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} +build_property.PublishSingleFile = +build_property.PublishSingleFile = +build_property.PublishSingleFile = +build_property.PublishSingleFile = +build_property.PublishSingleFile = +build_property.IncludeAllContentForSelfExtract = +build_property.IncludeAllContentForSelfExtract = +build_property.IncludeAllContentForSelfExtract = +build_property.IncludeAllContentForSelfExtract = +build_property.IncludeAllContentForSelfExtract = +build_property._SupportedPlatformList = +build_property._SupportedPlatformList = +build_property._SupportedPlatformList = +build_property._SupportedPlatformList = +build_property._SupportedPlatformList = diff --git a/Source/Sketch360.XPlat.UWP/Sketch360.XPlat.UWP.csproj b/Source/Sketch360.XPlat.UWP/Sketch360.XPlat.UWP.csproj new file mode 100644 index 0000000..712a59a --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/Sketch360.XPlat.UWP.csproj @@ -0,0 +1,258 @@ + + + + + Debug + x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664} + AppContainerExe + Properties + Sketch360.XPlat.UWP + Sketch360.XPlat.UWP + en-US + UAP + 10.0.18362.0 + 10.0.17134.0 + 14 + true + 512 + {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + false + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + ARM + false + prompt + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + ARM + false + prompt + true + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x64 + false + prompt + true + + + bin\x64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x64 + false + prompt + true + true + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x86 + false + prompt + true + bin\x86\Debug\Sketch360.XPlat.UWP.XML + + + bin\x86\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x86 + false + prompt + true + true + + + + App.xaml + + + + + MainPage.xaml + + + + ScrollingInkCanvas.xaml + + + + + + + + + Designer + + + + + BackButton.png + + + DrawButton.png + + + DrawingViewButton.png + + + DrawingViewCarousel.png + + + EraserButton.png + + + FrontBackButton.png + + + LeftRightButton.png + + + MenuButton.png + + + PaletteButton.png + + + PanZoomButton.png + + + PenSizeButton.png + + + RedoButton.png + + + SphericalViewCarousel.png + + + StencilButton.png + + + TouchDrawing.png + + + UndoButton.png + + + VerticalLinesButton.png + + + View360Button.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + + + 3.3.1 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 1.25.0 + + + + + + 4.8.0.1560 + + + + + {DA1D6F34-3FD1-4842-8FBF-D73F820D04FC} + Sketch360.XPlat + + + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD} + Xamarin.Forms.Inking + + + + + + + 14.0 + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.UWP/UWPInkExtensions.cs b/Source/Sketch360.XPlat.UWP/UWPInkExtensions.cs new file mode 100644 index 0000000..d369917 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/UWPInkExtensions.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Numerics; +using Windows.Foundation; +using Windows.UI.Input.Inking; +using Xamarin.Forms.Inking; +using Xamarin.Forms.Platform.UWP; + +namespace Sketch360.XPlat.UWP +{ + /// + /// Extensions to convert between UWP Inking and Xamarin.Forms.Inking classes + /// + public static class UWPInkExtensions + { + /// + /// Convert a UWP InkStroke list to a XInkStroke List + /// + /// a collection of UWP ink strokes + /// a collection of Xamarin Ink strokes + public static IReadOnlyList ToXInkStrokeList(this IEnumerable strokes) + { + var xInkStrokes = from stroke in strokes + let attributes = stroke.DrawingAttributes + let points = stroke.GetInkPoints() + select new XInkStroke + { + DrawingAttributes = attributes.ToXInkDrawingAttributes(), + Id = stroke.Id.ToString(CultureInfo.InvariantCulture), + Points = (from point in points + select new XInkPoint + { + Position = new Xamarin.Forms.Point(point.Position.X, point.Position.Y), + Pressure = point.Pressure, + Timestamp = point.Timestamp, + TiltX = point.TiltX, + TiltY = point.TiltY + }).ToList() + }; + + return xInkStrokes.ToList(); + } + + /// + /// Convert a Xamarin Ink Stroke to a UWP InkStroke + /// + /// a Xamarin Ink Stroke + /// a UWP Ink Stroke + public static InkStroke ToInkStroke(this XInkStroke xInkStroke) + { + if (xInkStroke == null) throw new ArgumentNullException(nameof(xInkStroke)); + + var builder = new InkStrokeBuilder(); + + var inkPoints = from item in xInkStroke.GetInkPoints() + select new InkPoint(new Point(item.Position.X, item.Position.Y), item.Pressure); + + if (!inkPoints.Any()) + { + return null; + } + + var stroke = builder.CreateStrokeFromInkPoints(inkPoints, Matrix3x2.Identity); + + stroke.DrawingAttributes = xInkStroke.DrawingAttributes.ToInkDrawingAttributes(); + + return stroke; + } + + + /// + /// Convert a UWP ink drawing attributes to Xamarin + /// + /// a UWP ink drawing attributes + /// a Xamarin ink drawing attributes + public static XInkDrawingAttributes ToXInkDrawingAttributes(this InkDrawingAttributes attributes) + { + if (attributes == null) throw new ArgumentNullException(nameof(attributes)); + + return new XInkDrawingAttributes + { + Color = attributes.Color.ToFormsColor(), + IgnorePressure = attributes.IgnorePressure, + Kind = attributes.Kind == Windows.UI.Input.Inking.InkDrawingAttributesKind.Default ? XInkDrawingAttributesKind.Default : XInkDrawingAttributesKind.Pencil, + PenTip = attributes.PenTip == Windows.UI.Input.Inking.PenTipShape.Circle ? XPenTipShape.Circle : XPenTipShape.Rectangle, + Size = Convert.ToSingle(attributes.Size.Height) + }; + } + + /// + /// Convert a Xamarin Ink drawing attributes to UWP + /// + /// Xamarin Ink Drawing attributes + /// Xamarin ink drawing attributes + public static InkDrawingAttributes ToInkDrawingAttributes(this XInkDrawingAttributes attributes) + { + if (attributes == null) throw new ArgumentNullException(nameof(attributes)); + + InkDrawingAttributes attributes2; + + if (attributes.Kind == XInkDrawingAttributesKind.Pencil) + { + attributes2 = InkDrawingAttributes.CreateForPencil(); + } + else + { + attributes2 = new InkDrawingAttributes(); + } + + attributes2.Color = attributes.Color.ToWindowsColor(); + attributes2.IgnorePressure = attributes.IgnorePressure; + attributes2.Size = new Windows.Foundation.Size(Convert.ToDouble(attributes.Size), Convert.ToDouble(attributes.Size)); + attributes2.PenTip = attributes.PenTip == XPenTipShape.Circle ? PenTipShape.Circle : PenTipShape.Rectangle; + + return attributes2; + } + } +} diff --git a/Source/Sketch360.XPlat.UWP/UWPInkPresenter.cs b/Source/Sketch360.XPlat.UWP/UWPInkPresenter.cs new file mode 100644 index 0000000..c76cf88 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/UWPInkPresenter.cs @@ -0,0 +1,124 @@ +using Sketch360.XPlat.UWP; +using System; +using System.Collections.Generic; +using System.Linq; +using Windows.UI.Xaml.Controls; +using Xamarin.Forms.Inking; +using Xamarin.Forms.Inking.Interfaces; +using Xamarin.Forms.Inking.Support; + +[assembly: Xamarin.Forms.Dependency(typeof(UWPInkPresenter))] + +namespace Sketch360.XPlat.UWP +{ + /// + /// UWP InkPresenter + /// + public class UWPInkPresenter : IInkPresenter + { + private InkCanvas _inkCanvas; + + /// + /// Initializes a new instance of the UWPInkPresenter class + /// + public UWPInkPresenter() + { + InputProcessingConfiguration = new XInkInputProcessingConfiguration(); + + StrokeContainer = new UWPInkStrokeContainer(); + } + + /// + /// Gets or sets the ink canvas + /// + public InkCanvas InkCanvas + { + get => _inkCanvas; + + set + { + _inkCanvas = value; + + (StrokeContainer as UWPInkStrokeContainer).NativeStrokeContainer = _inkCanvas.InkPresenter.StrokeContainer; + } + } + + /// + /// Gets or sets the stroke container + /// + public Xamarin.Forms.Inking.Interfaces.IInkStrokeContainer StrokeContainer { get; set; } + + /// + /// Gets or sets the input device types + /// + public XCoreInputDeviceTypes InputDeviceTypes { get; set; } + + /// + /// Gets the ink input processing configuration + /// + public XInkInputProcessingConfiguration InputProcessingConfiguration { get; } + + /// + /// Gets or sets the unprocessed input + /// + public XInkUnprocessedInput UnprocessedInput => throw new NotImplementedException(); + + /// + /// Gets or sets the wet stroke update source + /// + public XCoreWetStrokeUpdateSource WetStrokeUpdateSource { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + /// + /// strokes collected event handler + /// + public event TypedEventHandler StrokesCollected; + + /// + /// Strokes erased event handler; + /// + public event TypedEventHandler StrokesErased; + + /// + /// Copy the default drawing attributes + /// + /// + public XInkDrawingAttributes CopyDefaultDrawingAttributes() + { + var attributes = InkCanvas.InkPresenter.CopyDefaultDrawingAttributes(); + + return attributes.ToXInkDrawingAttributes(); + } + + /// + /// Trigger the strokes collected event + /// + /// the strokes + public void TriggerStrokesCollected(IEnumerable strokes) + { + StrokesCollected?.Invoke(this, new XInkStrokesCollectedEventArgs + { + Strokes = strokes.ToList() + }); + } + + /// + /// Trigger the strokes erased event + /// + /// the strokes + public void TriggerStrokesErased(IReadOnlyList list) + { + throw new NotImplementedException(); + } + + /// + /// Updates the default drawing attributes + /// + /// the ink drawing attributes + public void UpdateDefaultDrawingAttributes(XInkDrawingAttributes attributes) + { + var attributes2 = attributes.ToInkDrawingAttributes(); + + InkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(attributes2); + } + } +} diff --git a/Source/Sketch360.XPlat.UWP/UWPInkStrokeContainer.cs b/Source/Sketch360.XPlat.UWP/UWPInkStrokeContainer.cs new file mode 100644 index 0000000..43e9645 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/UWPInkStrokeContainer.cs @@ -0,0 +1,175 @@ + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using Windows.UI.Input.Inking; +using Xamarin.Forms.Inking; + +[assembly: Xamarin.Forms.Dependency(typeof(Sketch360.XPlat.UWP.UWPInkStrokeContainer))] + + +namespace Sketch360.XPlat.UWP +{ + /// + /// UWP Ink Stroke Container + /// + public sealed class UWPInkStrokeContainer : Xamarin.Forms.Inking.Interfaces.IInkStrokeContainer + { + /// + /// ink changed event + /// + public event EventHandler InkChanged; + + /// + /// the native UWP stroke container + /// + public IInkStrokeContainer NativeStrokeContainer { get; set; } + + /// + /// Add a stroke + /// + /// the ink stroke to add + public void Add(XInkStroke inkStroke) + { + var newStroke = inkStroke.ToInkStroke(); + + if (newStroke == null) return; + + NativeStrokeContainer.AddStroke(newStroke); + + InkChanged?.Invoke(this, new EventArgs()); + } + + /// + /// Add a collection of ink strokes + /// + /// the ink strokes to add + public void Add(IEnumerable strokes) + { + AddStrokes(strokes); + + InkChanged?.Invoke(this, new EventArgs()); + } + + /// + /// Add a collection of strokes. + /// + /// the strokes to add + private void AddStrokes(IEnumerable strokes) + { + if (strokes == null) throw new ArgumentNullException(nameof(strokes)); + + var strokesToAdd = from item in strokes + let newStroke = item.ToInkStroke() + where newStroke != null + select newStroke; + + foreach (var item in strokesToAdd) + { + NativeStrokeContainer.AddStroke(item); + } + + InkChanged?.Invoke(this, new EventArgs()); + } + + /// + /// Clear the strokes + /// + public void Clear() + { + DeleteStrokes(); + + InkChanged?.Invoke(this, new EventArgs()); + } + + /// + /// Delete the strokes + /// + private void DeleteStrokes() + { + foreach (var item in NativeStrokeContainer.GetStrokes()) + { + item.Selected = true; + } + + NativeStrokeContainer.DeleteSelected(); + } + + /// + /// Clear the strokes + /// + public void Dispose() + { + Clear(); + InkChanged?.Invoke(this, new EventArgs()); + } + + /// + /// Get the strokes + /// + /// a read-only list of the strokes + public IReadOnlyList GetStrokes() + { + var strokes = NativeStrokeContainer.GetStrokes(); + + return strokes.ToXInkStrokeList(); + } + + /// + /// Remove an ink stroke + /// + /// the stroke to remove + public void Remove(XInkStroke item) + { + if (item == null) throw new ArgumentNullException(nameof(item)); + + foreach (var stroke in NativeStrokeContainer.GetStrokes()) + { + if (stroke.Id.ToString(CultureInfo.InvariantCulture) == item.Id) + { + stroke.Selected = true; + } + } + + NativeStrokeContainer.DeleteSelected(); + + InkChanged?.Invoke(this, new EventArgs()); + } + + /// + /// Remove the strokes + /// + /// the strokes to remove + public void Remove(IReadOnlyList strokesToRemove) + { + var ids = from item in strokesToRemove + select item.Id; + + foreach (var stroke in NativeStrokeContainer.GetStrokes()) + { + if (ids.Contains(stroke.Id.ToString(CultureInfo.InvariantCulture))) + { + stroke.Selected = true; + } + } + + NativeStrokeContainer.DeleteSelected(); + + InkChanged?.Invoke(this, new EventArgs()); + } + + /// + /// Set the strokes + /// + /// the new ink strokes + public void SetRange(IEnumerable inkStrokes) + { + DeleteStrokes(); + + AddStrokes(inkStrokes); + + InkChanged?.Invoke(this, new EventArgs()); + } + } +} diff --git a/Source/Sketch360.XPlat.UWP/ZoomableScrollViewerRenderer.cs b/Source/Sketch360.XPlat.UWP/ZoomableScrollViewerRenderer.cs new file mode 100644 index 0000000..de75723 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/ZoomableScrollViewerRenderer.cs @@ -0,0 +1,79 @@ +using System; +using Sketch360.XPlat; +using Windows.UI; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Media; +using Xamarin.Forms; +using Xamarin.Forms.Platform.UWP; + + +[assembly: ExportRenderer( + typeof(ZoomableScrollView), + typeof(Sketch360.XPlat.UWP.ZoomableScrollViewerRenderer))] + +namespace Sketch360.XPlat.UWP +{ + /// + /// ZoomableScrollView UWP Renderer + /// + public class ZoomableScrollViewerRenderer : ScrollViewRenderer + { + #region Methods + /// + /// On element changed + /// + /// the element changed event arguments + protected override void OnElementChanged(ElementChangedEventArgs e) + { + if (e == null) throw new ArgumentNullException(nameof(e)); + + base.OnElementChanged(e); + + if (e.OldElement != null) + { + e.OldElement.PropertyChanged -= NewElement_PropertyChanged; + } + + if (e.NewElement != null) + { + if (e.NewElement is IZoomableScrollView zoomable) + { + e.NewElement.PropertyChanged += NewElement_PropertyChanged; + + UpdateZoomMode(zoomable); + } + } + } + #endregion + + #region Implementation + private void NewElement_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == nameof(IZoomableScrollView.IsZoomEnabled)) + { + UpdateZoomMode(sender as IZoomableScrollView); + } + } + + private void UpdateZoomMode(IZoomableScrollView zoomableScrollView) + { + if (zoomableScrollView.IsZoomEnabled) + { + Control.ZoomMode = ZoomMode.Enabled; + + ScrollViewer.SetHorizontalScrollMode(Control, Windows.UI.Xaml.Controls.ScrollMode.Auto); + ScrollViewer.SetVerticalScrollMode(Control, Windows.UI.Xaml.Controls.ScrollMode.Auto); + Control.VerticalScrollBarVisibility = Windows.UI.Xaml.Controls.ScrollBarVisibility.Auto; + Control.HorizontalScrollBarVisibility = Windows.UI.Xaml.Controls.ScrollBarVisibility.Auto; + + Control.MinZoomFactor = 0.1f; + Control.MaxZoomFactor = 20.0f; + } + else + { + Control.ZoomMode = ZoomMode.Disabled; + } + } + #endregion + } +} diff --git a/Source/Sketch360.XPlat.UWP/html/TiltRotate.png b/Source/Sketch360.XPlat.UWP/html/TiltRotate.png new file mode 100644 index 0000000..41c5cef Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/html/TiltRotate.png differ diff --git a/Source/Sketch360.XPlat.UWP/html/babylon.3.3.js b/Source/Sketch360.XPlat.UWP/html/babylon.3.3.js new file mode 100644 index 0000000..5bed08c --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/html/babylon.3.3.js @@ -0,0 +1,118116 @@ + + +(function universalModuleDefinition(root, factory) { + var amdDependencies = []; + var CANNON = root.CANNON || this.CANNON; + var OIMO = root.OIMO || this.OIMO; + var earcut = root.earcut || this.earcut; + if(typeof exports === 'object' && typeof module === 'object') { + try { CANNON = CANNON || require("cannon"); } catch(e) {} + try { OIMO = OIMO || require("oimo"); } catch(e) {} + try { earcut = earcut || require("earcut"); } catch(e) {} + + module.exports = factory(CANNON,OIMO,earcut); + } else if(typeof define === 'function' && define.amd) { + if(require.specified && require.specified("cannon")) amdDependencies.push("cannon"); + if(require.specified && require.specified("oimo")) amdDependencies.push("oimo"); + if(require.specified && require.specified("earcut")) amdDependencies.push("earcut"); + + define("babylonjs", amdDependencies, factory); + } else if(typeof exports === 'object') { + try { CANNON = CANNON || require("cannon"); } catch(e) {} + try { OIMO = OIMO || require("oimo"); } catch(e) {} + try { earcut = earcut || require("earcut"); } catch(e) {} + + exports["babylonjs"] = factory(CANNON,OIMO,earcut); + } else { + root["BABYLON"] = factory(CANNON,OIMO,earcut); + } +})(this, function(CANNON,OIMO,earcut) { + CANNON = CANNON || this.CANNON; + OIMO = OIMO || this.OIMO; + earcut = earcut || this.earcut; + +var __decorate=this&&this.__decorate||function(e,t,r,c){var o,f=arguments.length,n=f<3?t:null===c?c=Object.getOwnPropertyDescriptor(t,r):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,c);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(f<3?o(n):f>3?o(t,r,n):o(t,r))||n);return f>3&&n&&Object.defineProperty(t,r,n),n}; +var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])};return function(o,n){function r(){this.constructor=o}t(o,n),o.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(); +var BABYLON; +(function (BABYLON) { + /** + * EffectFallbacks can be used to add fallbacks (properties to disable) to certain properties when desired to improve performance. + * (Eg. Start at high quality with reflection and fog, if fps is low, remove reflection, if still low remove fog) + */ + var EffectFallbacks = /** @class */ (function () { + function EffectFallbacks() { + this._defines = {}; + this._currentRank = 32; + this._maxRank = -1; + } + /** + * Removes the fallback from the bound mesh. + */ + EffectFallbacks.prototype.unBindMesh = function () { + this._mesh = null; + }; + /** + * Adds a fallback on the specified property. + * @param rank The rank of the fallback (Lower ranks will be fallbacked to first) + * @param define The name of the define in the shader + */ + EffectFallbacks.prototype.addFallback = function (rank, define) { + if (!this._defines[rank]) { + if (rank < this._currentRank) { + this._currentRank = rank; + } + if (rank > this._maxRank) { + this._maxRank = rank; + } + this._defines[rank] = new Array(); + } + this._defines[rank].push(define); + }; + /** + * Sets the mesh to use CPU skinning when needing to fallback. + * @param rank The rank of the fallback (Lower ranks will be fallbacked to first) + * @param mesh The mesh to use the fallbacks. + */ + EffectFallbacks.prototype.addCPUSkinningFallback = function (rank, mesh) { + this._mesh = mesh; + if (rank < this._currentRank) { + this._currentRank = rank; + } + if (rank > this._maxRank) { + this._maxRank = rank; + } + }; + Object.defineProperty(EffectFallbacks.prototype, "isMoreFallbacks", { + /** + * Checks to see if more fallbacks are still availible. + */ + get: function () { + return this._currentRank <= this._maxRank; + }, + enumerable: true, + configurable: true + }); + /** + * Removes the defines that shoould be removed when falling back. + * @param currentDefines defines the current define statements for the shader. + * @param effect defines the current effect we try to compile + * @returns The resulting defines with defines of the current rank removed. + */ + EffectFallbacks.prototype.reduce = function (currentDefines, effect) { + // First we try to switch to CPU skinning + if (this._mesh && this._mesh.computeBonesUsingShaders && this._mesh.numBoneInfluencers > 0 && this._mesh.material) { + this._mesh.computeBonesUsingShaders = false; + currentDefines = currentDefines.replace("#define NUM_BONE_INFLUENCERS " + this._mesh.numBoneInfluencers, "#define NUM_BONE_INFLUENCERS 0"); + effect._bonesComputationForcedToCPU = true; + var scene = this._mesh.getScene(); + for (var index = 0; index < scene.meshes.length; index++) { + var otherMesh = scene.meshes[index]; + if (!otherMesh.material) { + continue; + } + if (!otherMesh.computeBonesUsingShaders || otherMesh.numBoneInfluencers === 0) { + continue; + } + if (otherMesh.material.getEffect() === effect) { + otherMesh.computeBonesUsingShaders = false; + } + else if (otherMesh.subMeshes) { + for (var _i = 0, _a = otherMesh.subMeshes; _i < _a.length; _i++) { + var subMesh = _a[_i]; + var subMeshEffect = subMesh.effect; + if (subMeshEffect === effect) { + otherMesh.computeBonesUsingShaders = false; + break; + } + } + } + } + } + else { + var currentFallbacks = this._defines[this._currentRank]; + if (currentFallbacks) { + for (var index = 0; index < currentFallbacks.length; index++) { + currentDefines = currentDefines.replace("#define " + currentFallbacks[index], ""); + } + } + this._currentRank++; + } + return currentDefines; + }; + return EffectFallbacks; + }()); + BABYLON.EffectFallbacks = EffectFallbacks; + /** + * Options to be used when creating an effect. + */ + var EffectCreationOptions = /** @class */ (function () { + function EffectCreationOptions() { + } + return EffectCreationOptions; + }()); + BABYLON.EffectCreationOptions = EffectCreationOptions; + /** + * Effect containing vertex and fragment shader that can be executed on an object. + */ + var Effect = /** @class */ (function () { + /** + * Instantiates an effect. + * An effect can be used to create/manage/execute vertex and fragment shaders. + * @param baseName Name of the effect. + * @param attributesNamesOrOptions List of attribute names that will be passed to the shader or set of all options to create the effect. + * @param uniformsNamesOrEngine List of uniform variable names that will be passed to the shader or the engine that will be used to render effect. + * @param samplers List of sampler variables that will be passed to the shader. + * @param engine Engine to be used to render the effect + * @param defines Define statements to be added to the shader. + * @param fallbacks Possible fallbacks for this effect to improve performance when needed. + * @param onCompiled Callback that will be called when the shader is compiled. + * @param onError Callback that will be called if an error occurs during shader compilation. + * @param indexParameters Parameters to be used with Babylons include syntax to iterate over an array (eg. {lights: 10}) + */ + function Effect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, engine, defines, fallbacks, onCompiled, onError, indexParameters) { + if (samplers === void 0) { samplers = null; } + if (defines === void 0) { defines = null; } + if (fallbacks === void 0) { fallbacks = null; } + if (onCompiled === void 0) { onCompiled = null; } + if (onError === void 0) { onError = null; } + var _this = this; + /** + * Unique ID of the effect. + */ + this.uniqueId = 0; + /** + * Observable that will be called when the shader is compiled. + */ + this.onCompileObservable = new BABYLON.Observable(); + /** + * Observable that will be called if an error occurs during shader compilation. + */ + this.onErrorObservable = new BABYLON.Observable(); + /** @hidden */ + this._bonesComputationForcedToCPU = false; + this._uniformBuffersNames = {}; + this._isReady = false; + this._compilationError = ""; + this.name = baseName; + if (attributesNamesOrOptions.attributes) { + var options = attributesNamesOrOptions; + this._engine = uniformsNamesOrEngine; + this._attributesNames = options.attributes; + this._uniformsNames = options.uniformsNames.concat(options.samplers); + this._samplers = options.samplers.slice(); + this.defines = options.defines; + this.onError = options.onError; + this.onCompiled = options.onCompiled; + this._fallbacks = options.fallbacks; + this._indexParameters = options.indexParameters; + this._transformFeedbackVaryings = options.transformFeedbackVaryings; + if (options.uniformBuffersNames) { + for (var i = 0; i < options.uniformBuffersNames.length; i++) { + this._uniformBuffersNames[options.uniformBuffersNames[i]] = i; + } + } + } + else { + this._engine = engine; + this.defines = defines; + this._uniformsNames = uniformsNamesOrEngine.concat(samplers); + this._samplers = samplers ? samplers.slice() : []; + this._attributesNames = attributesNamesOrOptions; + this.onError = onError; + this.onCompiled = onCompiled; + this._indexParameters = indexParameters; + this._fallbacks = fallbacks; + } + this.uniqueId = Effect._uniqueIdSeed++; + var vertexSource; + var fragmentSource; + if (baseName.vertexElement) { + vertexSource = document.getElementById(baseName.vertexElement); + if (!vertexSource) { + vertexSource = baseName.vertexElement; + } + } + else { + vertexSource = baseName.vertex || baseName; + } + if (baseName.fragmentElement) { + fragmentSource = document.getElementById(baseName.fragmentElement); + if (!fragmentSource) { + fragmentSource = baseName.fragmentElement; + } + } + else { + fragmentSource = baseName.fragment || baseName; + } + this._loadVertexShader(vertexSource, function (vertexCode) { + _this._processIncludes(vertexCode, function (vertexCodeWithIncludes) { + _this._processShaderConversion(vertexCodeWithIncludes, false, function (migratedVertexCode) { + _this._loadFragmentShader(fragmentSource, function (fragmentCode) { + _this._processIncludes(fragmentCode, function (fragmentCodeWithIncludes) { + _this._processShaderConversion(fragmentCodeWithIncludes, true, function (migratedFragmentCode) { + if (baseName) { + var vertex = baseName.vertexElement || baseName.vertex || baseName; + var fragment = baseName.fragmentElement || baseName.fragment || baseName; + _this._vertexSourceCode = "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; + _this._fragmentSourceCode = "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; + } + else { + _this._vertexSourceCode = migratedVertexCode; + _this._fragmentSourceCode = migratedFragmentCode; + } + _this._prepareEffect(); + }); + }); + }); + }); + }); + }); + } + Object.defineProperty(Effect.prototype, "onBindObservable", { + /** + * Observable that will be called when effect is bound. + */ + get: function () { + if (!this._onBindObservable) { + this._onBindObservable = new BABYLON.Observable(); + } + return this._onBindObservable; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Effect.prototype, "key", { + /** + * Unique key for this effect + */ + get: function () { + return this._key; + }, + enumerable: true, + configurable: true + }); + /** + * If the effect has been compiled and prepared. + * @returns if the effect is compiled and prepared. + */ + Effect.prototype.isReady = function () { + return this._isReady; + }; + /** + * The engine the effect was initialized with. + * @returns the engine. + */ + Effect.prototype.getEngine = function () { + return this._engine; + }; + /** + * The compiled webGL program for the effect + * @returns the webGL program. + */ + Effect.prototype.getProgram = function () { + return this._program; + }; + /** + * The set of names of attribute variables for the shader. + * @returns An array of attribute names. + */ + Effect.prototype.getAttributesNames = function () { + return this._attributesNames; + }; + /** + * Returns the attribute at the given index. + * @param index The index of the attribute. + * @returns The location of the attribute. + */ + Effect.prototype.getAttributeLocation = function (index) { + return this._attributes[index]; + }; + /** + * Returns the attribute based on the name of the variable. + * @param name of the attribute to look up. + * @returns the attribute location. + */ + Effect.prototype.getAttributeLocationByName = function (name) { + var index = this._attributesNames.indexOf(name); + return this._attributes[index]; + }; + /** + * The number of attributes. + * @returns the numnber of attributes. + */ + Effect.prototype.getAttributesCount = function () { + return this._attributes.length; + }; + /** + * Gets the index of a uniform variable. + * @param uniformName of the uniform to look up. + * @returns the index. + */ + Effect.prototype.getUniformIndex = function (uniformName) { + return this._uniformsNames.indexOf(uniformName); + }; + /** + * Returns the attribute based on the name of the variable. + * @param uniformName of the uniform to look up. + * @returns the location of the uniform. + */ + Effect.prototype.getUniform = function (uniformName) { + return this._uniforms[this._uniformsNames.indexOf(uniformName)]; + }; + /** + * Returns an array of sampler variable names + * @returns The array of sampler variable neames. + */ + Effect.prototype.getSamplers = function () { + return this._samplers; + }; + /** + * The error from the last compilation. + * @returns the error string. + */ + Effect.prototype.getCompilationError = function () { + return this._compilationError; + }; + /** + * Adds a callback to the onCompiled observable and call the callback imediatly if already ready. + * @param func The callback to be used. + */ + Effect.prototype.executeWhenCompiled = function (func) { + if (this.isReady()) { + func(this); + return; + } + this.onCompileObservable.add(function (effect) { + func(effect); + }); + }; + /** @hidden */ + Effect.prototype._loadVertexShader = function (vertex, callback) { + if (BABYLON.Tools.IsWindowObjectExist()) { + // DOM element ? + if (vertex instanceof HTMLElement) { + var vertexCode = BABYLON.Tools.GetDOMTextContent(vertex); + callback(vertexCode); + return; + } + } + // Base64 encoded ? + if (vertex.substr(0, 7) === "base64:") { + var vertexBinary = window.atob(vertex.substr(7)); + callback(vertexBinary); + return; + } + // Is in local store ? + if (Effect.ShadersStore[vertex + "VertexShader"]) { + callback(Effect.ShadersStore[vertex + "VertexShader"]); + return; + } + var vertexShaderUrl; + if (vertex[0] === "." || vertex[0] === "/" || vertex.indexOf("http") > -1) { + vertexShaderUrl = vertex; + } + else { + vertexShaderUrl = BABYLON.Engine.ShadersRepository + vertex; + } + // Vertex shader + this._engine._loadFile(vertexShaderUrl + ".vertex.fx", callback); + }; + /** @hidden */ + Effect.prototype._loadFragmentShader = function (fragment, callback) { + if (BABYLON.Tools.IsWindowObjectExist()) { + // DOM element ? + if (fragment instanceof HTMLElement) { + var fragmentCode = BABYLON.Tools.GetDOMTextContent(fragment); + callback(fragmentCode); + return; + } + } + // Base64 encoded ? + if (fragment.substr(0, 7) === "base64:") { + var fragmentBinary = window.atob(fragment.substr(7)); + callback(fragmentBinary); + return; + } + // Is in local store ? + if (Effect.ShadersStore[fragment + "PixelShader"]) { + callback(Effect.ShadersStore[fragment + "PixelShader"]); + return; + } + if (Effect.ShadersStore[fragment + "FragmentShader"]) { + callback(Effect.ShadersStore[fragment + "FragmentShader"]); + return; + } + var fragmentShaderUrl; + if (fragment[0] === "." || fragment[0] === "/" || fragment.indexOf("http") > -1) { + fragmentShaderUrl = fragment; + } + else { + fragmentShaderUrl = BABYLON.Engine.ShadersRepository + fragment; + } + // Fragment shader + this._engine._loadFile(fragmentShaderUrl + ".fragment.fx", callback); + }; + /** @hidden */ + Effect.prototype._dumpShadersSource = function (vertexCode, fragmentCode, defines) { + // Rebuild shaders source code + var shaderVersion = (this._engine.webGLVersion > 1) ? "#version 300 es\n#define WEBGL2 \n" : ""; + var prefix = shaderVersion + (defines ? defines + "\n" : ""); + vertexCode = prefix + vertexCode; + fragmentCode = prefix + fragmentCode; + // Number lines of shaders source code + var i = 2; + var regex = /\n/gm; + var formattedVertexCode = "\n1\t" + vertexCode.replace(regex, function () { return "\n" + (i++) + "\t"; }); + i = 2; + var formattedFragmentCode = "\n1\t" + fragmentCode.replace(regex, function () { return "\n" + (i++) + "\t"; }); + // Dump shaders name and formatted source code + if (this.name.vertexElement) { + BABYLON.Tools.Error("Vertex shader: " + this.name.vertexElement + formattedVertexCode); + BABYLON.Tools.Error("Fragment shader: " + this.name.fragmentElement + formattedFragmentCode); + } + else if (this.name.vertex) { + BABYLON.Tools.Error("Vertex shader: " + this.name.vertex + formattedVertexCode); + BABYLON.Tools.Error("Fragment shader: " + this.name.fragment + formattedFragmentCode); + } + else { + BABYLON.Tools.Error("Vertex shader: " + this.name + formattedVertexCode); + BABYLON.Tools.Error("Fragment shader: " + this.name + formattedFragmentCode); + } + }; + Effect.prototype._processShaderConversion = function (sourceCode, isFragment, callback) { + var preparedSourceCode = this._processPrecision(sourceCode); + if (this._engine.webGLVersion == 1) { + callback(preparedSourceCode); + return; + } + // Already converted + if (preparedSourceCode.indexOf("#version 3") !== -1) { + callback(preparedSourceCode.replace("#version 300 es", "")); + return; + } + var hasDrawBuffersExtension = preparedSourceCode.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1; + // Remove extensions + // #extension GL_OES_standard_derivatives : enable + // #extension GL_EXT_shader_texture_lod : enable + // #extension GL_EXT_frag_depth : enable + // #extension GL_EXT_draw_buffers : require + var regex = /#extension.+(GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g; + var result = preparedSourceCode.replace(regex, ""); + // Migrate to GLSL v300 + result = result.replace(/varying(?![\n\r])\s/g, isFragment ? "in " : "out "); + result = result.replace(/attribute[ \t]/g, "in "); + result = result.replace(/[ \t]attribute/g, " in"); + if (isFragment) { + result = result.replace(/texture2DLodEXT\s*\(/g, "textureLod("); + result = result.replace(/textureCubeLodEXT\s*\(/g, "textureLod("); + result = result.replace(/texture2D\s*\(/g, "texture("); + result = result.replace(/textureCube\s*\(/g, "texture("); + result = result.replace(/gl_FragDepthEXT/g, "gl_FragDepth"); + result = result.replace(/gl_FragColor/g, "glFragColor"); + result = result.replace(/gl_FragData/g, "glFragData"); + result = result.replace(/void\s+?main\s*\(/g, (hasDrawBuffersExtension ? "" : "out vec4 glFragColor;\n") + "void main("); + } + callback(result); + }; + Effect.prototype._processIncludes = function (sourceCode, callback) { + var _this = this; + var regex = /#include<(.+)>(\((.*)\))*(\[(.*)\])*/g; + var match = regex.exec(sourceCode); + var returnValue = new String(sourceCode); + while (match != null) { + var includeFile = match[1]; + // Uniform declaration + if (includeFile.indexOf("__decl__") !== -1) { + includeFile = includeFile.replace(/__decl__/, ""); + if (this._engine.supportsUniformBuffers) { + includeFile = includeFile.replace(/Vertex/, "Ubo"); + includeFile = includeFile.replace(/Fragment/, "Ubo"); + } + includeFile = includeFile + "Declaration"; + } + if (Effect.IncludesShadersStore[includeFile]) { + // Substitution + var includeContent = Effect.IncludesShadersStore[includeFile]; + if (match[2]) { + var splits = match[3].split(","); + for (var index = 0; index < splits.length; index += 2) { + var source = new RegExp(splits[index], "g"); + var dest = splits[index + 1]; + includeContent = includeContent.replace(source, dest); + } + } + if (match[4]) { + var indexString = match[5]; + if (indexString.indexOf("..") !== -1) { + var indexSplits = indexString.split(".."); + var minIndex = parseInt(indexSplits[0]); + var maxIndex = parseInt(indexSplits[1]); + var sourceIncludeContent = includeContent.slice(0); + includeContent = ""; + if (isNaN(maxIndex)) { + maxIndex = this._indexParameters[indexSplits[1]]; + } + for (var i = minIndex; i < maxIndex; i++) { + if (!this._engine.supportsUniformBuffers) { + // Ubo replacement + sourceIncludeContent = sourceIncludeContent.replace(/light\{X\}.(\w*)/g, function (str, p1) { + return p1 + "{X}"; + }); + } + includeContent += sourceIncludeContent.replace(/\{X\}/g, i.toString()) + "\n"; + } + } + else { + if (!this._engine.supportsUniformBuffers) { + // Ubo replacement + includeContent = includeContent.replace(/light\{X\}.(\w*)/g, function (str, p1) { + return p1 + "{X}"; + }); + } + includeContent = includeContent.replace(/\{X\}/g, indexString); + } + } + // Replace + returnValue = returnValue.replace(match[0], includeContent); + } + else { + var includeShaderUrl = BABYLON.Engine.ShadersRepository + "ShadersInclude/" + includeFile + ".fx"; + this._engine._loadFile(includeShaderUrl, function (fileContent) { + Effect.IncludesShadersStore[includeFile] = fileContent; + _this._processIncludes(returnValue, callback); + }); + return; + } + match = regex.exec(sourceCode); + } + callback(returnValue); + }; + Effect.prototype._processPrecision = function (source) { + if (source.indexOf("precision highp float") === -1) { + if (!this._engine.getCaps().highPrecisionShaderSupported) { + source = "precision mediump float;\n" + source; + } + else { + source = "precision highp float;\n" + source; + } + } + else { + if (!this._engine.getCaps().highPrecisionShaderSupported) { // Moving highp to mediump + source = source.replace("precision highp float", "precision mediump float"); + } + } + return source; + }; + /** + * Recompiles the webGL program + * @param vertexSourceCode The source code for the vertex shader. + * @param fragmentSourceCode The source code for the fragment shader. + * @param onCompiled Callback called when completed. + * @param onError Callback called on error. + * @hidden + */ + Effect.prototype._rebuildProgram = function (vertexSourceCode, fragmentSourceCode, onCompiled, onError) { + var _this = this; + this._isReady = false; + this._vertexSourceCodeOverride = vertexSourceCode; + this._fragmentSourceCodeOverride = fragmentSourceCode; + this.onError = function (effect, error) { + if (onError) { + onError(error); + } + }; + this.onCompiled = function () { + var scenes = _this.getEngine().scenes; + for (var i = 0; i < scenes.length; i++) { + scenes[i].markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + } + if (onCompiled) { + onCompiled(_this._program); + } + }; + this._fallbacks = null; + this._prepareEffect(); + }; + /** + * Gets the uniform locations of the the specified variable names + * @param names THe names of the variables to lookup. + * @returns Array of locations in the same order as variable names. + */ + Effect.prototype.getSpecificUniformLocations = function (names) { + var engine = this._engine; + return engine.getUniforms(this._program, names); + }; + /** + * Prepares the effect + * @hidden + */ + Effect.prototype._prepareEffect = function () { + var attributesNames = this._attributesNames; + var defines = this.defines; + var fallbacks = this._fallbacks; + this._valueCache = {}; + var previousProgram = this._program; + try { + var engine = this._engine; + if (this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride) { + this._program = engine.createRawShaderProgram(this._vertexSourceCodeOverride, this._fragmentSourceCodeOverride, undefined, this._transformFeedbackVaryings); + } + else { + this._program = engine.createShaderProgram(this._vertexSourceCode, this._fragmentSourceCode, defines, undefined, this._transformFeedbackVaryings); + } + this._program.__SPECTOR_rebuildProgram = this._rebuildProgram.bind(this); + if (engine.supportsUniformBuffers) { + for (var name in this._uniformBuffersNames) { + this.bindUniformBlock(name, this._uniformBuffersNames[name]); + } + } + this._uniforms = engine.getUniforms(this._program, this._uniformsNames); + this._attributes = engine.getAttributes(this._program, attributesNames); + var index; + for (index = 0; index < this._samplers.length; index++) { + var sampler = this.getUniform(this._samplers[index]); + if (sampler == null) { + this._samplers.splice(index, 1); + index--; + } + } + engine.bindSamplers(this); + this._compilationError = ""; + this._isReady = true; + if (this.onCompiled) { + this.onCompiled(this); + } + this.onCompileObservable.notifyObservers(this); + this.onCompileObservable.clear(); + // Unbind mesh reference in fallbacks + if (this._fallbacks) { + this._fallbacks.unBindMesh(); + } + if (previousProgram) { + this.getEngine()._deleteProgram(previousProgram); + } + } + catch (e) { + this._compilationError = e.message; + // Let's go through fallbacks then + BABYLON.Tools.Error("Unable to compile effect:"); + BABYLON.Tools.Error("Uniforms: " + this._uniformsNames.map(function (uniform) { + return " " + uniform; + })); + BABYLON.Tools.Error("Attributes: " + attributesNames.map(function (attribute) { + return " " + attribute; + })); + BABYLON.Tools.Error("Error: " + this._compilationError); + if (previousProgram) { + this._program = previousProgram; + this._isReady = true; + if (this.onError) { + this.onError(this, this._compilationError); + } + this.onErrorObservable.notifyObservers(this); + } + if (fallbacks && fallbacks.isMoreFallbacks) { + BABYLON.Tools.Error("Trying next fallback."); + this.defines = fallbacks.reduce(this.defines, this); + this._prepareEffect(); + } + else { // Sorry we did everything we can + if (this.onError) { + this.onError(this, this._compilationError); + } + this.onErrorObservable.notifyObservers(this); + this.onErrorObservable.clear(); + // Unbind mesh reference in fallbacks + if (this._fallbacks) { + this._fallbacks.unBindMesh(); + } + } + } + }; + Object.defineProperty(Effect.prototype, "isSupported", { + /** + * Checks if the effect is supported. (Must be called after compilation) + */ + get: function () { + return this._compilationError === ""; + }, + enumerable: true, + configurable: true + }); + /** + * Binds a texture to the engine to be used as output of the shader. + * @param channel Name of the output variable. + * @param texture Texture to bind. + * @hidden + */ + Effect.prototype._bindTexture = function (channel, texture) { + this._engine._bindTexture(this._samplers.indexOf(channel), texture); + }; + /** + * Sets a texture on the engine to be used in the shader. + * @param channel Name of the sampler variable. + * @param texture Texture to set. + */ + Effect.prototype.setTexture = function (channel, texture) { + this._engine.setTexture(this._samplers.indexOf(channel), this.getUniform(channel), texture); + }; + /** + * Sets a depth stencil texture from a render target on the engine to be used in the shader. + * @param channel Name of the sampler variable. + * @param texture Texture to set. + */ + Effect.prototype.setDepthStencilTexture = function (channel, texture) { + this._engine.setDepthStencilTexture(this._samplers.indexOf(channel), this.getUniform(channel), texture); + }; + /** + * Sets an array of textures on the engine to be used in the shader. + * @param channel Name of the variable. + * @param textures Textures to set. + */ + Effect.prototype.setTextureArray = function (channel, textures) { + if (this._samplers.indexOf(channel + "Ex") === -1) { + var initialPos = this._samplers.indexOf(channel); + for (var index = 1; index < textures.length; index++) { + this._samplers.splice(initialPos + index, 0, channel + "Ex"); + } + } + this._engine.setTextureArray(this._samplers.indexOf(channel), this.getUniform(channel), textures); + }; + /** + * Sets a texture to be the input of the specified post process. (To use the output, pass in the next post process in the pipeline) + * @param channel Name of the sampler variable. + * @param postProcess Post process to get the input texture from. + */ + Effect.prototype.setTextureFromPostProcess = function (channel, postProcess) { + this._engine.setTextureFromPostProcess(this._samplers.indexOf(channel), postProcess); + }; + /** + * (Warning! setTextureFromPostProcessOutput may be desired instead) + * Sets the input texture of the passed in post process to be input of this effect. (To use the output of the passed in post process use setTextureFromPostProcessOutput) + * @param channel Name of the sampler variable. + * @param postProcess Post process to get the output texture from. + */ + Effect.prototype.setTextureFromPostProcessOutput = function (channel, postProcess) { + this._engine.setTextureFromPostProcessOutput(this._samplers.indexOf(channel), postProcess); + }; + /** @hidden */ + Effect.prototype._cacheMatrix = function (uniformName, matrix) { + var cache = this._valueCache[uniformName]; + var flag = matrix.updateFlag; + if (cache !== undefined && cache === flag) { + return false; + } + this._valueCache[uniformName] = flag; + return true; + }; + /** @hidden */ + Effect.prototype._cacheFloat2 = function (uniformName, x, y) { + var cache = this._valueCache[uniformName]; + if (!cache) { + cache = [x, y]; + this._valueCache[uniformName] = cache; + return true; + } + var changed = false; + if (cache[0] !== x) { + cache[0] = x; + changed = true; + } + if (cache[1] !== y) { + cache[1] = y; + changed = true; + } + return changed; + }; + /** @hidden */ + Effect.prototype._cacheFloat3 = function (uniformName, x, y, z) { + var cache = this._valueCache[uniformName]; + if (!cache) { + cache = [x, y, z]; + this._valueCache[uniformName] = cache; + return true; + } + var changed = false; + if (cache[0] !== x) { + cache[0] = x; + changed = true; + } + if (cache[1] !== y) { + cache[1] = y; + changed = true; + } + if (cache[2] !== z) { + cache[2] = z; + changed = true; + } + return changed; + }; + /** @hidden */ + Effect.prototype._cacheFloat4 = function (uniformName, x, y, z, w) { + var cache = this._valueCache[uniformName]; + if (!cache) { + cache = [x, y, z, w]; + this._valueCache[uniformName] = cache; + return true; + } + var changed = false; + if (cache[0] !== x) { + cache[0] = x; + changed = true; + } + if (cache[1] !== y) { + cache[1] = y; + changed = true; + } + if (cache[2] !== z) { + cache[2] = z; + changed = true; + } + if (cache[3] !== w) { + cache[3] = w; + changed = true; + } + return changed; + }; + /** + * Binds a buffer to a uniform. + * @param buffer Buffer to bind. + * @param name Name of the uniform variable to bind to. + */ + Effect.prototype.bindUniformBuffer = function (buffer, name) { + var bufferName = this._uniformBuffersNames[name]; + if (bufferName === undefined || Effect._baseCache[bufferName] === buffer) { + return; + } + Effect._baseCache[bufferName] = buffer; + this._engine.bindUniformBufferBase(buffer, bufferName); + }; + /** + * Binds block to a uniform. + * @param blockName Name of the block to bind. + * @param index Index to bind. + */ + Effect.prototype.bindUniformBlock = function (blockName, index) { + this._engine.bindUniformBlock(this._program, blockName, index); + }; + /** + * Sets an interger value on a uniform variable. + * @param uniformName Name of the variable. + * @param value Value to be set. + * @returns this effect. + */ + Effect.prototype.setInt = function (uniformName, value) { + var cache = this._valueCache[uniformName]; + if (cache !== undefined && cache === value) { + return this; + } + this._valueCache[uniformName] = value; + this._engine.setInt(this.getUniform(uniformName), value); + return this; + }; + /** + * Sets an int array on a uniform variable. + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setIntArray = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setIntArray(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader) + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setIntArray2 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setIntArray2(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader) + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setIntArray3 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setIntArray3(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader) + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setIntArray4 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setIntArray4(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an float array on a uniform variable. + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setFloatArray = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setFloatArray(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an float array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader) + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setFloatArray2 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setFloatArray2(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an float array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader) + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setFloatArray3 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setFloatArray3(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an float array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader) + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setFloatArray4 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setFloatArray4(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an array on a uniform variable. + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setArray = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setArray(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader) + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setArray2 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setArray2(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader) + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setArray3 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setArray3(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader) + * @param uniformName Name of the variable. + * @param array array to be set. + * @returns this effect. + */ + Effect.prototype.setArray4 = function (uniformName, array) { + this._valueCache[uniformName] = null; + this._engine.setArray4(this.getUniform(uniformName), array); + return this; + }; + /** + * Sets matrices on a uniform variable. + * @param uniformName Name of the variable. + * @param matrices matrices to be set. + * @returns this effect. + */ + Effect.prototype.setMatrices = function (uniformName, matrices) { + if (!matrices) { + return this; + } + this._valueCache[uniformName] = null; + this._engine.setMatrices(this.getUniform(uniformName), matrices); + return this; + }; + /** + * Sets matrix on a uniform variable. + * @param uniformName Name of the variable. + * @param matrix matrix to be set. + * @returns this effect. + */ + Effect.prototype.setMatrix = function (uniformName, matrix) { + if (this._cacheMatrix(uniformName, matrix)) { + this._engine.setMatrix(this.getUniform(uniformName), matrix); + } + return this; + }; + /** + * Sets a 3x3 matrix on a uniform variable. (Speicified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix) + * @param uniformName Name of the variable. + * @param matrix matrix to be set. + * @returns this effect. + */ + Effect.prototype.setMatrix3x3 = function (uniformName, matrix) { + this._valueCache[uniformName] = null; + this._engine.setMatrix3x3(this.getUniform(uniformName), matrix); + return this; + }; + /** + * Sets a 2x2 matrix on a uniform variable. (Speicified as [1,2,3,4] will result in [1,2][3,4] matrix) + * @param uniformName Name of the variable. + * @param matrix matrix to be set. + * @returns this effect. + */ + Effect.prototype.setMatrix2x2 = function (uniformName, matrix) { + this._valueCache[uniformName] = null; + this._engine.setMatrix2x2(this.getUniform(uniformName), matrix); + return this; + }; + /** + * Sets a float on a uniform variable. + * @param uniformName Name of the variable. + * @param value value to be set. + * @returns this effect. + */ + Effect.prototype.setFloat = function (uniformName, value) { + var cache = this._valueCache[uniformName]; + if (cache !== undefined && cache === value) { + return this; + } + this._valueCache[uniformName] = value; + this._engine.setFloat(this.getUniform(uniformName), value); + return this; + }; + /** + * Sets a boolean on a uniform variable. + * @param uniformName Name of the variable. + * @param bool value to be set. + * @returns this effect. + */ + Effect.prototype.setBool = function (uniformName, bool) { + var cache = this._valueCache[uniformName]; + if (cache !== undefined && cache === bool) { + return this; + } + this._valueCache[uniformName] = bool; + this._engine.setBool(this.getUniform(uniformName), bool ? 1 : 0); + return this; + }; + /** + * Sets a Vector2 on a uniform variable. + * @param uniformName Name of the variable. + * @param vector2 vector2 to be set. + * @returns this effect. + */ + Effect.prototype.setVector2 = function (uniformName, vector2) { + if (this._cacheFloat2(uniformName, vector2.x, vector2.y)) { + this._engine.setFloat2(this.getUniform(uniformName), vector2.x, vector2.y); + } + return this; + }; + /** + * Sets a float2 on a uniform variable. + * @param uniformName Name of the variable. + * @param x First float in float2. + * @param y Second float in float2. + * @returns this effect. + */ + Effect.prototype.setFloat2 = function (uniformName, x, y) { + if (this._cacheFloat2(uniformName, x, y)) { + this._engine.setFloat2(this.getUniform(uniformName), x, y); + } + return this; + }; + /** + * Sets a Vector3 on a uniform variable. + * @param uniformName Name of the variable. + * @param vector3 Value to be set. + * @returns this effect. + */ + Effect.prototype.setVector3 = function (uniformName, vector3) { + if (this._cacheFloat3(uniformName, vector3.x, vector3.y, vector3.z)) { + this._engine.setFloat3(this.getUniform(uniformName), vector3.x, vector3.y, vector3.z); + } + return this; + }; + /** + * Sets a float3 on a uniform variable. + * @param uniformName Name of the variable. + * @param x First float in float3. + * @param y Second float in float3. + * @param z Third float in float3. + * @returns this effect. + */ + Effect.prototype.setFloat3 = function (uniformName, x, y, z) { + if (this._cacheFloat3(uniformName, x, y, z)) { + this._engine.setFloat3(this.getUniform(uniformName), x, y, z); + } + return this; + }; + /** + * Sets a Vector4 on a uniform variable. + * @param uniformName Name of the variable. + * @param vector4 Value to be set. + * @returns this effect. + */ + Effect.prototype.setVector4 = function (uniformName, vector4) { + if (this._cacheFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w)) { + this._engine.setFloat4(this.getUniform(uniformName), vector4.x, vector4.y, vector4.z, vector4.w); + } + return this; + }; + /** + * Sets a float4 on a uniform variable. + * @param uniformName Name of the variable. + * @param x First float in float4. + * @param y Second float in float4. + * @param z Third float in float4. + * @param w Fourth float in float4. + * @returns this effect. + */ + Effect.prototype.setFloat4 = function (uniformName, x, y, z, w) { + if (this._cacheFloat4(uniformName, x, y, z, w)) { + this._engine.setFloat4(this.getUniform(uniformName), x, y, z, w); + } + return this; + }; + /** + * Sets a Color3 on a uniform variable. + * @param uniformName Name of the variable. + * @param color3 Value to be set. + * @returns this effect. + */ + Effect.prototype.setColor3 = function (uniformName, color3) { + if (this._cacheFloat3(uniformName, color3.r, color3.g, color3.b)) { + this._engine.setColor3(this.getUniform(uniformName), color3); + } + return this; + }; + /** + * Sets a Color4 on a uniform variable. + * @param uniformName Name of the variable. + * @param color3 Value to be set. + * @param alpha Alpha value to be set. + * @returns this effect. + */ + Effect.prototype.setColor4 = function (uniformName, color3, alpha) { + if (this._cacheFloat4(uniformName, color3.r, color3.g, color3.b, alpha)) { + this._engine.setColor4(this.getUniform(uniformName), color3, alpha); + } + return this; + }; + /** + * Sets a Color4 on a uniform variable + * @param uniformName defines the name of the variable + * @param color4 defines the value to be set + * @returns this effect. + */ + Effect.prototype.setDirectColor4 = function (uniformName, color4) { + if (this._cacheFloat4(uniformName, color4.r, color4.g, color4.b, color4.a)) { + this._engine.setDirectColor4(this.getUniform(uniformName), color4); + } + return this; + }; + /** + * This function will add a new shader to the shader store + * @param name the name of the shader + * @param pixelShader optional pixel shader content + * @param vertexShader optional vertex shader content + */ + Effect.RegisterShader = function (name, pixelShader, vertexShader) { + if (pixelShader) { + Effect.ShadersStore[name + "PixelShader"] = pixelShader; + } + if (vertexShader) { + Effect.ShadersStore[name + "VertexShader"] = vertexShader; + } + }; + /** + * Resets the cache of effects. + */ + Effect.ResetCache = function () { + Effect._baseCache = {}; + }; + Effect._uniqueIdSeed = 0; + Effect._baseCache = {}; + /** + * Store of each shader (The can be looked up using effect.key) + */ + Effect.ShadersStore = {}; + /** + * Store of each included file for a shader (The can be looked up using effect.key) + */ + Effect.IncludesShadersStore = {}; + return Effect; + }()); + BABYLON.Effect = Effect; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.effect.js.map + + + +//# sourceMappingURL=babylon.types.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Gather the list of keyboard event types as constants. + */ + var KeyboardEventTypes = /** @class */ (function () { + function KeyboardEventTypes() { + } + /** + * The keydown event is fired when a key becomes active (pressed). + */ + KeyboardEventTypes.KEYDOWN = 0x01; + /** + * The keyup event is fired when a key has been released. + */ + KeyboardEventTypes.KEYUP = 0x02; + return KeyboardEventTypes; + }()); + BABYLON.KeyboardEventTypes = KeyboardEventTypes; + /** + * This class is used to store keyboard related info for the onKeyboardObservable event. + */ + var KeyboardInfo = /** @class */ (function () { + /** + * Instantiates a new keyboard info. + * This class is used to store keyboard related info for the onKeyboardObservable event. + * @param type Defines the type of event (BABYLON.KeyboardEventTypes) + * @param event Defines the related dom event + */ + function KeyboardInfo( + /** + * Defines the type of event (BABYLON.KeyboardEventTypes) + */ + type, + /** + * Defines the related dom event + */ + event) { + this.type = type; + this.event = event; + } + return KeyboardInfo; + }()); + BABYLON.KeyboardInfo = KeyboardInfo; + /** + * This class is used to store keyboard related info for the onPreKeyboardObservable event. + * Set the skipOnKeyboardObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onKeyboardObservable + */ + var KeyboardInfoPre = /** @class */ (function (_super) { + __extends(KeyboardInfoPre, _super); + /** + * Instantiates a new keyboard pre info. + * This class is used to store keyboard related info for the onPreKeyboardObservable event. + * @param type Defines the type of event (BABYLON.KeyboardEventTypes) + * @param event Defines the related dom event + */ + function KeyboardInfoPre( + /** + * Defines the type of event (BABYLON.KeyboardEventTypes) + */ + type, + /** + * Defines the related dom event + */ + event) { + var _this = _super.call(this, type, event) || this; + _this.type = type; + _this.event = event; + _this.skipOnPointerObservable = false; + return _this; + } + return KeyboardInfoPre; + }(KeyboardInfo)); + BABYLON.KeyboardInfoPre = KeyboardInfoPre; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.keyboardEvents.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Gather the list of pointer event types as constants. + */ + var PointerEventTypes = /** @class */ (function () { + function PointerEventTypes() { + } + /** + * The pointerdown event is fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer. + */ + PointerEventTypes.POINTERDOWN = 0x01; + /** + * The pointerup event is fired when a pointer is no longer active. + */ + PointerEventTypes.POINTERUP = 0x02; + /** + * The pointermove event is fired when a pointer changes coordinates. + */ + PointerEventTypes.POINTERMOVE = 0x04; + /** + * The pointerwheel event is fired when a mouse wheel has been rotated. + */ + PointerEventTypes.POINTERWHEEL = 0x08; + /** + * The pointerpick event is fired when a mesh or sprite has been picked by the pointer. + */ + PointerEventTypes.POINTERPICK = 0x10; + /** + * The pointertap event is fired when a the object has been touched and released without drag. + */ + PointerEventTypes.POINTERTAP = 0x20; + /** + * The pointerdoubletap event is fired when a the object has been touched and released twice without drag. + */ + PointerEventTypes.POINTERDOUBLETAP = 0x40; + return PointerEventTypes; + }()); + BABYLON.PointerEventTypes = PointerEventTypes; + /** + * Base class of pointer info types. + */ + var PointerInfoBase = /** @class */ (function () { + /** + * Instantiates the base class of pointers info. + * @param type Defines the type of event (BABYLON.PointerEventTypes) + * @param event Defines the related dom event + */ + function PointerInfoBase( + /** + * Defines the type of event (BABYLON.PointerEventTypes) + */ + type, + /** + * Defines the related dom event + */ + event) { + this.type = type; + this.event = event; + } + return PointerInfoBase; + }()); + BABYLON.PointerInfoBase = PointerInfoBase; + /** + * This class is used to store pointer related info for the onPrePointerObservable event. + * Set the skipOnPointerObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onPointerObservable + */ + var PointerInfoPre = /** @class */ (function (_super) { + __extends(PointerInfoPre, _super); + /** + * Instantiates a PointerInfoPre to store pointer related info to the onPrePointerObservable event. + * @param type Defines the type of event (BABYLON.PointerEventTypes) + * @param event Defines the related dom event + * @param localX Defines the local x coordinates of the pointer when the event occured + * @param localY Defines the local y coordinates of the pointer when the event occured + */ + function PointerInfoPre(type, event, localX, localY) { + var _this = _super.call(this, type, event) || this; + /** + * Ray from a pointer if availible (eg. 6dof controller) + */ + _this.ray = null; + _this.skipOnPointerObservable = false; + _this.localPosition = new BABYLON.Vector2(localX, localY); + return _this; + } + return PointerInfoPre; + }(PointerInfoBase)); + BABYLON.PointerInfoPre = PointerInfoPre; + /** + * This type contains all the data related to a pointer event in Babylon.js. + * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The different event types can be found in the PointerEventTypes class. + */ + var PointerInfo = /** @class */ (function (_super) { + __extends(PointerInfo, _super); + /** + * Instantiates a PointerInfo to store pointer related info to the onPointerObservable event. + * @param type Defines the type of event (BABYLON.PointerEventTypes) + * @param event Defines the related dom event + * @param pickInfo Defines the picking info associated to the info (if any)\ + */ + function PointerInfo(type, event, + /** + * Defines the picking info associated to the info (if any)\ + */ + pickInfo) { + var _this = _super.call(this, type, event) || this; + _this.pickInfo = pickInfo; + return _this; + } + return PointerInfo; + }(PointerInfoBase)); + BABYLON.PointerInfo = PointerInfo; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pointerEvents.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Constant used to convert a value to gamma space + * @ignorenaming + */ + BABYLON.ToGammaSpace = 1 / 2.2; + /** + * Constant used to convert a value to linear space + * @ignorenaming + */ + BABYLON.ToLinearSpace = 2.2; + /** + * Constant used to define the minimal number value in Babylon.js + * @ignorenaming + */ + BABYLON.Epsilon = 0.001; + /** + * Class used to hold a RBG color + */ + var Color3 = /** @class */ (function () { + /** + * Creates a new Color3 object from red, green, blue values, all between 0 and 1 + * @param r defines the red component (between 0 and 1, default is 0) + * @param g defines the green component (between 0 and 1, default is 0) + * @param b defines the blue component (between 0 and 1, default is 0) + */ + function Color3( + /** + * Defines the red component (between 0 and 1, default is 0) + */ + r, + /** + * Defines the green component (between 0 and 1, default is 0) + */ + g, + /** + * Defines the blue component (between 0 and 1, default is 0) + */ + b) { + if (r === void 0) { r = 0; } + if (g === void 0) { g = 0; } + if (b === void 0) { b = 0; } + this.r = r; + this.g = g; + this.b = b; + } + /** + * Creates a string with the Color3 current values + * @returns the string representation of the Color3 object + */ + Color3.prototype.toString = function () { + return "{R: " + this.r + " G:" + this.g + " B:" + this.b + "}"; + }; + /** + * Returns the string "Color3" + * @returns "Color3" + */ + Color3.prototype.getClassName = function () { + return "Color3"; + }; + /** + * Compute the Color3 hash code + * @returns an unique number that can be used to hash Color3 objects + */ + Color3.prototype.getHashCode = function () { + var hash = this.r || 0; + hash = (hash * 397) ^ (this.g || 0); + hash = (hash * 397) ^ (this.b || 0); + return hash; + }; + // Operators + /** + * Stores in the given array from the given starting index the red, green, blue values as successive elements + * @param array defines the array where to store the r,g,b components + * @param index defines an optional index in the target array to define where to start storing values + * @returns the current Color3 object + */ + Color3.prototype.toArray = function (array, index) { + if (index === undefined) { + index = 0; + } + array[index] = this.r; + array[index + 1] = this.g; + array[index + 2] = this.b; + return this; + }; + /** + * Returns a new Color4 object from the current Color3 and the given alpha + * @param alpha defines the alpha component on the new Color4 object (default is 1) + * @returns a new Color4 object + */ + Color3.prototype.toColor4 = function (alpha) { + if (alpha === void 0) { alpha = 1; } + return new Color4(this.r, this.g, this.b, alpha); + }; + /** + * Returns a new array populated with 3 numeric elements : red, green and blue values + * @returns the new array + */ + Color3.prototype.asArray = function () { + var result = new Array(); + this.toArray(result, 0); + return result; + }; + /** + * Returns the luminance value + * @returns a float value + */ + Color3.prototype.toLuminance = function () { + return this.r * 0.3 + this.g * 0.59 + this.b * 0.11; + }; + /** + * Multiply each Color3 rgb values by the given Color3 rgb values in a new Color3 object + * @param otherColor defines the second operand + * @returns the new Color3 object + */ + Color3.prototype.multiply = function (otherColor) { + return new Color3(this.r * otherColor.r, this.g * otherColor.g, this.b * otherColor.b); + }; + /** + * Multiply the rgb values of the Color3 and the given Color3 and stores the result in the object "result" + * @param otherColor defines the second operand + * @param result defines the Color3 object where to store the result + * @returns the current Color3 + */ + Color3.prototype.multiplyToRef = function (otherColor, result) { + result.r = this.r * otherColor.r; + result.g = this.g * otherColor.g; + result.b = this.b * otherColor.b; + return this; + }; + /** + * Determines equality between Color3 objects + * @param otherColor defines the second operand + * @returns true if the rgb values are equal to the given ones + */ + Color3.prototype.equals = function (otherColor) { + return otherColor && this.r === otherColor.r && this.g === otherColor.g && this.b === otherColor.b; + }; + /** + * Determines equality between the current Color3 object and a set of r,b,g values + * @param r defines the red component to check + * @param g defines the green component to check + * @param b defines the blue component to check + * @returns true if the rgb values are equal to the given ones + */ + Color3.prototype.equalsFloats = function (r, g, b) { + return this.r === r && this.g === g && this.b === b; + }; + /** + * Multiplies in place each rgb value by scale + * @param scale defines the scaling factor + * @returns the updated Color3 + */ + Color3.prototype.scale = function (scale) { + return new Color3(this.r * scale, this.g * scale, this.b * scale); + }; + /** + * Multiplies the rgb values by scale and stores the result into "result" + * @param scale defines the scaling factor + * @param result defines the Color3 object where to store the result + * @returns the unmodified current Color3 + */ + Color3.prototype.scaleToRef = function (scale, result) { + result.r = this.r * scale; + result.g = this.g * scale; + result.b = this.b * scale; + return this; + }; + /** + * Scale the current Color3 values by a factor and add the result to a given Color3 + * @param scale defines the scale factor + * @param result defines color to store the result into + * @returns the unmodified current Color3 + */ + Color3.prototype.scaleAndAddToRef = function (scale, result) { + result.r += this.r * scale; + result.g += this.g * scale; + result.b += this.b * scale; + return this; + }; + /** + * Clamps the rgb values by the min and max values and stores the result into "result" + * @param min defines minimum clamping value (default is 0) + * @param max defines maximum clamping value (default is 1) + * @param result defines color to store the result into + * @returns the original Color3 + */ + Color3.prototype.clampToRef = function (min, max, result) { + if (min === void 0) { min = 0; } + if (max === void 0) { max = 1; } + result.r = BABYLON.Scalar.Clamp(this.r, min, max); + result.g = BABYLON.Scalar.Clamp(this.g, min, max); + result.b = BABYLON.Scalar.Clamp(this.b, min, max); + return this; + }; + /** + * Creates a new Color3 set with the added values of the current Color3 and of the given one + * @param otherColor defines the second operand + * @returns the new Color3 + */ + Color3.prototype.add = function (otherColor) { + return new Color3(this.r + otherColor.r, this.g + otherColor.g, this.b + otherColor.b); + }; + /** + * Stores the result of the addition of the current Color3 and given one rgb values into "result" + * @param otherColor defines the second operand + * @param result defines Color3 object to store the result into + * @returns the unmodified current Color3 + */ + Color3.prototype.addToRef = function (otherColor, result) { + result.r = this.r + otherColor.r; + result.g = this.g + otherColor.g; + result.b = this.b + otherColor.b; + return this; + }; + /** + * Returns a new Color3 set with the subtracted values of the given one from the current Color3 + * @param otherColor defines the second operand + * @returns the new Color3 + */ + Color3.prototype.subtract = function (otherColor) { + return new Color3(this.r - otherColor.r, this.g - otherColor.g, this.b - otherColor.b); + }; + /** + * Stores the result of the subtraction of given one from the current Color3 rgb values into "result" + * @param otherColor defines the second operand + * @param result defines Color3 object to store the result into + * @returns the unmodified current Color3 + */ + Color3.prototype.subtractToRef = function (otherColor, result) { + result.r = this.r - otherColor.r; + result.g = this.g - otherColor.g; + result.b = this.b - otherColor.b; + return this; + }; + /** + * Copy the current object + * @returns a new Color3 copied the current one + */ + Color3.prototype.clone = function () { + return new Color3(this.r, this.g, this.b); + }; + /** + * Copies the rgb values from the source in the current Color3 + * @param source defines the source Color3 object + * @returns the updated Color3 object + */ + Color3.prototype.copyFrom = function (source) { + this.r = source.r; + this.g = source.g; + this.b = source.b; + return this; + }; + /** + * Updates the Color3 rgb values from the given floats + * @param r defines the red component to read from + * @param g defines the green component to read from + * @param b defines the blue component to read from + * @returns the current Color3 object + */ + Color3.prototype.copyFromFloats = function (r, g, b) { + this.r = r; + this.g = g; + this.b = b; + return this; + }; + /** + * Updates the Color3 rgb values from the given floats + * @param r defines the red component to read from + * @param g defines the green component to read from + * @param b defines the blue component to read from + * @returns the current Color3 object + */ + Color3.prototype.set = function (r, g, b) { + return this.copyFromFloats(r, g, b); + }; + /** + * Compute the Color3 hexadecimal code as a string + * @returns a string containing the hexadecimal representation of the Color3 object + */ + Color3.prototype.toHexString = function () { + var intR = (this.r * 255) | 0; + var intG = (this.g * 255) | 0; + var intB = (this.b * 255) | 0; + return "#" + BABYLON.Scalar.ToHex(intR) + BABYLON.Scalar.ToHex(intG) + BABYLON.Scalar.ToHex(intB); + }; + /** + * Computes a new Color3 converted from the current one to linear space + * @returns a new Color3 object + */ + Color3.prototype.toLinearSpace = function () { + var convertedColor = new Color3(); + this.toLinearSpaceToRef(convertedColor); + return convertedColor; + }; + /** + * Converts the Color3 values to linear space and stores the result in "convertedColor" + * @param convertedColor defines the Color3 object where to store the linear space version + * @returns the unmodified Color3 + */ + Color3.prototype.toLinearSpaceToRef = function (convertedColor) { + convertedColor.r = Math.pow(this.r, BABYLON.ToLinearSpace); + convertedColor.g = Math.pow(this.g, BABYLON.ToLinearSpace); + convertedColor.b = Math.pow(this.b, BABYLON.ToLinearSpace); + return this; + }; + /** + * Computes a new Color3 converted from the current one to gamma space + * @returns a new Color3 object + */ + Color3.prototype.toGammaSpace = function () { + var convertedColor = new Color3(); + this.toGammaSpaceToRef(convertedColor); + return convertedColor; + }; + /** + * Converts the Color3 values to gamma space and stores the result in "convertedColor" + * @param convertedColor defines the Color3 object where to store the gamma space version + * @returns the unmodified Color3 + */ + Color3.prototype.toGammaSpaceToRef = function (convertedColor) { + convertedColor.r = Math.pow(this.r, BABYLON.ToGammaSpace); + convertedColor.g = Math.pow(this.g, BABYLON.ToGammaSpace); + convertedColor.b = Math.pow(this.b, BABYLON.ToGammaSpace); + return this; + }; + // Statics + /** + * Creates a new Color3 from the string containing valid hexadecimal values + * @param hex defines a string containing valid hexadecimal values + * @returns a new Color3 object + */ + Color3.FromHexString = function (hex) { + if (hex.substring(0, 1) !== "#" || hex.length !== 7) { + return new Color3(0, 0, 0); + } + var r = parseInt(hex.substring(1, 3), 16); + var g = parseInt(hex.substring(3, 5), 16); + var b = parseInt(hex.substring(5, 7), 16); + return Color3.FromInts(r, g, b); + }; + /** + * Creates a new Vector3 from the starting index of the given array + * @param array defines the source array + * @param offset defines an offset in the source array + * @returns a new Color3 object + */ + Color3.FromArray = function (array, offset) { + if (offset === void 0) { offset = 0; } + return new Color3(array[offset], array[offset + 1], array[offset + 2]); + }; + /** + * Creates a new Color3 from integer values (< 256) + * @param r defines the red component to read from (value between 0 and 255) + * @param g defines the green component to read from (value between 0 and 255) + * @param b defines the blue component to read from (value between 0 and 255) + * @returns a new Color3 object + */ + Color3.FromInts = function (r, g, b) { + return new Color3(r / 255.0, g / 255.0, b / 255.0); + }; + /** + * Creates a new Color3 with values linearly interpolated of "amount" between the start Color3 and the end Color3 + * @param start defines the start Color3 value + * @param end defines the end Color3 value + * @param amount defines the gradient value between start and end + * @returns a new Color3 object + */ + Color3.Lerp = function (start, end, amount) { + var result = new Color3(0.0, 0.0, 0.0); + Color3.LerpToRef(start, end, amount, result); + return result; + }; + /** + * Creates a new Color3 with values linearly interpolated of "amount" between the start Color3 and the end Color3 + * @param left defines the start value + * @param right defines the end value + * @param amount defines the gradient factor + * @param result defines the Color3 object where to store the result + */ + Color3.LerpToRef = function (left, right, amount, result) { + result.r = left.r + ((right.r - left.r) * amount); + result.g = left.g + ((right.g - left.g) * amount); + result.b = left.b + ((right.b - left.b) * amount); + }; + /** + * Returns a Color3 value containing a red color + * @returns a new Color3 object + */ + Color3.Red = function () { return new Color3(1, 0, 0); }; + /** + * Returns a Color3 value containing a green color + * @returns a new Color3 object + */ + Color3.Green = function () { return new Color3(0, 1, 0); }; + /** + * Returns a Color3 value containing a blue color + * @returns a new Color3 object + */ + Color3.Blue = function () { return new Color3(0, 0, 1); }; + /** + * Returns a Color3 value containing a black color + * @returns a new Color3 object + */ + Color3.Black = function () { return new Color3(0, 0, 0); }; + /** + * Returns a Color3 value containing a white color + * @returns a new Color3 object + */ + Color3.White = function () { return new Color3(1, 1, 1); }; + /** + * Returns a Color3 value containing a purple color + * @returns a new Color3 object + */ + Color3.Purple = function () { return new Color3(0.5, 0, 0.5); }; + /** + * Returns a Color3 value containing a magenta color + * @returns a new Color3 object + */ + Color3.Magenta = function () { return new Color3(1, 0, 1); }; + /** + * Returns a Color3 value containing a yellow color + * @returns a new Color3 object + */ + Color3.Yellow = function () { return new Color3(1, 1, 0); }; + /** + * Returns a Color3 value containing a gray color + * @returns a new Color3 object + */ + Color3.Gray = function () { return new Color3(0.5, 0.5, 0.5); }; + /** + * Returns a Color3 value containing a teal color + * @returns a new Color3 object + */ + Color3.Teal = function () { return new Color3(0, 1.0, 1.0); }; + /** + * Returns a Color3 value containing a random color + * @returns a new Color3 object + */ + Color3.Random = function () { return new Color3(Math.random(), Math.random(), Math.random()); }; + return Color3; + }()); + BABYLON.Color3 = Color3; + /** + * Class used to hold a RBGA color + */ + var Color4 = /** @class */ (function () { + /** + * Creates a new Color4 object from red, green, blue values, all between 0 and 1 + * @param r defines the red component (between 0 and 1, default is 0) + * @param g defines the green component (between 0 and 1, default is 0) + * @param b defines the blue component (between 0 and 1, default is 0) + * @param a defines the alpha component (between 0 and 1, default is 1) + */ + function Color4( + /** + * Defines the red component (between 0 and 1, default is 0) + */ + r, + /** + * Defines the green component (between 0 and 1, default is 0) + */ + g, + /** + * Defines the blue component (between 0 and 1, default is 0) + */ + b, + /** + * Defines the alpha component (between 0 and 1, default is 1) + */ + a) { + if (r === void 0) { r = 0; } + if (g === void 0) { g = 0; } + if (b === void 0) { b = 0; } + if (a === void 0) { a = 1; } + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + // Operators + /** + * Adds in place the given Color4 values to the current Color4 object + * @param right defines the second operand + * @returns the current updated Color4 object + */ + Color4.prototype.addInPlace = function (right) { + this.r += right.r; + this.g += right.g; + this.b += right.b; + this.a += right.a; + return this; + }; + /** + * Creates a new array populated with 4 numeric elements : red, green, blue, alpha values + * @returns the new array + */ + Color4.prototype.asArray = function () { + var result = new Array(); + this.toArray(result, 0); + return result; + }; + /** + * Stores from the starting index in the given array the Color4 successive values + * @param array defines the array where to store the r,g,b components + * @param index defines an optional index in the target array to define where to start storing values + * @returns the current Color4 object + */ + Color4.prototype.toArray = function (array, index) { + if (index === undefined) { + index = 0; + } + array[index] = this.r; + array[index + 1] = this.g; + array[index + 2] = this.b; + array[index + 3] = this.a; + return this; + }; + /** + * Creates a new Color4 set with the added values of the current Color4 and of the given one + * @param right defines the second operand + * @returns a new Color4 object + */ + Color4.prototype.add = function (right) { + return new Color4(this.r + right.r, this.g + right.g, this.b + right.b, this.a + right.a); + }; + /** + * Creates a new Color4 set with the subtracted values of the given one from the current Color4 + * @param right defines the second operand + * @returns a new Color4 object + */ + Color4.prototype.subtract = function (right) { + return new Color4(this.r - right.r, this.g - right.g, this.b - right.b, this.a - right.a); + }; + /** + * Subtracts the given ones from the current Color4 values and stores the results in "result" + * @param right defines the second operand + * @param result defines the Color4 object where to store the result + * @returns the current Color4 object + */ + Color4.prototype.subtractToRef = function (right, result) { + result.r = this.r - right.r; + result.g = this.g - right.g; + result.b = this.b - right.b; + result.a = this.a - right.a; + return this; + }; + /** + * Creates a new Color4 with the current Color4 values multiplied by scale + * @param scale defines the scaling factor to apply + * @returns a new Color4 object + */ + Color4.prototype.scale = function (scale) { + return new Color4(this.r * scale, this.g * scale, this.b * scale, this.a * scale); + }; + /** + * Multiplies the current Color4 values by scale and stores the result in "result" + * @param scale defines the scaling factor to apply + * @param result defines the Color4 object where to store the result + * @returns the current unmodified Color4 + */ + Color4.prototype.scaleToRef = function (scale, result) { + result.r = this.r * scale; + result.g = this.g * scale; + result.b = this.b * scale; + result.a = this.a * scale; + return this; + }; + /** + * Scale the current Color4 values by a factor and add the result to a given Color4 + * @param scale defines the scale factor + * @param result defines the Color4 object where to store the result + * @returns the unmodified current Color4 + */ + Color4.prototype.scaleAndAddToRef = function (scale, result) { + result.r += this.r * scale; + result.g += this.g * scale; + result.b += this.b * scale; + result.a += this.a * scale; + return this; + }; + /** + * Clamps the rgb values by the min and max values and stores the result into "result" + * @param min defines minimum clamping value (default is 0) + * @param max defines maximum clamping value (default is 1) + * @param result defines color to store the result into. + * @returns the cuurent Color4 + */ + Color4.prototype.clampToRef = function (min, max, result) { + if (min === void 0) { min = 0; } + if (max === void 0) { max = 1; } + result.r = BABYLON.Scalar.Clamp(this.r, min, max); + result.g = BABYLON.Scalar.Clamp(this.g, min, max); + result.b = BABYLON.Scalar.Clamp(this.b, min, max); + result.a = BABYLON.Scalar.Clamp(this.a, min, max); + return this; + }; + /** + * Multipy an Color4 value by another and return a new Color4 object + * @param color defines the Color4 value to multiply by + * @returns a new Color4 object + */ + Color4.prototype.multiply = function (color) { + return new Color4(this.r * color.r, this.g * color.g, this.b * color.b, this.a * color.a); + }; + /** + * Multipy a Color4 value by another and push the result in a reference value + * @param color defines the Color4 value to multiply by + * @param result defines the Color4 to fill the result in + * @returns the result Color4 + */ + Color4.prototype.multiplyToRef = function (color, result) { + result.r = this.r * color.r; + result.g = this.g * color.g; + result.b = this.b * color.b; + result.a = this.a * color.a; + return result; + }; + /** + * Creates a string with the Color4 current values + * @returns the string representation of the Color4 object + */ + Color4.prototype.toString = function () { + return "{R: " + this.r + " G:" + this.g + " B:" + this.b + " A:" + this.a + "}"; + }; + /** + * Returns the string "Color4" + * @returns "Color4" + */ + Color4.prototype.getClassName = function () { + return "Color4"; + }; + /** + * Compute the Color4 hash code + * @returns an unique number that can be used to hash Color4 objects + */ + Color4.prototype.getHashCode = function () { + var hash = this.r || 0; + hash = (hash * 397) ^ (this.g || 0); + hash = (hash * 397) ^ (this.b || 0); + hash = (hash * 397) ^ (this.a || 0); + return hash; + }; + /** + * Creates a new Color4 copied from the current one + * @returns a new Color4 object + */ + Color4.prototype.clone = function () { + return new Color4(this.r, this.g, this.b, this.a); + }; + /** + * Copies the given Color4 values into the current one + * @param source defines the source Color4 object + * @returns the current updated Color4 object + */ + Color4.prototype.copyFrom = function (source) { + this.r = source.r; + this.g = source.g; + this.b = source.b; + this.a = source.a; + return this; + }; + /** + * Copies the given float values into the current one + * @param r defines the red component to read from + * @param g defines the green component to read from + * @param b defines the blue component to read from + * @param a defines the alpha component to read from + * @returns the current updated Color4 object + */ + Color4.prototype.copyFromFloats = function (r, g, b, a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + return this; + }; + /** + * Copies the given float values into the current one + * @param r defines the red component to read from + * @param g defines the green component to read from + * @param b defines the blue component to read from + * @param a defines the alpha component to read from + * @returns the current updated Color4 object + */ + Color4.prototype.set = function (r, g, b, a) { + return this.copyFromFloats(r, g, b, a); + }; + /** + * Compute the Color4 hexadecimal code as a string + * @returns a string containing the hexadecimal representation of the Color4 object + */ + Color4.prototype.toHexString = function () { + var intR = (this.r * 255) | 0; + var intG = (this.g * 255) | 0; + var intB = (this.b * 255) | 0; + var intA = (this.a * 255) | 0; + return "#" + BABYLON.Scalar.ToHex(intR) + BABYLON.Scalar.ToHex(intG) + BABYLON.Scalar.ToHex(intB) + BABYLON.Scalar.ToHex(intA); + }; + /** + * Computes a new Color4 converted from the current one to linear space + * @returns a new Color4 object + */ + Color4.prototype.toLinearSpace = function () { + var convertedColor = new Color4(); + this.toLinearSpaceToRef(convertedColor); + return convertedColor; + }; + /** + * Converts the Color4 values to linear space and stores the result in "convertedColor" + * @param convertedColor defines the Color4 object where to store the linear space version + * @returns the unmodified Color4 + */ + Color4.prototype.toLinearSpaceToRef = function (convertedColor) { + convertedColor.r = Math.pow(this.r, BABYLON.ToLinearSpace); + convertedColor.g = Math.pow(this.g, BABYLON.ToLinearSpace); + convertedColor.b = Math.pow(this.b, BABYLON.ToLinearSpace); + convertedColor.a = this.a; + return this; + }; + /** + * Computes a new Color4 converted from the current one to gamma space + * @returns a new Color4 object + */ + Color4.prototype.toGammaSpace = function () { + var convertedColor = new Color4(); + this.toGammaSpaceToRef(convertedColor); + return convertedColor; + }; + /** + * Converts the Color4 values to gamma space and stores the result in "convertedColor" + * @param convertedColor defines the Color4 object where to store the gamma space version + * @returns the unmodified Color4 + */ + Color4.prototype.toGammaSpaceToRef = function (convertedColor) { + convertedColor.r = Math.pow(this.r, BABYLON.ToGammaSpace); + convertedColor.g = Math.pow(this.g, BABYLON.ToGammaSpace); + convertedColor.b = Math.pow(this.b, BABYLON.ToGammaSpace); + convertedColor.a = this.a; + return this; + }; + // Statics + /** + * Creates a new Color4 from the string containing valid hexadecimal values + * @param hex defines a string containing valid hexadecimal values + * @returns a new Color4 object + */ + Color4.FromHexString = function (hex) { + if (hex.substring(0, 1) !== "#" || hex.length !== 9) { + return new Color4(0.0, 0.0, 0.0, 0.0); + } + var r = parseInt(hex.substring(1, 3), 16); + var g = parseInt(hex.substring(3, 5), 16); + var b = parseInt(hex.substring(5, 7), 16); + var a = parseInt(hex.substring(7, 9), 16); + return Color4.FromInts(r, g, b, a); + }; + /** + * Creates a new Color4 object set with the linearly interpolated values of "amount" between the left Color4 object and the right Color4 object + * @param left defines the start value + * @param right defines the end value + * @param amount defines the gradient factor + * @returns a new Color4 object + */ + Color4.Lerp = function (left, right, amount) { + var result = new Color4(0.0, 0.0, 0.0, 0.0); + Color4.LerpToRef(left, right, amount, result); + return result; + }; + /** + * Set the given "result" with the linearly interpolated values of "amount" between the left Color4 object and the right Color4 object + * @param left defines the start value + * @param right defines the end value + * @param amount defines the gradient factor + * @param result defines the Color4 object where to store data + */ + Color4.LerpToRef = function (left, right, amount, result) { + result.r = left.r + (right.r - left.r) * amount; + result.g = left.g + (right.g - left.g) * amount; + result.b = left.b + (right.b - left.b) * amount; + result.a = left.a + (right.a - left.a) * amount; + }; + /** + * Creates a new Color4 from a Color3 and an alpha value + * @param color3 defines the source Color3 to read from + * @param alpha defines the alpha component (1.0 by default) + * @returns a new Color4 object + */ + Color4.FromColor3 = function (color3, alpha) { + if (alpha === void 0) { alpha = 1.0; } + return new Color4(color3.r, color3.g, color3.b, alpha); + }; + /** + * Creates a new Color4 from the starting index element of the given array + * @param array defines the source array to read from + * @param offset defines the offset in the source array + * @returns a new Color4 object + */ + Color4.FromArray = function (array, offset) { + if (offset === void 0) { offset = 0; } + return new Color4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]); + }; + /** + * Creates a new Color3 from integer values (< 256) + * @param r defines the red component to read from (value between 0 and 255) + * @param g defines the green component to read from (value between 0 and 255) + * @param b defines the blue component to read from (value between 0 and 255) + * @param a defines the alpha component to read from (value between 0 and 255) + * @returns a new Color3 object + */ + Color4.FromInts = function (r, g, b, a) { + return new Color4(r / 255.0, g / 255.0, b / 255.0, a / 255.0); + }; + /** + * Check the content of a given array and convert it to an array containing RGBA data + * If the original array was already containing count * 4 values then it is returned directly + * @param colors defines the array to check + * @param count defines the number of RGBA data to expect + * @returns an array containing count * 4 values (RGBA) + */ + Color4.CheckColors4 = function (colors, count) { + // Check if color3 was used + if (colors.length === count * 3) { + var colors4 = []; + for (var index = 0; index < colors.length; index += 3) { + var newIndex = (index / 3) * 4; + colors4[newIndex] = colors[index]; + colors4[newIndex + 1] = colors[index + 1]; + colors4[newIndex + 2] = colors[index + 2]; + colors4[newIndex + 3] = 1.0; + } + return colors4; + } + return colors; + }; + return Color4; + }()); + BABYLON.Color4 = Color4; + /** + * Class representing a vector containing 2 coordinates + */ + var Vector2 = /** @class */ (function () { + /** + * Creates a new Vector2 from the given x and y coordinates + * @param x defines the first coordinate + * @param y defines the second coordinate + */ + function Vector2( + /** defines the first coordinate */ + x, + /** defines the second coordinate */ + y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + this.x = x; + this.y = y; + } + /** + * Gets a string with the Vector2 coordinates + * @returns a string with the Vector2 coordinates + */ + Vector2.prototype.toString = function () { + return "{X: " + this.x + " Y:" + this.y + "}"; + }; + /** + * Gets class name + * @returns the string "Vector2" + */ + Vector2.prototype.getClassName = function () { + return "Vector2"; + }; + /** + * Gets current vector hash code + * @returns the Vector2 hash code as a number + */ + Vector2.prototype.getHashCode = function () { + var hash = this.x || 0; + hash = (hash * 397) ^ (this.y || 0); + return hash; + }; + // Operators + /** + * Sets the Vector2 coordinates in the given array or Float32Array from the given index. + * @param array defines the source array + * @param index defines the offset in source array + * @returns the current Vector2 + */ + Vector2.prototype.toArray = function (array, index) { + if (index === void 0) { index = 0; } + array[index] = this.x; + array[index + 1] = this.y; + return this; + }; + /** + * Copy the current vector to an array + * @returns a new array with 2 elements: the Vector2 coordinates. + */ + Vector2.prototype.asArray = function () { + var result = new Array(); + this.toArray(result, 0); + return result; + }; + /** + * Sets the Vector2 coordinates with the given Vector2 coordinates + * @param source defines the source Vector2 + * @returns the current updated Vector2 + */ + Vector2.prototype.copyFrom = function (source) { + this.x = source.x; + this.y = source.y; + return this; + }; + /** + * Sets the Vector2 coordinates with the given floats + * @param x defines the first coordinate + * @param y defines the second coordinate + * @returns the current updated Vector2 + */ + Vector2.prototype.copyFromFloats = function (x, y) { + this.x = x; + this.y = y; + return this; + }; + /** + * Sets the Vector2 coordinates with the given floats + * @param x defines the first coordinate + * @param y defines the second coordinate + * @returns the current updated Vector2 + */ + Vector2.prototype.set = function (x, y) { + return this.copyFromFloats(x, y); + }; + /** + * Add another vector with the current one + * @param otherVector defines the other vector + * @returns a new Vector2 set with the addition of the current Vector2 and the given one coordinates + */ + Vector2.prototype.add = function (otherVector) { + return new Vector2(this.x + otherVector.x, this.y + otherVector.y); + }; + /** + * Sets the "result" coordinates with the addition of the current Vector2 and the given one coordinates + * @param otherVector defines the other vector + * @param result defines the target vector + * @returns the unmodified current Vector2 + */ + Vector2.prototype.addToRef = function (otherVector, result) { + result.x = this.x + otherVector.x; + result.y = this.y + otherVector.y; + return this; + }; + /** + * Set the Vector2 coordinates by adding the given Vector2 coordinates + * @param otherVector defines the other vector + * @returns the current updated Vector2 + */ + Vector2.prototype.addInPlace = function (otherVector) { + this.x += otherVector.x; + this.y += otherVector.y; + return this; + }; + /** + * Gets a new Vector2 by adding the current Vector2 coordinates to the given Vector3 x, y coordinates + * @param otherVector defines the other vector + * @returns a new Vector2 + */ + Vector2.prototype.addVector3 = function (otherVector) { + return new Vector2(this.x + otherVector.x, this.y + otherVector.y); + }; + /** + * Gets a new Vector2 set with the subtracted coordinates of the given one from the current Vector2 + * @param otherVector defines the other vector + * @returns a new Vector2 + */ + Vector2.prototype.subtract = function (otherVector) { + return new Vector2(this.x - otherVector.x, this.y - otherVector.y); + }; + /** + * Sets the "result" coordinates with the subtraction of the given one from the current Vector2 coordinates. + * @param otherVector defines the other vector + * @param result defines the target vector + * @returns the unmodified current Vector2 + */ + Vector2.prototype.subtractToRef = function (otherVector, result) { + result.x = this.x - otherVector.x; + result.y = this.y - otherVector.y; + return this; + }; + /** + * Sets the current Vector2 coordinates by subtracting from it the given one coordinates + * @param otherVector defines the other vector + * @returns the current updated Vector2 + */ + Vector2.prototype.subtractInPlace = function (otherVector) { + this.x -= otherVector.x; + this.y -= otherVector.y; + return this; + }; + /** + * Multiplies in place the current Vector2 coordinates by the given ones + * @param otherVector defines the other vector + * @returns the current updated Vector2 + */ + Vector2.prototype.multiplyInPlace = function (otherVector) { + this.x *= otherVector.x; + this.y *= otherVector.y; + return this; + }; + /** + * Returns a new Vector2 set with the multiplication of the current Vector2 and the given one coordinates + * @param otherVector defines the other vector + * @returns a new Vector2 + */ + Vector2.prototype.multiply = function (otherVector) { + return new Vector2(this.x * otherVector.x, this.y * otherVector.y); + }; + /** + * Sets "result" coordinates with the multiplication of the current Vector2 and the given one coordinates + * @param otherVector defines the other vector + * @param result defines the target vector + * @returns the unmodified current Vector2 + */ + Vector2.prototype.multiplyToRef = function (otherVector, result) { + result.x = this.x * otherVector.x; + result.y = this.y * otherVector.y; + return this; + }; + /** + * Gets a new Vector2 set with the Vector2 coordinates multiplied by the given floats + * @param x defines the first coordinate + * @param y defines the second coordinate + * @returns a new Vector2 + */ + Vector2.prototype.multiplyByFloats = function (x, y) { + return new Vector2(this.x * x, this.y * y); + }; + /** + * Returns a new Vector2 set with the Vector2 coordinates divided by the given one coordinates + * @param otherVector defines the other vector + * @returns a new Vector2 + */ + Vector2.prototype.divide = function (otherVector) { + return new Vector2(this.x / otherVector.x, this.y / otherVector.y); + }; + /** + * Sets the "result" coordinates with the Vector2 divided by the given one coordinates + * @param otherVector defines the other vector + * @param result defines the target vector + * @returns the unmodified current Vector2 + */ + Vector2.prototype.divideToRef = function (otherVector, result) { + result.x = this.x / otherVector.x; + result.y = this.y / otherVector.y; + return this; + }; + /** + * Divides the current Vector2 coordinates by the given ones + * @param otherVector defines the other vector + * @returns the current updated Vector2 + */ + Vector2.prototype.divideInPlace = function (otherVector) { + return this.divideToRef(otherVector, this); + }; + /** + * Gets a new Vector2 with current Vector2 negated coordinates + * @returns a new Vector2 + */ + Vector2.prototype.negate = function () { + return new Vector2(-this.x, -this.y); + }; + /** + * Multiply the Vector2 coordinates by scale + * @param scale defines the scaling factor + * @returns the current updated Vector2 + */ + Vector2.prototype.scaleInPlace = function (scale) { + this.x *= scale; + this.y *= scale; + return this; + }; + /** + * Returns a new Vector2 scaled by "scale" from the current Vector2 + * @param scale defines the scaling factor + * @returns a new Vector2 + */ + Vector2.prototype.scale = function (scale) { + var result = new Vector2(0, 0); + this.scaleToRef(scale, result); + return result; + }; + /** + * Scale the current Vector2 values by a factor to a given Vector2 + * @param scale defines the scale factor + * @param result defines the Vector2 object where to store the result + * @returns the unmodified current Vector2 + */ + Vector2.prototype.scaleToRef = function (scale, result) { + result.x = this.x * scale; + result.y = this.y * scale; + return this; + }; + /** + * Scale the current Vector2 values by a factor and add the result to a given Vector2 + * @param scale defines the scale factor + * @param result defines the Vector2 object where to store the result + * @returns the unmodified current Vector2 + */ + Vector2.prototype.scaleAndAddToRef = function (scale, result) { + result.x += this.x * scale; + result.y += this.y * scale; + return this; + }; + /** + * Gets a boolean if two vectors are equals + * @param otherVector defines the other vector + * @returns true if the given vector coordinates strictly equal the current Vector2 ones + */ + Vector2.prototype.equals = function (otherVector) { + return otherVector && this.x === otherVector.x && this.y === otherVector.y; + }; + /** + * Gets a boolean if two vectors are equals (using an epsilon value) + * @param otherVector defines the other vector + * @param epsilon defines the minimal distance to consider equality + * @returns true if the given vector coordinates are close to the current ones by a distance of epsilon. + */ + Vector2.prototype.equalsWithEpsilon = function (otherVector, epsilon) { + if (epsilon === void 0) { epsilon = BABYLON.Epsilon; } + return otherVector && BABYLON.Scalar.WithinEpsilon(this.x, otherVector.x, epsilon) && BABYLON.Scalar.WithinEpsilon(this.y, otherVector.y, epsilon); + }; + /** + * Gets a new Vector2 from current Vector2 floored values + * @returns a new Vector2 + */ + Vector2.prototype.floor = function () { + return new Vector2(Math.floor(this.x), Math.floor(this.y)); + }; + /** + * Gets a new Vector2 from current Vector2 floored values + * @returns a new Vector2 + */ + Vector2.prototype.fract = function () { + return new Vector2(this.x - Math.floor(this.x), this.y - Math.floor(this.y)); + }; + // Properties + /** + * Gets the length of the vector + * @returns the vector length (float) + */ + Vector2.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y); + }; + /** + * Gets the vector squared length + * @returns the vector squared length (float) + */ + Vector2.prototype.lengthSquared = function () { + return (this.x * this.x + this.y * this.y); + }; + // Methods + /** + * Normalize the vector + * @returns the current updated Vector2 + */ + Vector2.prototype.normalize = function () { + var len = this.length(); + if (len === 0) { + return this; + } + var num = 1.0 / len; + this.x *= num; + this.y *= num; + return this; + }; + /** + * Gets a new Vector2 copied from the Vector2 + * @returns a new Vector2 + */ + Vector2.prototype.clone = function () { + return new Vector2(this.x, this.y); + }; + // Statics + /** + * Gets a new Vector2(0, 0) + * @returns a new Vector2 + */ + Vector2.Zero = function () { + return new Vector2(0, 0); + }; + /** + * Gets a new Vector2(1, 1) + * @returns a new Vector2 + */ + Vector2.One = function () { + return new Vector2(1, 1); + }; + /** + * Gets a new Vector2 set from the given index element of the given array + * @param array defines the data source + * @param offset defines the offset in the data source + * @returns a new Vector2 + */ + Vector2.FromArray = function (array, offset) { + if (offset === void 0) { offset = 0; } + return new Vector2(array[offset], array[offset + 1]); + }; + /** + * Sets "result" from the given index element of the given array + * @param array defines the data source + * @param offset defines the offset in the data source + * @param result defines the target vector + */ + Vector2.FromArrayToRef = function (array, offset, result) { + result.x = array[offset]; + result.y = array[offset + 1]; + }; + /** + * Gets a new Vector2 located for "amount" (float) on the CatmullRom spline defined by the given four Vector2 + * @param value1 defines 1st point of control + * @param value2 defines 2nd point of control + * @param value3 defines 3rd point of control + * @param value4 defines 4th point of control + * @param amount defines the interpolation factor + * @returns a new Vector2 + */ + Vector2.CatmullRom = function (value1, value2, value3, value4, amount) { + var squared = amount * amount; + var cubed = amount * squared; + var x = 0.5 * ((((2.0 * value2.x) + ((-value1.x + value3.x) * amount)) + + (((((2.0 * value1.x) - (5.0 * value2.x)) + (4.0 * value3.x)) - value4.x) * squared)) + + ((((-value1.x + (3.0 * value2.x)) - (3.0 * value3.x)) + value4.x) * cubed)); + var y = 0.5 * ((((2.0 * value2.y) + ((-value1.y + value3.y) * amount)) + + (((((2.0 * value1.y) - (5.0 * value2.y)) + (4.0 * value3.y)) - value4.y) * squared)) + + ((((-value1.y + (3.0 * value2.y)) - (3.0 * value3.y)) + value4.y) * cubed)); + return new Vector2(x, y); + }; + /** + * Returns a new Vector2 set with same the coordinates than "value" ones if the vector "value" is in the square defined by "min" and "max". + * If a coordinate of "value" is lower than "min" coordinates, the returned Vector2 is given this "min" coordinate. + * If a coordinate of "value" is greater than "max" coordinates, the returned Vector2 is given this "max" coordinate + * @param value defines the value to clamp + * @param min defines the lower limit + * @param max defines the upper limit + * @returns a new Vector2 + */ + Vector2.Clamp = function (value, min, max) { + var x = value.x; + x = (x > max.x) ? max.x : x; + x = (x < min.x) ? min.x : x; + var y = value.y; + y = (y > max.y) ? max.y : y; + y = (y < min.y) ? min.y : y; + return new Vector2(x, y); + }; + /** + * Returns a new Vector2 located for "amount" (float) on the Hermite spline defined by the vectors "value1", "value3", "tangent1", "tangent2" + * @param value1 defines the 1st control point + * @param tangent1 defines the outgoing tangent + * @param value2 defines the 2nd control point + * @param tangent2 defines the incoming tangent + * @param amount defines the interpolation factor + * @returns a new Vector2 + */ + Vector2.Hermite = function (value1, tangent1, value2, tangent2, amount) { + var squared = amount * amount; + var cubed = amount * squared; + var part1 = ((2.0 * cubed) - (3.0 * squared)) + 1.0; + var part2 = (-2.0 * cubed) + (3.0 * squared); + var part3 = (cubed - (2.0 * squared)) + amount; + var part4 = cubed - squared; + var x = (((value1.x * part1) + (value2.x * part2)) + (tangent1.x * part3)) + (tangent2.x * part4); + var y = (((value1.y * part1) + (value2.y * part2)) + (tangent1.y * part3)) + (tangent2.y * part4); + return new Vector2(x, y); + }; + /** + * Returns a new Vector2 located for "amount" (float) on the linear interpolation between the vector "start" adn the vector "end". + * @param start defines the start vector + * @param end defines the end vector + * @param amount defines the interpolation factor + * @returns a new Vector2 + */ + Vector2.Lerp = function (start, end, amount) { + var x = start.x + ((end.x - start.x) * amount); + var y = start.y + ((end.y - start.y) * amount); + return new Vector2(x, y); + }; + /** + * Gets the dot product of the vector "left" and the vector "right" + * @param left defines first vector + * @param right defines second vector + * @returns the dot product (float) + */ + Vector2.Dot = function (left, right) { + return left.x * right.x + left.y * right.y; + }; + /** + * Returns a new Vector2 equal to the normalized given vector + * @param vector defines the vector to normalize + * @returns a new Vector2 + */ + Vector2.Normalize = function (vector) { + var newVector = vector.clone(); + newVector.normalize(); + return newVector; + }; + /** + * Gets a new Vector2 set with the minimal coordinate values from the "left" and "right" vectors + * @param left defines 1st vector + * @param right defines 2nd vector + * @returns a new Vector2 + */ + Vector2.Minimize = function (left, right) { + var x = (left.x < right.x) ? left.x : right.x; + var y = (left.y < right.y) ? left.y : right.y; + return new Vector2(x, y); + }; + /** + * Gets a new Vecto2 set with the maximal coordinate values from the "left" and "right" vectors + * @param left defines 1st vector + * @param right defines 2nd vector + * @returns a new Vector2 + */ + Vector2.Maximize = function (left, right) { + var x = (left.x > right.x) ? left.x : right.x; + var y = (left.y > right.y) ? left.y : right.y; + return new Vector2(x, y); + }; + /** + * Gets a new Vector2 set with the transformed coordinates of the given vector by the given transformation matrix + * @param vector defines the vector to transform + * @param transformation defines the matrix to apply + * @returns a new Vector2 + */ + Vector2.Transform = function (vector, transformation) { + var r = Vector2.Zero(); + Vector2.TransformToRef(vector, transformation, r); + return r; + }; + /** + * Transforms the given vector coordinates by the given transformation matrix and stores the result in the vector "result" coordinates + * @param vector defines the vector to transform + * @param transformation defines the matrix to apply + * @param result defines the target vector + */ + Vector2.TransformToRef = function (vector, transformation, result) { + var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + transformation.m[12]; + var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + transformation.m[13]; + result.x = x; + result.y = y; + }; + /** + * Determines if a given vector is included in a triangle + * @param p defines the vector to test + * @param p0 defines 1st triangle point + * @param p1 defines 2nd triangle point + * @param p2 defines 3rd triangle point + * @returns true if the point "p" is in the triangle defined by the vertors "p0", "p1", "p2" + */ + Vector2.PointInTriangle = function (p, p0, p1, p2) { + var a = 1 / 2 * (-p1.y * p2.x + p0.y * (-p1.x + p2.x) + p0.x * (p1.y - p2.y) + p1.x * p2.y); + var sign = a < 0 ? -1 : 1; + var s = (p0.y * p2.x - p0.x * p2.y + (p2.y - p0.y) * p.x + (p0.x - p2.x) * p.y) * sign; + var t = (p0.x * p1.y - p0.y * p1.x + (p0.y - p1.y) * p.x + (p1.x - p0.x) * p.y) * sign; + return s > 0 && t > 0 && (s + t) < 2 * a * sign; + }; + /** + * Gets the distance between the vectors "value1" and "value2" + * @param value1 defines first vector + * @param value2 defines second vector + * @returns the distance between vectors + */ + Vector2.Distance = function (value1, value2) { + return Math.sqrt(Vector2.DistanceSquared(value1, value2)); + }; + /** + * Returns the squared distance between the vectors "value1" and "value2" + * @param value1 defines first vector + * @param value2 defines second vector + * @returns the squared distance between vectors + */ + Vector2.DistanceSquared = function (value1, value2) { + var x = value1.x - value2.x; + var y = value1.y - value2.y; + return (x * x) + (y * y); + }; + /** + * Gets a new Vector2 located at the center of the vectors "value1" and "value2" + * @param value1 defines first vector + * @param value2 defines second vector + * @returns a new Vector2 + */ + Vector2.Center = function (value1, value2) { + var center = value1.add(value2); + center.scaleInPlace(0.5); + return center; + }; + /** + * Gets the shortest distance (float) between the point "p" and the segment defined by the two points "segA" and "segB". + * @param p defines the middle point + * @param segA defines one point of the segment + * @param segB defines the other point of the segment + * @returns the shortest distance + */ + Vector2.DistanceOfPointFromSegment = function (p, segA, segB) { + var l2 = Vector2.DistanceSquared(segA, segB); + if (l2 === 0.0) { + return Vector2.Distance(p, segA); + } + var v = segB.subtract(segA); + var t = Math.max(0, Math.min(1, Vector2.Dot(p.subtract(segA), v) / l2)); + var proj = segA.add(v.multiplyByFloats(t, t)); + return Vector2.Distance(p, proj); + }; + return Vector2; + }()); + BABYLON.Vector2 = Vector2; + /** + * Classed used to store (x,y,z) vector representation + * A Vector3 is the main object used in 3D geometry + * It can represent etiher the coordinates of a point the space, either a direction + * Reminder: Babylon.js uses a left handed forward facing system + */ + var Vector3 = /** @class */ (function () { + /** + * Creates a new Vector3 object from the given x, y, z (floats) coordinates. + * @param x defines the first coordinates (on X axis) + * @param y defines the second coordinates (on Y axis) + * @param z defines the third coordinates (on Z axis) + */ + function Vector3( + /** + * Defines the first coordinates (on X axis) + */ + x, + /** + * Defines the second coordinates (on Y axis) + */ + y, + /** + * Defines the third coordinates (on Z axis) + */ + z) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (z === void 0) { z = 0; } + this.x = x; + this.y = y; + this.z = z; + } + /** + * Creates a string representation of the Vector3 + * @returns a string with the Vector3 coordinates. + */ + Vector3.prototype.toString = function () { + return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + "}"; + }; + /** + * Gets the class name + * @returns the string "Vector3" + */ + Vector3.prototype.getClassName = function () { + return "Vector3"; + }; + /** + * Creates the Vector3 hash code + * @returns a number which tends to be unique between Vector3 instances + */ + Vector3.prototype.getHashCode = function () { + var hash = this.x || 0; + hash = (hash * 397) ^ (this.y || 0); + hash = (hash * 397) ^ (this.z || 0); + return hash; + }; + // Operators + /** + * Creates an array containing three elements : the coordinates of the Vector3 + * @returns a new array of numbers + */ + Vector3.prototype.asArray = function () { + var result = []; + this.toArray(result, 0); + return result; + }; + /** + * Populates the given array or Float32Array from the given index with the successive coordinates of the Vector3 + * @param array defines the destination array + * @param index defines the offset in the destination array + * @returns the current Vector3 + */ + Vector3.prototype.toArray = function (array, index) { + if (index === void 0) { index = 0; } + array[index] = this.x; + array[index + 1] = this.y; + array[index + 2] = this.z; + return this; + }; + /** + * Converts the current Vector3 into a quaternion (considering that the Vector3 contains Euler angles representation of a rotation) + * @returns a new Quaternion object, computed from the Vector3 coordinates + */ + Vector3.prototype.toQuaternion = function () { + return BABYLON.Quaternion.RotationYawPitchRoll(this.x, this.y, this.z); + }; + /** + * Adds the given vector to the current Vector3 + * @param otherVector defines the second operand + * @returns the current updated Vector3 + */ + Vector3.prototype.addInPlace = function (otherVector) { + this.x += otherVector.x; + this.y += otherVector.y; + this.z += otherVector.z; + return this; + }; + /** + * Gets a new Vector3, result of the addition the current Vector3 and the given vector + * @param otherVector defines the second operand + * @returns the resulting Vector3 + */ + Vector3.prototype.add = function (otherVector) { + return new Vector3(this.x + otherVector.x, this.y + otherVector.y, this.z + otherVector.z); + }; + /** + * Adds the current Vector3 to the given one and stores the result in the vector "result" + * @param otherVector defines the second operand + * @param result defines the Vector3 object where to store the result + * @returns the current Vector3 + */ + Vector3.prototype.addToRef = function (otherVector, result) { + result.x = this.x + otherVector.x; + result.y = this.y + otherVector.y; + result.z = this.z + otherVector.z; + return this; + }; + /** + * Subtract the given vector from the current Vector3 + * @param otherVector defines the second operand + * @returns the current updated Vector3 + */ + Vector3.prototype.subtractInPlace = function (otherVector) { + this.x -= otherVector.x; + this.y -= otherVector.y; + this.z -= otherVector.z; + return this; + }; + /** + * Returns a new Vector3, result of the subtraction of the given vector from the current Vector3 + * @param otherVector defines the second operand + * @returns the resulting Vector3 + */ + Vector3.prototype.subtract = function (otherVector) { + return new Vector3(this.x - otherVector.x, this.y - otherVector.y, this.z - otherVector.z); + }; + /** + * Subtracts the given vector from the current Vector3 and stores the result in the vector "result". + * @param otherVector defines the second operand + * @param result defines the Vector3 object where to store the result + * @returns the current Vector3 + */ + Vector3.prototype.subtractToRef = function (otherVector, result) { + result.x = this.x - otherVector.x; + result.y = this.y - otherVector.y; + result.z = this.z - otherVector.z; + return this; + }; + /** + * Returns a new Vector3 set with the subtraction of the given floats from the current Vector3 coordinates + * @param x defines the x coordinate of the operand + * @param y defines the y coordinate of the operand + * @param z defines the z coordinate of the operand + * @returns the resulting Vector3 + */ + Vector3.prototype.subtractFromFloats = function (x, y, z) { + return new Vector3(this.x - x, this.y - y, this.z - z); + }; + /** + * Subtracts the given floats from the current Vector3 coordinates and set the given vector "result" with this result + * @param x defines the x coordinate of the operand + * @param y defines the y coordinate of the operand + * @param z defines the z coordinate of the operand + * @param result defines the Vector3 object where to store the result + * @returns the current Vector3 + */ + Vector3.prototype.subtractFromFloatsToRef = function (x, y, z, result) { + result.x = this.x - x; + result.y = this.y - y; + result.z = this.z - z; + return this; + }; + /** + * Gets a new Vector3 set with the current Vector3 negated coordinates + * @returns a new Vector3 + */ + Vector3.prototype.negate = function () { + return new Vector3(-this.x, -this.y, -this.z); + }; + /** + * Multiplies the Vector3 coordinates by the float "scale" + * @param scale defines the multiplier factor + * @returns the current updated Vector3 + */ + Vector3.prototype.scaleInPlace = function (scale) { + this.x *= scale; + this.y *= scale; + this.z *= scale; + return this; + }; + /** + * Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float "scale" + * @param scale defines the multiplier factor + * @returns a new Vector3 + */ + Vector3.prototype.scale = function (scale) { + return new Vector3(this.x * scale, this.y * scale, this.z * scale); + }; + /** + * Multiplies the current Vector3 coordinates by the float "scale" and stores the result in the given vector "result" coordinates + * @param scale defines the multiplier factor + * @param result defines the Vector3 object where to store the result + * @returns the current Vector3 + */ + Vector3.prototype.scaleToRef = function (scale, result) { + result.x = this.x * scale; + result.y = this.y * scale; + result.z = this.z * scale; + return this; + }; + /** + * Scale the current Vector3 values by a factor and add the result to a given Vector3 + * @param scale defines the scale factor + * @param result defines the Vector3 object where to store the result + * @returns the unmodified current Vector3 + */ + Vector3.prototype.scaleAndAddToRef = function (scale, result) { + result.x += this.x * scale; + result.y += this.y * scale; + result.z += this.z * scale; + return this; + }; + /** + * Returns true if the current Vector3 and the given vector coordinates are strictly equal + * @param otherVector defines the second operand + * @returns true if both vectors are equals + */ + Vector3.prototype.equals = function (otherVector) { + return otherVector && this.x === otherVector.x && this.y === otherVector.y && this.z === otherVector.z; + }; + /** + * Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon + * @param otherVector defines the second operand + * @param epsilon defines the minimal distance to define values as equals + * @returns true if both vectors are distant less than epsilon + */ + Vector3.prototype.equalsWithEpsilon = function (otherVector, epsilon) { + if (epsilon === void 0) { epsilon = BABYLON.Epsilon; } + return otherVector && BABYLON.Scalar.WithinEpsilon(this.x, otherVector.x, epsilon) && BABYLON.Scalar.WithinEpsilon(this.y, otherVector.y, epsilon) && BABYLON.Scalar.WithinEpsilon(this.z, otherVector.z, epsilon); + }; + /** + * Returns true if the current Vector3 coordinates equals the given floats + * @param x defines the x coordinate of the operand + * @param y defines the y coordinate of the operand + * @param z defines the z coordinate of the operand + * @returns true if both vectors are equals + */ + Vector3.prototype.equalsToFloats = function (x, y, z) { + return this.x === x && this.y === y && this.z === z; + }; + /** + * Multiplies the current Vector3 coordinates by the given ones + * @param otherVector defines the second operand + * @returns the current updated Vector3 + */ + Vector3.prototype.multiplyInPlace = function (otherVector) { + this.x *= otherVector.x; + this.y *= otherVector.y; + this.z *= otherVector.z; + return this; + }; + /** + * Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector + * @param otherVector defines the second operand + * @returns the new Vector3 + */ + Vector3.prototype.multiply = function (otherVector) { + return new Vector3(this.x * otherVector.x, this.y * otherVector.y, this.z * otherVector.z); + }; + /** + * Multiplies the current Vector3 by the given one and stores the result in the given vector "result" + * @param otherVector defines the second operand + * @param result defines the Vector3 object where to store the result + * @returns the current Vector3 + */ + Vector3.prototype.multiplyToRef = function (otherVector, result) { + result.x = this.x * otherVector.x; + result.y = this.y * otherVector.y; + result.z = this.z * otherVector.z; + return this; + }; + /** + * Returns a new Vector3 set with the result of the mulliplication of the current Vector3 coordinates by the given floats + * @param x defines the x coordinate of the operand + * @param y defines the y coordinate of the operand + * @param z defines the z coordinate of the operand + * @returns the new Vector3 + */ + Vector3.prototype.multiplyByFloats = function (x, y, z) { + return new Vector3(this.x * x, this.y * y, this.z * z); + }; + /** + * Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones + * @param otherVector defines the second operand + * @returns the new Vector3 + */ + Vector3.prototype.divide = function (otherVector) { + return new Vector3(this.x / otherVector.x, this.y / otherVector.y, this.z / otherVector.z); + }; + /** + * Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result" + * @param otherVector defines the second operand + * @param result defines the Vector3 object where to store the result + * @returns the current Vector3 + */ + Vector3.prototype.divideToRef = function (otherVector, result) { + result.x = this.x / otherVector.x; + result.y = this.y / otherVector.y; + result.z = this.z / otherVector.z; + return this; + }; + /** + * Divides the current Vector3 coordinates by the given ones. + * @param otherVector defines the second operand + * @returns the current updated Vector3 + */ + Vector3.prototype.divideInPlace = function (otherVector) { + return this.divideToRef(otherVector, this); + }; + /** + * Updates the current Vector3 with the minimal coordinate values between its and the given vector ones + * @param other defines the second operand + * @returns the current updated Vector3 + */ + Vector3.prototype.minimizeInPlace = function (other) { + return this.minimizeInPlaceFromFloats(other.x, other.y, other.z); + }; + /** + * Updates the current Vector3 with the maximal coordinate values between its and the given vector ones. + * @param other defines the second operand + * @returns the current updated Vector3 + */ + Vector3.prototype.maximizeInPlace = function (other) { + return this.maximizeInPlaceFromFloats(other.x, other.y, other.z); + }; + /** + * Updates the current Vector3 with the minimal coordinate values between its and the given coordinates + * @param x defines the x coordinate of the operand + * @param y defines the y coordinate of the operand + * @param z defines the z coordinate of the operand + * @returns the current updated Vector3 + */ + Vector3.prototype.minimizeInPlaceFromFloats = function (x, y, z) { + if (x < this.x) { + this.x = x; + } + if (y < this.y) { + this.y = y; + } + if (z < this.z) { + this.z = z; + } + return this; + }; + /** + * Updates the current Vector3 with the maximal coordinate values between its and the given coordinates. + * @param x defines the x coordinate of the operand + * @param y defines the y coordinate of the operand + * @param z defines the z coordinate of the operand + * @returns the current updated Vector3 + */ + Vector3.prototype.maximizeInPlaceFromFloats = function (x, y, z) { + if (x > this.x) { + this.x = x; + } + if (y > this.y) { + this.y = y; + } + if (z > this.z) { + this.z = z; + } + return this; + }; + Object.defineProperty(Vector3.prototype, "isNonUniform", { + /** + * Gets a boolean indicating that the vector is non uniform meaning x, y or z are not all the same + */ + get: function () { + var absX = Math.abs(this.x); + var absY = Math.abs(this.y); + if (absX !== absY) { + return true; + } + var absZ = Math.abs(this.z); + if (absX !== absZ) { + return true; + } + if (absY !== absZ) { + return true; + } + return false; + }, + enumerable: true, + configurable: true + }); + /** + * Gets a new Vector3 from current Vector3 floored values + * @returns a new Vector3 + */ + Vector3.prototype.floor = function () { + return new Vector3(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z)); + }; + /** + * Gets a new Vector3 from current Vector3 floored values + * @returns a new Vector3 + */ + Vector3.prototype.fract = function () { + return new Vector3(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z)); + }; + // Properties + /** + * Gets the length of the Vector3 + * @returns the length of the Vecto3 + */ + Vector3.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + }; + /** + * Gets the squared length of the Vector3 + * @returns squared length of the Vector3 + */ + Vector3.prototype.lengthSquared = function () { + return (this.x * this.x + this.y * this.y + this.z * this.z); + }; + /** + * Normalize the current Vector3. + * Please note that this is an in place operation. + * @returns the current updated Vector3 + */ + Vector3.prototype.normalize = function () { + var len = this.length(); + if (len === 0 || len === 1.0) { + return this; + } + var num = 1.0 / len; + this.x *= num; + this.y *= num; + this.z *= num; + return this; + }; + /** + * Normalize the current Vector3 to a new vector + * @returns the new Vector3 + */ + Vector3.prototype.normalizeToNew = function () { + var normalized = new Vector3(0, 0, 0); + this.normalizeToRef(normalized); + return normalized; + }; + /** + * Normalize the current Vector3 to the reference + * @param reference define the Vector3 to update + * @returns the updated Vector3 + */ + Vector3.prototype.normalizeToRef = function (reference) { + var len = this.length(); + if (len === 0 || len === 1.0) { + reference.set(this.x, this.y, this.z); + return reference; + } + var scale = 1.0 / len; + this.scaleToRef(scale, reference); + return reference; + }; + /** + * Creates a new Vector3 copied from the current Vector3 + * @returns the new Vector3 + */ + Vector3.prototype.clone = function () { + return new Vector3(this.x, this.y, this.z); + }; + /** + * Copies the given vector coordinates to the current Vector3 ones + * @param source defines the source Vector3 + * @returns the current updated Vector3 + */ + Vector3.prototype.copyFrom = function (source) { + this.x = source.x; + this.y = source.y; + this.z = source.z; + return this; + }; + /** + * Copies the given floats to the current Vector3 coordinates + * @param x defines the x coordinate of the operand + * @param y defines the y coordinate of the operand + * @param z defines the z coordinate of the operand + * @returns the current updated Vector3 + */ + Vector3.prototype.copyFromFloats = function (x, y, z) { + this.x = x; + this.y = y; + this.z = z; + return this; + }; + /** + * Copies the given floats to the current Vector3 coordinates + * @param x defines the x coordinate of the operand + * @param y defines the y coordinate of the operand + * @param z defines the z coordinate of the operand + * @returns the current updated Vector3 + */ + Vector3.prototype.set = function (x, y, z) { + return this.copyFromFloats(x, y, z); + }; + // Statics + /** + * Get the clip factor between two vectors + * @param vector0 defines the first operand + * @param vector1 defines the second operand + * @param axis defines the axis to use + * @param size defines the size along the axis + * @returns the clip factor + */ + Vector3.GetClipFactor = function (vector0, vector1, axis, size) { + var d0 = Vector3.Dot(vector0, axis) - size; + var d1 = Vector3.Dot(vector1, axis) - size; + var s = d0 / (d0 - d1); + return s; + }; + /** + * Get angle between two vectors + * @param vector0 angle between vector0 and vector1 + * @param vector1 angle between vector0 and vector1 + * @param normal direction of the normal + * @return the angle between vector0 and vector1 + */ + Vector3.GetAngleBetweenVectors = function (vector0, vector1, normal) { + var v0 = MathTmp.Vector3[1].copyFrom(vector0).normalize(); + var v1 = MathTmp.Vector3[2].copyFrom(vector1).normalize(); + var dot = Vector3.Dot(v0, v1); + var n = MathTmp.Vector3[3]; + Vector3.CrossToRef(v0, v1, n); + if (Vector3.Dot(n, normal) > 0) { + return Math.acos(dot); + } + return -Math.acos(dot); + }; + /** + * Returns a new Vector3 set from the index "offset" of the given array + * @param array defines the source array + * @param offset defines the offset in the source array + * @returns the new Vector3 + */ + Vector3.FromArray = function (array, offset) { + if (!offset) { + offset = 0; + } + return new Vector3(array[offset], array[offset + 1], array[offset + 2]); + }; + /** + * Returns a new Vector3 set from the index "offset" of the given Float32Array + * This function is deprecated. Use FromArray instead + * @param array defines the source array + * @param offset defines the offset in the source array + * @returns the new Vector3 + */ + Vector3.FromFloatArray = function (array, offset) { + return Vector3.FromArray(array, offset); + }; + /** + * Sets the given vector "result" with the element values from the index "offset" of the given array + * @param array defines the source array + * @param offset defines the offset in the source array + * @param result defines the Vector3 where to store the result + */ + Vector3.FromArrayToRef = function (array, offset, result) { + result.x = array[offset]; + result.y = array[offset + 1]; + result.z = array[offset + 2]; + }; + /** + * Sets the given vector "result" with the element values from the index "offset" of the given Float32Array + * This function is deprecated. Use FromArrayToRef instead. + * @param array defines the source array + * @param offset defines the offset in the source array + * @param result defines the Vector3 where to store the result + */ + Vector3.FromFloatArrayToRef = function (array, offset, result) { + return Vector3.FromArrayToRef(array, offset, result); + }; + /** + * Sets the given vector "result" with the given floats. + * @param x defines the x coordinate of the source + * @param y defines the y coordinate of the source + * @param z defines the z coordinate of the source + * @param result defines the Vector3 where to store the result + */ + Vector3.FromFloatsToRef = function (x, y, z, result) { + result.x = x; + result.y = y; + result.z = z; + }; + /** + * Returns a new Vector3 set to (0.0, 0.0, 0.0) + * @returns a new empty Vector3 + */ + Vector3.Zero = function () { + return new Vector3(0.0, 0.0, 0.0); + }; + /** + * Returns a new Vector3 set to (1.0, 1.0, 1.0) + * @returns a new unit Vector3 + */ + Vector3.One = function () { + return new Vector3(1.0, 1.0, 1.0); + }; + /** + * Returns a new Vector3 set to (0.0, 1.0, 0.0) + * @returns a new up Vector3 + */ + Vector3.Up = function () { + return new Vector3(0.0, 1.0, 0.0); + }; + /** + * Returns a new Vector3 set to (0.0, -1.0, 0.0) + * @returns a new down Vector3 + */ + Vector3.Down = function () { + return new Vector3(0.0, -1.0, 0.0); + }; + /** + * Returns a new Vector3 set to (0.0, 0.0, 1.0) + * @returns a new forward Vector3 + */ + Vector3.Forward = function () { + return new Vector3(0.0, 0.0, 1.0); + }; + /** + * Returns a new Vector3 set to (0.0, 0.0, -1.0) + * @returns a new forward Vector3 + */ + Vector3.Backward = function () { + return new Vector3(0.0, 0.0, -1.0); + }; + /** + * Returns a new Vector3 set to (1.0, 0.0, 0.0) + * @returns a new right Vector3 + */ + Vector3.Right = function () { + return new Vector3(1.0, 0.0, 0.0); + }; + /** + * Returns a new Vector3 set to (-1.0, 0.0, 0.0) + * @returns a new left Vector3 + */ + Vector3.Left = function () { + return new Vector3(-1.0, 0.0, 0.0); + }; + /** + * Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector. + * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account) + * @param vector defines the Vector3 to transform + * @param transformation defines the transformation matrix + * @returns the transformed Vector3 + */ + Vector3.TransformCoordinates = function (vector, transformation) { + var result = Vector3.Zero(); + Vector3.TransformCoordinatesToRef(vector, transformation, result); + return result; + }; + /** + * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector + * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account) + * @param vector defines the Vector3 to transform + * @param transformation defines the transformation matrix + * @param result defines the Vector3 where to store the result + */ + Vector3.TransformCoordinatesToRef = function (vector, transformation, result) { + var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + (vector.z * transformation.m[8]) + transformation.m[12]; + var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + (vector.z * transformation.m[9]) + transformation.m[13]; + var z = (vector.x * transformation.m[2]) + (vector.y * transformation.m[6]) + (vector.z * transformation.m[10]) + transformation.m[14]; + var w = (vector.x * transformation.m[3]) + (vector.y * transformation.m[7]) + (vector.z * transformation.m[11]) + transformation.m[15]; + result.x = x / w; + result.y = y / w; + result.z = z / w; + }; + /** + * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z) + * This method computes tranformed coordinates only, not transformed direction vectors + * @param x define the x coordinate of the source vector + * @param y define the y coordinate of the source vector + * @param z define the z coordinate of the source vector + * @param transformation defines the transformation matrix + * @param result defines the Vector3 where to store the result + */ + Vector3.TransformCoordinatesFromFloatsToRef = function (x, y, z, transformation, result) { + var rx = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]) + transformation.m[12]; + var ry = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]) + transformation.m[13]; + var rz = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]) + transformation.m[14]; + var rw = (x * transformation.m[3]) + (y * transformation.m[7]) + (z * transformation.m[11]) + transformation.m[15]; + result.x = rx / rw; + result.y = ry / rw; + result.z = rz / rw; + }; + /** + * Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector + * This methods computes transformed normalized direction vectors only (ie. it does not apply translation) + * @param vector defines the Vector3 to transform + * @param transformation defines the transformation matrix + * @returns the new Vector3 + */ + Vector3.TransformNormal = function (vector, transformation) { + var result = Vector3.Zero(); + Vector3.TransformNormalToRef(vector, transformation, result); + return result; + }; + /** + * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector + * This methods computes transformed normalized direction vectors only (ie. it does not apply translation) + * @param vector defines the Vector3 to transform + * @param transformation defines the transformation matrix + * @param result defines the Vector3 where to store the result + */ + Vector3.TransformNormalToRef = function (vector, transformation, result) { + var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + (vector.z * transformation.m[8]); + var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + (vector.z * transformation.m[9]); + var z = (vector.x * transformation.m[2]) + (vector.y * transformation.m[6]) + (vector.z * transformation.m[10]); + result.x = x; + result.y = y; + result.z = z; + }; + /** + * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z) + * This methods computes transformed normalized direction vectors only (ie. it does not apply translation) + * @param x define the x coordinate of the source vector + * @param y define the y coordinate of the source vector + * @param z define the z coordinate of the source vector + * @param transformation defines the transformation matrix + * @param result defines the Vector3 where to store the result + */ + Vector3.TransformNormalFromFloatsToRef = function (x, y, z, transformation, result) { + result.x = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]); + result.y = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]); + result.z = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]); + }; + /** + * Returns a new Vector3 located for "amount" on the CatmullRom interpolation spline defined by the vectors "value1", "value2", "value3", "value4" + * @param value1 defines the first control point + * @param value2 defines the second control point + * @param value3 defines the third control point + * @param value4 defines the fourth control point + * @param amount defines the amount on the spline to use + * @returns the new Vector3 + */ + Vector3.CatmullRom = function (value1, value2, value3, value4, amount) { + var squared = amount * amount; + var cubed = amount * squared; + var x = 0.5 * ((((2.0 * value2.x) + ((-value1.x + value3.x) * amount)) + + (((((2.0 * value1.x) - (5.0 * value2.x)) + (4.0 * value3.x)) - value4.x) * squared)) + + ((((-value1.x + (3.0 * value2.x)) - (3.0 * value3.x)) + value4.x) * cubed)); + var y = 0.5 * ((((2.0 * value2.y) + ((-value1.y + value3.y) * amount)) + + (((((2.0 * value1.y) - (5.0 * value2.y)) + (4.0 * value3.y)) - value4.y) * squared)) + + ((((-value1.y + (3.0 * value2.y)) - (3.0 * value3.y)) + value4.y) * cubed)); + var z = 0.5 * ((((2.0 * value2.z) + ((-value1.z + value3.z) * amount)) + + (((((2.0 * value1.z) - (5.0 * value2.z)) + (4.0 * value3.z)) - value4.z) * squared)) + + ((((-value1.z + (3.0 * value2.z)) - (3.0 * value3.z)) + value4.z) * cubed)); + return new Vector3(x, y, z); + }; + /** + * Returns a new Vector3 set with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max" + * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one + * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one + * @param value defines the current value + * @param min defines the lower range value + * @param max defines the upper range value + * @returns the new Vector3 + */ + Vector3.Clamp = function (value, min, max) { + var x = value.x; + x = (x > max.x) ? max.x : x; + x = (x < min.x) ? min.x : x; + var y = value.y; + y = (y > max.y) ? max.y : y; + y = (y < min.y) ? min.y : y; + var z = value.z; + z = (z > max.z) ? max.z : z; + z = (z < min.z) ? min.z : z; + return new Vector3(x, y, z); + }; + /** + * Returns a new Vector3 located for "amount" (float) on the Hermite interpolation spline defined by the vectors "value1", "tangent1", "value2", "tangent2" + * @param value1 defines the first control point + * @param tangent1 defines the first tangent vector + * @param value2 defines the second control point + * @param tangent2 defines the second tangent vector + * @param amount defines the amount on the interpolation spline (between 0 and 1) + * @returns the new Vector3 + */ + Vector3.Hermite = function (value1, tangent1, value2, tangent2, amount) { + var squared = amount * amount; + var cubed = amount * squared; + var part1 = ((2.0 * cubed) - (3.0 * squared)) + 1.0; + var part2 = (-2.0 * cubed) + (3.0 * squared); + var part3 = (cubed - (2.0 * squared)) + amount; + var part4 = cubed - squared; + var x = (((value1.x * part1) + (value2.x * part2)) + (tangent1.x * part3)) + (tangent2.x * part4); + var y = (((value1.y * part1) + (value2.y * part2)) + (tangent1.y * part3)) + (tangent2.y * part4); + var z = (((value1.z * part1) + (value2.z * part2)) + (tangent1.z * part3)) + (tangent2.z * part4); + return new Vector3(x, y, z); + }; + /** + * Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end" + * @param start defines the start value + * @param end defines the end value + * @param amount max defines amount between both (between 0 and 1) + * @returns the new Vector3 + */ + Vector3.Lerp = function (start, end, amount) { + var result = new Vector3(0, 0, 0); + Vector3.LerpToRef(start, end, amount, result); + return result; + }; + /** + * Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end" + * @param start defines the start value + * @param end defines the end value + * @param amount max defines amount between both (between 0 and 1) + * @param result defines the Vector3 where to store the result + */ + Vector3.LerpToRef = function (start, end, amount, result) { + result.x = start.x + ((end.x - start.x) * amount); + result.y = start.y + ((end.y - start.y) * amount); + result.z = start.z + ((end.z - start.z) * amount); + }; + /** + * Returns the dot product (float) between the vectors "left" and "right" + * @param left defines the left operand + * @param right defines the right operand + * @returns the dot product + */ + Vector3.Dot = function (left, right) { + return (left.x * right.x + left.y * right.y + left.z * right.z); + }; + /** + * Returns a new Vector3 as the cross product of the vectors "left" and "right" + * The cross product is then orthogonal to both "left" and "right" + * @param left defines the left operand + * @param right defines the right operand + * @returns the cross product + */ + Vector3.Cross = function (left, right) { + var result = Vector3.Zero(); + Vector3.CrossToRef(left, right, result); + return result; + }; + /** + * Sets the given vector "result" with the cross product of "left" and "right" + * The cross product is then orthogonal to both "left" and "right" + * @param left defines the left operand + * @param right defines the right operand + * @param result defines the Vector3 where to store the result + */ + Vector3.CrossToRef = function (left, right, result) { + MathTmp.Vector3[0].x = left.y * right.z - left.z * right.y; + MathTmp.Vector3[0].y = left.z * right.x - left.x * right.z; + MathTmp.Vector3[0].z = left.x * right.y - left.y * right.x; + result.copyFrom(MathTmp.Vector3[0]); + }; + /** + * Returns a new Vector3 as the normalization of the given vector + * @param vector defines the Vector3 to normalize + * @returns the new Vector3 + */ + Vector3.Normalize = function (vector) { + var result = Vector3.Zero(); + Vector3.NormalizeToRef(vector, result); + return result; + }; + /** + * Sets the given vector "result" with the normalization of the given first vector + * @param vector defines the Vector3 to normalize + * @param result defines the Vector3 where to store the result + */ + Vector3.NormalizeToRef = function (vector, result) { + result.copyFrom(vector); + result.normalize(); + }; + /** + * Project a Vector3 onto screen space + * @param vector defines the Vector3 to project + * @param world defines the world matrix to use + * @param transform defines the transform (view x projection) matrix to use + * @param viewport defines the screen viewport to use + * @returns the new Vector3 + */ + Vector3.Project = function (vector, world, transform, viewport) { + var cw = viewport.width; + var ch = viewport.height; + var cx = viewport.x; + var cy = viewport.y; + var viewportMatrix = Vector3._viewportMatrixCache ? Vector3._viewportMatrixCache : (Vector3._viewportMatrixCache = new Matrix()); + Matrix.FromValuesToRef(cw / 2.0, 0, 0, 0, 0, -ch / 2.0, 0, 0, 0, 0, 0.5, 0, cx + cw / 2.0, ch / 2.0 + cy, 0.5, 1, viewportMatrix); + var matrix = MathTmp.Matrix[0]; + world.multiplyToRef(transform, matrix); + matrix.multiplyToRef(viewportMatrix, matrix); + return Vector3.TransformCoordinates(vector, matrix); + }; + /** + * Unproject from screen space to object space + * @param source defines the screen space Vector3 to use + * @param viewportWidth defines the current width of the viewport + * @param viewportHeight defines the current height of the viewport + * @param world defines the world matrix to use (can be set to Identity to go to world space) + * @param transform defines the transform (view x projection) matrix to use + * @returns the new Vector3 + */ + Vector3.UnprojectFromTransform = function (source, viewportWidth, viewportHeight, world, transform) { + var matrix = MathTmp.Matrix[0]; + world.multiplyToRef(transform, matrix); + matrix.invert(); + source.x = source.x / viewportWidth * 2 - 1; + source.y = -(source.y / viewportHeight * 2 - 1); + var vector = Vector3.TransformCoordinates(source, matrix); + var num = source.x * matrix.m[3] + source.y * matrix.m[7] + source.z * matrix.m[11] + matrix.m[15]; + if (BABYLON.Scalar.WithinEpsilon(num, 1.0)) { + vector = vector.scale(1.0 / num); + } + return vector; + }; + /** + * Unproject from screen space to object space + * @param source defines the screen space Vector3 to use + * @param viewportWidth defines the current width of the viewport + * @param viewportHeight defines the current height of the viewport + * @param world defines the world matrix to use (can be set to Identity to go to world space) + * @param view defines the view matrix to use + * @param projection defines the projection matrix to use + * @returns the new Vector3 + */ + Vector3.Unproject = function (source, viewportWidth, viewportHeight, world, view, projection) { + var result = Vector3.Zero(); + Vector3.UnprojectToRef(source, viewportWidth, viewportHeight, world, view, projection, result); + return result; + }; + /** + * Unproject from screen space to object space + * @param source defines the screen space Vector3 to use + * @param viewportWidth defines the current width of the viewport + * @param viewportHeight defines the current height of the viewport + * @param world defines the world matrix to use (can be set to Identity to go to world space) + * @param view defines the view matrix to use + * @param projection defines the projection matrix to use + * @param result defines the Vector3 where to store the result + */ + Vector3.UnprojectToRef = function (source, viewportWidth, viewportHeight, world, view, projection, result) { + Vector3.UnprojectFloatsToRef(source.x, source.y, source.z, viewportWidth, viewportHeight, world, view, projection, result); + }; + /** + * Unproject from screen space to object space + * @param sourceX defines the screen space x coordinate to use + * @param sourceY defines the screen space y coordinate to use + * @param sourceZ defines the screen space z coordinate to use + * @param viewportWidth defines the current width of the viewport + * @param viewportHeight defines the current height of the viewport + * @param world defines the world matrix to use (can be set to Identity to go to world space) + * @param view defines the view matrix to use + * @param projection defines the projection matrix to use + * @param result defines the Vector3 where to store the result + */ + Vector3.UnprojectFloatsToRef = function (sourceX, sourceY, sourceZ, viewportWidth, viewportHeight, world, view, projection, result) { + var matrix = MathTmp.Matrix[0]; + world.multiplyToRef(view, matrix); + matrix.multiplyToRef(projection, matrix); + matrix.invert(); + var screenSource = MathTmp.Vector3[0]; + screenSource.x = sourceX / viewportWidth * 2 - 1; + screenSource.y = -(sourceY / viewportHeight * 2 - 1); + screenSource.z = 2 * sourceZ - 1.0; + Vector3.TransformCoordinatesToRef(screenSource, matrix, result); + var num = screenSource.x * matrix.m[3] + screenSource.y * matrix.m[7] + screenSource.z * matrix.m[11] + matrix.m[15]; + if (BABYLON.Scalar.WithinEpsilon(num, 1.0)) { + result.scaleInPlace(1.0 / num); + } + }; + /** + * Gets the minimal coordinate values between two Vector3 + * @param left defines the first operand + * @param right defines the second operand + * @returns the new Vector3 + */ + Vector3.Minimize = function (left, right) { + var min = left.clone(); + min.minimizeInPlace(right); + return min; + }; + /** + * Gets the maximal coordinate values between two Vector3 + * @param left defines the first operand + * @param right defines the second operand + * @returns the new Vector3 + */ + Vector3.Maximize = function (left, right) { + var max = left.clone(); + max.maximizeInPlace(right); + return max; + }; + /** + * Returns the distance between the vectors "value1" and "value2" + * @param value1 defines the first operand + * @param value2 defines the second operand + * @returns the distance + */ + Vector3.Distance = function (value1, value2) { + return Math.sqrt(Vector3.DistanceSquared(value1, value2)); + }; + /** + * Returns the squared distance between the vectors "value1" and "value2" + * @param value1 defines the first operand + * @param value2 defines the second operand + * @returns the squared distance + */ + Vector3.DistanceSquared = function (value1, value2) { + var x = value1.x - value2.x; + var y = value1.y - value2.y; + var z = value1.z - value2.z; + return (x * x) + (y * y) + (z * z); + }; + /** + * Returns a new Vector3 located at the center between "value1" and "value2" + * @param value1 defines the first operand + * @param value2 defines the second operand + * @returns the new Vector3 + */ + Vector3.Center = function (value1, value2) { + var center = value1.add(value2); + center.scaleInPlace(0.5); + return center; + }; + /** + * Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system), + * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply + * to something in order to rotate it from its local system to the given target system + * Note: axis1, axis2 and axis3 are normalized during this operation + * @param axis1 defines the first axis + * @param axis2 defines the second axis + * @param axis3 defines the third axis + * @returns a new Vector3 + */ + Vector3.RotationFromAxis = function (axis1, axis2, axis3) { + var rotation = Vector3.Zero(); + Vector3.RotationFromAxisToRef(axis1, axis2, axis3, rotation); + return rotation; + }; + /** + * The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3 + * @param axis1 defines the first axis + * @param axis2 defines the second axis + * @param axis3 defines the third axis + * @param ref defines the Vector3 where to store the result + */ + Vector3.RotationFromAxisToRef = function (axis1, axis2, axis3, ref) { + var quat = MathTmp.Quaternion[0]; + Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat); + quat.toEulerAnglesToRef(ref); + }; + return Vector3; + }()); + BABYLON.Vector3 = Vector3; + /** + * Vector4 class created for EulerAngle class conversion to Quaternion + */ + var Vector4 = /** @class */ (function () { + /** + * Creates a Vector4 object from the given floats. + * @param x x value of the vector + * @param y y value of the vector + * @param z z value of the vector + * @param w w value of the vector + */ + function Vector4( + /** x value of the vector */ + x, + /** y value of the vector */ + y, + /** z value of the vector */ + z, + /** w value of the vector */ + w) { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + /** + * Returns the string with the Vector4 coordinates. + * @returns a string containing all the vector values + */ + Vector4.prototype.toString = function () { + return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + " W:" + this.w + "}"; + }; + /** + * Returns the string "Vector4". + * @returns "Vector4" + */ + Vector4.prototype.getClassName = function () { + return "Vector4"; + }; + /** + * Returns the Vector4 hash code. + * @returns a unique hash code + */ + Vector4.prototype.getHashCode = function () { + var hash = this.x || 0; + hash = (hash * 397) ^ (this.y || 0); + hash = (hash * 397) ^ (this.z || 0); + hash = (hash * 397) ^ (this.w || 0); + return hash; + }; + // Operators + /** + * Returns a new array populated with 4 elements : the Vector4 coordinates. + * @returns the resulting array + */ + Vector4.prototype.asArray = function () { + var result = new Array(); + this.toArray(result, 0); + return result; + }; + /** + * Populates the given array from the given index with the Vector4 coordinates. + * @param array array to populate + * @param index index of the array to start at (default: 0) + * @returns the Vector4. + */ + Vector4.prototype.toArray = function (array, index) { + if (index === undefined) { + index = 0; + } + array[index] = this.x; + array[index + 1] = this.y; + array[index + 2] = this.z; + array[index + 3] = this.w; + return this; + }; + /** + * Adds the given vector to the current Vector4. + * @param otherVector the vector to add + * @returns the updated Vector4. + */ + Vector4.prototype.addInPlace = function (otherVector) { + this.x += otherVector.x; + this.y += otherVector.y; + this.z += otherVector.z; + this.w += otherVector.w; + return this; + }; + /** + * Returns a new Vector4 as the result of the addition of the current Vector4 and the given one. + * @param otherVector the vector to add + * @returns the resulting vector + */ + Vector4.prototype.add = function (otherVector) { + return new Vector4(this.x + otherVector.x, this.y + otherVector.y, this.z + otherVector.z, this.w + otherVector.w); + }; + /** + * Updates the given vector "result" with the result of the addition of the current Vector4 and the given one. + * @param otherVector the vector to add + * @param result the vector to store the result + * @returns the current Vector4. + */ + Vector4.prototype.addToRef = function (otherVector, result) { + result.x = this.x + otherVector.x; + result.y = this.y + otherVector.y; + result.z = this.z + otherVector.z; + result.w = this.w + otherVector.w; + return this; + }; + /** + * Subtract in place the given vector from the current Vector4. + * @param otherVector the vector to subtract + * @returns the updated Vector4. + */ + Vector4.prototype.subtractInPlace = function (otherVector) { + this.x -= otherVector.x; + this.y -= otherVector.y; + this.z -= otherVector.z; + this.w -= otherVector.w; + return this; + }; + /** + * Returns a new Vector4 with the result of the subtraction of the given vector from the current Vector4. + * @param otherVector the vector to add + * @returns the new vector with the result + */ + Vector4.prototype.subtract = function (otherVector) { + return new Vector4(this.x - otherVector.x, this.y - otherVector.y, this.z - otherVector.z, this.w - otherVector.w); + }; + /** + * Sets the given vector "result" with the result of the subtraction of the given vector from the current Vector4. + * @param otherVector the vector to subtract + * @param result the vector to store the result + * @returns the current Vector4. + */ + Vector4.prototype.subtractToRef = function (otherVector, result) { + result.x = this.x - otherVector.x; + result.y = this.y - otherVector.y; + result.z = this.z - otherVector.z; + result.w = this.w - otherVector.w; + return this; + }; + /** + * Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates. + */ + /** + * Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates. + * @param x value to subtract + * @param y value to subtract + * @param z value to subtract + * @param w value to subtract + * @returns new vector containing the result + */ + Vector4.prototype.subtractFromFloats = function (x, y, z, w) { + return new Vector4(this.x - x, this.y - y, this.z - z, this.w - w); + }; + /** + * Sets the given vector "result" set with the result of the subtraction of the given floats from the current Vector4 coordinates. + * @param x value to subtract + * @param y value to subtract + * @param z value to subtract + * @param w value to subtract + * @param result the vector to store the result in + * @returns the current Vector4. + */ + Vector4.prototype.subtractFromFloatsToRef = function (x, y, z, w, result) { + result.x = this.x - x; + result.y = this.y - y; + result.z = this.z - z; + result.w = this.w - w; + return this; + }; + /** + * Returns a new Vector4 set with the current Vector4 negated coordinates. + * @returns a new vector with the negated values + */ + Vector4.prototype.negate = function () { + return new Vector4(-this.x, -this.y, -this.z, -this.w); + }; + /** + * Multiplies the current Vector4 coordinates by scale (float). + * @param scale the number to scale with + * @returns the updated Vector4. + */ + Vector4.prototype.scaleInPlace = function (scale) { + this.x *= scale; + this.y *= scale; + this.z *= scale; + this.w *= scale; + return this; + }; + /** + * Returns a new Vector4 set with the current Vector4 coordinates multiplied by scale (float). + * @param scale the number to scale with + * @returns a new vector with the result + */ + Vector4.prototype.scale = function (scale) { + return new Vector4(this.x * scale, this.y * scale, this.z * scale, this.w * scale); + }; + /** + * Sets the given vector "result" with the current Vector4 coordinates multiplied by scale (float). + * @param scale the number to scale with + * @param result a vector to store the result in + * @returns the current Vector4. + */ + Vector4.prototype.scaleToRef = function (scale, result) { + result.x = this.x * scale; + result.y = this.y * scale; + result.z = this.z * scale; + result.w = this.w * scale; + return this; + }; + /** + * Scale the current Vector4 values by a factor and add the result to a given Vector4 + * @param scale defines the scale factor + * @param result defines the Vector4 object where to store the result + * @returns the unmodified current Vector4 + */ + Vector4.prototype.scaleAndAddToRef = function (scale, result) { + result.x += this.x * scale; + result.y += this.y * scale; + result.z += this.z * scale; + result.w += this.w * scale; + return this; + }; + /** + * Boolean : True if the current Vector4 coordinates are stricly equal to the given ones. + * @param otherVector the vector to compare against + * @returns true if they are equal + */ + Vector4.prototype.equals = function (otherVector) { + return otherVector && this.x === otherVector.x && this.y === otherVector.y && this.z === otherVector.z && this.w === otherVector.w; + }; + /** + * Boolean : True if the current Vector4 coordinates are each beneath the distance "epsilon" from the given vector ones. + * @param otherVector vector to compare against + * @param epsilon (Default: very small number) + * @returns true if they are equal + */ + Vector4.prototype.equalsWithEpsilon = function (otherVector, epsilon) { + if (epsilon === void 0) { epsilon = BABYLON.Epsilon; } + return otherVector + && BABYLON.Scalar.WithinEpsilon(this.x, otherVector.x, epsilon) + && BABYLON.Scalar.WithinEpsilon(this.y, otherVector.y, epsilon) + && BABYLON.Scalar.WithinEpsilon(this.z, otherVector.z, epsilon) + && BABYLON.Scalar.WithinEpsilon(this.w, otherVector.w, epsilon); + }; + /** + * Boolean : True if the given floats are strictly equal to the current Vector4 coordinates. + * @param x x value to compare against + * @param y y value to compare against + * @param z z value to compare against + * @param w w value to compare against + * @returns true if equal + */ + Vector4.prototype.equalsToFloats = function (x, y, z, w) { + return this.x === x && this.y === y && this.z === z && this.w === w; + }; + /** + * Multiplies in place the current Vector4 by the given one. + * @param otherVector vector to multiple with + * @returns the updated Vector4. + */ + Vector4.prototype.multiplyInPlace = function (otherVector) { + this.x *= otherVector.x; + this.y *= otherVector.y; + this.z *= otherVector.z; + this.w *= otherVector.w; + return this; + }; + /** + * Returns a new Vector4 set with the multiplication result of the current Vector4 and the given one. + * @param otherVector vector to multiple with + * @returns resulting new vector + */ + Vector4.prototype.multiply = function (otherVector) { + return new Vector4(this.x * otherVector.x, this.y * otherVector.y, this.z * otherVector.z, this.w * otherVector.w); + }; + /** + * Updates the given vector "result" with the multiplication result of the current Vector4 and the given one. + * @param otherVector vector to multiple with + * @param result vector to store the result + * @returns the current Vector4. + */ + Vector4.prototype.multiplyToRef = function (otherVector, result) { + result.x = this.x * otherVector.x; + result.y = this.y * otherVector.y; + result.z = this.z * otherVector.z; + result.w = this.w * otherVector.w; + return this; + }; + /** + * Returns a new Vector4 set with the multiplication result of the given floats and the current Vector4 coordinates. + * @param x x value multiply with + * @param y y value multiply with + * @param z z value multiply with + * @param w w value multiply with + * @returns resulting new vector + */ + Vector4.prototype.multiplyByFloats = function (x, y, z, w) { + return new Vector4(this.x * x, this.y * y, this.z * z, this.w * w); + }; + /** + * Returns a new Vector4 set with the division result of the current Vector4 by the given one. + * @param otherVector vector to devide with + * @returns resulting new vector + */ + Vector4.prototype.divide = function (otherVector) { + return new Vector4(this.x / otherVector.x, this.y / otherVector.y, this.z / otherVector.z, this.w / otherVector.w); + }; + /** + * Updates the given vector "result" with the division result of the current Vector4 by the given one. + * @param otherVector vector to devide with + * @param result vector to store the result + * @returns the current Vector4. + */ + Vector4.prototype.divideToRef = function (otherVector, result) { + result.x = this.x / otherVector.x; + result.y = this.y / otherVector.y; + result.z = this.z / otherVector.z; + result.w = this.w / otherVector.w; + return this; + }; + /** + * Divides the current Vector3 coordinates by the given ones. + * @param otherVector vector to devide with + * @returns the updated Vector3. + */ + Vector4.prototype.divideInPlace = function (otherVector) { + return this.divideToRef(otherVector, this); + }; + /** + * Updates the Vector4 coordinates with the minimum values between its own and the given vector ones + * @param other defines the second operand + * @returns the current updated Vector4 + */ + Vector4.prototype.minimizeInPlace = function (other) { + if (other.x < this.x) { + this.x = other.x; + } + if (other.y < this.y) { + this.y = other.y; + } + if (other.z < this.z) { + this.z = other.z; + } + if (other.w < this.w) { + this.w = other.w; + } + return this; + }; + /** + * Updates the Vector4 coordinates with the maximum values between its own and the given vector ones + * @param other defines the second operand + * @returns the current updated Vector4 + */ + Vector4.prototype.maximizeInPlace = function (other) { + if (other.x > this.x) { + this.x = other.x; + } + if (other.y > this.y) { + this.y = other.y; + } + if (other.z > this.z) { + this.z = other.z; + } + if (other.w > this.w) { + this.w = other.w; + } + return this; + }; + /** + * Gets a new Vector4 from current Vector4 floored values + * @returns a new Vector4 + */ + Vector4.prototype.floor = function () { + return new Vector4(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w)); + }; + /** + * Gets a new Vector4 from current Vector3 floored values + * @returns a new Vector4 + */ + Vector4.prototype.fract = function () { + return new Vector4(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z), this.w - Math.floor(this.w)); + }; + // Properties + /** + * Returns the Vector4 length (float). + * @returns the length + */ + Vector4.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w); + }; + /** + * Returns the Vector4 squared length (float). + * @returns the length squared + */ + Vector4.prototype.lengthSquared = function () { + return (this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w); + }; + // Methods + /** + * Normalizes in place the Vector4. + * @returns the updated Vector4. + */ + Vector4.prototype.normalize = function () { + var len = this.length(); + if (len === 0) { + return this; + } + var num = 1.0 / len; + this.x *= num; + this.y *= num; + this.z *= num; + this.w *= num; + return this; + }; + /** + * Returns a new Vector3 from the Vector4 (x, y, z) coordinates. + * @returns this converted to a new vector3 + */ + Vector4.prototype.toVector3 = function () { + return new Vector3(this.x, this.y, this.z); + }; + /** + * Returns a new Vector4 copied from the current one. + * @returns the new cloned vector + */ + Vector4.prototype.clone = function () { + return new Vector4(this.x, this.y, this.z, this.w); + }; + /** + * Updates the current Vector4 with the given one coordinates. + * @param source the source vector to copy from + * @returns the updated Vector4. + */ + Vector4.prototype.copyFrom = function (source) { + this.x = source.x; + this.y = source.y; + this.z = source.z; + this.w = source.w; + return this; + }; + /** + * Updates the current Vector4 coordinates with the given floats. + * @param x float to copy from + * @param y float to copy from + * @param z float to copy from + * @param w float to copy from + * @returns the updated Vector4. + */ + Vector4.prototype.copyFromFloats = function (x, y, z, w) { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + return this; + }; + /** + * Updates the current Vector4 coordinates with the given floats. + * @param x float to set from + * @param y float to set from + * @param z float to set from + * @param w float to set from + * @returns the updated Vector4. + */ + Vector4.prototype.set = function (x, y, z, w) { + return this.copyFromFloats(x, y, z, w); + }; + // Statics + /** + * Returns a new Vector4 set from the starting index of the given array. + * @param array the array to pull values from + * @param offset the offset into the array to start at + * @returns the new vector + */ + Vector4.FromArray = function (array, offset) { + if (!offset) { + offset = 0; + } + return new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]); + }; + /** + * Updates the given vector "result" from the starting index of the given array. + * @param array the array to pull values from + * @param offset the offset into the array to start at + * @param result the vector to store the result in + */ + Vector4.FromArrayToRef = function (array, offset, result) { + result.x = array[offset]; + result.y = array[offset + 1]; + result.z = array[offset + 2]; + result.w = array[offset + 3]; + }; + /** + * Updates the given vector "result" from the starting index of the given Float32Array. + * @param array the array to pull values from + * @param offset the offset into the array to start at + * @param result the vector to store the result in + */ + Vector4.FromFloatArrayToRef = function (array, offset, result) { + Vector4.FromArrayToRef(array, offset, result); + }; + /** + * Updates the given vector "result" coordinates from the given floats. + * @param x float to set from + * @param y float to set from + * @param z float to set from + * @param w float to set from + * @param result the vector to the floats in + */ + Vector4.FromFloatsToRef = function (x, y, z, w, result) { + result.x = x; + result.y = y; + result.z = z; + result.w = w; + }; + /** + * Returns a new Vector4 set to (0.0, 0.0, 0.0, 0.0) + * @returns the new vector + */ + Vector4.Zero = function () { + return new Vector4(0.0, 0.0, 0.0, 0.0); + }; + /** + * Returns a new Vector4 set to (1.0, 1.0, 1.0, 1.0) + * @returns the new vector + */ + Vector4.One = function () { + return new Vector4(1.0, 1.0, 1.0, 1.0); + }; + /** + * Returns a new normalized Vector4 from the given one. + * @param vector the vector to normalize + * @returns the vector + */ + Vector4.Normalize = function (vector) { + var result = Vector4.Zero(); + Vector4.NormalizeToRef(vector, result); + return result; + }; + /** + * Updates the given vector "result" from the normalization of the given one. + * @param vector the vector to normalize + * @param result the vector to store the result in + */ + Vector4.NormalizeToRef = function (vector, result) { + result.copyFrom(vector); + result.normalize(); + }; + /** + * Returns a vector with the minimum values from the left and right vectors + * @param left left vector to minimize + * @param right right vector to minimize + * @returns a new vector with the minimum of the left and right vector values + */ + Vector4.Minimize = function (left, right) { + var min = left.clone(); + min.minimizeInPlace(right); + return min; + }; + /** + * Returns a vector with the maximum values from the left and right vectors + * @param left left vector to maximize + * @param right right vector to maximize + * @returns a new vector with the maximum of the left and right vector values + */ + Vector4.Maximize = function (left, right) { + var max = left.clone(); + max.maximizeInPlace(right); + return max; + }; + /** + * Returns the distance (float) between the vectors "value1" and "value2". + * @param value1 value to calulate the distance between + * @param value2 value to calulate the distance between + * @return the distance between the two vectors + */ + Vector4.Distance = function (value1, value2) { + return Math.sqrt(Vector4.DistanceSquared(value1, value2)); + }; + /** + * Returns the squared distance (float) between the vectors "value1" and "value2". + * @param value1 value to calulate the distance between + * @param value2 value to calulate the distance between + * @return the distance between the two vectors squared + */ + Vector4.DistanceSquared = function (value1, value2) { + var x = value1.x - value2.x; + var y = value1.y - value2.y; + var z = value1.z - value2.z; + var w = value1.w - value2.w; + return (x * x) + (y * y) + (z * z) + (w * w); + }; + /** + * Returns a new Vector4 located at the center between the vectors "value1" and "value2". + * @param value1 value to calulate the center between + * @param value2 value to calulate the center between + * @return the center between the two vectors + */ + Vector4.Center = function (value1, value2) { + var center = value1.add(value2); + center.scaleInPlace(0.5); + return center; + }; + /** + * Returns a new Vector4 set with the result of the normal transformation by the given matrix of the given vector. + * This methods computes transformed normalized direction vectors only. + * @param vector the vector to transform + * @param transformation the transformation matrix to apply + * @returns the new vector + */ + Vector4.TransformNormal = function (vector, transformation) { + var result = Vector4.Zero(); + Vector4.TransformNormalToRef(vector, transformation, result); + return result; + }; + /** + * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector. + * This methods computes transformed normalized direction vectors only. + * @param vector the vector to transform + * @param transformation the transformation matrix to apply + * @param result the vector to store the result in + */ + Vector4.TransformNormalToRef = function (vector, transformation, result) { + var x = (vector.x * transformation.m[0]) + (vector.y * transformation.m[4]) + (vector.z * transformation.m[8]); + var y = (vector.x * transformation.m[1]) + (vector.y * transformation.m[5]) + (vector.z * transformation.m[9]); + var z = (vector.x * transformation.m[2]) + (vector.y * transformation.m[6]) + (vector.z * transformation.m[10]); + result.x = x; + result.y = y; + result.z = z; + result.w = vector.w; + }; + /** + * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z, w). + * This methods computes transformed normalized direction vectors only. + * @param x value to transform + * @param y value to transform + * @param z value to transform + * @param w value to transform + * @param transformation the transformation matrix to apply + * @param result the vector to store the results in + */ + Vector4.TransformNormalFromFloatsToRef = function (x, y, z, w, transformation, result) { + result.x = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]); + result.y = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]); + result.z = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]); + result.w = w; + }; + return Vector4; + }()); + BABYLON.Vector4 = Vector4; + /** + * Size containing widht and height + */ + var Size = /** @class */ (function () { + /** + * Creates a Size object from the given width and height (floats). + * @param width width of the new size + * @param height height of the new size + */ + function Size(width, height) { + this.width = width; + this.height = height; + } + /** + * Returns a string with the Size width and height + * @returns a string with the Size width and height + */ + Size.prototype.toString = function () { + return "{W: " + this.width + ", H: " + this.height + "}"; + }; + /** + * "Size" + * @returns the string "Size" + */ + Size.prototype.getClassName = function () { + return "Size"; + }; + /** + * Returns the Size hash code. + * @returns a hash code for a unique width and height + */ + Size.prototype.getHashCode = function () { + var hash = this.width || 0; + hash = (hash * 397) ^ (this.height || 0); + return hash; + }; + /** + * Updates the current size from the given one. + * @param src the given size + */ + Size.prototype.copyFrom = function (src) { + this.width = src.width; + this.height = src.height; + }; + /** + * Updates in place the current Size from the given floats. + * @param width width of the new size + * @param height height of the new size + * @returns the updated Size. + */ + Size.prototype.copyFromFloats = function (width, height) { + this.width = width; + this.height = height; + return this; + }; + /** + * Updates in place the current Size from the given floats. + * @param width width to set + * @param height height to set + * @returns the updated Size. + */ + Size.prototype.set = function (width, height) { + return this.copyFromFloats(width, height); + }; + /** + * Multiplies the width and height by numbers + * @param w factor to multiple the width by + * @param h factor to multiple the height by + * @returns a new Size set with the multiplication result of the current Size and the given floats. + */ + Size.prototype.multiplyByFloats = function (w, h) { + return new Size(this.width * w, this.height * h); + }; + /** + * Clones the size + * @returns a new Size copied from the given one. + */ + Size.prototype.clone = function () { + return new Size(this.width, this.height); + }; + /** + * True if the current Size and the given one width and height are strictly equal. + * @param other the other size to compare against + * @returns True if the current Size and the given one width and height are strictly equal. + */ + Size.prototype.equals = function (other) { + if (!other) { + return false; + } + return (this.width === other.width) && (this.height === other.height); + }; + Object.defineProperty(Size.prototype, "surface", { + /** + * The surface of the Size : width * height (float). + */ + get: function () { + return this.width * this.height; + }, + enumerable: true, + configurable: true + }); + /** + * Create a new size of zero + * @returns a new Size set to (0.0, 0.0) + */ + Size.Zero = function () { + return new Size(0.0, 0.0); + }; + /** + * Sums the width and height of two sizes + * @param otherSize size to add to this size + * @returns a new Size set as the addition result of the current Size and the given one. + */ + Size.prototype.add = function (otherSize) { + var r = new Size(this.width + otherSize.width, this.height + otherSize.height); + return r; + }; + /** + * Subtracts the width and height of two + * @param otherSize size to subtract to this size + * @returns a new Size set as the subtraction result of the given one from the current Size. + */ + Size.prototype.subtract = function (otherSize) { + var r = new Size(this.width - otherSize.width, this.height - otherSize.height); + return r; + }; + /** + * Creates a new Size set at the linear interpolation "amount" between "start" and "end" + * @param start starting size to lerp between + * @param end end size to lerp between + * @param amount amount to lerp between the start and end values + * @returns a new Size set at the linear interpolation "amount" between "start" and "end" + */ + Size.Lerp = function (start, end, amount) { + var w = start.width + ((end.width - start.width) * amount); + var h = start.height + ((end.height - start.height) * amount); + return new Size(w, h); + }; + return Size; + }()); + BABYLON.Size = Size; + /** + * Class used to store quaternion data + * @see https://en.wikipedia.org/wiki/Quaternion + * @see http://doc.babylonjs.com/features/position,_rotation,_scaling + */ + var Quaternion = /** @class */ (function () { + /** + * Creates a new Quaternion from the given floats + * @param x defines the first component (0 by default) + * @param y defines the second component (0 by default) + * @param z defines the third component (0 by default) + * @param w defines the fourth component (1.0 by default) + */ + function Quaternion( + /** defines the first component (0 by default) */ + x, + /** defines the second component (0 by default) */ + y, + /** defines the third component (0 by default) */ + z, + /** defines the fourth component (1.0 by default) */ + w) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (z === void 0) { z = 0.0; } + if (w === void 0) { w = 1.0; } + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + /** + * Gets a string representation for the current quaternion + * @returns a string with the Quaternion coordinates + */ + Quaternion.prototype.toString = function () { + return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + " W:" + this.w + "}"; + }; + /** + * Gets the class name of the quaternion + * @returns the string "Quaternion" + */ + Quaternion.prototype.getClassName = function () { + return "Quaternion"; + }; + /** + * Gets a hash code for this quaternion + * @returns the quaternion hash code + */ + Quaternion.prototype.getHashCode = function () { + var hash = this.x || 0; + hash = (hash * 397) ^ (this.y || 0); + hash = (hash * 397) ^ (this.z || 0); + hash = (hash * 397) ^ (this.w || 0); + return hash; + }; + /** + * Copy the quaternion to an array + * @returns a new array populated with 4 elements from the quaternion coordinates + */ + Quaternion.prototype.asArray = function () { + return [this.x, this.y, this.z, this.w]; + }; + /** + * Check if two quaternions are equals + * @param otherQuaternion defines the second operand + * @return true if the current quaternion and the given one coordinates are strictly equals + */ + Quaternion.prototype.equals = function (otherQuaternion) { + return otherQuaternion && this.x === otherQuaternion.x && this.y === otherQuaternion.y && this.z === otherQuaternion.z && this.w === otherQuaternion.w; + }; + /** + * Clone the current quaternion + * @returns a new quaternion copied from the current one + */ + Quaternion.prototype.clone = function () { + return new Quaternion(this.x, this.y, this.z, this.w); + }; + /** + * Copy a quaternion to the current one + * @param other defines the other quaternion + * @returns the updated current quaternion + */ + Quaternion.prototype.copyFrom = function (other) { + this.x = other.x; + this.y = other.y; + this.z = other.z; + this.w = other.w; + return this; + }; + /** + * Updates the current quaternion with the given float coordinates + * @param x defines the x coordinate + * @param y defines the y coordinate + * @param z defines the z coordinate + * @param w defines the w coordinate + * @returns the updated current quaternion + */ + Quaternion.prototype.copyFromFloats = function (x, y, z, w) { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + return this; + }; + /** + * Updates the current quaternion from the given float coordinates + * @param x defines the x coordinate + * @param y defines the y coordinate + * @param z defines the z coordinate + * @param w defines the w coordinate + * @returns the updated current quaternion + */ + Quaternion.prototype.set = function (x, y, z, w) { + return this.copyFromFloats(x, y, z, w); + }; + /** + * Adds two quaternions + * @param other defines the second operand + * @returns a new quaternion as the addition result of the given one and the current quaternion + */ + Quaternion.prototype.add = function (other) { + return new Quaternion(this.x + other.x, this.y + other.y, this.z + other.z, this.w + other.w); + }; + /** + * Add a quaternion to the current one + * @param other defines the quaternion to add + * @returns the current quaternion + */ + Quaternion.prototype.addInPlace = function (other) { + this.x += other.x; + this.y += other.y; + this.z += other.z; + this.w += other.w; + return this; + }; + /** + * Subtract two quaternions + * @param other defines the second operand + * @returns a new quaternion as the subtraction result of the given one from the current one + */ + Quaternion.prototype.subtract = function (other) { + return new Quaternion(this.x - other.x, this.y - other.y, this.z - other.z, this.w - other.w); + }; + /** + * Multiplies the current quaternion by a scale factor + * @param value defines the scale factor + * @returns a new quaternion set by multiplying the current quaternion coordinates by the float "scale" + */ + Quaternion.prototype.scale = function (value) { + return new Quaternion(this.x * value, this.y * value, this.z * value, this.w * value); + }; + /** + * Scale the current quaternion values by a factor and stores the result to a given quaternion + * @param scale defines the scale factor + * @param result defines the Quaternion object where to store the result + * @returns the unmodified current quaternion + */ + Quaternion.prototype.scaleToRef = function (scale, result) { + result.x = this.x * scale; + result.y = this.y * scale; + result.z = this.z * scale; + result.w = this.w * scale; + return this; + }; + /** + * Multiplies in place the current quaternion by a scale factor + * @param value defines the scale factor + * @returns the current modified quaternion + */ + Quaternion.prototype.scaleInPlace = function (value) { + this.x *= value; + this.y *= value; + this.z *= value; + this.w *= value; + return this; + }; + /** + * Scale the current quaternion values by a factor and add the result to a given quaternion + * @param scale defines the scale factor + * @param result defines the Quaternion object where to store the result + * @returns the unmodified current quaternion + */ + Quaternion.prototype.scaleAndAddToRef = function (scale, result) { + result.x += this.x * scale; + result.y += this.y * scale; + result.z += this.z * scale; + result.w += this.w * scale; + return this; + }; + /** + * Multiplies two quaternions + * @param q1 defines the second operand + * @returns a new quaternion set as the multiplication result of the current one with the given one "q1" + */ + Quaternion.prototype.multiply = function (q1) { + var result = new Quaternion(0, 0, 0, 1.0); + this.multiplyToRef(q1, result); + return result; + }; + /** + * Sets the given "result" as the the multiplication result of the current one with the given one "q1" + * @param q1 defines the second operand + * @param result defines the target quaternion + * @returns the current quaternion + */ + Quaternion.prototype.multiplyToRef = function (q1, result) { + var x = this.x * q1.w + this.y * q1.z - this.z * q1.y + this.w * q1.x; + var y = -this.x * q1.z + this.y * q1.w + this.z * q1.x + this.w * q1.y; + var z = this.x * q1.y - this.y * q1.x + this.z * q1.w + this.w * q1.z; + var w = -this.x * q1.x - this.y * q1.y - this.z * q1.z + this.w * q1.w; + result.copyFromFloats(x, y, z, w); + return this; + }; + /** + * Updates the current quaternion with the multiplication of itself with the given one "q1" + * @param q1 defines the second operand + * @returns the currentupdated quaternion + */ + Quaternion.prototype.multiplyInPlace = function (q1) { + this.multiplyToRef(q1, this); + return this; + }; + /** + * Conjugates (1-q) the current quaternion and stores the result in the given quaternion + * @param ref defines the target quaternion + * @returns the current quaternion + */ + Quaternion.prototype.conjugateToRef = function (ref) { + ref.copyFromFloats(-this.x, -this.y, -this.z, this.w); + return this; + }; + /** + * Conjugates in place (1-q) the current quaternion + * @returns the current updated quaternion + */ + Quaternion.prototype.conjugateInPlace = function () { + this.x *= -1; + this.y *= -1; + this.z *= -1; + return this; + }; + /** + * Conjugates in place (1-q) the current quaternion + * @returns a new quaternion + */ + Quaternion.prototype.conjugate = function () { + var result = new Quaternion(-this.x, -this.y, -this.z, this.w); + return result; + }; + /** + * Gets length of current quaternion + * @returns the quaternion length (float) + */ + Quaternion.prototype.length = function () { + return Math.sqrt((this.x * this.x) + (this.y * this.y) + (this.z * this.z) + (this.w * this.w)); + }; + /** + * Normalize in place the current quaternion + * @returns the current updated quaternion + */ + Quaternion.prototype.normalize = function () { + var length = 1.0 / this.length(); + this.x *= length; + this.y *= length; + this.z *= length; + this.w *= length; + return this; + }; + /** + * Returns a new Vector3 set with the Euler angles translated from the current quaternion + * @param order is a reserved parameter and is ignore for now + * @returns a new Vector3 containing the Euler angles + */ + Quaternion.prototype.toEulerAngles = function (order) { + if (order === void 0) { order = "YZX"; } + var result = Vector3.Zero(); + this.toEulerAnglesToRef(result, order); + return result; + }; + /** + * Sets the given vector3 "result" with the Euler angles translated from the current quaternion + * @param result defines the vector which will be filled with the Euler angles + * @param order is a reserved parameter and is ignore for now + * @returns the current unchanged quaternion + */ + Quaternion.prototype.toEulerAnglesToRef = function (result, order) { + if (order === void 0) { order = "YZX"; } + var qz = this.z; + var qx = this.x; + var qy = this.y; + var qw = this.w; + var sqw = qw * qw; + var sqz = qz * qz; + var sqx = qx * qx; + var sqy = qy * qy; + var zAxisY = qy * qz - qx * qw; + var limit = .4999999; + if (zAxisY < -limit) { + result.y = 2 * Math.atan2(qy, qw); + result.x = Math.PI / 2; + result.z = 0; + } + else if (zAxisY > limit) { + result.y = 2 * Math.atan2(qy, qw); + result.x = -Math.PI / 2; + result.z = 0; + } + else { + result.z = Math.atan2(2.0 * (qx * qy + qz * qw), (-sqz - sqx + sqy + sqw)); + result.x = Math.asin(-2.0 * (qz * qy - qx * qw)); + result.y = Math.atan2(2.0 * (qz * qx + qy * qw), (sqz - sqx - sqy + sqw)); + } + return this; + }; + /** + * Updates the given rotation matrix with the current quaternion values + * @param result defines the target matrix + * @returns the current unchanged quaternion + */ + Quaternion.prototype.toRotationMatrix = function (result) { + var xx = this.x * this.x; + var yy = this.y * this.y; + var zz = this.z * this.z; + var xy = this.x * this.y; + var zw = this.z * this.w; + var zx = this.z * this.x; + var yw = this.y * this.w; + var yz = this.y * this.z; + var xw = this.x * this.w; + result.m[0] = 1.0 - (2.0 * (yy + zz)); + result.m[1] = 2.0 * (xy + zw); + result.m[2] = 2.0 * (zx - yw); + result.m[3] = 0; + result.m[4] = 2.0 * (xy - zw); + result.m[5] = 1.0 - (2.0 * (zz + xx)); + result.m[6] = 2.0 * (yz + xw); + result.m[7] = 0; + result.m[8] = 2.0 * (zx + yw); + result.m[9] = 2.0 * (yz - xw); + result.m[10] = 1.0 - (2.0 * (yy + xx)); + result.m[11] = 0; + result.m[12] = 0; + result.m[13] = 0; + result.m[14] = 0; + result.m[15] = 1.0; + result._markAsUpdated(); + return this; + }; + /** + * Updates the current quaternion from the given rotation matrix values + * @param matrix defines the source matrix + * @returns the current updated quaternion + */ + Quaternion.prototype.fromRotationMatrix = function (matrix) { + Quaternion.FromRotationMatrixToRef(matrix, this); + return this; + }; + // Statics + /** + * Creates a new quaternion from a rotation matrix + * @param matrix defines the source matrix + * @returns a new quaternion created from the given rotation matrix values + */ + Quaternion.FromRotationMatrix = function (matrix) { + var result = new Quaternion(); + Quaternion.FromRotationMatrixToRef(matrix, result); + return result; + }; + /** + * Updates the given quaternion with the given rotation matrix values + * @param matrix defines the source matrix + * @param result defines the target quaternion + */ + Quaternion.FromRotationMatrixToRef = function (matrix, result) { + var data = matrix.m; + var m11 = data[0], m12 = data[4], m13 = data[8]; + var m21 = data[1], m22 = data[5], m23 = data[9]; + var m31 = data[2], m32 = data[6], m33 = data[10]; + var trace = m11 + m22 + m33; + var s; + if (trace > 0) { + s = 0.5 / Math.sqrt(trace + 1.0); + result.w = 0.25 / s; + result.x = (m32 - m23) * s; + result.y = (m13 - m31) * s; + result.z = (m21 - m12) * s; + } + else if (m11 > m22 && m11 > m33) { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + result.w = (m32 - m23) / s; + result.x = 0.25 * s; + result.y = (m12 + m21) / s; + result.z = (m13 + m31) / s; + } + else if (m22 > m33) { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + result.w = (m13 - m31) / s; + result.x = (m12 + m21) / s; + result.y = 0.25 * s; + result.z = (m23 + m32) / s; + } + else { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + result.w = (m21 - m12) / s; + result.x = (m13 + m31) / s; + result.y = (m23 + m32) / s; + result.z = 0.25 * s; + } + }; + /** + * Returns the dot product (float) between the quaternions "left" and "right" + * @param left defines the left operand + * @param right defines the right operand + * @returns the dot product + */ + Quaternion.Dot = function (left, right) { + return (left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w); + }; + /** + * Checks if the two quaternions are close to each other + * @param quat0 defines the first quaternion to check + * @param quat1 defines the second quaternion to check + * @returns true if the two quaternions are close to each other + */ + Quaternion.AreClose = function (quat0, quat1) { + var dot = Quaternion.Dot(quat0, quat1); + return dot >= 0; + }; + /** + * Creates an empty quaternion + * @returns a new quaternion set to (0.0, 0.0, 0.0) + */ + Quaternion.Zero = function () { + return new Quaternion(0.0, 0.0, 0.0, 0.0); + }; + /** + * Inverse a given quaternion + * @param q defines the source quaternion + * @returns a new quaternion as the inverted current quaternion + */ + Quaternion.Inverse = function (q) { + return new Quaternion(-q.x, -q.y, -q.z, q.w); + }; + /** + * Creates an identity quaternion + * @returns the identity quaternion + */ + Quaternion.Identity = function () { + return new Quaternion(0.0, 0.0, 0.0, 1.0); + }; + /** + * Gets a boolean indicating if the given quaternion is identity + * @param quaternion defines the quaternion to check + * @returns true if the quaternion is identity + */ + Quaternion.IsIdentity = function (quaternion) { + return quaternion && quaternion.x === 0 && quaternion.y === 0 && quaternion.z === 0 && quaternion.w === 1; + }; + /** + * Creates a quaternion from a rotation around an axis + * @param axis defines the axis to use + * @param angle defines the angle to use + * @returns a new quaternion created from the given axis (Vector3) and angle in radians (float) + */ + Quaternion.RotationAxis = function (axis, angle) { + return Quaternion.RotationAxisToRef(axis, angle, new Quaternion()); + }; + /** + * Creates a rotation around an axis and stores it into the given quaternion + * @param axis defines the axis to use + * @param angle defines the angle to use + * @param result defines the target quaternion + * @returns the target quaternion + */ + Quaternion.RotationAxisToRef = function (axis, angle, result) { + var sin = Math.sin(angle / 2); + axis.normalize(); + result.w = Math.cos(angle / 2); + result.x = axis.x * sin; + result.y = axis.y * sin; + result.z = axis.z * sin; + return result; + }; + /** + * Creates a new quaternion from data stored into an array + * @param array defines the data source + * @param offset defines the offset in the source array where the data starts + * @returns a new quaternion + */ + Quaternion.FromArray = function (array, offset) { + if (!offset) { + offset = 0; + } + return new Quaternion(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]); + }; + /** + * Creates a new quaternion from the given Euler float angles (y, x, z) + * @param yaw defines the rotation around Y axis + * @param pitch defines the rotation around X axis + * @param roll defines the rotation around Z axis + * @returns the new quaternion + */ + Quaternion.RotationYawPitchRoll = function (yaw, pitch, roll) { + var q = new Quaternion(); + Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, q); + return q; + }; + /** + * Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion + * @param yaw defines the rotation around Y axis + * @param pitch defines the rotation around X axis + * @param roll defines the rotation around Z axis + * @param result defines the target quaternion + */ + Quaternion.RotationYawPitchRollToRef = function (yaw, pitch, roll, result) { + // Produces a quaternion from Euler angles in the z-y-x orientation (Tait-Bryan angles) + var halfRoll = roll * 0.5; + var halfPitch = pitch * 0.5; + var halfYaw = yaw * 0.5; + var sinRoll = Math.sin(halfRoll); + var cosRoll = Math.cos(halfRoll); + var sinPitch = Math.sin(halfPitch); + var cosPitch = Math.cos(halfPitch); + var sinYaw = Math.sin(halfYaw); + var cosYaw = Math.cos(halfYaw); + result.x = (cosYaw * sinPitch * cosRoll) + (sinYaw * cosPitch * sinRoll); + result.y = (sinYaw * cosPitch * cosRoll) - (cosYaw * sinPitch * sinRoll); + result.z = (cosYaw * cosPitch * sinRoll) - (sinYaw * sinPitch * cosRoll); + result.w = (cosYaw * cosPitch * cosRoll) + (sinYaw * sinPitch * sinRoll); + }; + /** + * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation + * @param alpha defines the rotation around first axis + * @param beta defines the rotation around second axis + * @param gamma defines the rotation around third axis + * @returns the new quaternion + */ + Quaternion.RotationAlphaBetaGamma = function (alpha, beta, gamma) { + var result = new Quaternion(); + Quaternion.RotationAlphaBetaGammaToRef(alpha, beta, gamma, result); + return result; + }; + /** + * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation and stores it in the target quaternion + * @param alpha defines the rotation around first axis + * @param beta defines the rotation around second axis + * @param gamma defines the rotation around third axis + * @param result defines the target quaternion + */ + Quaternion.RotationAlphaBetaGammaToRef = function (alpha, beta, gamma, result) { + // Produces a quaternion from Euler angles in the z-x-z orientation + var halfGammaPlusAlpha = (gamma + alpha) * 0.5; + var halfGammaMinusAlpha = (gamma - alpha) * 0.5; + var halfBeta = beta * 0.5; + result.x = Math.cos(halfGammaMinusAlpha) * Math.sin(halfBeta); + result.y = Math.sin(halfGammaMinusAlpha) * Math.sin(halfBeta); + result.z = Math.sin(halfGammaPlusAlpha) * Math.cos(halfBeta); + result.w = Math.cos(halfGammaPlusAlpha) * Math.cos(halfBeta); + }; + /** + * Creates a new quaternion containing the rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) + * @param axis1 defines the first axis + * @param axis2 defines the second axis + * @param axis3 defines the third axis + * @returns the new quaternion + */ + Quaternion.RotationQuaternionFromAxis = function (axis1, axis2, axis3) { + var quat = new Quaternion(0.0, 0.0, 0.0, 0.0); + Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat); + return quat; + }; + /** + * Creates a rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) and stores it in the target quaternion + * @param axis1 defines the first axis + * @param axis2 defines the second axis + * @param axis3 defines the third axis + * @param ref defines the target quaternion + */ + Quaternion.RotationQuaternionFromAxisToRef = function (axis1, axis2, axis3, ref) { + var rotMat = MathTmp.Matrix[0]; + Matrix.FromXYZAxesToRef(axis1.normalize(), axis2.normalize(), axis3.normalize(), rotMat); + Quaternion.FromRotationMatrixToRef(rotMat, ref); + }; + /** + * Interpolates between two quaternions + * @param left defines first quaternion + * @param right defines second quaternion + * @param amount defines the gradient to use + * @returns the new interpolated quaternion + */ + Quaternion.Slerp = function (left, right, amount) { + var result = Quaternion.Identity(); + Quaternion.SlerpToRef(left, right, amount, result); + return result; + }; + /** + * Interpolates between two quaternions and stores it into a target quaternion + * @param left defines first quaternion + * @param right defines second quaternion + * @param amount defines the gradient to use + * @param result defines the target quaternion + */ + Quaternion.SlerpToRef = function (left, right, amount, result) { + var num2; + var num3; + var num4 = (((left.x * right.x) + (left.y * right.y)) + (left.z * right.z)) + (left.w * right.w); + var flag = false; + if (num4 < 0) { + flag = true; + num4 = -num4; + } + if (num4 > 0.999999) { + num3 = 1 - amount; + num2 = flag ? -amount : amount; + } + else { + var num5 = Math.acos(num4); + var num6 = (1.0 / Math.sin(num5)); + num3 = (Math.sin((1.0 - amount) * num5)) * num6; + num2 = flag ? ((-Math.sin(amount * num5)) * num6) : ((Math.sin(amount * num5)) * num6); + } + result.x = (num3 * left.x) + (num2 * right.x); + result.y = (num3 * left.y) + (num2 * right.y); + result.z = (num3 * left.z) + (num2 * right.z); + result.w = (num3 * left.w) + (num2 * right.w); + }; + /** + * Interpolate between two quaternions using Hermite interpolation + * @param value1 defines first quaternion + * @param tangent1 defines the incoming tangent + * @param value2 defines second quaternion + * @param tangent2 defines the outgoing tangent + * @param amount defines the target quaternion + * @returns the new interpolated quaternion + */ + Quaternion.Hermite = function (value1, tangent1, value2, tangent2, amount) { + var squared = amount * amount; + var cubed = amount * squared; + var part1 = ((2.0 * cubed) - (3.0 * squared)) + 1.0; + var part2 = (-2.0 * cubed) + (3.0 * squared); + var part3 = (cubed - (2.0 * squared)) + amount; + var part4 = cubed - squared; + var x = (((value1.x * part1) + (value2.x * part2)) + (tangent1.x * part3)) + (tangent2.x * part4); + var y = (((value1.y * part1) + (value2.y * part2)) + (tangent1.y * part3)) + (tangent2.y * part4); + var z = (((value1.z * part1) + (value2.z * part2)) + (tangent1.z * part3)) + (tangent2.z * part4); + var w = (((value1.w * part1) + (value2.w * part2)) + (tangent1.w * part3)) + (tangent2.w * part4); + return new Quaternion(x, y, z, w); + }; + return Quaternion; + }()); + BABYLON.Quaternion = Quaternion; + /** + * Class used to store matrix data (4x4) + */ + var Matrix = /** @class */ (function () { + /** + * Creates an empty matrix (filled with zeros) + */ + function Matrix() { + this._isIdentity = false; + this._isIdentityDirty = true; + /** + * Gets or sets the internal data of the matrix + */ + this.m = new Float32Array(16); + this._markAsUpdated(); + } + /** @hidden */ + Matrix.prototype._markAsUpdated = function () { + this.updateFlag = Matrix._updateFlagSeed++; + this._isIdentityDirty = true; + }; + // Properties + /** + * Check if the current matrix is indentity + * @param considerAsTextureMatrix defines if the current matrix must be considered as a texture matrix (3x2) + * @returns true is the matrix is the identity matrix + */ + Matrix.prototype.isIdentity = function (considerAsTextureMatrix) { + if (considerAsTextureMatrix === void 0) { considerAsTextureMatrix = false; } + if (this._isIdentityDirty) { + this._isIdentityDirty = false; + if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[15] !== 1.0) { + this._isIdentity = false; + } + else if (this.m[1] !== 0.0 || this.m[2] !== 0.0 || this.m[3] !== 0.0 || + this.m[4] !== 0.0 || this.m[6] !== 0.0 || this.m[7] !== 0.0 || + this.m[8] !== 0.0 || this.m[9] !== 0.0 || this.m[11] !== 0.0 || + this.m[12] !== 0.0 || this.m[13] !== 0.0 || this.m[14] !== 0.0) { + this._isIdentity = false; + } + else { + this._isIdentity = true; + } + if (!considerAsTextureMatrix && this.m[10] !== 1.0) { + this._isIdentity = false; + } + } + return this._isIdentity; + }; + /** + * Gets the determinant of the matrix + * @returns the matrix determinant + */ + Matrix.prototype.determinant = function () { + var temp1 = (this.m[10] * this.m[15]) - (this.m[11] * this.m[14]); + var temp2 = (this.m[9] * this.m[15]) - (this.m[11] * this.m[13]); + var temp3 = (this.m[9] * this.m[14]) - (this.m[10] * this.m[13]); + var temp4 = (this.m[8] * this.m[15]) - (this.m[11] * this.m[12]); + var temp5 = (this.m[8] * this.m[14]) - (this.m[10] * this.m[12]); + var temp6 = (this.m[8] * this.m[13]) - (this.m[9] * this.m[12]); + return ((((this.m[0] * (((this.m[5] * temp1) - (this.m[6] * temp2)) + (this.m[7] * temp3))) - (this.m[1] * (((this.m[4] * temp1) - + (this.m[6] * temp4)) + (this.m[7] * temp5)))) + (this.m[2] * (((this.m[4] * temp2) - (this.m[5] * temp4)) + (this.m[7] * temp6)))) - + (this.m[3] * (((this.m[4] * temp3) - (this.m[5] * temp5)) + (this.m[6] * temp6)))); + }; + // Methods + /** + * Returns the matrix as a Float32Array + * @returns the matrix underlying array + */ + Matrix.prototype.toArray = function () { + return this.m; + }; + /** + * Returns the matrix as a Float32Array + * @returns the matrix underlying array. + */ + Matrix.prototype.asArray = function () { + return this.toArray(); + }; + /** + * Inverts the current matrix in place + * @returns the current inverted matrix + */ + Matrix.prototype.invert = function () { + this.invertToRef(this); + return this; + }; + /** + * Sets all the matrix elements to zero + * @returns the current matrix + */ + Matrix.prototype.reset = function () { + for (var index = 0; index < 16; index++) { + this.m[index] = 0.0; + } + this._markAsUpdated(); + return this; + }; + /** + * Adds the current matrix with a second one + * @param other defines the matrix to add + * @returns a new matrix as the addition of the current matrix and the given one + */ + Matrix.prototype.add = function (other) { + var result = new Matrix(); + this.addToRef(other, result); + return result; + }; + /** + * Sets the given matrix "result" to the addition of the current matrix and the given one + * @param other defines the matrix to add + * @param result defines the target matrix + * @returns the current matrix + */ + Matrix.prototype.addToRef = function (other, result) { + for (var index = 0; index < 16; index++) { + result.m[index] = this.m[index] + other.m[index]; + } + result._markAsUpdated(); + return this; + }; + /** + * Adds in place the given matrix to the current matrix + * @param other defines the second operand + * @returns the current updated matrix + */ + Matrix.prototype.addToSelf = function (other) { + for (var index = 0; index < 16; index++) { + this.m[index] += other.m[index]; + } + this._markAsUpdated(); + return this; + }; + /** + * Sets the given matrix to the current inverted Matrix + * @param other defines the target matrix + * @returns the unmodified current matrix + */ + Matrix.prototype.invertToRef = function (other) { + var l1 = this.m[0]; + var l2 = this.m[1]; + var l3 = this.m[2]; + var l4 = this.m[3]; + var l5 = this.m[4]; + var l6 = this.m[5]; + var l7 = this.m[6]; + var l8 = this.m[7]; + var l9 = this.m[8]; + var l10 = this.m[9]; + var l11 = this.m[10]; + var l12 = this.m[11]; + var l13 = this.m[12]; + var l14 = this.m[13]; + var l15 = this.m[14]; + var l16 = this.m[15]; + var l17 = (l11 * l16) - (l12 * l15); + var l18 = (l10 * l16) - (l12 * l14); + var l19 = (l10 * l15) - (l11 * l14); + var l20 = (l9 * l16) - (l12 * l13); + var l21 = (l9 * l15) - (l11 * l13); + var l22 = (l9 * l14) - (l10 * l13); + var l23 = ((l6 * l17) - (l7 * l18)) + (l8 * l19); + var l24 = -(((l5 * l17) - (l7 * l20)) + (l8 * l21)); + var l25 = ((l5 * l18) - (l6 * l20)) + (l8 * l22); + var l26 = -(((l5 * l19) - (l6 * l21)) + (l7 * l22)); + var l27 = 1.0 / ((((l1 * l23) + (l2 * l24)) + (l3 * l25)) + (l4 * l26)); + var l28 = (l7 * l16) - (l8 * l15); + var l29 = (l6 * l16) - (l8 * l14); + var l30 = (l6 * l15) - (l7 * l14); + var l31 = (l5 * l16) - (l8 * l13); + var l32 = (l5 * l15) - (l7 * l13); + var l33 = (l5 * l14) - (l6 * l13); + var l34 = (l7 * l12) - (l8 * l11); + var l35 = (l6 * l12) - (l8 * l10); + var l36 = (l6 * l11) - (l7 * l10); + var l37 = (l5 * l12) - (l8 * l9); + var l38 = (l5 * l11) - (l7 * l9); + var l39 = (l5 * l10) - (l6 * l9); + other.m[0] = l23 * l27; + other.m[4] = l24 * l27; + other.m[8] = l25 * l27; + other.m[12] = l26 * l27; + other.m[1] = -(((l2 * l17) - (l3 * l18)) + (l4 * l19)) * l27; + other.m[5] = (((l1 * l17) - (l3 * l20)) + (l4 * l21)) * l27; + other.m[9] = -(((l1 * l18) - (l2 * l20)) + (l4 * l22)) * l27; + other.m[13] = (((l1 * l19) - (l2 * l21)) + (l3 * l22)) * l27; + other.m[2] = (((l2 * l28) - (l3 * l29)) + (l4 * l30)) * l27; + other.m[6] = -(((l1 * l28) - (l3 * l31)) + (l4 * l32)) * l27; + other.m[10] = (((l1 * l29) - (l2 * l31)) + (l4 * l33)) * l27; + other.m[14] = -(((l1 * l30) - (l2 * l32)) + (l3 * l33)) * l27; + other.m[3] = -(((l2 * l34) - (l3 * l35)) + (l4 * l36)) * l27; + other.m[7] = (((l1 * l34) - (l3 * l37)) + (l4 * l38)) * l27; + other.m[11] = -(((l1 * l35) - (l2 * l37)) + (l4 * l39)) * l27; + other.m[15] = (((l1 * l36) - (l2 * l38)) + (l3 * l39)) * l27; + other._markAsUpdated(); + return this; + }; + /** + * Inserts the translation vector (using 3 floats) in the current matrix + * @param x defines the 1st component of the translation + * @param y defines the 2nd component of the translation + * @param z defines the 3rd component of the translation + * @returns the current updated matrix + */ + Matrix.prototype.setTranslationFromFloats = function (x, y, z) { + this.m[12] = x; + this.m[13] = y; + this.m[14] = z; + this._markAsUpdated(); + return this; + }; + /** + * Inserts the translation vector in the current matrix + * @param vector3 defines the translation to insert + * @returns the current updated matrix + */ + Matrix.prototype.setTranslation = function (vector3) { + this.m[12] = vector3.x; + this.m[13] = vector3.y; + this.m[14] = vector3.z; + this._markAsUpdated(); + return this; + }; + /** + * Gets the translation value of the current matrix + * @returns a new Vector3 as the extracted translation from the matrix + */ + Matrix.prototype.getTranslation = function () { + return new Vector3(this.m[12], this.m[13], this.m[14]); + }; + /** + * Fill a Vector3 with the extracted translation from the matrix + * @param result defines the Vector3 where to store the translation + * @returns the current matrix + */ + Matrix.prototype.getTranslationToRef = function (result) { + result.x = this.m[12]; + result.y = this.m[13]; + result.z = this.m[14]; + return this; + }; + /** + * Remove rotation and scaling part from the matrix + * @returns the updated matrix + */ + Matrix.prototype.removeRotationAndScaling = function () { + this.setRowFromFloats(0, 1, 0, 0, 0); + this.setRowFromFloats(1, 0, 1, 0, 0); + this.setRowFromFloats(2, 0, 0, 1, 0); + return this; + }; + /** + * Multiply two matrices + * @param other defines the second operand + * @returns a new matrix set with the multiplication result of the current Matrix and the given one + */ + Matrix.prototype.multiply = function (other) { + var result = new Matrix(); + this.multiplyToRef(other, result); + return result; + }; + /** + * Copy the current matrix from the given one + * @param other defines the source matrix + * @returns the current updated matrix + */ + Matrix.prototype.copyFrom = function (other) { + for (var index = 0; index < 16; index++) { + this.m[index] = other.m[index]; + } + this._markAsUpdated(); + return this; + }; + /** + * Populates the given array from the starting index with the current matrix values + * @param array defines the target array + * @param offset defines the offset in the target array where to start storing values + * @returns the current matrix + */ + Matrix.prototype.copyToArray = function (array, offset) { + if (offset === void 0) { offset = 0; } + for (var index = 0; index < 16; index++) { + array[offset + index] = this.m[index]; + } + return this; + }; + /** + * Sets the given matrix "result" with the multiplication result of the current Matrix and the given one + * @param other defines the second operand + * @param result defines the matrix where to store the multiplication + * @returns the current matrix + */ + Matrix.prototype.multiplyToRef = function (other, result) { + this.multiplyToArray(other, result.m, 0); + result._markAsUpdated(); + return this; + }; + /** + * Sets the Float32Array "result" from the given index "offset" with the multiplication of the current matrix and the given one + * @param other defines the second operand + * @param result defines the array where to store the multiplication + * @param offset defines the offset in the target array where to start storing values + * @returns the current matrix + */ + Matrix.prototype.multiplyToArray = function (other, result, offset) { + var tm0 = this.m[0]; + var tm1 = this.m[1]; + var tm2 = this.m[2]; + var tm3 = this.m[3]; + var tm4 = this.m[4]; + var tm5 = this.m[5]; + var tm6 = this.m[6]; + var tm7 = this.m[7]; + var tm8 = this.m[8]; + var tm9 = this.m[9]; + var tm10 = this.m[10]; + var tm11 = this.m[11]; + var tm12 = this.m[12]; + var tm13 = this.m[13]; + var tm14 = this.m[14]; + var tm15 = this.m[15]; + var om0 = other.m[0]; + var om1 = other.m[1]; + var om2 = other.m[2]; + var om3 = other.m[3]; + var om4 = other.m[4]; + var om5 = other.m[5]; + var om6 = other.m[6]; + var om7 = other.m[7]; + var om8 = other.m[8]; + var om9 = other.m[9]; + var om10 = other.m[10]; + var om11 = other.m[11]; + var om12 = other.m[12]; + var om13 = other.m[13]; + var om14 = other.m[14]; + var om15 = other.m[15]; + result[offset] = tm0 * om0 + tm1 * om4 + tm2 * om8 + tm3 * om12; + result[offset + 1] = tm0 * om1 + tm1 * om5 + tm2 * om9 + tm3 * om13; + result[offset + 2] = tm0 * om2 + tm1 * om6 + tm2 * om10 + tm3 * om14; + result[offset + 3] = tm0 * om3 + tm1 * om7 + tm2 * om11 + tm3 * om15; + result[offset + 4] = tm4 * om0 + tm5 * om4 + tm6 * om8 + tm7 * om12; + result[offset + 5] = tm4 * om1 + tm5 * om5 + tm6 * om9 + tm7 * om13; + result[offset + 6] = tm4 * om2 + tm5 * om6 + tm6 * om10 + tm7 * om14; + result[offset + 7] = tm4 * om3 + tm5 * om7 + tm6 * om11 + tm7 * om15; + result[offset + 8] = tm8 * om0 + tm9 * om4 + tm10 * om8 + tm11 * om12; + result[offset + 9] = tm8 * om1 + tm9 * om5 + tm10 * om9 + tm11 * om13; + result[offset + 10] = tm8 * om2 + tm9 * om6 + tm10 * om10 + tm11 * om14; + result[offset + 11] = tm8 * om3 + tm9 * om7 + tm10 * om11 + tm11 * om15; + result[offset + 12] = tm12 * om0 + tm13 * om4 + tm14 * om8 + tm15 * om12; + result[offset + 13] = tm12 * om1 + tm13 * om5 + tm14 * om9 + tm15 * om13; + result[offset + 14] = tm12 * om2 + tm13 * om6 + tm14 * om10 + tm15 * om14; + result[offset + 15] = tm12 * om3 + tm13 * om7 + tm14 * om11 + tm15 * om15; + return this; + }; + /** + * Check equality between this matrix and a second one + * @param value defines the second matrix to compare + * @returns true is the current matrix and the given one values are strictly equal + */ + Matrix.prototype.equals = function (value) { + return value && + (this.m[0] === value.m[0] && this.m[1] === value.m[1] && this.m[2] === value.m[2] && this.m[3] === value.m[3] && + this.m[4] === value.m[4] && this.m[5] === value.m[5] && this.m[6] === value.m[6] && this.m[7] === value.m[7] && + this.m[8] === value.m[8] && this.m[9] === value.m[9] && this.m[10] === value.m[10] && this.m[11] === value.m[11] && + this.m[12] === value.m[12] && this.m[13] === value.m[13] && this.m[14] === value.m[14] && this.m[15] === value.m[15]); + }; + /** + * Clone the current matrix + * @returns a new matrix from the current matrix + */ + Matrix.prototype.clone = function () { + return Matrix.FromValues(this.m[0], this.m[1], this.m[2], this.m[3], this.m[4], this.m[5], this.m[6], this.m[7], this.m[8], this.m[9], this.m[10], this.m[11], this.m[12], this.m[13], this.m[14], this.m[15]); + }; + /** + * Returns the name of the current matrix class + * @returns the string "Matrix" + */ + Matrix.prototype.getClassName = function () { + return "Matrix"; + }; + /** + * Gets the hash code of the current matrix + * @returns the hash code + */ + Matrix.prototype.getHashCode = function () { + var hash = this.m[0] || 0; + for (var i = 1; i < 16; i++) { + hash = (hash * 397) ^ (this.m[i] || 0); + } + return hash; + }; + /** + * Decomposes the current Matrix into a translation, rotation and scaling components + * @param scale defines the scale vector3 given as a reference to update + * @param rotation defines the rotation quaternion given as a reference to update + * @param translation defines the translation vector3 given as a reference to update + * @returns true if operation was successful + */ + Matrix.prototype.decompose = function (scale, rotation, translation) { + if (translation) { + translation.x = this.m[12]; + translation.y = this.m[13]; + translation.z = this.m[14]; + } + scale = scale || MathTmp.Vector3[0]; + scale.x = Math.sqrt(this.m[0] * this.m[0] + this.m[1] * this.m[1] + this.m[2] * this.m[2]); + scale.y = Math.sqrt(this.m[4] * this.m[4] + this.m[5] * this.m[5] + this.m[6] * this.m[6]); + scale.z = Math.sqrt(this.m[8] * this.m[8] + this.m[9] * this.m[9] + this.m[10] * this.m[10]); + if (this.determinant() <= 0) { + scale.y *= -1; + } + if (scale.x === 0 || scale.y === 0 || scale.z === 0) { + if (rotation) { + rotation.x = 0; + rotation.y = 0; + rotation.z = 0; + rotation.w = 1; + } + return false; + } + if (rotation) { + Matrix.FromValuesToRef(this.m[0] / scale.x, this.m[1] / scale.x, this.m[2] / scale.x, 0, this.m[4] / scale.y, this.m[5] / scale.y, this.m[6] / scale.y, 0, this.m[8] / scale.z, this.m[9] / scale.z, this.m[10] / scale.z, 0, 0, 0, 0, 1, MathTmp.Matrix[0]); + Quaternion.FromRotationMatrixToRef(MathTmp.Matrix[0], rotation); + } + return true; + }; + /** + * Gets specific row of the matrix + * @param index defines the number of the row to get + * @returns the index-th row of the current matrix as a new Vector4 + */ + Matrix.prototype.getRow = function (index) { + if (index < 0 || index > 3) { + return null; + } + var i = index * 4; + return new Vector4(this.m[i + 0], this.m[i + 1], this.m[i + 2], this.m[i + 3]); + }; + /** + * Sets the index-th row of the current matrix to the vector4 values + * @param index defines the number of the row to set + * @param row defines the target vector4 + * @returns the updated current matrix + */ + Matrix.prototype.setRow = function (index, row) { + if (index < 0 || index > 3) { + return this; + } + var i = index * 4; + this.m[i + 0] = row.x; + this.m[i + 1] = row.y; + this.m[i + 2] = row.z; + this.m[i + 3] = row.w; + this._markAsUpdated(); + return this; + }; + /** + * Compute the transpose of the matrix + * @returns the new transposed matrix + */ + Matrix.prototype.transpose = function () { + return Matrix.Transpose(this); + }; + /** + * Compute the transpose of the matrix and store it in a given matrix + * @param result defines the target matrix + * @returns the current matrix + */ + Matrix.prototype.transposeToRef = function (result) { + Matrix.TransposeToRef(this, result); + return this; + }; + /** + * Sets the index-th row of the current matrix with the given 4 x float values + * @param index defines the row index + * @param x defines the x component to set + * @param y defines the y component to set + * @param z defines the z component to set + * @param w defines the w component to set + * @returns the updated current matrix + */ + Matrix.prototype.setRowFromFloats = function (index, x, y, z, w) { + if (index < 0 || index > 3) { + return this; + } + var i = index * 4; + this.m[i + 0] = x; + this.m[i + 1] = y; + this.m[i + 2] = z; + this.m[i + 3] = w; + this._markAsUpdated(); + return this; + }; + /** + * Compute a new matrix set with the current matrix values multiplied by scale (float) + * @param scale defines the scale factor + * @returns a new matrix + */ + Matrix.prototype.scale = function (scale) { + var result = new Matrix(); + this.scaleToRef(scale, result); + return result; + }; + /** + * Scale the current matrix values by a factor to a given result matrix + * @param scale defines the scale factor + * @param result defines the matrix to store the result + * @returns the current matrix + */ + Matrix.prototype.scaleToRef = function (scale, result) { + for (var index = 0; index < 16; index++) { + result.m[index] = this.m[index] * scale; + } + result._markAsUpdated(); + return this; + }; + /** + * Scale the current matrix values by a factor and add the result to a given matrix + * @param scale defines the scale factor + * @param result defines the Matrix to store the result + * @returns the current matrix + */ + Matrix.prototype.scaleAndAddToRef = function (scale, result) { + for (var index = 0; index < 16; index++) { + result.m[index] += this.m[index] * scale; + } + result._markAsUpdated(); + return this; + }; + /** + * Writes to the given matrix a normal matrix, computed from this one (using values from identity matrix for fourth row and column). + * @param ref matrix to store the result + */ + Matrix.prototype.toNormalMatrix = function (ref) { + this.invertToRef(ref); + ref.transpose(); + var m = ref.m; + Matrix.FromValuesToRef(m[0], m[1], m[2], 0, m[4], m[5], m[6], 0, m[8], m[9], m[10], 0, 0, 0, 0, 1, ref); + }; + /** + * Gets only rotation part of the current matrix + * @returns a new matrix sets to the extracted rotation matrix from the current one + */ + Matrix.prototype.getRotationMatrix = function () { + var result = Matrix.Identity(); + this.getRotationMatrixToRef(result); + return result; + }; + /** + * Extracts the rotation matrix from the current one and sets it as the given "result" + * @param result defines the target matrix to store data to + * @returns the current matrix + */ + Matrix.prototype.getRotationMatrixToRef = function (result) { + var m = this.m; + var sx = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]); + var sy = Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]); + var sz = Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]); + if (this.determinant() <= 0) { + sy *= -1; + } + if (sx === 0 || sy === 0 || sz === 0) { + Matrix.IdentityToRef(result); + } + else { + Matrix.FromValuesToRef(m[0] / sx, m[1] / sx, m[2] / sx, 0, m[4] / sy, m[5] / sy, m[6] / sy, 0, m[8] / sz, m[9] / sz, m[10] / sz, 0, 0, 0, 0, 1, result); + } + return this; + }; + // Statics + /** + * Creates a matrix from an array + * @param array defines the source array + * @param offset defines an offset in the source array + * @returns a new Matrix set from the starting index of the given array + */ + Matrix.FromArray = function (array, offset) { + var result = new Matrix(); + if (!offset) { + offset = 0; + } + Matrix.FromArrayToRef(array, offset, result); + return result; + }; + /** + * Copy the content of an array into a given matrix + * @param array defines the source array + * @param offset defines an offset in the source array + * @param result defines the target matrix + */ + Matrix.FromArrayToRef = function (array, offset, result) { + for (var index = 0; index < 16; index++) { + result.m[index] = array[index + offset]; + } + result._markAsUpdated(); + }; + /** + * Stores an array into a matrix after having multiplied each component by a given factor + * @param array defines the source array + * @param offset defines the offset in the source array + * @param scale defines the scaling factor + * @param result defines the target matrix + */ + Matrix.FromFloat32ArrayToRefScaled = function (array, offset, scale, result) { + for (var index = 0; index < 16; index++) { + result.m[index] = array[index + offset] * scale; + } + result._markAsUpdated(); + }; + /** + * Stores a list of values (16) inside a given matrix + * @param initialM11 defines 1st value of 1st row + * @param initialM12 defines 2nd value of 1st row + * @param initialM13 defines 3rd value of 1st row + * @param initialM14 defines 4th value of 1st row + * @param initialM21 defines 1st value of 2nd row + * @param initialM22 defines 2nd value of 2nd row + * @param initialM23 defines 3rd value of 2nd row + * @param initialM24 defines 4th value of 2nd row + * @param initialM31 defines 1st value of 3rd row + * @param initialM32 defines 2nd value of 3rd row + * @param initialM33 defines 3rd value of 3rd row + * @param initialM34 defines 4th value of 3rd row + * @param initialM41 defines 1st value of 4th row + * @param initialM42 defines 2nd value of 4th row + * @param initialM43 defines 3rd value of 4th row + * @param initialM44 defines 4th value of 4th row + * @param result defines the target matrix + */ + Matrix.FromValuesToRef = function (initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44, result) { + result.m[0] = initialM11; + result.m[1] = initialM12; + result.m[2] = initialM13; + result.m[3] = initialM14; + result.m[4] = initialM21; + result.m[5] = initialM22; + result.m[6] = initialM23; + result.m[7] = initialM24; + result.m[8] = initialM31; + result.m[9] = initialM32; + result.m[10] = initialM33; + result.m[11] = initialM34; + result.m[12] = initialM41; + result.m[13] = initialM42; + result.m[14] = initialM43; + result.m[15] = initialM44; + result._markAsUpdated(); + }; + Object.defineProperty(Matrix, "IdentityReadOnly", { + /** + * Gets an identity matrix that must not be updated + */ + get: function () { + return Matrix._identityReadOnly; + }, + enumerable: true, + configurable: true + }); + /** + * Creates new matrix from a list of values (16) + * @param initialM11 defines 1st value of 1st row + * @param initialM12 defines 2nd value of 1st row + * @param initialM13 defines 3rd value of 1st row + * @param initialM14 defines 4th value of 1st row + * @param initialM21 defines 1st value of 2nd row + * @param initialM22 defines 2nd value of 2nd row + * @param initialM23 defines 3rd value of 2nd row + * @param initialM24 defines 4th value of 2nd row + * @param initialM31 defines 1st value of 3rd row + * @param initialM32 defines 2nd value of 3rd row + * @param initialM33 defines 3rd value of 3rd row + * @param initialM34 defines 4th value of 3rd row + * @param initialM41 defines 1st value of 4th row + * @param initialM42 defines 2nd value of 4th row + * @param initialM43 defines 3rd value of 4th row + * @param initialM44 defines 4th value of 4th row + * @returns the new matrix + */ + Matrix.FromValues = function (initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44) { + var result = new Matrix(); + result.m[0] = initialM11; + result.m[1] = initialM12; + result.m[2] = initialM13; + result.m[3] = initialM14; + result.m[4] = initialM21; + result.m[5] = initialM22; + result.m[6] = initialM23; + result.m[7] = initialM24; + result.m[8] = initialM31; + result.m[9] = initialM32; + result.m[10] = initialM33; + result.m[11] = initialM34; + result.m[12] = initialM41; + result.m[13] = initialM42; + result.m[14] = initialM43; + result.m[15] = initialM44; + return result; + }; + /** + * Creates a new matrix composed by merging scale (vector3), rotation (quaternion) and translation (vector3) + * @param scale defines the scale vector3 + * @param rotation defines the rotation quaternion + * @param translation defines the translation vector3 + * @returns a new matrix + */ + Matrix.Compose = function (scale, rotation, translation) { + var result = Matrix.Identity(); + Matrix.ComposeToRef(scale, rotation, translation, result); + return result; + }; + /** + * Sets a matrix to a value composed by merging scale (vector3), rotation (quaternion) and translation (vector3) + * @param scale defines the scale vector3 + * @param rotation defines the rotation quaternion + * @param translation defines the translation vector3 + * @param result defines the target matrix + */ + Matrix.ComposeToRef = function (scale, rotation, translation, result) { + Matrix.FromValuesToRef(scale.x, 0, 0, 0, 0, scale.y, 0, 0, 0, 0, scale.z, 0, 0, 0, 0, 1, MathTmp.Matrix[1]); + rotation.toRotationMatrix(MathTmp.Matrix[0]); + MathTmp.Matrix[1].multiplyToRef(MathTmp.Matrix[0], result); + result.setTranslation(translation); + }; + /** + * Creates a new identity matrix + * @returns a new identity matrix + */ + Matrix.Identity = function () { + return Matrix.FromValues(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0); + }; + /** + * Creates a new identity matrix and stores the result in a given matrix + * @param result defines the target matrix + */ + Matrix.IdentityToRef = function (result) { + Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, result); + }; + /** + * Creates a new zero matrix + * @returns a new zero matrix + */ + Matrix.Zero = function () { + return Matrix.FromValues(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + }; + /** + * Creates a new rotation matrix for "angle" radians around the X axis + * @param angle defines the angle (in radians) to use + * @return the new matrix + */ + Matrix.RotationX = function (angle) { + var result = new Matrix(); + Matrix.RotationXToRef(angle, result); + return result; + }; + /** + * Creates a new matrix as the invert of a given matrix + * @param source defines the source matrix + * @returns the new matrix + */ + Matrix.Invert = function (source) { + var result = new Matrix(); + source.invertToRef(result); + return result; + }; + /** + * Creates a new rotation matrix for "angle" radians around the X axis and stores it in a given matrix + * @param angle defines the angle (in radians) to use + * @param result defines the target matrix + */ + Matrix.RotationXToRef = function (angle, result) { + var s = Math.sin(angle); + var c = Math.cos(angle); + result.m[0] = 1.0; + result.m[15] = 1.0; + result.m[5] = c; + result.m[10] = c; + result.m[9] = -s; + result.m[6] = s; + result.m[1] = 0.0; + result.m[2] = 0.0; + result.m[3] = 0.0; + result.m[4] = 0.0; + result.m[7] = 0.0; + result.m[8] = 0.0; + result.m[11] = 0.0; + result.m[12] = 0.0; + result.m[13] = 0.0; + result.m[14] = 0.0; + result._markAsUpdated(); + }; + /** + * Creates a new rotation matrix for "angle" radians around the Y axis + * @param angle defines the angle (in radians) to use + * @return the new matrix + */ + Matrix.RotationY = function (angle) { + var result = new Matrix(); + Matrix.RotationYToRef(angle, result); + return result; + }; + /** + * Creates a new rotation matrix for "angle" radians around the Y axis and stores it in a given matrix + * @param angle defines the angle (in radians) to use + * @param result defines the target matrix + */ + Matrix.RotationYToRef = function (angle, result) { + var s = Math.sin(angle); + var c = Math.cos(angle); + result.m[5] = 1.0; + result.m[15] = 1.0; + result.m[0] = c; + result.m[2] = -s; + result.m[8] = s; + result.m[10] = c; + result.m[1] = 0.0; + result.m[3] = 0.0; + result.m[4] = 0.0; + result.m[6] = 0.0; + result.m[7] = 0.0; + result.m[9] = 0.0; + result.m[11] = 0.0; + result.m[12] = 0.0; + result.m[13] = 0.0; + result.m[14] = 0.0; + result._markAsUpdated(); + }; + /** + * Creates a new rotation matrix for "angle" radians around the Z axis + * @param angle defines the angle (in radians) to use + * @return the new matrix + */ + Matrix.RotationZ = function (angle) { + var result = new Matrix(); + Matrix.RotationZToRef(angle, result); + return result; + }; + /** + * Creates a new rotation matrix for "angle" radians around the Z axis and stores it in a given matrix + * @param angle defines the angle (in radians) to use + * @param result defines the target matrix + */ + Matrix.RotationZToRef = function (angle, result) { + var s = Math.sin(angle); + var c = Math.cos(angle); + result.m[10] = 1.0; + result.m[15] = 1.0; + result.m[0] = c; + result.m[1] = s; + result.m[4] = -s; + result.m[5] = c; + result.m[2] = 0.0; + result.m[3] = 0.0; + result.m[6] = 0.0; + result.m[7] = 0.0; + result.m[8] = 0.0; + result.m[9] = 0.0; + result.m[11] = 0.0; + result.m[12] = 0.0; + result.m[13] = 0.0; + result.m[14] = 0.0; + result._markAsUpdated(); + }; + /** + * Creates a new rotation matrix for "angle" radians around the given axis + * @param axis defines the axis to use + * @param angle defines the angle (in radians) to use + * @return the new matrix + */ + Matrix.RotationAxis = function (axis, angle) { + var result = Matrix.Zero(); + Matrix.RotationAxisToRef(axis, angle, result); + return result; + }; + /** + * Creates a new rotation matrix for "angle" radians around the given axis and stores it in a given matrix + * @param axis defines the axis to use + * @param angle defines the angle (in radians) to use + * @param result defines the target matrix + */ + Matrix.RotationAxisToRef = function (axis, angle, result) { + var s = Math.sin(-angle); + var c = Math.cos(-angle); + var c1 = 1 - c; + axis.normalize(); + result.m[0] = (axis.x * axis.x) * c1 + c; + result.m[1] = (axis.x * axis.y) * c1 - (axis.z * s); + result.m[2] = (axis.x * axis.z) * c1 + (axis.y * s); + result.m[3] = 0.0; + result.m[4] = (axis.y * axis.x) * c1 + (axis.z * s); + result.m[5] = (axis.y * axis.y) * c1 + c; + result.m[6] = (axis.y * axis.z) * c1 - (axis.x * s); + result.m[7] = 0.0; + result.m[8] = (axis.z * axis.x) * c1 - (axis.y * s); + result.m[9] = (axis.z * axis.y) * c1 + (axis.x * s); + result.m[10] = (axis.z * axis.z) * c1 + c; + result.m[11] = 0.0; + result.m[15] = 1.0; + result._markAsUpdated(); + }; + /** + * Creates a rotation matrix + * @param yaw defines the yaw angle in radians (Y axis) + * @param pitch defines the pitch angle in radians (X axis) + * @param roll defines the roll angle in radians (X axis) + * @returns the new rotation matrix + */ + Matrix.RotationYawPitchRoll = function (yaw, pitch, roll) { + var result = new Matrix(); + Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, result); + return result; + }; + /** + * Creates a rotation matrix and stores it in a given matrix + * @param yaw defines the yaw angle in radians (Y axis) + * @param pitch defines the pitch angle in radians (X axis) + * @param roll defines the roll angle in radians (X axis) + * @param result defines the target matrix + */ + Matrix.RotationYawPitchRollToRef = function (yaw, pitch, roll, result) { + Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, this._tempQuaternion); + this._tempQuaternion.toRotationMatrix(result); + }; + /** + * Creates a scaling matrix + * @param x defines the scale factor on X axis + * @param y defines the scale factor on Y axis + * @param z defines the scale factor on Z axis + * @returns the new matrix + */ + Matrix.Scaling = function (x, y, z) { + var result = Matrix.Zero(); + Matrix.ScalingToRef(x, y, z, result); + return result; + }; + /** + * Creates a scaling matrix and stores it in a given matrix + * @param x defines the scale factor on X axis + * @param y defines the scale factor on Y axis + * @param z defines the scale factor on Z axis + * @param result defines the target matrix + */ + Matrix.ScalingToRef = function (x, y, z, result) { + result.m[0] = x; + result.m[1] = 0.0; + result.m[2] = 0.0; + result.m[3] = 0.0; + result.m[4] = 0.0; + result.m[5] = y; + result.m[6] = 0.0; + result.m[7] = 0.0; + result.m[8] = 0.0; + result.m[9] = 0.0; + result.m[10] = z; + result.m[11] = 0.0; + result.m[12] = 0.0; + result.m[13] = 0.0; + result.m[14] = 0.0; + result.m[15] = 1.0; + result._markAsUpdated(); + }; + /** + * Creates a translation matrix + * @param x defines the translation on X axis + * @param y defines the translation on Y axis + * @param z defines the translationon Z axis + * @returns the new matrix + */ + Matrix.Translation = function (x, y, z) { + var result = Matrix.Identity(); + Matrix.TranslationToRef(x, y, z, result); + return result; + }; + /** + * Creates a translation matrix and stores it in a given matrix + * @param x defines the translation on X axis + * @param y defines the translation on Y axis + * @param z defines the translationon Z axis + * @param result defines the target matrix + */ + Matrix.TranslationToRef = function (x, y, z, result) { + Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, x, y, z, 1.0, result); + }; + /** + * Returns a new Matrix whose values are the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue". + * @param startValue defines the start value + * @param endValue defines the end value + * @param gradient defines the gradient factor + * @returns the new matrix + */ + Matrix.Lerp = function (startValue, endValue, gradient) { + var result = Matrix.Zero(); + Matrix.LerpToRef(startValue, endValue, gradient, result); + return result; + }; + /** + * Set the given matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue". + * @param startValue defines the start value + * @param endValue defines the end value + * @param gradient defines the gradient factor + * @param result defines the Matrix object where to store data + */ + Matrix.LerpToRef = function (startValue, endValue, gradient, result) { + for (var index = 0; index < 16; index++) { + result.m[index] = startValue.m[index] * (1.0 - gradient) + endValue.m[index] * gradient; + } + result._markAsUpdated(); + }; + /** + * Builds a new matrix whose values are computed by: + * * decomposing the the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices + * * interpolating for "gradient" (float) the values between each of these decomposed matrices between the start and the end + * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices + * @param startValue defines the first matrix + * @param endValue defines the second matrix + * @param gradient defines the gradient between the two matrices + * @returns the new matrix + */ + Matrix.DecomposeLerp = function (startValue, endValue, gradient) { + var result = Matrix.Zero(); + Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result); + return result; + }; + /** + * Update a matrix to values which are computed by: + * * decomposing the the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices + * * interpolating for "gradient" (float) the values between each of these decomposed matrices between the start and the end + * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices + * @param startValue defines the first matrix + * @param endValue defines the second matrix + * @param gradient defines the gradient between the two matrices + * @param result defines the target matrix + */ + Matrix.DecomposeLerpToRef = function (startValue, endValue, gradient, result) { + var startScale = MathTmp.Vector3[0]; + var startRotation = MathTmp.Quaternion[0]; + var startTranslation = MathTmp.Vector3[1]; + startValue.decompose(startScale, startRotation, startTranslation); + var endScale = MathTmp.Vector3[2]; + var endRotation = MathTmp.Quaternion[1]; + var endTranslation = MathTmp.Vector3[3]; + endValue.decompose(endScale, endRotation, endTranslation); + var resultScale = MathTmp.Vector3[4]; + Vector3.LerpToRef(startScale, endScale, gradient, resultScale); + var resultRotation = MathTmp.Quaternion[2]; + Quaternion.SlerpToRef(startRotation, endRotation, gradient, resultRotation); + var resultTranslation = MathTmp.Vector3[5]; + Vector3.LerpToRef(startTranslation, endTranslation, gradient, resultTranslation); + Matrix.ComposeToRef(resultScale, resultRotation, resultTranslation, result); + }; + /** + * Gets a new rotation matrix used to rotate an entity so as it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up" + * This function works in left handed mode + * @param eye defines the final position of the entity + * @param target defines where the entity should look at + * @param up defines the up vector for the entity + * @returns the new matrix + */ + Matrix.LookAtLH = function (eye, target, up) { + var result = Matrix.Zero(); + Matrix.LookAtLHToRef(eye, target, up, result); + return result; + }; + /** + * Sets the given "result" Matrix to a rotation matrix used to rotate an entity so that it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up". + * This function works in left handed mode + * @param eye defines the final position of the entity + * @param target defines where the entity should look at + * @param up defines the up vector for the entity + * @param result defines the target matrix + */ + Matrix.LookAtLHToRef = function (eye, target, up, result) { + // Z axis + target.subtractToRef(eye, this._zAxis); + this._zAxis.normalize(); + // X axis + Vector3.CrossToRef(up, this._zAxis, this._xAxis); + if (this._xAxis.lengthSquared() === 0) { + this._xAxis.x = 1.0; + } + else { + this._xAxis.normalize(); + } + // Y axis + Vector3.CrossToRef(this._zAxis, this._xAxis, this._yAxis); + this._yAxis.normalize(); + // Eye angles + var ex = -Vector3.Dot(this._xAxis, eye); + var ey = -Vector3.Dot(this._yAxis, eye); + var ez = -Vector3.Dot(this._zAxis, eye); + return Matrix.FromValuesToRef(this._xAxis.x, this._yAxis.x, this._zAxis.x, 0, this._xAxis.y, this._yAxis.y, this._zAxis.y, 0, this._xAxis.z, this._yAxis.z, this._zAxis.z, 0, ex, ey, ez, 1, result); + }; + /** + * Gets a new rotation matrix used to rotate an entity so as it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up" + * This function works in right handed mode + * @param eye defines the final position of the entity + * @param target defines where the entity should look at + * @param up defines the up vector for the entity + * @returns the new matrix + */ + Matrix.LookAtRH = function (eye, target, up) { + var result = Matrix.Zero(); + Matrix.LookAtRHToRef(eye, target, up, result); + return result; + }; + /** + * Sets the given "result" Matrix to a rotation matrix used to rotate an entity so that it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up". + * This function works in right handed mode + * @param eye defines the final position of the entity + * @param target defines where the entity should look at + * @param up defines the up vector for the entity + * @param result defines the target matrix + */ + Matrix.LookAtRHToRef = function (eye, target, up, result) { + // Z axis + eye.subtractToRef(target, this._zAxis); + this._zAxis.normalize(); + // X axis + Vector3.CrossToRef(up, this._zAxis, this._xAxis); + if (this._xAxis.lengthSquared() === 0) { + this._xAxis.x = 1.0; + } + else { + this._xAxis.normalize(); + } + // Y axis + Vector3.CrossToRef(this._zAxis, this._xAxis, this._yAxis); + this._yAxis.normalize(); + // Eye angles + var ex = -Vector3.Dot(this._xAxis, eye); + var ey = -Vector3.Dot(this._yAxis, eye); + var ez = -Vector3.Dot(this._zAxis, eye); + return Matrix.FromValuesToRef(this._xAxis.x, this._yAxis.x, this._zAxis.x, 0, this._xAxis.y, this._yAxis.y, this._zAxis.y, 0, this._xAxis.z, this._yAxis.z, this._zAxis.z, 0, ex, ey, ez, 1, result); + }; + /** + * Create a left-handed orthographic projection matrix + * @param width defines the viewport width + * @param height defines the viewport height + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @returns a new matrix as a left-handed orthographic projection matrix + */ + Matrix.OrthoLH = function (width, height, znear, zfar) { + var matrix = Matrix.Zero(); + Matrix.OrthoLHToRef(width, height, znear, zfar, matrix); + return matrix; + }; + /** + * Store a left-handed orthographic projection to a given matrix + * @param width defines the viewport width + * @param height defines the viewport height + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @param result defines the target matrix + */ + Matrix.OrthoLHToRef = function (width, height, znear, zfar, result) { + var n = znear; + var f = zfar; + var a = 2.0 / width; + var b = 2.0 / height; + var c = 2.0 / (f - n); + var d = -(f + n) / (f - n); + Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, 0.0, 0.0, d, 1.0, result); + }; + /** + * Create a left-handed orthographic projection matrix + * @param left defines the viewport left coordinate + * @param right defines the viewport right coordinate + * @param bottom defines the viewport bottom coordinate + * @param top defines the viewport top coordinate + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @returns a new matrix as a left-handed orthographic projection matrix + */ + Matrix.OrthoOffCenterLH = function (left, right, bottom, top, znear, zfar) { + var matrix = Matrix.Zero(); + Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, matrix); + return matrix; + }; + /** + * Stores a left-handed orthographic projection into a given matrix + * @param left defines the viewport left coordinate + * @param right defines the viewport right coordinate + * @param bottom defines the viewport bottom coordinate + * @param top defines the viewport top coordinate + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @param result defines the target matrix + */ + Matrix.OrthoOffCenterLHToRef = function (left, right, bottom, top, znear, zfar, result) { + var n = znear; + var f = zfar; + var a = 2.0 / (right - left); + var b = 2.0 / (top - bottom); + var c = 2.0 / (f - n); + var d = -(f + n) / (f - n); + var i0 = (left + right) / (left - right); + var i1 = (top + bottom) / (bottom - top); + Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, i0, i1, d, 1.0, result); + }; + /** + * Creates a right-handed orthographic projection matrix + * @param left defines the viewport left coordinate + * @param right defines the viewport right coordinate + * @param bottom defines the viewport bottom coordinate + * @param top defines the viewport top coordinate + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @returns a new matrix as a right-handed orthographic projection matrix + */ + Matrix.OrthoOffCenterRH = function (left, right, bottom, top, znear, zfar) { + var matrix = Matrix.Zero(); + Matrix.OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, matrix); + return matrix; + }; + /** + * Stores a right-handed orthographic projection into a given matrix + * @param left defines the viewport left coordinate + * @param right defines the viewport right coordinate + * @param bottom defines the viewport bottom coordinate + * @param top defines the viewport top coordinate + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @param result defines the target matrix + */ + Matrix.OrthoOffCenterRHToRef = function (left, right, bottom, top, znear, zfar, result) { + Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result); + result.m[10] *= -1.0; + }; + /** + * Creates a left-handed perspective projection matrix + * @param width defines the viewport width + * @param height defines the viewport height + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @returns a new matrix as a left-handed perspective projection matrix + */ + Matrix.PerspectiveLH = function (width, height, znear, zfar) { + var matrix = Matrix.Zero(); + var n = znear; + var f = zfar; + var a = 2.0 * n / width; + var b = 2.0 * n / height; + var c = (f + n) / (f - n); + var d = -2.0 * f * n / (f - n); + Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, matrix); + return matrix; + }; + /** + * Creates a left-handed perspective projection matrix + * @param fov defines the horizontal field of view + * @param aspect defines the aspect ratio + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @returns a new matrix as a left-handed perspective projection matrix + */ + Matrix.PerspectiveFovLH = function (fov, aspect, znear, zfar) { + var matrix = Matrix.Zero(); + Matrix.PerspectiveFovLHToRef(fov, aspect, znear, zfar, matrix); + return matrix; + }; + /** + * Stores a left-handed perspective projection into a given matrix + * @param fov defines the horizontal field of view + * @param aspect defines the aspect ratio + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @param result defines the target matrix + * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally + */ + Matrix.PerspectiveFovLHToRef = function (fov, aspect, znear, zfar, result, isVerticalFovFixed) { + if (isVerticalFovFixed === void 0) { isVerticalFovFixed = true; } + var n = znear; + var f = zfar; + var t = 1.0 / (Math.tan(fov * 0.5)); + var a = isVerticalFovFixed ? (t / aspect) : t; + var b = isVerticalFovFixed ? t : (t * aspect); + var c = (f + n) / (f - n); + var d = -2.0 * f * n / (f - n); + Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, result); + }; + /** + * Creates a right-handed perspective projection matrix + * @param fov defines the horizontal field of view + * @param aspect defines the aspect ratio + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @returns a new matrix as a right-handed perspective projection matrix + */ + Matrix.PerspectiveFovRH = function (fov, aspect, znear, zfar) { + var matrix = Matrix.Zero(); + Matrix.PerspectiveFovRHToRef(fov, aspect, znear, zfar, matrix); + return matrix; + }; + /** + * Stores a right-handed perspective projection into a given matrix + * @param fov defines the horizontal field of view + * @param aspect defines the aspect ratio + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @param result defines the target matrix + * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally + */ + Matrix.PerspectiveFovRHToRef = function (fov, aspect, znear, zfar, result, isVerticalFovFixed) { + //alternatively this could be expressed as: + // m = PerspectiveFovLHToRef + // m[10] *= -1.0; + // m[11] *= -1.0; + if (isVerticalFovFixed === void 0) { isVerticalFovFixed = true; } + var n = znear; + var f = zfar; + var t = 1.0 / (Math.tan(fov * 0.5)); + var a = isVerticalFovFixed ? (t / aspect) : t; + var b = isVerticalFovFixed ? t : (t * aspect); + var c = -(f + n) / (f - n); + var d = -2 * f * n / (f - n); + Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, -1.0, 0.0, 0.0, d, 0.0, result); + }; + /** + * Stores a perspective projection for WebVR info a given matrix + * @param fov defines the field of view + * @param znear defines the near clip plane + * @param zfar defines the far clip plane + * @param result defines the target matrix + * @param rightHanded defines if the matrix must be in right-handed mode (false by default) + */ + Matrix.PerspectiveFovWebVRToRef = function (fov, znear, zfar, result, rightHanded) { + if (rightHanded === void 0) { rightHanded = false; } + var rightHandedFactor = rightHanded ? -1 : 1; + var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); + var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); + var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); + var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); + var xScale = 2.0 / (leftTan + rightTan); + var yScale = 2.0 / (upTan + downTan); + result.m[0] = xScale; + result.m[1] = result.m[2] = result.m[3] = result.m[4] = 0.0; + result.m[5] = yScale; + result.m[6] = result.m[7] = 0.0; + result.m[8] = ((leftTan - rightTan) * xScale * 0.5); + result.m[9] = -((upTan - downTan) * yScale * 0.5); + result.m[10] = -zfar / (znear - zfar); + result.m[11] = 1.0 * rightHandedFactor; + result.m[12] = result.m[13] = result.m[15] = 0.0; + result.m[14] = -(2.0 * zfar * znear) / (zfar - znear); + result._markAsUpdated(); + }; + /** + * Computes a complete transformation matrix + * @param viewport defines the viewport to use + * @param world defines the world matrix + * @param view defines the view matrix + * @param projection defines the projection matrix + * @param zmin defines the near clip plane + * @param zmax defines the far clip plane + * @returns the transformation matrix + */ + Matrix.GetFinalMatrix = function (viewport, world, view, projection, zmin, zmax) { + var cw = viewport.width; + var ch = viewport.height; + var cx = viewport.x; + var cy = viewport.y; + var viewportMatrix = Matrix.FromValues(cw / 2.0, 0.0, 0.0, 0.0, 0.0, -ch / 2.0, 0.0, 0.0, 0.0, 0.0, zmax - zmin, 0.0, cx + cw / 2.0, ch / 2.0 + cy, zmin, 1); + return world.multiply(view).multiply(projection).multiply(viewportMatrix); + }; + /** + * Extracts a 2x2 matrix from a given matrix and store the result in a Float32Array + * @param matrix defines the matrix to use + * @returns a new Float32Array array with 4 elements : the 2x2 matrix extracted from the given matrix + */ + Matrix.GetAsMatrix2x2 = function (matrix) { + return new Float32Array([ + matrix.m[0], matrix.m[1], + matrix.m[4], matrix.m[5] + ]); + }; + /** + * Extracts a 3x3 matrix from a given matrix and store the result in a Float32Array + * @param matrix defines the matrix to use + * @returns a new Float32Array array with 9 elements : the 3x3 matrix extracted from the given matrix + */ + Matrix.GetAsMatrix3x3 = function (matrix) { + return new Float32Array([ + matrix.m[0], matrix.m[1], matrix.m[2], + matrix.m[4], matrix.m[5], matrix.m[6], + matrix.m[8], matrix.m[9], matrix.m[10] + ]); + }; + /** + * Compute the transpose of a given matrix + * @param matrix defines the matrix to transpose + * @returns the new matrix + */ + Matrix.Transpose = function (matrix) { + var result = new Matrix(); + Matrix.TransposeToRef(matrix, result); + return result; + }; + /** + * Compute the transpose of a matrix and store it in a target matrix + * @param matrix defines the matrix to transpose + * @param result defines the target matrix + */ + Matrix.TransposeToRef = function (matrix, result) { + result.m[0] = matrix.m[0]; + result.m[1] = matrix.m[4]; + result.m[2] = matrix.m[8]; + result.m[3] = matrix.m[12]; + result.m[4] = matrix.m[1]; + result.m[5] = matrix.m[5]; + result.m[6] = matrix.m[9]; + result.m[7] = matrix.m[13]; + result.m[8] = matrix.m[2]; + result.m[9] = matrix.m[6]; + result.m[10] = matrix.m[10]; + result.m[11] = matrix.m[14]; + result.m[12] = matrix.m[3]; + result.m[13] = matrix.m[7]; + result.m[14] = matrix.m[11]; + result.m[15] = matrix.m[15]; + }; + /** + * Computes a reflection matrix from a plane + * @param plane defines the reflection plane + * @returns a new matrix + */ + Matrix.Reflection = function (plane) { + var matrix = new Matrix(); + Matrix.ReflectionToRef(plane, matrix); + return matrix; + }; + /** + * Computes a reflection matrix from a plane + * @param plane defines the reflection plane + * @param result defines the target matrix + */ + Matrix.ReflectionToRef = function (plane, result) { + plane.normalize(); + var x = plane.normal.x; + var y = plane.normal.y; + var z = plane.normal.z; + var temp = -2 * x; + var temp2 = -2 * y; + var temp3 = -2 * z; + result.m[0] = (temp * x) + 1; + result.m[1] = temp2 * x; + result.m[2] = temp3 * x; + result.m[3] = 0.0; + result.m[4] = temp * y; + result.m[5] = (temp2 * y) + 1; + result.m[6] = temp3 * y; + result.m[7] = 0.0; + result.m[8] = temp * z; + result.m[9] = temp2 * z; + result.m[10] = (temp3 * z) + 1; + result.m[11] = 0.0; + result.m[12] = temp * plane.d; + result.m[13] = temp2 * plane.d; + result.m[14] = temp3 * plane.d; + result.m[15] = 1.0; + result._markAsUpdated(); + }; + /** + * Sets the given matrix as a rotation matrix composed from the 3 left handed axes + * @param xaxis defines the value of the 1st axis + * @param yaxis defines the value of the 2nd axis + * @param zaxis defines the value of the 3rd axis + * @param result defines the target matrix + */ + Matrix.FromXYZAxesToRef = function (xaxis, yaxis, zaxis, result) { + result.m[0] = xaxis.x; + result.m[1] = xaxis.y; + result.m[2] = xaxis.z; + result.m[3] = 0.0; + result.m[4] = yaxis.x; + result.m[5] = yaxis.y; + result.m[6] = yaxis.z; + result.m[7] = 0.0; + result.m[8] = zaxis.x; + result.m[9] = zaxis.y; + result.m[10] = zaxis.z; + result.m[11] = 0.0; + result.m[12] = 0.0; + result.m[13] = 0.0; + result.m[14] = 0.0; + result.m[15] = 1.0; + result._markAsUpdated(); + }; + /** + * Creates a rotation matrix from a quaternion and stores it in a target matrix + * @param quat defines the quaternion to use + * @param result defines the target matrix + */ + Matrix.FromQuaternionToRef = function (quat, result) { + var xx = quat.x * quat.x; + var yy = quat.y * quat.y; + var zz = quat.z * quat.z; + var xy = quat.x * quat.y; + var zw = quat.z * quat.w; + var zx = quat.z * quat.x; + var yw = quat.y * quat.w; + var yz = quat.y * quat.z; + var xw = quat.x * quat.w; + result.m[0] = 1.0 - (2.0 * (yy + zz)); + result.m[1] = 2.0 * (xy + zw); + result.m[2] = 2.0 * (zx - yw); + result.m[3] = 0.0; + result.m[4] = 2.0 * (xy - zw); + result.m[5] = 1.0 - (2.0 * (zz + xx)); + result.m[6] = 2.0 * (yz + xw); + result.m[7] = 0.0; + result.m[8] = 2.0 * (zx + yw); + result.m[9] = 2.0 * (yz - xw); + result.m[10] = 1.0 - (2.0 * (yy + xx)); + result.m[11] = 0.0; + result.m[12] = 0.0; + result.m[13] = 0.0; + result.m[14] = 0.0; + result.m[15] = 1.0; + result._markAsUpdated(); + }; + Matrix._tempQuaternion = new Quaternion(); + Matrix._xAxis = Vector3.Zero(); + Matrix._yAxis = Vector3.Zero(); + Matrix._zAxis = Vector3.Zero(); + Matrix._updateFlagSeed = 0; + Matrix._identityReadOnly = Matrix.Identity(); + return Matrix; + }()); + BABYLON.Matrix = Matrix; + /** + * Represens a plane by the equation ax + by + cz + d = 0 + */ + var Plane = /** @class */ (function () { + /** + * Creates a Plane object according to the given floats a, b, c, d and the plane equation : ax + by + cz + d = 0 + * @param a a component of the plane + * @param b b component of the plane + * @param c c component of the plane + * @param d d component of the plane + */ + function Plane(a, b, c, d) { + this.normal = new Vector3(a, b, c); + this.d = d; + } + /** + * @returns the plane coordinates as a new array of 4 elements [a, b, c, d]. + */ + Plane.prototype.asArray = function () { + return [this.normal.x, this.normal.y, this.normal.z, this.d]; + }; + // Methods + /** + * @returns a new plane copied from the current Plane. + */ + Plane.prototype.clone = function () { + return new Plane(this.normal.x, this.normal.y, this.normal.z, this.d); + }; + /** + * @returns the string "Plane". + */ + Plane.prototype.getClassName = function () { + return "Plane"; + }; + /** + * @returns the Plane hash code. + */ + Plane.prototype.getHashCode = function () { + var hash = this.normal.getHashCode(); + hash = (hash * 397) ^ (this.d || 0); + return hash; + }; + /** + * Normalize the current Plane in place. + * @returns the updated Plane. + */ + Plane.prototype.normalize = function () { + var norm = (Math.sqrt((this.normal.x * this.normal.x) + (this.normal.y * this.normal.y) + (this.normal.z * this.normal.z))); + var magnitude = 0.0; + if (norm !== 0) { + magnitude = 1.0 / norm; + } + this.normal.x *= magnitude; + this.normal.y *= magnitude; + this.normal.z *= magnitude; + this.d *= magnitude; + return this; + }; + /** + * Applies a transformation the plane and returns the result + * @param transformation the transformation matrix to be applied to the plane + * @returns a new Plane as the result of the transformation of the current Plane by the given matrix. + */ + Plane.prototype.transform = function (transformation) { + var transposedMatrix = Matrix.Transpose(transformation); + var x = this.normal.x; + var y = this.normal.y; + var z = this.normal.z; + var d = this.d; + var normalX = (((x * transposedMatrix.m[0]) + (y * transposedMatrix.m[1])) + (z * transposedMatrix.m[2])) + (d * transposedMatrix.m[3]); + var normalY = (((x * transposedMatrix.m[4]) + (y * transposedMatrix.m[5])) + (z * transposedMatrix.m[6])) + (d * transposedMatrix.m[7]); + var normalZ = (((x * transposedMatrix.m[8]) + (y * transposedMatrix.m[9])) + (z * transposedMatrix.m[10])) + (d * transposedMatrix.m[11]); + var finalD = (((x * transposedMatrix.m[12]) + (y * transposedMatrix.m[13])) + (z * transposedMatrix.m[14])) + (d * transposedMatrix.m[15]); + return new Plane(normalX, normalY, normalZ, finalD); + }; + /** + * Calcualtte the dot product between the point and the plane normal + * @param point point to calculate the dot product with + * @returns the dot product (float) of the point coordinates and the plane normal. + */ + Plane.prototype.dotCoordinate = function (point) { + return ((((this.normal.x * point.x) + (this.normal.y * point.y)) + (this.normal.z * point.z)) + this.d); + }; + /** + * Updates the current Plane from the plane defined by the three given points. + * @param point1 one of the points used to contruct the plane + * @param point2 one of the points used to contruct the plane + * @param point3 one of the points used to contruct the plane + * @returns the updated Plane. + */ + Plane.prototype.copyFromPoints = function (point1, point2, point3) { + var x1 = point2.x - point1.x; + var y1 = point2.y - point1.y; + var z1 = point2.z - point1.z; + var x2 = point3.x - point1.x; + var y2 = point3.y - point1.y; + var z2 = point3.z - point1.z; + var yz = (y1 * z2) - (z1 * y2); + var xz = (z1 * x2) - (x1 * z2); + var xy = (x1 * y2) - (y1 * x2); + var pyth = (Math.sqrt((yz * yz) + (xz * xz) + (xy * xy))); + var invPyth; + if (pyth !== 0) { + invPyth = 1.0 / pyth; + } + else { + invPyth = 0.0; + } + this.normal.x = yz * invPyth; + this.normal.y = xz * invPyth; + this.normal.z = xy * invPyth; + this.d = -((this.normal.x * point1.x) + (this.normal.y * point1.y) + (this.normal.z * point1.z)); + return this; + }; + /** + * Checks if the plane is facing a given direction + * @param direction the direction to check if the plane is facing + * @param epsilon value the dot product is compared against (returns true if dot <= epsilon) + * @returns True is the vector "direction" is the same side than the plane normal. + */ + Plane.prototype.isFrontFacingTo = function (direction, epsilon) { + var dot = Vector3.Dot(this.normal, direction); + return (dot <= epsilon); + }; + /** + * Calculates the distance to a point + * @param point point to calculate distance to + * @returns the signed distance (float) from the given point to the Plane. + */ + Plane.prototype.signedDistanceTo = function (point) { + return Vector3.Dot(point, this.normal) + this.d; + }; + // Statics + /** + * Creates a plane from an array + * @param array the array to create a plane from + * @returns a new Plane from the given array. + */ + Plane.FromArray = function (array) { + return new Plane(array[0], array[1], array[2], array[3]); + }; + /** + * Creates a plane from three points + * @param point1 point used to create the plane + * @param point2 point used to create the plane + * @param point3 point used to create the plane + * @returns a new Plane defined by the three given points. + */ + Plane.FromPoints = function (point1, point2, point3) { + var result = new Plane(0.0, 0.0, 0.0, 0.0); + result.copyFromPoints(point1, point2, point3); + return result; + }; + /** + * Creates a plane from an origin point and a normal + * @param origin origin of the plane to be constructed + * @param normal normal of the plane to be constructed + * @returns a new Plane the normal vector to this plane at the given origin point. + * Note : the vector "normal" is updated because normalized. + */ + Plane.FromPositionAndNormal = function (origin, normal) { + var result = new Plane(0.0, 0.0, 0.0, 0.0); + normal.normalize(); + result.normal = normal; + result.d = -(normal.x * origin.x + normal.y * origin.y + normal.z * origin.z); + return result; + }; + /** + * Calculates the distance from a plane and a point + * @param origin origin of the plane to be constructed + * @param normal normal of the plane to be constructed + * @param point point to calculate distance to + * @returns the signed distance between the plane defined by the normal vector at the "origin"" point and the given other point. + */ + Plane.SignedDistanceToPlaneFromPositionAndNormal = function (origin, normal, point) { + var d = -(normal.x * origin.x + normal.y * origin.y + normal.z * origin.z); + return Vector3.Dot(point, normal) + d; + }; + return Plane; + }()); + BABYLON.Plane = Plane; + /** + * Class used to represent a viewport on screen + */ + var Viewport = /** @class */ (function () { + /** + * Creates a Viewport object located at (x, y) and sized (width, height) + * @param x defines viewport left coordinate + * @param y defines viewport top coordinate + * @param width defines the viewport width + * @param height defines the viewport height + */ + function Viewport( + /** viewport left coordinate */ + x, + /** viewport top coordinate */ + y, + /**viewport width */ + width, + /** viewport height */ + height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + /** + * Creates a new viewport using absolute sizing (from 0-> width, 0-> height instead of 0->1) + * @param renderWidthOrEngine defines either an engine or the rendering width + * @param renderHeight defines the rendering height + * @returns a new Viewport + */ + Viewport.prototype.toGlobal = function (renderWidthOrEngine, renderHeight) { + if (renderWidthOrEngine.getRenderWidth) { + var engine = renderWidthOrEngine; + return this.toGlobal(engine.getRenderWidth(), engine.getRenderHeight()); + } + var renderWidth = renderWidthOrEngine; + return new Viewport(this.x * renderWidth, this.y * renderHeight, this.width * renderWidth, this.height * renderHeight); + }; + /** + * Returns a new Viewport copied from the current one + * @returns a new Viewport + */ + Viewport.prototype.clone = function () { + return new Viewport(this.x, this.y, this.width, this.height); + }; + return Viewport; + }()); + BABYLON.Viewport = Viewport; + /** + * Reprasents a camera frustum + */ + var Frustum = /** @class */ (function () { + function Frustum() { + } + /** + * Gets the planes representing the frustum + * @param transform matrix to be applied to the returned planes + * @returns a new array of 6 Frustum planes computed by the given transformation matrix. + */ + Frustum.GetPlanes = function (transform) { + var frustumPlanes = []; + for (var index = 0; index < 6; index++) { + frustumPlanes.push(new Plane(0.0, 0.0, 0.0, 0.0)); + } + Frustum.GetPlanesToRef(transform, frustumPlanes); + return frustumPlanes; + }; + /** + * Gets the near frustum plane transformed by the transform matrix + * @param transform transformation matrix to be applied to the resulting frustum plane + * @param frustumPlane the resuling frustum plane + */ + Frustum.GetNearPlaneToRef = function (transform, frustumPlane) { + frustumPlane.normal.x = transform.m[3] + transform.m[2]; + frustumPlane.normal.y = transform.m[7] + transform.m[6]; + frustumPlane.normal.z = transform.m[11] + transform.m[10]; + frustumPlane.d = transform.m[15] + transform.m[14]; + frustumPlane.normalize(); + }; + /** + * Gets the far frustum plane transformed by the transform matrix + * @param transform transformation matrix to be applied to the resulting frustum plane + * @param frustumPlane the resuling frustum plane + */ + Frustum.GetFarPlaneToRef = function (transform, frustumPlane) { + frustumPlane.normal.x = transform.m[3] - transform.m[2]; + frustumPlane.normal.y = transform.m[7] - transform.m[6]; + frustumPlane.normal.z = transform.m[11] - transform.m[10]; + frustumPlane.d = transform.m[15] - transform.m[14]; + frustumPlane.normalize(); + }; + /** + * Gets the left frustum plane transformed by the transform matrix + * @param transform transformation matrix to be applied to the resulting frustum plane + * @param frustumPlane the resuling frustum plane + */ + Frustum.GetLeftPlaneToRef = function (transform, frustumPlane) { + frustumPlane.normal.x = transform.m[3] + transform.m[0]; + frustumPlane.normal.y = transform.m[7] + transform.m[4]; + frustumPlane.normal.z = transform.m[11] + transform.m[8]; + frustumPlane.d = transform.m[15] + transform.m[12]; + frustumPlane.normalize(); + }; + /** + * Gets the right frustum plane transformed by the transform matrix + * @param transform transformation matrix to be applied to the resulting frustum plane + * @param frustumPlane the resuling frustum plane + */ + Frustum.GetRightPlaneToRef = function (transform, frustumPlane) { + frustumPlane.normal.x = transform.m[3] - transform.m[0]; + frustumPlane.normal.y = transform.m[7] - transform.m[4]; + frustumPlane.normal.z = transform.m[11] - transform.m[8]; + frustumPlane.d = transform.m[15] - transform.m[12]; + frustumPlane.normalize(); + }; + /** + * Gets the top frustum plane transformed by the transform matrix + * @param transform transformation matrix to be applied to the resulting frustum plane + * @param frustumPlane the resuling frustum plane + */ + Frustum.GetTopPlaneToRef = function (transform, frustumPlane) { + frustumPlane.normal.x = transform.m[3] - transform.m[1]; + frustumPlane.normal.y = transform.m[7] - transform.m[5]; + frustumPlane.normal.z = transform.m[11] - transform.m[9]; + frustumPlane.d = transform.m[15] - transform.m[13]; + frustumPlane.normalize(); + }; + /** + * Gets the bottom frustum plane transformed by the transform matrix + * @param transform transformation matrix to be applied to the resulting frustum plane + * @param frustumPlane the resuling frustum plane + */ + Frustum.GetBottomPlaneToRef = function (transform, frustumPlane) { + frustumPlane.normal.x = transform.m[3] + transform.m[1]; + frustumPlane.normal.y = transform.m[7] + transform.m[5]; + frustumPlane.normal.z = transform.m[11] + transform.m[9]; + frustumPlane.d = transform.m[15] + transform.m[13]; + frustumPlane.normalize(); + }; + /** + * Sets the given array "frustumPlanes" with the 6 Frustum planes computed by the given transformation matrix. + * @param transform transformation matrix to be applied to the resulting frustum planes + * @param frustumPlanes the resuling frustum planes + */ + Frustum.GetPlanesToRef = function (transform, frustumPlanes) { + // Near + Frustum.GetNearPlaneToRef(transform, frustumPlanes[0]); + // Far + Frustum.GetFarPlaneToRef(transform, frustumPlanes[1]); + // Left + Frustum.GetLeftPlaneToRef(transform, frustumPlanes[2]); + // Right + Frustum.GetRightPlaneToRef(transform, frustumPlanes[3]); + // Top + Frustum.GetTopPlaneToRef(transform, frustumPlanes[4]); + // Bottom + Frustum.GetBottomPlaneToRef(transform, frustumPlanes[5]); + }; + return Frustum; + }()); + BABYLON.Frustum = Frustum; + /** Defines supported spaces */ + var Space; + (function (Space) { + /** Local (object) space */ + Space[Space["LOCAL"] = 0] = "LOCAL"; + /** World space */ + Space[Space["WORLD"] = 1] = "WORLD"; + /** Bone space */ + Space[Space["BONE"] = 2] = "BONE"; + })(Space = BABYLON.Space || (BABYLON.Space = {})); + /** Defines the 3 main axes */ + var Axis = /** @class */ (function () { + function Axis() { + } + /** X axis */ + Axis.X = new Vector3(1.0, 0.0, 0.0); + /** Y axis */ + Axis.Y = new Vector3(0.0, 1.0, 0.0); + /** Z axis */ + Axis.Z = new Vector3(0.0, 0.0, 1.0); + return Axis; + }()); + BABYLON.Axis = Axis; + /** Class used to represent a Bezier curve */ + var BezierCurve = /** @class */ (function () { + function BezierCurve() { + } + /** + * Returns the cubic Bezier interpolated value (float) at "t" (float) from the given x1, y1, x2, y2 floats + * @param t defines the time + * @param x1 defines the left coordinate on X axis + * @param y1 defines the left coordinate on Y axis + * @param x2 defines the right coordinate on X axis + * @param y2 defines the right coordinate on Y axis + * @returns the interpolated value + */ + BezierCurve.Interpolate = function (t, x1, y1, x2, y2) { + // Extract X (which is equal to time here) + var f0 = 1 - 3 * x2 + 3 * x1; + var f1 = 3 * x2 - 6 * x1; + var f2 = 3 * x1; + var refinedT = t; + for (var i = 0; i < 5; i++) { + var refinedT2 = refinedT * refinedT; + var refinedT3 = refinedT2 * refinedT; + var x = f0 * refinedT3 + f1 * refinedT2 + f2 * refinedT; + var slope = 1.0 / (3.0 * f0 * refinedT2 + 2.0 * f1 * refinedT + f2); + refinedT -= (x - t) * slope; + refinedT = Math.min(1, Math.max(0, refinedT)); + } + // Resolve cubic bezier for the given x + return 3 * Math.pow(1 - refinedT, 2) * refinedT * y1 + + 3 * (1 - refinedT) * Math.pow(refinedT, 2) * y2 + + Math.pow(refinedT, 3); + }; + return BezierCurve; + }()); + BABYLON.BezierCurve = BezierCurve; + /** + * Defines potential orientation for back face culling + */ + var Orientation; + (function (Orientation) { + /** + * Clockwise + */ + Orientation[Orientation["CW"] = 0] = "CW"; + /** Counter clockwise */ + Orientation[Orientation["CCW"] = 1] = "CCW"; + })(Orientation = BABYLON.Orientation || (BABYLON.Orientation = {})); + /** + * Defines angle representation + */ + var Angle = /** @class */ (function () { + /** + * Creates an Angle object of "radians" radians (float). + */ + function Angle(radians) { + this._radians = radians; + if (this._radians < 0.0) { + this._radians += (2.0 * Math.PI); + } + } + /** + * Get value in degrees + * @returns the Angle value in degrees (float) + */ + Angle.prototype.degrees = function () { + return this._radians * 180.0 / Math.PI; + }; + /** + * Get value in radians + * @returns the Angle value in radians (float) + */ + Angle.prototype.radians = function () { + return this._radians; + }; + /** + * Gets a new Angle object valued with the angle value in radians between the two given vectors + * @param a defines first vector + * @param b defines second vector + * @returns a new Angle + */ + Angle.BetweenTwoPoints = function (a, b) { + var delta = b.subtract(a); + var theta = Math.atan2(delta.y, delta.x); + return new Angle(theta); + }; + /** + * Gets a new Angle object from the given float in radians + * @param radians defines the angle value in radians + * @returns a new Angle + */ + Angle.FromRadians = function (radians) { + return new Angle(radians); + }; + /** + * Gets a new Angle object from the given float in degrees + * @param degrees defines the angle value in degrees + * @returns a new Angle + */ + Angle.FromDegrees = function (degrees) { + return new Angle(degrees * Math.PI / 180.0); + }; + return Angle; + }()); + BABYLON.Angle = Angle; + /** + * This represents an arc in a 2d space. + */ + var Arc2 = /** @class */ (function () { + /** + * Creates an Arc object from the three given points : start, middle and end. + * @param startPoint Defines the start point of the arc + * @param midPoint Defines the midlle point of the arc + * @param endPoint Defines the end point of the arc + */ + function Arc2( + /** Defines the start point of the arc */ + startPoint, + /** Defines the mid point of the arc */ + midPoint, + /** Defines the end point of the arc */ + endPoint) { + this.startPoint = startPoint; + this.midPoint = midPoint; + this.endPoint = endPoint; + var temp = Math.pow(midPoint.x, 2) + Math.pow(midPoint.y, 2); + var startToMid = (Math.pow(startPoint.x, 2) + Math.pow(startPoint.y, 2) - temp) / 2.; + var midToEnd = (temp - Math.pow(endPoint.x, 2) - Math.pow(endPoint.y, 2)) / 2.; + var det = (startPoint.x - midPoint.x) * (midPoint.y - endPoint.y) - (midPoint.x - endPoint.x) * (startPoint.y - midPoint.y); + this.centerPoint = new Vector2((startToMid * (midPoint.y - endPoint.y) - midToEnd * (startPoint.y - midPoint.y)) / det, ((startPoint.x - midPoint.x) * midToEnd - (midPoint.x - endPoint.x) * startToMid) / det); + this.radius = this.centerPoint.subtract(this.startPoint).length(); + this.startAngle = Angle.BetweenTwoPoints(this.centerPoint, this.startPoint); + var a1 = this.startAngle.degrees(); + var a2 = Angle.BetweenTwoPoints(this.centerPoint, this.midPoint).degrees(); + var a3 = Angle.BetweenTwoPoints(this.centerPoint, this.endPoint).degrees(); + // angles correction + if (a2 - a1 > +180.0) { + a2 -= 360.0; + } + if (a2 - a1 < -180.0) { + a2 += 360.0; + } + if (a3 - a2 > +180.0) { + a3 -= 360.0; + } + if (a3 - a2 < -180.0) { + a3 += 360.0; + } + this.orientation = (a2 - a1) < 0 ? Orientation.CW : Orientation.CCW; + this.angle = Angle.FromDegrees(this.orientation === Orientation.CW ? a1 - a3 : a3 - a1); + } + return Arc2; + }()); + BABYLON.Arc2 = Arc2; + /** + * Represents a 2D path made up of multiple 2D points + */ + var Path2 = /** @class */ (function () { + /** + * Creates a Path2 object from the starting 2D coordinates x and y. + * @param x the starting points x value + * @param y the starting points y value + */ + function Path2(x, y) { + this._points = new Array(); + this._length = 0.0; + /** + * If the path start and end point are the same + */ + this.closed = false; + this._points.push(new Vector2(x, y)); + } + /** + * Adds a new segment until the given coordinates (x, y) to the current Path2. + * @param x the added points x value + * @param y the added points y value + * @returns the updated Path2. + */ + Path2.prototype.addLineTo = function (x, y) { + if (this.closed) { + return this; + } + var newPoint = new Vector2(x, y); + var previousPoint = this._points[this._points.length - 1]; + this._points.push(newPoint); + this._length += newPoint.subtract(previousPoint).length(); + return this; + }; + /** + * Adds _numberOfSegments_ segments according to the arc definition (middle point coordinates, end point coordinates, the arc start point being the current Path2 last point) to the current Path2. + * @param midX middle point x value + * @param midY middle point y value + * @param endX end point x value + * @param endY end point y value + * @param numberOfSegments (default: 36) + * @returns the updated Path2. + */ + Path2.prototype.addArcTo = function (midX, midY, endX, endY, numberOfSegments) { + if (numberOfSegments === void 0) { numberOfSegments = 36; } + if (this.closed) { + return this; + } + var startPoint = this._points[this._points.length - 1]; + var midPoint = new Vector2(midX, midY); + var endPoint = new Vector2(endX, endY); + var arc = new Arc2(startPoint, midPoint, endPoint); + var increment = arc.angle.radians() / numberOfSegments; + if (arc.orientation === Orientation.CW) { + increment *= -1; + } + var currentAngle = arc.startAngle.radians() + increment; + for (var i = 0; i < numberOfSegments; i++) { + var x = Math.cos(currentAngle) * arc.radius + arc.centerPoint.x; + var y = Math.sin(currentAngle) * arc.radius + arc.centerPoint.y; + this.addLineTo(x, y); + currentAngle += increment; + } + return this; + }; + /** + * Closes the Path2. + * @returns the Path2. + */ + Path2.prototype.close = function () { + this.closed = true; + return this; + }; + /** + * Gets the sum of the distance between each sequential point in the path + * @returns the Path2 total length (float). + */ + Path2.prototype.length = function () { + var result = this._length; + if (!this.closed) { + var lastPoint = this._points[this._points.length - 1]; + var firstPoint = this._points[0]; + result += (firstPoint.subtract(lastPoint).length()); + } + return result; + }; + /** + * Gets the points which construct the path + * @returns the Path2 internal array of points. + */ + Path2.prototype.getPoints = function () { + return this._points; + }; + /** + * Retreives the point at the distance aways from the starting point + * @param normalizedLengthPosition the length along the path to retreive the point from + * @returns a new Vector2 located at a percentage of the Path2 total length on this path. + */ + Path2.prototype.getPointAtLengthPosition = function (normalizedLengthPosition) { + if (normalizedLengthPosition < 0 || normalizedLengthPosition > 1) { + return Vector2.Zero(); + } + var lengthPosition = normalizedLengthPosition * this.length(); + var previousOffset = 0; + for (var i = 0; i < this._points.length; i++) { + var j = (i + 1) % this._points.length; + var a = this._points[i]; + var b = this._points[j]; + var bToA = b.subtract(a); + var nextOffset = (bToA.length() + previousOffset); + if (lengthPosition >= previousOffset && lengthPosition <= nextOffset) { + var dir = bToA.normalize(); + var localOffset = lengthPosition - previousOffset; + return new Vector2(a.x + (dir.x * localOffset), a.y + (dir.y * localOffset)); + } + previousOffset = nextOffset; + } + return Vector2.Zero(); + }; + /** + * Creates a new path starting from an x and y position + * @param x starting x value + * @param y starting y value + * @returns a new Path2 starting at the coordinates (x, y). + */ + Path2.StartingAt = function (x, y) { + return new Path2(x, y); + }; + return Path2; + }()); + BABYLON.Path2 = Path2; + /** + * Represents a 3D path made up of multiple 3D points + */ + var Path3D = /** @class */ (function () { + /** + * new Path3D(path, normal, raw) + * Creates a Path3D. A Path3D is a logical math object, so not a mesh. + * please read the description in the tutorial : http://doc.babylonjs.com/tutorials/How_to_use_Path3D + * @param path an array of Vector3, the curve axis of the Path3D + * @param normal (options) Vector3, the first wanted normal to the curve. Ex (0, 1, 0) for a vertical normal. + * @param raw (optional, default false) : boolean, if true the returned Path3D isn't normalized. Useful to depict path acceleration or speed. + */ + function Path3D( + /** + * an array of Vector3, the curve axis of the Path3D + */ + path, firstNormal, raw) { + if (firstNormal === void 0) { firstNormal = null; } + this.path = path; + this._curve = new Array(); + this._distances = new Array(); + this._tangents = new Array(); + this._normals = new Array(); + this._binormals = new Array(); + for (var p = 0; p < path.length; p++) { + this._curve[p] = path[p].clone(); // hard copy + } + this._raw = raw || false; + this._compute(firstNormal); + } + /** + * Returns the Path3D array of successive Vector3 designing its curve. + * @returns the Path3D array of successive Vector3 designing its curve. + */ + Path3D.prototype.getCurve = function () { + return this._curve; + }; + /** + * Returns an array populated with tangent vectors on each Path3D curve point. + * @returns an array populated with tangent vectors on each Path3D curve point. + */ + Path3D.prototype.getTangents = function () { + return this._tangents; + }; + /** + * Returns an array populated with normal vectors on each Path3D curve point. + * @returns an array populated with normal vectors on each Path3D curve point. + */ + Path3D.prototype.getNormals = function () { + return this._normals; + }; + /** + * Returns an array populated with binormal vectors on each Path3D curve point. + * @returns an array populated with binormal vectors on each Path3D curve point. + */ + Path3D.prototype.getBinormals = function () { + return this._binormals; + }; + /** + * Returns an array populated with distances (float) of the i-th point from the first curve point. + * @returns an array populated with distances (float) of the i-th point from the first curve point. + */ + Path3D.prototype.getDistances = function () { + return this._distances; + }; + /** + * Forces the Path3D tangent, normal, binormal and distance recomputation. + * @param path path which all values are copied into the curves points + * @param firstNormal which should be projected onto the curve + * @returns the same object updated. + */ + Path3D.prototype.update = function (path, firstNormal) { + if (firstNormal === void 0) { firstNormal = null; } + for (var p = 0; p < path.length; p++) { + this._curve[p].x = path[p].x; + this._curve[p].y = path[p].y; + this._curve[p].z = path[p].z; + } + this._compute(firstNormal); + return this; + }; + // private function compute() : computes tangents, normals and binormals + Path3D.prototype._compute = function (firstNormal) { + var l = this._curve.length; + // first and last tangents + this._tangents[0] = this._getFirstNonNullVector(0); + if (!this._raw) { + this._tangents[0].normalize(); + } + this._tangents[l - 1] = this._curve[l - 1].subtract(this._curve[l - 2]); + if (!this._raw) { + this._tangents[l - 1].normalize(); + } + // normals and binormals at first point : arbitrary vector with _normalVector() + var tg0 = this._tangents[0]; + var pp0 = this._normalVector(this._curve[0], tg0, firstNormal); + this._normals[0] = pp0; + if (!this._raw) { + this._normals[0].normalize(); + } + this._binormals[0] = Vector3.Cross(tg0, this._normals[0]); + if (!this._raw) { + this._binormals[0].normalize(); + } + this._distances[0] = 0.0; + // normals and binormals : next points + var prev; // previous vector (segment) + var cur; // current vector (segment) + var curTang; // current tangent + // previous normal + var prevBinor; // previous binormal + for (var i = 1; i < l; i++) { + // tangents + prev = this._getLastNonNullVector(i); + if (i < l - 1) { + cur = this._getFirstNonNullVector(i); + this._tangents[i] = prev.add(cur); + this._tangents[i].normalize(); + } + this._distances[i] = this._distances[i - 1] + prev.length(); + // normals and binormals + // http://www.cs.cmu.edu/afs/andrew/scs/cs/15-462/web/old/asst2camera.html + curTang = this._tangents[i]; + prevBinor = this._binormals[i - 1]; + this._normals[i] = Vector3.Cross(prevBinor, curTang); + if (!this._raw) { + this._normals[i].normalize(); + } + this._binormals[i] = Vector3.Cross(curTang, this._normals[i]); + if (!this._raw) { + this._binormals[i].normalize(); + } + } + }; + // private function getFirstNonNullVector(index) + // returns the first non null vector from index : curve[index + N].subtract(curve[index]) + Path3D.prototype._getFirstNonNullVector = function (index) { + var i = 1; + var nNVector = this._curve[index + i].subtract(this._curve[index]); + while (nNVector.length() === 0 && index + i + 1 < this._curve.length) { + i++; + nNVector = this._curve[index + i].subtract(this._curve[index]); + } + return nNVector; + }; + // private function getLastNonNullVector(index) + // returns the last non null vector from index : curve[index].subtract(curve[index - N]) + Path3D.prototype._getLastNonNullVector = function (index) { + var i = 1; + var nLVector = this._curve[index].subtract(this._curve[index - i]); + while (nLVector.length() === 0 && index > i + 1) { + i++; + nLVector = this._curve[index].subtract(this._curve[index - i]); + } + return nLVector; + }; + // private function normalVector(v0, vt, va) : + // returns an arbitrary point in the plane defined by the point v0 and the vector vt orthogonal to this plane + // if va is passed, it returns the va projection on the plane orthogonal to vt at the point v0 + Path3D.prototype._normalVector = function (v0, vt, va) { + var normal0; + var tgl = vt.length(); + if (tgl === 0.0) { + tgl = 1.0; + } + if (va === undefined || va === null) { + var point; + if (!BABYLON.Scalar.WithinEpsilon(Math.abs(vt.y) / tgl, 1.0, BABYLON.Epsilon)) { // search for a point in the plane + point = new Vector3(0.0, -1.0, 0.0); + } + else if (!BABYLON.Scalar.WithinEpsilon(Math.abs(vt.x) / tgl, 1.0, BABYLON.Epsilon)) { + point = new Vector3(1.0, 0.0, 0.0); + } + else if (!BABYLON.Scalar.WithinEpsilon(Math.abs(vt.z) / tgl, 1.0, BABYLON.Epsilon)) { + point = new Vector3(0.0, 0.0, 1.0); + } + else { + point = Vector3.Zero(); + } + normal0 = Vector3.Cross(vt, point); + } + else { + normal0 = Vector3.Cross(vt, va); + Vector3.CrossToRef(normal0, vt, normal0); + } + normal0.normalize(); + return normal0; + }; + return Path3D; + }()); + BABYLON.Path3D = Path3D; + /** + * A Curve3 object is a logical object, so not a mesh, to handle curves in the 3D geometric space. + * A Curve3 is designed from a series of successive Vector3. + * @see https://doc.babylonjs.com/how_to/how_to_use_curve3 + */ + var Curve3 = /** @class */ (function () { + /** + * A Curve3 object is a logical object, so not a mesh, to handle curves in the 3D geometric space. + * A Curve3 is designed from a series of successive Vector3. + * Tuto : http://doc.babylonjs.com/tutorials/How_to_use_Curve3#curve3-object + * @param points points which make up the curve + */ + function Curve3(points) { + this._length = 0.0; + this._points = points; + this._length = this._computeLength(points); + } + /** + * Returns a Curve3 object along a Quadratic Bezier curve : http://doc.babylonjs.com/tutorials/How_to_use_Curve3#quadratic-bezier-curve + * @param v0 (Vector3) the origin point of the Quadratic Bezier + * @param v1 (Vector3) the control point + * @param v2 (Vector3) the end point of the Quadratic Bezier + * @param nbPoints (integer) the wanted number of points in the curve + * @returns the created Curve3 + */ + Curve3.CreateQuadraticBezier = function (v0, v1, v2, nbPoints) { + nbPoints = nbPoints > 2 ? nbPoints : 3; + var bez = new Array(); + var equation = function (t, val0, val1, val2) { + var res = (1.0 - t) * (1.0 - t) * val0 + 2.0 * t * (1.0 - t) * val1 + t * t * val2; + return res; + }; + for (var i = 0; i <= nbPoints; i++) { + bez.push(new Vector3(equation(i / nbPoints, v0.x, v1.x, v2.x), equation(i / nbPoints, v0.y, v1.y, v2.y), equation(i / nbPoints, v0.z, v1.z, v2.z))); + } + return new Curve3(bez); + }; + /** + * Returns a Curve3 object along a Cubic Bezier curve : http://doc.babylonjs.com/tutorials/How_to_use_Curve3#cubic-bezier-curve + * @param v0 (Vector3) the origin point of the Cubic Bezier + * @param v1 (Vector3) the first control point + * @param v2 (Vector3) the second control point + * @param v3 (Vector3) the end point of the Cubic Bezier + * @param nbPoints (integer) the wanted number of points in the curve + * @returns the created Curve3 + */ + Curve3.CreateCubicBezier = function (v0, v1, v2, v3, nbPoints) { + nbPoints = nbPoints > 3 ? nbPoints : 4; + var bez = new Array(); + var equation = function (t, val0, val1, val2, val3) { + var res = (1.0 - t) * (1.0 - t) * (1.0 - t) * val0 + 3.0 * t * (1.0 - t) * (1.0 - t) * val1 + 3.0 * t * t * (1.0 - t) * val2 + t * t * t * val3; + return res; + }; + for (var i = 0; i <= nbPoints; i++) { + bez.push(new Vector3(equation(i / nbPoints, v0.x, v1.x, v2.x, v3.x), equation(i / nbPoints, v0.y, v1.y, v2.y, v3.y), equation(i / nbPoints, v0.z, v1.z, v2.z, v3.z))); + } + return new Curve3(bez); + }; + /** + * Returns a Curve3 object along a Hermite Spline curve : http://doc.babylonjs.com/tutorials/How_to_use_Curve3#hermite-spline + * @param p1 (Vector3) the origin point of the Hermite Spline + * @param t1 (Vector3) the tangent vector at the origin point + * @param p2 (Vector3) the end point of the Hermite Spline + * @param t2 (Vector3) the tangent vector at the end point + * @param nbPoints (integer) the wanted number of points in the curve + * @returns the created Curve3 + */ + Curve3.CreateHermiteSpline = function (p1, t1, p2, t2, nbPoints) { + var hermite = new Array(); + var step = 1.0 / nbPoints; + for (var i = 0; i <= nbPoints; i++) { + hermite.push(Vector3.Hermite(p1, t1, p2, t2, i * step)); + } + return new Curve3(hermite); + }; + /** + * Returns a Curve3 object along a CatmullRom Spline curve : + * @param points (array of Vector3) the points the spline must pass through. At least, four points required + * @param nbPoints (integer) the wanted number of points between each curve control points + * @param closed (boolean) optional with default false, when true forms a closed loop from the points + * @returns the created Curve3 + */ + Curve3.CreateCatmullRomSpline = function (points, nbPoints, closed) { + var catmullRom = new Array(); + var step = 1.0 / nbPoints; + var amount = 0.0; + if (closed) { + var pointsCount = points.length; + for (var i = 0; i < pointsCount; i++) { + amount = 0; + for (var c = 0; c < nbPoints; c++) { + catmullRom.push(Vector3.CatmullRom(points[i % pointsCount], points[(i + 1) % pointsCount], points[(i + 2) % pointsCount], points[(i + 3) % pointsCount], amount)); + amount += step; + } + } + catmullRom.push(catmullRom[0]); + } + else { + var totalPoints = new Array(); + totalPoints.push(points[0].clone()); + Array.prototype.push.apply(totalPoints, points); + totalPoints.push(points[points.length - 1].clone()); + for (var i = 0; i < totalPoints.length - 3; i++) { + amount = 0; + for (var c = 0; c < nbPoints; c++) { + catmullRom.push(Vector3.CatmullRom(totalPoints[i], totalPoints[i + 1], totalPoints[i + 2], totalPoints[i + 3], amount)); + amount += step; + } + } + i--; + catmullRom.push(Vector3.CatmullRom(totalPoints[i], totalPoints[i + 1], totalPoints[i + 2], totalPoints[i + 3], amount)); + } + return new Curve3(catmullRom); + }; + /** + * @returns the Curve3 stored array of successive Vector3 + */ + Curve3.prototype.getPoints = function () { + return this._points; + }; + /** + * @returns the computed length (float) of the curve. + */ + Curve3.prototype.length = function () { + return this._length; + }; + /** + * Returns a new instance of Curve3 object : var curve = curveA.continue(curveB); + * This new Curve3 is built by translating and sticking the curveB at the end of the curveA. + * curveA and curveB keep unchanged. + * @param curve the curve to continue from this curve + * @returns the newly constructed curve + */ + Curve3.prototype.continue = function (curve) { + var lastPoint = this._points[this._points.length - 1]; + var continuedPoints = this._points.slice(); + var curvePoints = curve.getPoints(); + for (var i = 1; i < curvePoints.length; i++) { + continuedPoints.push(curvePoints[i].subtract(curvePoints[0]).add(lastPoint)); + } + var continuedCurve = new Curve3(continuedPoints); + return continuedCurve; + }; + Curve3.prototype._computeLength = function (path) { + var l = 0; + for (var i = 1; i < path.length; i++) { + l += (path[i].subtract(path[i - 1])).length(); + } + return l; + }; + return Curve3; + }()); + BABYLON.Curve3 = Curve3; + // Vertex formats + /** + * Contains position and normal vectors for a vertex + */ + var PositionNormalVertex = /** @class */ (function () { + /** + * Creates a PositionNormalVertex + * @param position the position of the vertex (defaut: 0,0,0) + * @param normal the normal of the vertex (defaut: 0,1,0) + */ + function PositionNormalVertex( + /** the position of the vertex (defaut: 0,0,0) */ + position, + /** the normal of the vertex (defaut: 0,1,0) */ + normal) { + if (position === void 0) { position = Vector3.Zero(); } + if (normal === void 0) { normal = Vector3.Up(); } + this.position = position; + this.normal = normal; + } + /** + * Clones the PositionNormalVertex + * @returns the cloned PositionNormalVertex + */ + PositionNormalVertex.prototype.clone = function () { + return new PositionNormalVertex(this.position.clone(), this.normal.clone()); + }; + return PositionNormalVertex; + }()); + BABYLON.PositionNormalVertex = PositionNormalVertex; + /** + * Contains position, normal and uv vectors for a vertex + */ + var PositionNormalTextureVertex = /** @class */ (function () { + /** + * Creates a PositionNormalTextureVertex + * @param position the position of the vertex (defaut: 0,0,0) + * @param normal the normal of the vertex (defaut: 0,1,0) + * @param uv the uv of the vertex (default: 0,0) + */ + function PositionNormalTextureVertex( + /** the position of the vertex (defaut: 0,0,0) */ + position, + /** the normal of the vertex (defaut: 0,1,0) */ + normal, + /** the uv of the vertex (default: 0,0) */ + uv) { + if (position === void 0) { position = Vector3.Zero(); } + if (normal === void 0) { normal = Vector3.Up(); } + if (uv === void 0) { uv = Vector2.Zero(); } + this.position = position; + this.normal = normal; + this.uv = uv; + } + /** + * Clones the PositionNormalTextureVertex + * @returns the cloned PositionNormalTextureVertex + */ + PositionNormalTextureVertex.prototype.clone = function () { + return new PositionNormalTextureVertex(this.position.clone(), this.normal.clone(), this.uv.clone()); + }; + return PositionNormalTextureVertex; + }()); + BABYLON.PositionNormalTextureVertex = PositionNormalTextureVertex; + // Temporary pre-allocated objects for engine internal use + // usage in any internal function : + // var tmp = Tmp.Vector3[0]; <= gets access to the first pre-created Vector3 + // There's a Tmp array per object type : int, float, Vector2, Vector3, Vector4, Quaternion, Matrix + /** + * @hidden + */ + var Tmp = /** @class */ (function () { + function Tmp() { + } + Tmp.Color3 = [Color3.Black(), Color3.Black(), Color3.Black()]; + Tmp.Color4 = [new Color4(0, 0, 0, 0), new Color4(0, 0, 0, 0)]; + Tmp.Vector2 = [Vector2.Zero(), Vector2.Zero(), Vector2.Zero()]; // 3 temp Vector2 at once should be enough + Tmp.Vector3 = [Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), + Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero()]; // 9 temp Vector3 at once should be enough + Tmp.Vector4 = [Vector4.Zero(), Vector4.Zero(), Vector4.Zero()]; // 3 temp Vector4 at once should be enough + Tmp.Quaternion = [Quaternion.Zero(), Quaternion.Zero()]; // 2 temp Quaternion at once should be enough + Tmp.Matrix = [Matrix.Zero(), Matrix.Zero(), + Matrix.Zero(), Matrix.Zero(), + Matrix.Zero(), Matrix.Zero(), + Matrix.Zero(), Matrix.Zero()]; // 6 temp Matrices at once should be enough + return Tmp; + }()); + BABYLON.Tmp = Tmp; + /** + * @hidden + * Same as Tmp but not exported to keep it only for math functions to avoid conflicts + */ + var MathTmp = /** @class */ (function () { + function MathTmp() { + } + MathTmp.Vector3 = [Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero()]; + MathTmp.Matrix = [Matrix.Zero(), Matrix.Zero()]; + MathTmp.Quaternion = [Quaternion.Zero(), Quaternion.Zero(), Quaternion.Zero()]; + return MathTmp; + }()); +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.math.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Scalar computation library + */ + var Scalar = /** @class */ (function () { + function Scalar() { + } + /** + * Boolean : true if the absolute difference between a and b is lower than epsilon (default = 1.401298E-45) + * @param a number + * @param b number + * @param epsilon (default = 1.401298E-45) + * @returns true if the absolute difference between a and b is lower than epsilon (default = 1.401298E-45) + */ + Scalar.WithinEpsilon = function (a, b, epsilon) { + if (epsilon === void 0) { epsilon = 1.401298E-45; } + var num = a - b; + return -epsilon <= num && num <= epsilon; + }; + /** + * Returns a string : the upper case translation of the number i to hexadecimal. + * @param i number + * @returns the upper case translation of the number i to hexadecimal. + */ + Scalar.ToHex = function (i) { + var str = i.toString(16); + if (i <= 15) { + return ("0" + str).toUpperCase(); + } + return str.toUpperCase(); + }; + /** + * Returns -1 if value is negative and +1 is value is positive. + * @param value the value + * @returns the value itself if it's equal to zero. + */ + Scalar.Sign = function (value) { + value = +value; // convert to a number + if (value === 0 || isNaN(value)) { + return value; + } + return value > 0 ? 1 : -1; + }; + /** + * Returns the value itself if it's between min and max. + * Returns min if the value is lower than min. + * Returns max if the value is greater than max. + * @param value the value to clmap + * @param min the min value to clamp to (default: 0) + * @param max the max value to clamp to (default: 1) + * @returns the clamped value + */ + Scalar.Clamp = function (value, min, max) { + if (min === void 0) { min = 0; } + if (max === void 0) { max = 1; } + return Math.min(max, Math.max(min, value)); + }; + /** + * the log2 of value. + * @param value the value to compute log2 of + * @returns the log2 of value. + */ + Scalar.Log2 = function (value) { + return Math.log(value) * Math.LOG2E; + }; + /** + * Loops the value, so that it is never larger than length and never smaller than 0. + * + * This is similar to the modulo operator but it works with floating point numbers. + * For example, using 3.0 for t and 2.5 for length, the result would be 0.5. + * With t = 5 and length = 2.5, the result would be 0.0. + * Note, however, that the behaviour is not defined for negative numbers as it is for the modulo operator + * @param value the value + * @param length the length + * @returns the looped value + */ + Scalar.Repeat = function (value, length) { + return value - Math.floor(value / length) * length; + }; + /** + * Normalize the value between 0.0 and 1.0 using min and max values + * @param value value to normalize + * @param min max to normalize between + * @param max min to normalize between + * @returns the normalized value + */ + Scalar.Normalize = function (value, min, max) { + return (value - min) / (max - min); + }; + /** + * Denormalize the value from 0.0 and 1.0 using min and max values + * @param normalized value to denormalize + * @param min max to denormalize between + * @param max min to denormalize between + * @returns the denormalized value + */ + Scalar.Denormalize = function (normalized, min, max) { + return (normalized * (max - min) + min); + }; + /** + * Calculates the shortest difference between two given angles given in degrees. + * @param current current angle in degrees + * @param target target angle in degrees + * @returns the delta + */ + Scalar.DeltaAngle = function (current, target) { + var num = Scalar.Repeat(target - current, 360.0); + if (num > 180.0) { + num -= 360.0; + } + return num; + }; + /** + * PingPongs the value t, so that it is never larger than length and never smaller than 0. + * @param tx value + * @param length length + * @returns The returned value will move back and forth between 0 and length + */ + Scalar.PingPong = function (tx, length) { + var t = Scalar.Repeat(tx, length * 2.0); + return length - Math.abs(t - length); + }; + /** + * Interpolates between min and max with smoothing at the limits. + * + * This function interpolates between min and max in a similar way to Lerp. However, the interpolation will gradually speed up + * from the start and slow down toward the end. This is useful for creating natural-looking animation, fading and other transitions. + * @param from from + * @param to to + * @param tx value + * @returns the smooth stepped value + */ + Scalar.SmoothStep = function (from, to, tx) { + var t = Scalar.Clamp(tx); + t = -2.0 * t * t * t + 3.0 * t * t; + return to * t + from * (1.0 - t); + }; + /** + * Moves a value current towards target. + * + * This is essentially the same as Mathf.Lerp but instead the function will ensure that the speed never exceeds maxDelta. + * Negative values of maxDelta pushes the value away from target. + * @param current current value + * @param target target value + * @param maxDelta max distance to move + * @returns resulting value + */ + Scalar.MoveTowards = function (current, target, maxDelta) { + var result = 0; + if (Math.abs(target - current) <= maxDelta) { + result = target; + } + else { + result = current + Scalar.Sign(target - current) * maxDelta; + } + return result; + }; + /** + * Same as MoveTowards but makes sure the values interpolate correctly when they wrap around 360 degrees. + * + * Variables current and target are assumed to be in degrees. For optimization reasons, negative values of maxDelta + * are not supported and may cause oscillation. To push current away from a target angle, add 180 to that angle instead. + * @param current current value + * @param target target value + * @param maxDelta max distance to move + * @returns resulting angle + */ + Scalar.MoveTowardsAngle = function (current, target, maxDelta) { + var num = Scalar.DeltaAngle(current, target); + var result = 0; + if (-maxDelta < num && num < maxDelta) { + result = target; + } + else { + target = current + num; + result = Scalar.MoveTowards(current, target, maxDelta); + } + return result; + }; + /** + * Creates a new scalar with values linearly interpolated of "amount" between the start scalar and the end scalar. + * @param start start value + * @param end target value + * @param amount amount to lerp between + * @returns the lerped value + */ + Scalar.Lerp = function (start, end, amount) { + return start + ((end - start) * amount); + }; + /** + * Same as Lerp but makes sure the values interpolate correctly when they wrap around 360 degrees. + * The parameter t is clamped to the range [0, 1]. Variables a and b are assumed to be in degrees. + * @param start start value + * @param end target value + * @param amount amount to lerp between + * @returns the lerped value + */ + Scalar.LerpAngle = function (start, end, amount) { + var num = Scalar.Repeat(end - start, 360.0); + if (num > 180.0) { + num -= 360.0; + } + return start + num * Scalar.Clamp(amount); + }; + /** + * Calculates the linear parameter t that produces the interpolant value within the range [a, b]. + * @param a start value + * @param b target value + * @param value value between a and b + * @returns the inverseLerp value + */ + Scalar.InverseLerp = function (a, b, value) { + var result = 0; + if (a != b) { + result = Scalar.Clamp((value - a) / (b - a)); + } + else { + result = 0.0; + } + return result; + }; + /** + * Returns a new scalar located for "amount" (float) on the Hermite spline defined by the scalars "value1", "value3", "tangent1", "tangent2". + * @see http://mathworld.wolfram.com/HermitePolynomial.html + * @param value1 spline value + * @param tangent1 spline value + * @param value2 spline value + * @param tangent2 spline value + * @param amount input value + * @returns hermite result + */ + Scalar.Hermite = function (value1, tangent1, value2, tangent2, amount) { + var squared = amount * amount; + var cubed = amount * squared; + var part1 = ((2.0 * cubed) - (3.0 * squared)) + 1.0; + var part2 = (-2.0 * cubed) + (3.0 * squared); + var part3 = (cubed - (2.0 * squared)) + amount; + var part4 = cubed - squared; + return (((value1 * part1) + (value2 * part2)) + (tangent1 * part3)) + (tangent2 * part4); + }; + /** + * Returns a random float number between and min and max values + * @param min min value of random + * @param max max value of random + * @returns random value + */ + Scalar.RandomRange = function (min, max) { + if (min === max) { + return min; + } + return ((Math.random() * (max - min)) + min); + }; + /** + * This function returns percentage of a number in a given range. + * + * RangeToPercent(40,20,60) will return 0.5 (50%) + * RangeToPercent(34,0,100) will return 0.34 (34%) + * @param number to convert to percentage + * @param min min range + * @param max max range + * @returns the percentage + */ + Scalar.RangeToPercent = function (number, min, max) { + return ((number - min) / (max - min)); + }; + /** + * This function returns number that corresponds to the percentage in a given range. + * + * PercentToRange(0.34,0,100) will return 34. + * @param percent to convert to number + * @param min min range + * @param max max range + * @returns the number + */ + Scalar.PercentToRange = function (percent, min, max) { + return ((max - min) * percent + min); + }; + /** + * Returns the angle converted to equivalent value between -Math.PI and Math.PI radians. + * @param angle The angle to normalize in radian. + * @return The converted angle. + */ + Scalar.NormalizeRadians = function (angle) { + // More precise but slower version kept for reference. + // angle = angle % Tools.TwoPi; + // angle = (angle + Tools.TwoPi) % Tools.TwoPi; + //if (angle > Math.PI) { + // angle -= Tools.TwoPi; + //} + angle -= (Scalar.TwoPi * Math.floor((angle + Math.PI) / Scalar.TwoPi)); + return angle; + }; + /** + * Two pi constants convenient for computation. + */ + Scalar.TwoPi = Math.PI * 2; + return Scalar; + }()); + BABYLON.Scalar = Scalar; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.math.scalar.js.map + + + +//# sourceMappingURL=babylon.mixins.js.map + +// Type definitions for WebGL 2, Editor's Draft Fri Feb 24 16:10:18 2017 -0800 +// Project: https://www.khronos.org/registry/webgl/specs/latest/2.0/ +// Definitions by: Nico Kemnitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +//# sourceMappingURL=babylon.webgl2.js.map + +var BABYLON; +(function (BABYLON) { + var __decoratorInitialStore = {}; + var __mergedStore = {}; + var _copySource = function (creationFunction, source, instanciate) { + var destination = creationFunction(); + // Tags + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(destination, source.tags); + } + var classStore = getMergedStore(destination); + // Properties + for (var property in classStore) { + var propertyDescriptor = classStore[property]; + var sourceProperty = source[property]; + var propertyType = propertyDescriptor.type; + if (sourceProperty !== undefined && sourceProperty !== null) { + switch (propertyType) { + case 0: // Value + case 6: // Mesh reference + case 11: // Camera reference + destination[property] = sourceProperty; + break; + case 1: // Texture + destination[property] = (instanciate || sourceProperty.isRenderTarget) ? sourceProperty : sourceProperty.clone(); + break; + case 2: // Color3 + case 3: // FresnelParameters + case 4: // Vector2 + case 5: // Vector3 + case 7: // Color Curves + case 10: // Quaternion + destination[property] = instanciate ? sourceProperty : sourceProperty.clone(); + break; + } + } + } + return destination; + }; + function getDirectStore(target) { + var classKey = target.getClassName(); + if (!__decoratorInitialStore[classKey]) { + __decoratorInitialStore[classKey] = {}; + } + return __decoratorInitialStore[classKey]; + } + /** + * Return the list of properties flagged as serializable + * @param target: host object + */ + function getMergedStore(target) { + var classKey = target.getClassName(); + if (__mergedStore[classKey]) { + return __mergedStore[classKey]; + } + __mergedStore[classKey] = {}; + var store = __mergedStore[classKey]; + var currentTarget = target; + var currentKey = classKey; + while (currentKey) { + var initialStore = __decoratorInitialStore[currentKey]; + for (var property in initialStore) { + store[property] = initialStore[property]; + } + var parent_1 = void 0; + var done = false; + do { + parent_1 = Object.getPrototypeOf(currentTarget); + if (!parent_1.getClassName) { + done = true; + break; + } + if (parent_1.getClassName() !== currentKey) { + break; + } + currentTarget = parent_1; + } while (parent_1); + if (done) { + break; + } + currentKey = parent_1.getClassName(); + currentTarget = parent_1; + } + return store; + } + function generateSerializableMember(type, sourceName) { + return function (target, propertyKey) { + var classStore = getDirectStore(target); + if (!classStore[propertyKey]) { + classStore[propertyKey] = { type: type, sourceName: sourceName }; + } + }; + } + function generateExpandMember(setCallback, targetKey) { + if (targetKey === void 0) { targetKey = null; } + return function (target, propertyKey) { + var key = targetKey || ("_" + propertyKey); + Object.defineProperty(target, propertyKey, { + get: function () { + return this[key]; + }, + set: function (value) { + if (this[key] === value) { + return; + } + this[key] = value; + target[setCallback].apply(this); + }, + enumerable: true, + configurable: true + }); + }; + } + function expandToProperty(callback, targetKey) { + if (targetKey === void 0) { targetKey = null; } + return generateExpandMember(callback, targetKey); + } + BABYLON.expandToProperty = expandToProperty; + function serialize(sourceName) { + return generateSerializableMember(0, sourceName); // value member + } + BABYLON.serialize = serialize; + function serializeAsTexture(sourceName) { + return generateSerializableMember(1, sourceName); // texture member + } + BABYLON.serializeAsTexture = serializeAsTexture; + function serializeAsColor3(sourceName) { + return generateSerializableMember(2, sourceName); // color3 member + } + BABYLON.serializeAsColor3 = serializeAsColor3; + function serializeAsFresnelParameters(sourceName) { + return generateSerializableMember(3, sourceName); // fresnel parameters member + } + BABYLON.serializeAsFresnelParameters = serializeAsFresnelParameters; + function serializeAsVector2(sourceName) { + return generateSerializableMember(4, sourceName); // vector2 member + } + BABYLON.serializeAsVector2 = serializeAsVector2; + function serializeAsVector3(sourceName) { + return generateSerializableMember(5, sourceName); // vector3 member + } + BABYLON.serializeAsVector3 = serializeAsVector3; + function serializeAsMeshReference(sourceName) { + return generateSerializableMember(6, sourceName); // mesh reference member + } + BABYLON.serializeAsMeshReference = serializeAsMeshReference; + function serializeAsColorCurves(sourceName) { + return generateSerializableMember(7, sourceName); // color curves + } + BABYLON.serializeAsColorCurves = serializeAsColorCurves; + function serializeAsColor4(sourceName) { + return generateSerializableMember(8, sourceName); // color 4 + } + BABYLON.serializeAsColor4 = serializeAsColor4; + function serializeAsImageProcessingConfiguration(sourceName) { + return generateSerializableMember(9, sourceName); // image processing + } + BABYLON.serializeAsImageProcessingConfiguration = serializeAsImageProcessingConfiguration; + function serializeAsQuaternion(sourceName) { + return generateSerializableMember(10, sourceName); // quaternion member + } + BABYLON.serializeAsQuaternion = serializeAsQuaternion; + /** + * Decorator used to define property that can be serialized as reference to a camera + * @param sourceName defines the name of the property to decorate + */ + function serializeAsCameraReference(sourceName) { + return generateSerializableMember(11, sourceName); // camera reference member + } + BABYLON.serializeAsCameraReference = serializeAsCameraReference; + /** + * Class used to help serialization objects + */ + var SerializationHelper = /** @class */ (function () { + function SerializationHelper() { + } + /** + * Static function used to serialized a specific entity + * @param entity defines the entity to serialize + * @param serializationObject defines the optional target obecjt where serialization data will be stored + * @returns a JSON compatible object representing the serialization of the entity + */ + SerializationHelper.Serialize = function (entity, serializationObject) { + if (!serializationObject) { + serializationObject = {}; + } + // Tags + if (BABYLON.Tags) { + serializationObject.tags = BABYLON.Tags.GetTags(entity); + } + var serializedProperties = getMergedStore(entity); + // Properties + for (var property in serializedProperties) { + var propertyDescriptor = serializedProperties[property]; + var targetPropertyName = propertyDescriptor.sourceName || property; + var propertyType = propertyDescriptor.type; + var sourceProperty = entity[property]; + if (sourceProperty !== undefined && sourceProperty !== null) { + switch (propertyType) { + case 0: // Value + serializationObject[targetPropertyName] = sourceProperty; + break; + case 1: // Texture + serializationObject[targetPropertyName] = sourceProperty.serialize(); + break; + case 2: // Color3 + serializationObject[targetPropertyName] = sourceProperty.asArray(); + break; + case 3: // FresnelParameters + serializationObject[targetPropertyName] = sourceProperty.serialize(); + break; + case 4: // Vector2 + serializationObject[targetPropertyName] = sourceProperty.asArray(); + break; + case 5: // Vector3 + serializationObject[targetPropertyName] = sourceProperty.asArray(); + break; + case 6: // Mesh reference + serializationObject[targetPropertyName] = sourceProperty.id; + break; + case 7: // Color Curves + serializationObject[targetPropertyName] = sourceProperty.serialize(); + break; + case 8: // Color 4 + serializationObject[targetPropertyName] = sourceProperty.asArray(); + break; + case 9: // Image Processing + serializationObject[targetPropertyName] = sourceProperty.serialize(); + break; + case 10: // Quaternion + serializationObject[targetPropertyName] = sourceProperty.asArray(); + break; + case 11: // Camera reference + serializationObject[targetPropertyName] = sourceProperty.id; + break; + } + } + } + return serializationObject; + }; + /** + * Creates a new entity from a serialization data object + * @param creationFunction defines a function used to instanciated the new entity + * @param source defines the source serialization data + * @param scene defines the hosting scene + * @param rootUrl defines the root url for resources + * @returns a new entity + */ + SerializationHelper.Parse = function (creationFunction, source, scene, rootUrl) { + if (rootUrl === void 0) { rootUrl = null; } + var destination = creationFunction(); + if (!rootUrl) { + rootUrl = ""; + } + // Tags + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(destination, source.tags); + } + var classStore = getMergedStore(destination); + // Properties + for (var property in classStore) { + var propertyDescriptor = classStore[property]; + var sourceProperty = source[propertyDescriptor.sourceName || property]; + var propertyType = propertyDescriptor.type; + if (sourceProperty !== undefined && sourceProperty !== null) { + var dest = destination; + switch (propertyType) { + case 0: // Value + dest[property] = sourceProperty; + break; + case 1: // Texture + if (scene) { + dest[property] = BABYLON.Texture.Parse(sourceProperty, scene, rootUrl); + } + break; + case 2: // Color3 + dest[property] = BABYLON.Color3.FromArray(sourceProperty); + break; + case 3: // FresnelParameters + dest[property] = BABYLON.FresnelParameters.Parse(sourceProperty); + break; + case 4: // Vector2 + dest[property] = BABYLON.Vector2.FromArray(sourceProperty); + break; + case 5: // Vector3 + dest[property] = BABYLON.Vector3.FromArray(sourceProperty); + break; + case 6: // Mesh reference + if (scene) { + dest[property] = scene.getLastMeshByID(sourceProperty); + } + break; + case 7: // Color Curves + dest[property] = BABYLON.ColorCurves.Parse(sourceProperty); + break; + case 8: // Color 4 + dest[property] = BABYLON.Color4.FromArray(sourceProperty); + break; + case 9: // Image Processing + dest[property] = BABYLON.ImageProcessingConfiguration.Parse(sourceProperty); + break; + case 10: // Quaternion + dest[property] = BABYLON.Quaternion.FromArray(sourceProperty); + break; + case 11: // Camera reference + if (scene) { + dest[property] = scene.getCameraByID(sourceProperty); + } + break; + } + } + } + return destination; + }; + /** + * Clones an object + * @param creationFunction defines the function used to instanciate the new object + * @param source defines the source object + * @returns the cloned object + */ + SerializationHelper.Clone = function (creationFunction, source) { + return _copySource(creationFunction, source, false); + }; + /** + * Instanciates a new object based on a source one (some data will be shared between both object) + * @param creationFunction defines the function used to instanciate the new object + * @param source defines the source object + * @returns the new object + */ + SerializationHelper.Instanciate = function (creationFunction, source) { + return _copySource(creationFunction, source, true); + }; + return SerializationHelper; + }()); + BABYLON.SerializationHelper = SerializationHelper; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.decorators.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Wrapper class for promise with external resolve and reject. + */ + var Deferred = /** @class */ (function () { + /** + * Constructor for this deferred object. + */ + function Deferred() { + var _this = this; + this.promise = new Promise(function (resolve, reject) { + _this._resolve = resolve; + _this._reject = reject; + }); + } + Object.defineProperty(Deferred.prototype, "resolve", { + /** + * The resolve method of the promise associated with this deferred object. + */ + get: function () { + return this._resolve; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Deferred.prototype, "reject", { + /** + * The reject method of the promise associated with this deferred object. + */ + get: function () { + return this._reject; + }, + enumerable: true, + configurable: true + }); + return Deferred; + }()); + BABYLON.Deferred = Deferred; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.deferred.js.map + +var BABYLON; +(function (BABYLON) { + /** + * A class serves as a medium between the observable and its observers + */ + var EventState = /** @class */ (function () { + /** + * Create a new EventState + * @param mask defines the mask associated with this state + * @param skipNextObservers defines a flag which will instruct the observable to skip following observers when set to true + * @param target defines the original target of the state + * @param currentTarget defines the current target of the state + */ + function EventState(mask, skipNextObservers, target, currentTarget) { + if (skipNextObservers === void 0) { skipNextObservers = false; } + this.initalize(mask, skipNextObservers, target, currentTarget); + } + /** + * Initialize the current event state + * @param mask defines the mask associated with this state + * @param skipNextObservers defines a flag which will instruct the observable to skip following observers when set to true + * @param target defines the original target of the state + * @param currentTarget defines the current target of the state + * @returns the current event state + */ + EventState.prototype.initalize = function (mask, skipNextObservers, target, currentTarget) { + if (skipNextObservers === void 0) { skipNextObservers = false; } + this.mask = mask; + this.skipNextObservers = skipNextObservers; + this.target = target; + this.currentTarget = currentTarget; + return this; + }; + return EventState; + }()); + BABYLON.EventState = EventState; + /** + * Represent an Observer registered to a given Observable object. + */ + var Observer = /** @class */ (function () { + /** + * Creates a new observer + * @param callback defines the callback to call when the observer is notified + * @param mask defines the mask of the observer (used to filter notifications) + * @param scope defines the current scope used to restore the JS context + */ + function Observer( + /** + * Defines the callback to call when the observer is notified + */ + callback, + /** + * Defines the mask of the observer (used to filter notifications) + */ + mask, + /** + * Defines the current scope used to restore the JS context + */ + scope) { + if (scope === void 0) { scope = null; } + this.callback = callback; + this.mask = mask; + this.scope = scope; + /** @hidden */ + this._willBeUnregistered = false; + /** + * Gets or sets a property defining that the observer as to be unregistered after the next notification + */ + this.unregisterOnNextCall = false; + } + return Observer; + }()); + BABYLON.Observer = Observer; + /** + * Represent a list of observers registered to multiple Observables object. + */ + var MultiObserver = /** @class */ (function () { + function MultiObserver() { + } + /** + * Release associated resources + */ + MultiObserver.prototype.dispose = function () { + if (this._observers && this._observables) { + for (var index = 0; index < this._observers.length; index++) { + this._observables[index].remove(this._observers[index]); + } + } + this._observers = null; + this._observables = null; + }; + /** + * Raise a callback when one of the observable will notify + * @param observables defines a list of observables to watch + * @param callback defines the callback to call on notification + * @param mask defines the mask used to filter notifications + * @param scope defines the current scope used to restore the JS context + * @returns the new MultiObserver + */ + MultiObserver.Watch = function (observables, callback, mask, scope) { + if (mask === void 0) { mask = -1; } + if (scope === void 0) { scope = null; } + var result = new MultiObserver(); + result._observers = new Array(); + result._observables = observables; + for (var _i = 0, observables_1 = observables; _i < observables_1.length; _i++) { + var observable = observables_1[_i]; + var observer = observable.add(callback, mask, false, scope); + if (observer) { + result._observers.push(observer); + } + } + return result; + }; + return MultiObserver; + }()); + BABYLON.MultiObserver = MultiObserver; + /** + * The Observable class is a simple implementation of the Observable pattern. + * + * There's one slight particularity though: a given Observable can notify its observer using a particular mask value, only the Observers registered with this mask value will be notified. + * This enable a more fine grained execution without having to rely on multiple different Observable objects. + * For instance you may have a given Observable that have four different types of notifications: Move (mask = 0x01), Stop (mask = 0x02), Turn Right (mask = 0X04), Turn Left (mask = 0X08). + * A given observer can register itself with only Move and Stop (mask = 0x03), then it will only be notified when one of these two occurs and will never be for Turn Left/Right. + */ + var Observable = /** @class */ (function () { + /** + * Creates a new observable + * @param onObserverAdded defines a callback to call when a new observer is added + */ + function Observable(onObserverAdded) { + this._observers = new Array(); + this._eventState = new EventState(0); + if (onObserverAdded) { + this._onObserverAdded = onObserverAdded; + } + } + /** + * Create a new Observer with the specified callback + * @param callback the callback that will be executed for that Observer + * @param mask the mask used to filter observers + * @param insertFirst if true the callback will be inserted at the first position, hence executed before the others ones. If false (default behavior) the callback will be inserted at the last position, executed after all the others already present. + * @param scope optional scope for the callback to be called from + * @param unregisterOnFirstCall defines if the observer as to be unregistered after the next notification + * @returns the new observer created for the callback + */ + Observable.prototype.add = function (callback, mask, insertFirst, scope, unregisterOnFirstCall) { + if (mask === void 0) { mask = -1; } + if (insertFirst === void 0) { insertFirst = false; } + if (scope === void 0) { scope = null; } + if (unregisterOnFirstCall === void 0) { unregisterOnFirstCall = false; } + if (!callback) { + return null; + } + var observer = new Observer(callback, mask, scope); + observer.unregisterOnNextCall = unregisterOnFirstCall; + if (insertFirst) { + this._observers.unshift(observer); + } + else { + this._observers.push(observer); + } + if (this._onObserverAdded) { + this._onObserverAdded(observer); + } + return observer; + }; + /** + * Create a new Observer with the specified callback and unregisters after the next notification + * @param callback the callback that will be executed for that Observer + * @returns the new observer created for the callback + */ + Observable.prototype.addOnce = function (callback) { + return this.add(callback, undefined, undefined, undefined, true); + }; + /** + * Remove an Observer from the Observable object + * @param observer the instance of the Observer to remove + * @returns false if it doesn't belong to this Observable + */ + Observable.prototype.remove = function (observer) { + if (!observer) { + return false; + } + var index = this._observers.indexOf(observer); + if (index !== -1) { + this._deferUnregister(observer); + return true; + } + return false; + }; + /** + * Remove a callback from the Observable object + * @param callback the callback to remove + * @param scope optional scope. If used only the callbacks with this scope will be removed + * @returns false if it doesn't belong to this Observable + */ + Observable.prototype.removeCallback = function (callback, scope) { + for (var index = 0; index < this._observers.length; index++) { + if (this._observers[index].callback === callback && (!scope || scope === this._observers[index].scope)) { + this._deferUnregister(this._observers[index]); + return true; + } + } + return false; + }; + Observable.prototype._deferUnregister = function (observer) { + var _this = this; + observer.unregisterOnNextCall = false; + observer._willBeUnregistered = true; + BABYLON.Tools.SetImmediate(function () { + _this._remove(observer); + }); + }; + // This should only be called when not iterating over _observers to avoid callback skipping. + // Removes an observer from the _observer Array. + Observable.prototype._remove = function (observer) { + if (!observer) { + return false; + } + var index = this._observers.indexOf(observer); + if (index !== -1) { + this._observers.splice(index, 1); + return true; + } + return false; + }; + /** + * Notify all Observers by calling their respective callback with the given data + * Will return true if all observers were executed, false if an observer set skipNextObservers to true, then prevent the subsequent ones to execute + * @param eventData defines the data to send to all observers + * @param mask defines the mask of the current notification (observers with incompatible mask (ie mask & observer.mask === 0) will not be notified) + * @param target defines the original target of the state + * @param currentTarget defines the current target of the state + * @returns false if the complete observer chain was not processed (because one observer set the skipNextObservers to true) + */ + Observable.prototype.notifyObservers = function (eventData, mask, target, currentTarget) { + if (mask === void 0) { mask = -1; } + if (!this._observers.length) { + return true; + } + var state = this._eventState; + state.mask = mask; + state.target = target; + state.currentTarget = currentTarget; + state.skipNextObservers = false; + state.lastReturnValue = eventData; + for (var _i = 0, _a = this._observers; _i < _a.length; _i++) { + var obs = _a[_i]; + if (obs._willBeUnregistered) { + continue; + } + if (obs.mask & mask) { + if (obs.scope) { + state.lastReturnValue = obs.callback.apply(obs.scope, [eventData, state]); + } + else { + state.lastReturnValue = obs.callback(eventData, state); + } + if (obs.unregisterOnNextCall) { + this._deferUnregister(obs); + } + } + if (state.skipNextObservers) { + return false; + } + } + return true; + }; + /** + * Calling this will execute each callback, expecting it to be a promise or return a value. + * If at any point in the chain one function fails, the promise will fail and the execution will not continue. + * This is useful when a chain of events (sometimes async events) is needed to initialize a certain object + * and it is crucial that all callbacks will be executed. + * The order of the callbacks is kept, callbacks are not executed parallel. + * + * @param eventData The data to be sent to each callback + * @param mask is used to filter observers defaults to -1 + * @param target defines the callback target (see EventState) + * @param currentTarget defines he current object in the bubbling phase + * @returns {Promise} will return a Promise than resolves when all callbacks executed successfully. + */ + Observable.prototype.notifyObserversWithPromise = function (eventData, mask, target, currentTarget) { + var _this = this; + if (mask === void 0) { mask = -1; } + // create an empty promise + var p = Promise.resolve(eventData); + // no observers? return this promise. + if (!this._observers.length) { + return p; + } + var state = this._eventState; + state.mask = mask; + state.target = target; + state.currentTarget = currentTarget; + state.skipNextObservers = false; + // execute one callback after another (not using Promise.all, the order is important) + this._observers.forEach(function (obs) { + if (state.skipNextObservers) { + return; + } + if (obs._willBeUnregistered) { + return; + } + if (obs.mask & mask) { + if (obs.scope) { + p = p.then(function (lastReturnedValue) { + state.lastReturnValue = lastReturnedValue; + return obs.callback.apply(obs.scope, [eventData, state]); + }); + } + else { + p = p.then(function (lastReturnedValue) { + state.lastReturnValue = lastReturnedValue; + return obs.callback(eventData, state); + }); + } + if (obs.unregisterOnNextCall) { + _this._deferUnregister(obs); + } + } + }); + // return the eventData + return p.then(function () { return eventData; }); + }; + /** + * Notify a specific observer + * @param observer defines the observer to notify + * @param eventData defines the data to be sent to each callback + * @param mask is used to filter observers defaults to -1 + */ + Observable.prototype.notifyObserver = function (observer, eventData, mask) { + if (mask === void 0) { mask = -1; } + var state = this._eventState; + state.mask = mask; + state.skipNextObservers = false; + observer.callback(eventData, state); + }; + /** + * Gets a boolean indicating if the observable has at least one observer + * @returns true is the Observable has at least one Observer registered + */ + Observable.prototype.hasObservers = function () { + return this._observers.length > 0; + }; + /** + * Clear the list of observers + */ + Observable.prototype.clear = function () { + this._observers = new Array(); + this._onObserverAdded = null; + }; + /** + * Clone the current observable + * @returns a new observable + */ + Observable.prototype.clone = function () { + var result = new Observable(); + result._observers = this._observers.slice(0); + return result; + }; + /** + * Does this observable handles observer registered with a given mask + * @param mask defines the mask to be tested + * @return whether or not one observer registered with the given mask is handeled + **/ + Observable.prototype.hasSpecificMask = function (mask) { + if (mask === void 0) { mask = -1; } + for (var _i = 0, _a = this._observers; _i < _a.length; _i++) { + var obs = _a[_i]; + if (obs.mask & mask || obs.mask === mask) { + return true; + } + } + return false; + }; + return Observable; + }()); + BABYLON.Observable = Observable; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.observable.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Defines an GC Friendly array where the backfield array do not shrink to prevent over allocations. + */ + var SmartArray = /** @class */ (function () { + /** + * Instantiates a Smart Array. + * @param capacity defines the default capacity of the array. + */ + function SmartArray(capacity) { + /** + * The active length of the array. + */ + this.length = 0; + this.data = new Array(capacity); + this._id = SmartArray._GlobalId++; + } + /** + * Pushes a value at the end of the active data. + * @param value defines the object to push in the array. + */ + SmartArray.prototype.push = function (value) { + this.data[this.length++] = value; + if (this.length > this.data.length) { + this.data.length *= 2; + } + }; + /** + * Iterates over the active data and apply the lambda to them. + * @param func defines the action to apply on each value. + */ + SmartArray.prototype.forEach = function (func) { + for (var index = 0; index < this.length; index++) { + func(this.data[index]); + } + }; + /** + * Sorts the full sets of data. + * @param compareFn defines the comparison function to apply. + */ + SmartArray.prototype.sort = function (compareFn) { + this.data.sort(compareFn); + }; + /** + * Resets the active data to an empty array. + */ + SmartArray.prototype.reset = function () { + this.length = 0; + }; + /** + * Releases all the data from the array as well as the array. + */ + SmartArray.prototype.dispose = function () { + this.reset(); + if (this.data) { + this.data.length = 0; + this.data = []; + } + }; + /** + * Concats the active data with a given array. + * @param array defines the data to concatenate with. + */ + SmartArray.prototype.concat = function (array) { + if (array.length === 0) { + return; + } + if (this.length + array.length > this.data.length) { + this.data.length = (this.length + array.length) * 2; + } + for (var index = 0; index < array.length; index++) { + this.data[this.length++] = (array.data || array)[index]; + } + }; + /** + * Returns the position of a value in the active data. + * @param value defines the value to find the index for + * @returns the index if found in the active data otherwise -1 + */ + SmartArray.prototype.indexOf = function (value) { + var position = this.data.indexOf(value); + if (position >= this.length) { + return -1; + } + return position; + }; + /** + * Returns whether an element is part of the active data. + * @param value defines the value to look for + * @returns true if found in the active data otherwise false + */ + SmartArray.prototype.contains = function (value) { + return this.indexOf(value) !== -1; + }; + // Statics + SmartArray._GlobalId = 0; + return SmartArray; + }()); + BABYLON.SmartArray = SmartArray; + /** + * Defines an GC Friendly array where the backfield array do not shrink to prevent over allocations. + * The data in this array can only be present once + */ + var SmartArrayNoDuplicate = /** @class */ (function (_super) { + __extends(SmartArrayNoDuplicate, _super); + function SmartArrayNoDuplicate() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._duplicateId = 0; + return _this; + } + /** + * Pushes a value at the end of the active data. + * THIS DOES NOT PREVENT DUPPLICATE DATA + * @param value defines the object to push in the array. + */ + SmartArrayNoDuplicate.prototype.push = function (value) { + _super.prototype.push.call(this, value); + if (!value.__smartArrayFlags) { + value.__smartArrayFlags = {}; + } + value.__smartArrayFlags[this._id] = this._duplicateId; + }; + /** + * Pushes a value at the end of the active data. + * If the data is already present, it won t be added again + * @param value defines the object to push in the array. + * @returns true if added false if it was already present + */ + SmartArrayNoDuplicate.prototype.pushNoDuplicate = function (value) { + if (value.__smartArrayFlags && value.__smartArrayFlags[this._id] === this._duplicateId) { + return false; + } + this.push(value); + return true; + }; + /** + * Resets the active data to an empty array. + */ + SmartArrayNoDuplicate.prototype.reset = function () { + _super.prototype.reset.call(this); + this._duplicateId++; + }; + /** + * Concats the active data with a given array. + * This ensures no dupplicate will be present in the result. + * @param array defines the data to concatenate with. + */ + SmartArrayNoDuplicate.prototype.concatWithNoDuplicate = function (array) { + if (array.length === 0) { + return; + } + if (this.length + array.length > this.data.length) { + this.data.length = (this.length + array.length) * 2; + } + for (var index = 0; index < array.length; index++) { + var item = (array.data || array)[index]; + this.pushNoDuplicate(item); + } + }; + return SmartArrayNoDuplicate; + }(SmartArray)); + BABYLON.SmartArrayNoDuplicate = SmartArrayNoDuplicate; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.smartArray.js.map + + +var BABYLON; +(function (BABYLON) { + /** Class used to store color4 gradient */ + var ColorGradient = /** @class */ (function () { + function ColorGradient() { + } + /** + * Will get a color picked randomly between color1 and color2. + * If color2 is undefined then color1 will be used + * @param result defines the target Color4 to store the result in + */ + ColorGradient.prototype.getColorToRef = function (result) { + if (!this.color2) { + result.copyFrom(this.color1); + return; + } + BABYLON.Color4.LerpToRef(this.color1, this.color2, Math.random(), result); + }; + return ColorGradient; + }()); + BABYLON.ColorGradient = ColorGradient; + /** Class used to store color 3 gradient */ + var Color3Gradient = /** @class */ (function () { + function Color3Gradient() { + } + return Color3Gradient; + }()); + BABYLON.Color3Gradient = Color3Gradient; + /** Class used to store factor gradient */ + var FactorGradient = /** @class */ (function () { + function FactorGradient() { + } + /** + * Will get a number picked randomly between factor1 and factor2. + * If factor2 is undefined then factor1 will be used + * @returns the picked number + */ + FactorGradient.prototype.getFactor = function () { + if (this.factor2 === undefined) { + return this.factor1; + } + return BABYLON.Scalar.Lerp(this.factor1, this.factor2, Math.random()); + }; + return FactorGradient; + }()); + BABYLON.FactorGradient = FactorGradient; + /** + * @ignore + * Application error to support additional information when loading a file + */ + var LoadFileError = /** @class */ (function (_super) { + __extends(LoadFileError, _super); + /** + * Creates a new LoadFileError + * @param message defines the message of the error + * @param request defines the optional XHR request + */ + function LoadFileError(message, + /** defines the optional XHR request */ + request) { + var _this = _super.call(this, message) || this; + _this.request = request; + _this.name = "LoadFileError"; + LoadFileError._setPrototypeOf(_this, LoadFileError.prototype); + return _this; + } + // See https://stackoverflow.com/questions/12915412/how-do-i-extend-a-host-object-e-g-error-in-typescript + // and https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work + // Polyfill for Object.setPrototypeOf if necessary. + LoadFileError._setPrototypeOf = Object.setPrototypeOf || (function (o, proto) { o.__proto__ = proto; return o; }); + return LoadFileError; + }(Error)); + BABYLON.LoadFileError = LoadFileError; + /** + * Class used to define a retry strategy when error happens while loading assets + */ + var RetryStrategy = /** @class */ (function () { + function RetryStrategy() { + } + /** + * Function used to defines an exponential back off strategy + * @param maxRetries defines the maximum number of retries (3 by default) + * @param baseInterval defines the interval between retries + * @returns the strategy function to use + */ + RetryStrategy.ExponentialBackoff = function (maxRetries, baseInterval) { + if (maxRetries === void 0) { maxRetries = 3; } + if (baseInterval === void 0) { baseInterval = 500; } + return function (url, request, retryIndex) { + if (request.status !== 0 || retryIndex >= maxRetries || url.indexOf("file:") !== -1) { + return -1; + } + return Math.pow(2, retryIndex) * baseInterval; + }; + }; + return RetryStrategy; + }()); + BABYLON.RetryStrategy = RetryStrategy; + // Screenshots + var screenshotCanvas; + var cloneValue = function (source, destinationObject) { + if (!source) { + return null; + } + if (source instanceof BABYLON.Mesh) { + return null; + } + if (source instanceof BABYLON.SubMesh) { + return source.clone(destinationObject); + } + else if (source.clone) { + return source.clone(); + } + return null; + }; + /** + * Class containing a set of static utilities functions + */ + var Tools = /** @class */ (function () { + function Tools() { + } + /** + * Read the content of a byte array at a specified coordinates (taking in account wrapping) + * @param u defines the coordinate on X axis + * @param v defines the coordinate on Y axis + * @param width defines the width of the source data + * @param height defines the height of the source data + * @param pixels defines the source byte array + * @param color defines the output color + */ + Tools.FetchToRef = function (u, v, width, height, pixels, color) { + var wrappedU = ((Math.abs(u) * width) % width) | 0; + var wrappedV = ((Math.abs(v) * height) % height) | 0; + var position = (wrappedU + wrappedV * width) * 4; + color.r = pixels[position] / 255; + color.g = pixels[position + 1] / 255; + color.b = pixels[position + 2] / 255; + color.a = pixels[position + 3] / 255; + }; + /** + * Interpolates between a and b via alpha + * @param a The lower value (returned when alpha = 0) + * @param b The upper value (returned when alpha = 1) + * @param alpha The interpolation-factor + * @return The mixed value + */ + Tools.Mix = function (a, b, alpha) { + return a * (1 - alpha) + b * alpha; + }; + /** + * Tries to instantiate a new object from a given class name + * @param className defines the class name to instantiate + * @returns the new object or null if the system was not able to do the instantiation + */ + Tools.Instantiate = function (className) { + if (Tools.RegisteredExternalClasses && Tools.RegisteredExternalClasses[className]) { + return Tools.RegisteredExternalClasses[className]; + } + var arr = className.split("."); + var fn = (window || this); + for (var i = 0, len = arr.length; i < len; i++) { + fn = fn[arr[i]]; + } + if (typeof fn !== "function") { + return null; + } + return fn; + }; + /** + * Provides a slice function that will work even on IE + * @param data defines the array to slice + * @param start defines the start of the data (optional) + * @param end defines the end of the data (optional) + * @returns the new sliced array + */ + Tools.Slice = function (data, start, end) { + if (data.slice) { + return data.slice(start, end); + } + return Array.prototype.slice.call(data, start, end); + }; + /** + * Polyfill for setImmediate + * @param action defines the action to execute after the current execution block + */ + Tools.SetImmediate = function (action) { + if (Tools.IsWindowObjectExist() && window.setImmediate) { + window.setImmediate(action); + } + else { + setTimeout(action, 1); + } + }; + /** + * Function indicating if a number is an exponent of 2 + * @param value defines the value to test + * @returns true if the value is an exponent of 2 + */ + Tools.IsExponentOfTwo = function (value) { + var count = 1; + do { + count *= 2; + } while (count < value); + return count === value; + }; + /** + * Returns the nearest 32-bit single precision float representation of a Number + * @param value A Number. If the parameter is of a different type, it will get converted + * to a number or to NaN if it cannot be converted + * @returns number + */ + Tools.FloatRound = function (value) { + if (Math.fround) { + return Math.fround(value); + } + return (Tools._tmpFloatArray[0] = value); + }; + /** + * Find the next highest power of two. + * @param x Number to start search from. + * @return Next highest power of two. + */ + Tools.CeilingPOT = function (x) { + x--; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + x++; + return x; + }; + /** + * Find the next lowest power of two. + * @param x Number to start search from. + * @return Next lowest power of two. + */ + Tools.FloorPOT = function (x) { + x = x | (x >> 1); + x = x | (x >> 2); + x = x | (x >> 4); + x = x | (x >> 8); + x = x | (x >> 16); + return x - (x >> 1); + }; + /** + * Find the nearest power of two. + * @param x Number to start search from. + * @return Next nearest power of two. + */ + Tools.NearestPOT = function (x) { + var c = Tools.CeilingPOT(x); + var f = Tools.FloorPOT(x); + return (c - x) > (x - f) ? f : c; + }; + /** + * Get the closest exponent of two + * @param value defines the value to approximate + * @param max defines the maximum value to return + * @param mode defines how to define the closest value + * @returns closest exponent of two of the given value + */ + Tools.GetExponentOfTwo = function (value, max, mode) { + if (mode === void 0) { mode = BABYLON.Engine.SCALEMODE_NEAREST; } + var pot; + switch (mode) { + case BABYLON.Engine.SCALEMODE_FLOOR: + pot = Tools.FloorPOT(value); + break; + case BABYLON.Engine.SCALEMODE_NEAREST: + pot = Tools.NearestPOT(value); + break; + case BABYLON.Engine.SCALEMODE_CEILING: + default: + pot = Tools.CeilingPOT(value); + break; + } + return Math.min(pot, max); + }; + /** + * Extracts the filename from a path + * @param path defines the path to use + * @returns the filename + */ + Tools.GetFilename = function (path) { + var index = path.lastIndexOf("/"); + if (index < 0) { + return path; + } + return path.substring(index + 1); + }; + /** + * Extracts the "folder" part of a path (everything before the filename). + * @param uri The URI to extract the info from + * @param returnUnchangedIfNoSlash Do not touch the URI if no slashes are present + * @returns The "folder" part of the path + */ + Tools.GetFolderPath = function (uri, returnUnchangedIfNoSlash) { + if (returnUnchangedIfNoSlash === void 0) { returnUnchangedIfNoSlash = false; } + var index = uri.lastIndexOf("/"); + if (index < 0) { + if (returnUnchangedIfNoSlash) { + return uri; + } + return ""; + } + return uri.substring(0, index + 1); + }; + /** + * Extracts text content from a DOM element hierarchy + * @param element defines the root element + * @returns a string + */ + Tools.GetDOMTextContent = function (element) { + var result = ""; + var child = element.firstChild; + while (child) { + if (child.nodeType === 3) { + result += child.textContent; + } + child = child.nextSibling; + } + return result; + }; + /** + * Convert an angle in radians to degrees + * @param angle defines the angle to convert + * @returns the angle in degrees + */ + Tools.ToDegrees = function (angle) { + return angle * 180 / Math.PI; + }; + /** + * Convert an angle in degrees to radians + * @param angle defines the angle to convert + * @returns the angle in radians + */ + Tools.ToRadians = function (angle) { + return angle * Math.PI / 180; + }; + /** + * Encode a buffer to a base64 string + * @param buffer defines the buffer to encode + * @returns the encoded string + */ + Tools.EncodeArrayBufferTobase64 = function (buffer) { + var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + var bytes = new Uint8Array(buffer); + while (i < bytes.length) { + chr1 = bytes[i++]; + chr2 = i < bytes.length ? bytes[i++] : Number.NaN; // Not sure if the index + chr3 = i < bytes.length ? bytes[i++] : Number.NaN; // checks are needed here + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } + else if (isNaN(chr3)) { + enc4 = 64; + } + output += keyStr.charAt(enc1) + keyStr.charAt(enc2) + + keyStr.charAt(enc3) + keyStr.charAt(enc4); + } + return "data:image/png;base64," + output; + }; + /** + * Extracts minimum and maximum values from a list of indexed positions + * @param positions defines the positions to use + * @param indices defines the indices to the positions + * @param indexStart defines the start index + * @param indexCount defines the end index + * @param bias defines bias value to add to the result + * @return minimum and maximum values + */ + Tools.ExtractMinAndMaxIndexed = function (positions, indices, indexStart, indexCount, bias) { + if (bias === void 0) { bias = null; } + var minimum = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + var maximum = new BABYLON.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); + for (var index = indexStart; index < indexStart + indexCount; index++) { + var offset = indices[index] * 3; + var x = positions[offset]; + var y = positions[offset + 1]; + var z = positions[offset + 2]; + minimum.minimizeInPlaceFromFloats(x, y, z); + maximum.maximizeInPlaceFromFloats(x, y, z); + } + if (bias) { + minimum.x -= minimum.x * bias.x + bias.y; + minimum.y -= minimum.y * bias.x + bias.y; + minimum.z -= minimum.z * bias.x + bias.y; + maximum.x += maximum.x * bias.x + bias.y; + maximum.y += maximum.y * bias.x + bias.y; + maximum.z += maximum.z * bias.x + bias.y; + } + return { + minimum: minimum, + maximum: maximum + }; + }; + /** + * Extracts minimum and maximum values from a list of positions + * @param positions defines the positions to use + * @param start defines the start index in the positions array + * @param count defines the number of positions to handle + * @param bias defines bias value to add to the result + * @param stride defines the stride size to use (distance between two positions in the positions array) + * @return minimum and maximum values + */ + Tools.ExtractMinAndMax = function (positions, start, count, bias, stride) { + if (bias === void 0) { bias = null; } + var minimum = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + var maximum = new BABYLON.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); + if (!stride) { + stride = 3; + } + for (var index = start, offset = start * stride; index < start + count; index++, offset += stride) { + var x = positions[offset]; + var y = positions[offset + 1]; + var z = positions[offset + 2]; + minimum.minimizeInPlaceFromFloats(x, y, z); + maximum.maximizeInPlaceFromFloats(x, y, z); + } + if (bias) { + minimum.x -= minimum.x * bias.x + bias.y; + minimum.y -= minimum.y * bias.x + bias.y; + minimum.z -= minimum.z * bias.x + bias.y; + maximum.x += maximum.x * bias.x + bias.y; + maximum.y += maximum.y * bias.x + bias.y; + maximum.z += maximum.z * bias.x + bias.y; + } + return { + minimum: minimum, + maximum: maximum + }; + }; + /** + * Returns an array if obj is not an array + * @param obj defines the object to evaluate as an array + * @param allowsNullUndefined defines a boolean indicating if obj is allowed to be null or undefined + * @returns either obj directly if obj is an array or a new array containing obj + */ + Tools.MakeArray = function (obj, allowsNullUndefined) { + if (allowsNullUndefined !== true && (obj === undefined || obj == null)) { + return null; + } + return Array.isArray(obj) ? obj : [obj]; + }; + /** + * Gets the pointer prefix to use + * @returns "pointer" if touch is enabled. Else returns "mouse" + */ + Tools.GetPointerPrefix = function () { + var eventPrefix = "pointer"; + // Check if pointer events are supported + if (Tools.IsWindowObjectExist() && !window.PointerEvent && !navigator.pointerEnabled) { + eventPrefix = "mouse"; + } + return eventPrefix; + }; + /** + * Queue a new function into the requested animation frame pool (ie. this function will be executed byt the browser for the next frame) + * @param func - the function to be called + * @param requester - the object that will request the next frame. Falls back to window. + * @returns frame number + */ + Tools.QueueNewFrame = function (func, requester) { + if (!Tools.IsWindowObjectExist()) { + return setTimeout(func, 16); + } + if (!requester) { + requester = window; + } + if (requester.requestAnimationFrame) { + return requester.requestAnimationFrame(func); + } + else if (requester.msRequestAnimationFrame) { + return requester.msRequestAnimationFrame(func); + } + else if (requester.webkitRequestAnimationFrame) { + return requester.webkitRequestAnimationFrame(func); + } + else if (requester.mozRequestAnimationFrame) { + return requester.mozRequestAnimationFrame(func); + } + else if (requester.oRequestAnimationFrame) { + return requester.oRequestAnimationFrame(func); + } + else { + return window.setTimeout(func, 16); + } + }; + /** + * Ask the browser to promote the current element to fullscreen rendering mode + * @param element defines the DOM element to promote + */ + Tools.RequestFullscreen = function (element) { + var requestFunction = element.requestFullscreen || element.msRequestFullscreen || element.webkitRequestFullscreen || element.mozRequestFullScreen; + if (!requestFunction) { + return; + } + requestFunction.call(element); + }; + /** + * Asks the browser to exit fullscreen mode + */ + Tools.ExitFullscreen = function () { + if (document.exitFullscreen) { + document.exitFullscreen(); + } + else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } + else if (document.webkitCancelFullScreen) { + document.webkitCancelFullScreen(); + } + else if (document.msCancelFullScreen) { + document.msCancelFullScreen(); + } + }; + /** + * Sets the cors behavior on a dom element. This will add the required Tools.CorsBehavior to the element. + * @param url define the url we are trying + * @param element define the dom element where to configure the cors policy + */ + Tools.SetCorsBehavior = function (url, element) { + if (url && url.indexOf("data:") === 0) { + return; + } + if (Tools.CorsBehavior) { + if (typeof (Tools.CorsBehavior) === 'string' || Tools.CorsBehavior instanceof String) { + element.crossOrigin = Tools.CorsBehavior; + } + else { + var result = Tools.CorsBehavior(url); + if (result) { + element.crossOrigin = result; + } + } + } + }; + // External files + /** + * Removes unwanted characters from an url + * @param url defines the url to clean + * @returns the cleaned url + */ + Tools.CleanUrl = function (url) { + url = url.replace(/#/mg, "%23"); + return url; + }; + /** + * Loads an image as an HTMLImageElement. + * @param input url string, ArrayBuffer, or Blob to load + * @param onLoad callback called when the image successfully loads + * @param onError callback called when the image fails to load + * @param database database for caching + * @returns the HTMLImageElement of the loaded image + */ + Tools.LoadImage = function (input, onLoad, onError, database) { + var url; + var usingObjectURL = false; + if (input instanceof ArrayBuffer) { + url = URL.createObjectURL(new Blob([input])); + usingObjectURL = true; + } + else if (input instanceof Blob) { + url = URL.createObjectURL(input); + usingObjectURL = true; + } + else { + url = Tools.CleanUrl(input); + url = Tools.PreprocessUrl(input); + } + var img = new Image(); + Tools.SetCorsBehavior(url, img); + var loadHandler = function () { + if (usingObjectURL && img.src) { + URL.revokeObjectURL(img.src); + } + img.removeEventListener("load", loadHandler); + img.removeEventListener("error", errorHandler); + onLoad(img); + }; + var errorHandler = function (err) { + if (usingObjectURL && img.src) { + URL.revokeObjectURL(img.src); + } + img.removeEventListener("load", loadHandler); + img.removeEventListener("error", errorHandler); + Tools.Error("Error while trying to load image: " + input); + if (onError) { + onError("Error while trying to load image: " + input, err); + } + }; + img.addEventListener("load", loadHandler); + img.addEventListener("error", errorHandler); + var noIndexedDB = function () { + img.src = url; + }; + var loadFromIndexedDB = function () { + if (database) { + database.loadImageFromDB(url, img); + } + }; + //ANY database to do! + if (url.substr(0, 5) !== "data:" && database && database.enableTexturesOffline && BABYLON.Database.IsUASupportingBlobStorage) { + database.openAsync(loadFromIndexedDB, noIndexedDB); + } + else { + if (url.indexOf("file:") !== -1) { + var textureName = decodeURIComponent(url.substring(5).toLowerCase()); + if (BABYLON.FilesInput.FilesToLoad[textureName]) { + try { + var blobURL; + try { + blobURL = URL.createObjectURL(BABYLON.FilesInput.FilesToLoad[textureName]); + } + catch (ex) { + // Chrome doesn't support oneTimeOnly parameter + blobURL = URL.createObjectURL(BABYLON.FilesInput.FilesToLoad[textureName]); + } + img.src = blobURL; + usingObjectURL = true; + } + catch (e) { + img.src = ""; + } + return img; + } + } + noIndexedDB(); + } + return img; + }; + /** + * Loads a file + * @param url url string, ArrayBuffer, or Blob to load + * @param onSuccess callback called when the file successfully loads + * @param onProgress callback called while file is loading (if the server supports this mode) + * @param database database for caching + * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer + * @param onError callback called when the file fails to load + * @returns a file request object + */ + Tools.LoadFile = function (url, onSuccess, onProgress, database, useArrayBuffer, onError) { + url = Tools.CleanUrl(url); + url = Tools.PreprocessUrl(url); + // If file and file input are set + if (url.indexOf("file:") !== -1) { + var fileName = decodeURIComponent(url.substring(5).toLowerCase()); + if (BABYLON.FilesInput.FilesToLoad[fileName]) { + return Tools.ReadFile(BABYLON.FilesInput.FilesToLoad[fileName], onSuccess, onProgress, useArrayBuffer); + } + } + var loadUrl = Tools.BaseUrl + url; + var aborted = false; + var fileRequest = { + onCompleteObservable: new BABYLON.Observable(), + abort: function () { return aborted = true; }, + }; + var requestFile = function () { + var request = new XMLHttpRequest(); + var retryHandle = null; + fileRequest.abort = function () { + aborted = true; + if (request.readyState !== (XMLHttpRequest.DONE || 4)) { + request.abort(); + } + if (retryHandle !== null) { + clearTimeout(retryHandle); + retryHandle = null; + } + }; + var retryLoop = function (retryIndex) { + request.open('GET', loadUrl, true); + if (useArrayBuffer) { + request.responseType = "arraybuffer"; + } + if (onProgress) { + request.addEventListener("progress", onProgress); + } + var onLoadEnd = function () { + request.removeEventListener("loadend", onLoadEnd); + fileRequest.onCompleteObservable.notifyObservers(fileRequest); + fileRequest.onCompleteObservable.clear(); + }; + request.addEventListener("loadend", onLoadEnd); + var onReadyStateChange = function () { + if (aborted) { + return; + } + // In case of undefined state in some browsers. + if (request.readyState === (XMLHttpRequest.DONE || 4)) { + // Some browsers have issues where onreadystatechange can be called multiple times with the same value. + request.removeEventListener("readystatechange", onReadyStateChange); + if ((request.status >= 200 && request.status < 300) || (request.status === 0 && (!Tools.IsWindowObjectExist() || Tools.IsFileURL()))) { + onSuccess(!useArrayBuffer ? request.responseText : request.response, request.responseURL); + return; + } + var retryStrategy = Tools.DefaultRetryStrategy; + if (retryStrategy) { + var waitTime = retryStrategy(loadUrl, request, retryIndex); + if (waitTime !== -1) { + // Prevent the request from completing for retry. + request.removeEventListener("loadend", onLoadEnd); + request = new XMLHttpRequest(); + retryHandle = setTimeout(function () { return retryLoop(retryIndex + 1); }, waitTime); + return; + } + } + var e = new LoadFileError("Error status: " + request.status + " " + request.statusText + " - Unable to load " + loadUrl, request); + if (onError) { + onError(request, e); + } + else { + throw e; + } + } + }; + request.addEventListener("readystatechange", onReadyStateChange); + request.send(); + }; + retryLoop(0); + }; + // Caching all files + if (database && database.enableSceneOffline) { + var noIndexedDB_1 = function (request) { + if (request && request.status > 400) { + if (onError) { + onError(request); + } + } + else { + if (!aborted) { + requestFile(); + } + } + }; + var loadFromIndexedDB = function () { + // TODO: database needs to support aborting and should return a IFileRequest + if (aborted) { + return; + } + if (database) { + database.loadFileFromDB(url, function (data) { + if (!aborted) { + onSuccess(data); + } + fileRequest.onCompleteObservable.notifyObservers(fileRequest); + }, onProgress ? function (event) { + if (!aborted) { + onProgress(event); + } + } : undefined, noIndexedDB_1, useArrayBuffer); + } + }; + database.openAsync(loadFromIndexedDB, noIndexedDB_1); + } + else { + requestFile(); + } + return fileRequest; + }; + /** + * Load a script (identified by an url). When the url returns, the + * content of this file is added into a new script element, attached to the DOM (body element) + * @param scriptUrl defines the url of the script to laod + * @param onSuccess defines the callback called when the script is loaded + * @param onError defines the callback to call if an error occurs + */ + Tools.LoadScript = function (scriptUrl, onSuccess, onError) { + if (!Tools.IsWindowObjectExist()) { + return; + } + var head = document.getElementsByTagName('head')[0]; + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = scriptUrl; + script.onload = function () { + if (onSuccess) { + onSuccess(); + } + }; + script.onerror = function (e) { + if (onError) { + onError("Unable to load script '" + scriptUrl + "'", e); + } + }; + head.appendChild(script); + }; + /** + * Loads a file from a blob + * @param fileToLoad defines the blob to use + * @param callback defines the callback to call when data is loaded + * @param progressCallback defines the callback to call during loading process + * @returns a file request object + */ + Tools.ReadFileAsDataURL = function (fileToLoad, callback, progressCallback) { + var reader = new FileReader(); + var request = { + onCompleteObservable: new BABYLON.Observable(), + abort: function () { return reader.abort(); }, + }; + reader.onloadend = function (e) { + request.onCompleteObservable.notifyObservers(request); + }; + reader.onload = function (e) { + //target doesn't have result from ts 1.3 + callback(e.target['result']); + }; + reader.onprogress = progressCallback; + reader.readAsDataURL(fileToLoad); + return request; + }; + /** + * Loads a file + * @param fileToLoad defines the file to load + * @param callback defines the callback to call when data is loaded + * @param progressCallBack defines the callback to call during loading process + * @param useArrayBuffer defines a boolean indicating that data must be returned as an ArrayBuffer + * @returns a file request object + */ + Tools.ReadFile = function (fileToLoad, callback, progressCallBack, useArrayBuffer) { + var reader = new FileReader(); + var request = { + onCompleteObservable: new BABYLON.Observable(), + abort: function () { return reader.abort(); }, + }; + reader.onloadend = function (e) { return request.onCompleteObservable.notifyObservers(request); }; + reader.onerror = function (e) { + Tools.Log("Error while reading file: " + fileToLoad.name); + callback(JSON.stringify({ autoClear: true, clearColor: [1, 0, 0], ambientColor: [0, 0, 0], gravity: [0, -9.807, 0], meshes: [], cameras: [], lights: [] })); + }; + reader.onload = function (e) { + //target doesn't have result from ts 1.3 + callback(e.target['result']); + }; + if (progressCallBack) { + reader.onprogress = progressCallBack; + } + if (!useArrayBuffer) { + // Asynchronous read + reader.readAsText(fileToLoad); + } + else { + reader.readAsArrayBuffer(fileToLoad); + } + return request; + }; + /** + * Creates a data url from a given string content + * @param content defines the content to convert + * @returns the new data url link + */ + Tools.FileAsURL = function (content) { + var fileBlob = new Blob([content]); + var url = window.URL || window.webkitURL; + var link = url.createObjectURL(fileBlob); + return link; + }; + /** + * Format the given number to a specific decimal format + * @param value defines the number to format + * @param decimals defines the number of decimals to use + * @returns the formatted string + */ + Tools.Format = function (value, decimals) { + if (decimals === void 0) { decimals = 2; } + return value.toFixed(decimals); + }; + /** + * Checks if a given vector is inside a specific range + * @param v defines the vector to test + * @param min defines the minimum range + * @param max defines the maximum range + */ + Tools.CheckExtends = function (v, min, max) { + if (v.x < min.x) { + min.x = v.x; + } + if (v.y < min.y) { + min.y = v.y; + } + if (v.z < min.z) { + min.z = v.z; + } + if (v.x > max.x) { + max.x = v.x; + } + if (v.y > max.y) { + max.y = v.y; + } + if (v.z > max.z) { + max.z = v.z; + } + }; + /** + * Tries to copy an object by duplicating every property + * @param source defines the source object + * @param destination defines the target object + * @param doNotCopyList defines a list of properties to avoid + * @param mustCopyList defines a list of properties to copy (even if they start with _) + */ + Tools.DeepCopy = function (source, destination, doNotCopyList, mustCopyList) { + for (var prop in source) { + if (prop[0] === "_" && (!mustCopyList || mustCopyList.indexOf(prop) === -1)) { + continue; + } + if (doNotCopyList && doNotCopyList.indexOf(prop) !== -1) { + continue; + } + var sourceValue = source[prop]; + var typeOfSourceValue = typeof sourceValue; + if (typeOfSourceValue === "function") { + continue; + } + try { + if (typeOfSourceValue === "object") { + if (sourceValue instanceof Array) { + destination[prop] = []; + if (sourceValue.length > 0) { + if (typeof sourceValue[0] == "object") { + for (var index = 0; index < sourceValue.length; index++) { + var clonedValue = cloneValue(sourceValue[index], destination); + if (destination[prop].indexOf(clonedValue) === -1) { // Test if auto inject was not done + destination[prop].push(clonedValue); + } + } + } + else { + destination[prop] = sourceValue.slice(0); + } + } + } + else { + destination[prop] = cloneValue(sourceValue, destination); + } + } + else { + destination[prop] = sourceValue; + } + } + catch (e) { + // Just ignore error (it could be because of a read-only property) + } + } + }; + /** + * Gets a boolean indicating if the given object has no own property + * @param obj defines the object to test + * @returns true if object has no own property + */ + Tools.IsEmpty = function (obj) { + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + return false; + } + } + return true; + }; + /** + * Function used to register events at window level + * @param events defines the events to register + */ + Tools.RegisterTopRootEvents = function (events) { + for (var index = 0; index < events.length; index++) { + var event = events[index]; + window.addEventListener(event.name, event.handler, false); + try { + if (window.parent) { + window.parent.addEventListener(event.name, event.handler, false); + } + } + catch (e) { + // Silently fails... + } + } + }; + /** + * Function used to unregister events from window level + * @param events defines the events to unregister + */ + Tools.UnregisterTopRootEvents = function (events) { + for (var index = 0; index < events.length; index++) { + var event = events[index]; + window.removeEventListener(event.name, event.handler); + try { + if (window.parent) { + window.parent.removeEventListener(event.name, event.handler); + } + } + catch (e) { + // Silently fails... + } + } + }; + /** + * Dumps the current bound framebuffer + * @param width defines the rendering width + * @param height defines the rendering height + * @param engine defines the hosting engine + * @param successCallback defines the callback triggered once the data are available + * @param mimeType defines the mime type of the result + * @param fileName defines the filename to download. If present, the result will automatically be downloaded + */ + Tools.DumpFramebuffer = function (width, height, engine, successCallback, mimeType, fileName) { + if (mimeType === void 0) { mimeType = "image/png"; } + // Read the contents of the framebuffer + var numberOfChannelsByLine = width * 4; + var halfHeight = height / 2; + //Reading datas from WebGL + var data = engine.readPixels(0, 0, width, height); + //To flip image on Y axis. + for (var i = 0; i < halfHeight; i++) { + for (var j = 0; j < numberOfChannelsByLine; j++) { + var currentCell = j + i * numberOfChannelsByLine; + var targetLine = height - i - 1; + var targetCell = j + targetLine * numberOfChannelsByLine; + var temp = data[currentCell]; + data[currentCell] = data[targetCell]; + data[targetCell] = temp; + } + } + // Create a 2D canvas to store the result + if (!screenshotCanvas) { + screenshotCanvas = document.createElement('canvas'); + } + screenshotCanvas.width = width; + screenshotCanvas.height = height; + var context = screenshotCanvas.getContext('2d'); + if (context) { + // Copy the pixels to a 2D canvas + var imageData = context.createImageData(width, height); + var castData = (imageData.data); + castData.set(data); + context.putImageData(imageData, 0, 0); + Tools.EncodeScreenshotCanvasData(successCallback, mimeType, fileName); + } + }; + /** + * Converts the canvas data to blob. + * This acts as a polyfill for browsers not supporting the to blob function. + * @param canvas Defines the canvas to extract the data from + * @param successCallback Defines the callback triggered once the data are available + * @param mimeType Defines the mime type of the result + */ + Tools.ToBlob = function (canvas, successCallback, mimeType) { + if (mimeType === void 0) { mimeType = "image/png"; } + // We need HTMLCanvasElement.toBlob for HD screenshots + if (!canvas.toBlob) { + // low performance polyfill based on toDataURL (https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob) + canvas.toBlob = function (callback, type, quality) { + var _this = this; + setTimeout(function () { + var binStr = atob(_this.toDataURL(type, quality).split(',')[1]), len = binStr.length, arr = new Uint8Array(len); + for (var i = 0; i < len; i++) { + arr[i] = binStr.charCodeAt(i); + } + callback(new Blob([arr])); + }); + }; + } + canvas.toBlob(function (blob) { + successCallback(blob); + }, mimeType); + }; + /** + * Encodes the canvas data to base 64 or automatically download the result if filename is defined + * @param successCallback defines the callback triggered once the data are available + * @param mimeType defines the mime type of the result + * @param fileName defines he filename to download. If present, the result will automatically be downloaded + */ + Tools.EncodeScreenshotCanvasData = function (successCallback, mimeType, fileName) { + if (mimeType === void 0) { mimeType = "image/png"; } + if (successCallback) { + var base64Image = screenshotCanvas.toDataURL(mimeType); + successCallback(base64Image); + } + else { + this.ToBlob(screenshotCanvas, function (blob) { + //Creating a link if the browser have the download attribute on the a tag, to automatically start download generated image. + if (("download" in document.createElement("a"))) { + if (!fileName) { + var date = new Date(); + var stringDate = (date.getFullYear() + "-" + (date.getMonth() + 1)).slice(2) + "-" + date.getDate() + "_" + date.getHours() + "-" + ('0' + date.getMinutes()).slice(-2); + fileName = "screenshot_" + stringDate + ".png"; + } + Tools.Download(blob, fileName); + } + else { + var url = URL.createObjectURL(blob); + var newWindow = window.open(""); + if (!newWindow) { + return; + } + var img = newWindow.document.createElement("img"); + img.onload = function () { + // no longer need to read the blob so it's revoked + URL.revokeObjectURL(url); + }; + img.src = url; + newWindow.document.body.appendChild(img); + } + }, mimeType); + } + }; + /** + * Downloads a blob in the browser + * @param blob defines the blob to download + * @param fileName defines the name of the downloaded file + */ + Tools.Download = function (blob, fileName) { + if (navigator && navigator.msSaveBlob) { + navigator.msSaveBlob(blob, fileName); + return; + } + var url = window.URL.createObjectURL(blob); + var a = document.createElement("a"); + document.body.appendChild(a); + a.style.display = "none"; + a.href = url; + a.download = fileName; + a.addEventListener("click", function () { + if (a.parentElement) { + a.parentElement.removeChild(a); + } + }); + a.click(); + window.URL.revokeObjectURL(url); + }; + /** + * Captures a screenshot of the current rendering + * @see http://doc.babylonjs.com/how_to/render_scene_on_a_png + * @param engine defines the rendering engine + * @param camera defines the source camera + * @param size This parameter can be set to a single number or to an object with the + * following (optional) properties: precision, width, height. If a single number is passed, + * it will be used for both width and height. If an object is passed, the screenshot size + * will be derived from the parameters. The precision property is a multiplier allowing + * rendering at a higher or lower resolution + * @param successCallback defines the callback receives a single parameter which contains the + * screenshot as a string of base64-encoded characters. This string can be assigned to the + * src parameter of an to display it + * @param mimeType defines the MIME type of the screenshot image (default: image/png). + * Check your browser for supported MIME types + */ + Tools.CreateScreenshot = function (engine, camera, size, successCallback, mimeType) { + if (mimeType === void 0) { mimeType = "image/png"; } + var width; + var height; + // If a precision value is specified + if (size.precision) { + width = Math.round(engine.getRenderWidth() * size.precision); + height = Math.round(width / engine.getAspectRatio(camera)); + } + else if (size.width && size.height) { + width = size.width; + height = size.height; + } + //If passing only width, computing height to keep display canvas ratio. + else if (size.width && !size.height) { + width = size.width; + height = Math.round(width / engine.getAspectRatio(camera)); + } + //If passing only height, computing width to keep display canvas ratio. + else if (size.height && !size.width) { + height = size.height; + width = Math.round(height * engine.getAspectRatio(camera)); + } + //Assuming here that "size" parameter is a number + else if (!isNaN(size)) { + height = size; + width = size; + } + else { + Tools.Error("Invalid 'size' parameter !"); + return; + } + if (!screenshotCanvas) { + screenshotCanvas = document.createElement('canvas'); + } + screenshotCanvas.width = width; + screenshotCanvas.height = height; + var renderContext = screenshotCanvas.getContext("2d"); + var ratio = engine.getRenderWidth() / engine.getRenderHeight(); + var newWidth = width; + var newHeight = newWidth / ratio; + if (newHeight > height) { + newHeight = height; + newWidth = newHeight * ratio; + } + var offsetX = Math.max(0, width - newWidth) / 2; + var offsetY = Math.max(0, height - newHeight) / 2; + var renderingCanvas = engine.getRenderingCanvas(); + if (renderContext && renderingCanvas) { + renderContext.drawImage(renderingCanvas, offsetX, offsetY, newWidth, newHeight); + } + Tools.EncodeScreenshotCanvasData(successCallback, mimeType); + }; + /** + * Generates an image screenshot from the specified camera. + * @see http://doc.babylonjs.com/how_to/render_scene_on_a_png + * @param engine The engine to use for rendering + * @param camera The camera to use for rendering + * @param size This parameter can be set to a single number or to an object with the + * following (optional) properties: precision, width, height. If a single number is passed, + * it will be used for both width and height. If an object is passed, the screenshot size + * will be derived from the parameters. The precision property is a multiplier allowing + * rendering at a higher or lower resolution + * @param successCallback The callback receives a single parameter which contains the + * screenshot as a string of base64-encoded characters. This string can be assigned to the + * src parameter of an to display it + * @param mimeType The MIME type of the screenshot image (default: image/png). + * Check your browser for supported MIME types + * @param samples Texture samples (default: 1) + * @param antialiasing Whether antialiasing should be turned on or not (default: false) + * @param fileName A name for for the downloaded file. + */ + Tools.CreateScreenshotUsingRenderTarget = function (engine, camera, size, successCallback, mimeType, samples, antialiasing, fileName) { + if (mimeType === void 0) { mimeType = "image/png"; } + if (samples === void 0) { samples = 1; } + if (antialiasing === void 0) { antialiasing = false; } + var width; + var height; + //If a precision value is specified + if (size.precision) { + width = Math.round(engine.getRenderWidth() * size.precision); + height = Math.round(width / engine.getAspectRatio(camera)); + size = { width: width, height: height }; + } + else if (size.width && size.height) { + width = size.width; + height = size.height; + } + //If passing only width, computing height to keep display canvas ratio. + else if (size.width && !size.height) { + width = size.width; + height = Math.round(width / engine.getAspectRatio(camera)); + size = { width: width, height: height }; + } + //If passing only height, computing width to keep display canvas ratio. + else if (size.height && !size.width) { + height = size.height; + width = Math.round(height * engine.getAspectRatio(camera)); + size = { width: width, height: height }; + } + //Assuming here that "size" parameter is a number + else if (!isNaN(size)) { + height = size; + width = size; + } + else { + Tools.Error("Invalid 'size' parameter !"); + return; + } + var scene = camera.getScene(); + var previousCamera = null; + if (scene.activeCamera !== camera) { + previousCamera = scene.activeCamera; + scene.activeCamera = camera; + } + // At this point size can be a number, or an object (according to engine.prototype.createRenderTargetTexture method) + var texture = new BABYLON.RenderTargetTexture("screenShot", size, scene, false, false, BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT, false, BABYLON.Texture.NEAREST_SAMPLINGMODE); + texture.renderList = null; + texture.samples = samples; + if (antialiasing) { + texture.addPostProcess(new BABYLON.FxaaPostProcess('antialiasing', 1.0, scene.activeCamera)); + } + texture.onAfterRenderObservable.add(function () { + Tools.DumpFramebuffer(width, height, engine, successCallback, mimeType, fileName); + }); + scene.incrementRenderId(); + scene.resetCachedMaterial(); + texture.render(true); + texture.dispose(); + if (previousCamera) { + scene.activeCamera = previousCamera; + } + camera.getProjectionMatrix(true); // Force cache refresh; + }; + /** + * Validates if xhr data is correct + * @param xhr defines the request to validate + * @param dataType defines the expected data type + * @returns true if data is correct + */ + Tools.ValidateXHRData = function (xhr, dataType) { + // 1 for text (.babylon, manifest and shaders), 2 for TGA, 4 for DDS, 7 for all + if (dataType === void 0) { dataType = 7; } + try { + if (dataType & 1) { + if (xhr.responseText && xhr.responseText.length > 0) { + return true; + } + else if (dataType === 1) { + return false; + } + } + if (dataType & 2) { + // Check header width and height since there is no "TGA" magic number + var tgaHeader = BABYLON.TGATools.GetTGAHeader(xhr.response); + if (tgaHeader.width && tgaHeader.height && tgaHeader.width > 0 && tgaHeader.height > 0) { + return true; + } + else if (dataType === 2) { + return false; + } + } + if (dataType & 4) { + // Check for the "DDS" magic number + var ddsHeader = new Uint8Array(xhr.response, 0, 3); + if (ddsHeader[0] === 68 && ddsHeader[1] === 68 && ddsHeader[2] === 83) { + return true; + } + else { + return false; + } + } + } + catch (e) { + // Global protection + } + return false; + }; + /** + * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523 + * Be aware Math.random() could cause collisions, but: + * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide" + * @returns a pseudo random id + */ + Tools.RandomId = function () { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); + return v.toString(16); + }); + }; + /** + * Test if the given uri is a base64 string + * @param uri The uri to test + * @return True if the uri is a base64 string or false otherwise + */ + Tools.IsBase64 = function (uri) { + return uri.length < 5 ? false : uri.substr(0, 5) === "data:"; + }; + /** + * Decode the given base64 uri. + * @param uri The uri to decode + * @return The decoded base64 data. + */ + Tools.DecodeBase64 = function (uri) { + var decodedString = atob(uri.split(",")[1]); + var bufferLength = decodedString.length; + var bufferView = new Uint8Array(new ArrayBuffer(bufferLength)); + for (var i = 0; i < bufferLength; i++) { + bufferView[i] = decodedString.charCodeAt(i); + } + return bufferView.buffer; + }; + Tools._AddLogEntry = function (entry) { + Tools._LogCache = entry + Tools._LogCache; + if (Tools.OnNewCacheEntry) { + Tools.OnNewCacheEntry(entry); + } + }; + Tools._FormatMessage = function (message) { + var padStr = function (i) { return (i < 10) ? "0" + i : "" + i; }; + var date = new Date(); + return "[" + padStr(date.getHours()) + ":" + padStr(date.getMinutes()) + ":" + padStr(date.getSeconds()) + "]: " + message; + }; + Tools._LogDisabled = function (message) { + // nothing to do + }; + Tools._LogEnabled = function (message) { + var formattedMessage = Tools._FormatMessage(message); + console.log("BJS - " + formattedMessage); + var entry = "
" + formattedMessage + "

"; + Tools._AddLogEntry(entry); + }; + Tools._WarnDisabled = function (message) { + // nothing to do + }; + Tools._WarnEnabled = function (message) { + var formattedMessage = Tools._FormatMessage(message); + console.warn("BJS - " + formattedMessage); + var entry = "
" + formattedMessage + "

"; + Tools._AddLogEntry(entry); + }; + Tools._ErrorDisabled = function (message) { + // nothing to do + }; + Tools._ErrorEnabled = function (message) { + Tools.errorsCount++; + var formattedMessage = Tools._FormatMessage(message); + console.error("BJS - " + formattedMessage); + var entry = "
" + formattedMessage + "

"; + Tools._AddLogEntry(entry); + }; + Object.defineProperty(Tools, "LogCache", { + /** + * Gets current log cache (list of logs) + */ + get: function () { + return Tools._LogCache; + }, + enumerable: true, + configurable: true + }); + /** + * Clears the log cache + */ + Tools.ClearLogCache = function () { + Tools._LogCache = ""; + Tools.errorsCount = 0; + }; + Object.defineProperty(Tools, "LogLevels", { + /** + * Sets the current log level (MessageLogLevel / WarningLogLevel / ErrorLogLevel) + */ + set: function (level) { + if ((level & Tools.MessageLogLevel) === Tools.MessageLogLevel) { + Tools.Log = Tools._LogEnabled; + } + else { + Tools.Log = Tools._LogDisabled; + } + if ((level & Tools.WarningLogLevel) === Tools.WarningLogLevel) { + Tools.Warn = Tools._WarnEnabled; + } + else { + Tools.Warn = Tools._WarnDisabled; + } + if ((level & Tools.ErrorLogLevel) === Tools.ErrorLogLevel) { + Tools.Error = Tools._ErrorEnabled; + } + else { + Tools.Error = Tools._ErrorDisabled; + } + }, + enumerable: true, + configurable: true + }); + /** + * Checks if the loaded document was accessed via `file:`-Protocol. + * @returns boolean + */ + Tools.IsFileURL = function () { + return location.protocol === "file:"; + }; + /** + * Checks if the window object exists + * @returns true if the window object exists + */ + Tools.IsWindowObjectExist = function () { + return (typeof window) !== "undefined"; + }; + Object.defineProperty(Tools, "PerformanceLogLevel", { + /** + * Sets the current performance log level + */ + set: function (level) { + if ((level & Tools.PerformanceUserMarkLogLevel) === Tools.PerformanceUserMarkLogLevel) { + Tools.StartPerformanceCounter = Tools._StartUserMark; + Tools.EndPerformanceCounter = Tools._EndUserMark; + return; + } + if ((level & Tools.PerformanceConsoleLogLevel) === Tools.PerformanceConsoleLogLevel) { + Tools.StartPerformanceCounter = Tools._StartPerformanceConsole; + Tools.EndPerformanceCounter = Tools._EndPerformanceConsole; + return; + } + Tools.StartPerformanceCounter = Tools._StartPerformanceCounterDisabled; + Tools.EndPerformanceCounter = Tools._EndPerformanceCounterDisabled; + }, + enumerable: true, + configurable: true + }); + Tools._StartPerformanceCounterDisabled = function (counterName, condition) { + }; + Tools._EndPerformanceCounterDisabled = function (counterName, condition) { + }; + Tools._StartUserMark = function (counterName, condition) { + if (condition === void 0) { condition = true; } + if (!Tools._performance) { + if (!Tools.IsWindowObjectExist()) { + return; + } + Tools._performance = window.performance; + } + if (!condition || !Tools._performance.mark) { + return; + } + Tools._performance.mark(counterName + "-Begin"); + }; + Tools._EndUserMark = function (counterName, condition) { + if (condition === void 0) { condition = true; } + if (!condition || !Tools._performance.mark) { + return; + } + Tools._performance.mark(counterName + "-End"); + Tools._performance.measure(counterName, counterName + "-Begin", counterName + "-End"); + }; + Tools._StartPerformanceConsole = function (counterName, condition) { + if (condition === void 0) { condition = true; } + if (!condition) { + return; + } + Tools._StartUserMark(counterName, condition); + if (console.time) { + console.time(counterName); + } + }; + Tools._EndPerformanceConsole = function (counterName, condition) { + if (condition === void 0) { condition = true; } + if (!condition) { + return; + } + Tools._EndUserMark(counterName, condition); + if (console.time) { + console.timeEnd(counterName); + } + }; + Object.defineProperty(Tools, "Now", { + /** + * Gets either window.performance.now() if supported or Date.now() else + */ + get: function () { + if (Tools.IsWindowObjectExist() && window.performance && window.performance.now) { + return window.performance.now(); + } + return Date.now(); + }, + enumerable: true, + configurable: true + }); + /** + * This method will return the name of the class used to create the instance of the given object. + * It will works only on Javascript basic data types (number, string, ...) and instance of class declared with the @className decorator. + * @param object the object to get the class name from + * @param isType defines if the object is actually a type + * @returns the name of the class, will be "object" for a custom data type not using the @className decorator + */ + Tools.GetClassName = function (object, isType) { + if (isType === void 0) { isType = false; } + var name = null; + if (!isType && object.getClassName) { + name = object.getClassName(); + } + else { + if (object instanceof Object) { + var classObj = isType ? object : Object.getPrototypeOf(object); + name = classObj.constructor["__bjsclassName__"]; + } + if (!name) { + name = typeof object; + } + } + return name; + }; + /** + * Gets the first element of an array satisfying a given predicate + * @param array defines the array to browse + * @param predicate defines the predicate to use + * @returns null if not found or the element + */ + Tools.First = function (array, predicate) { + for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { + var el = array_1[_i]; + if (predicate(el)) { + return el; + } + } + return null; + }; + /** + * This method will return the name of the full name of the class, including its owning module (if any). + * It will works only on Javascript basic data types (number, string, ...) and instance of class declared with the @className decorator or implementing a method getClassName():string (in which case the module won't be specified). + * @param object the object to get the class name from + * @param isType defines if the object is actually a type + * @return a string that can have two forms: "moduleName.className" if module was specified when the class' Name was registered or "className" if there was not module specified. + * @ignorenaming + */ + Tools.getFullClassName = function (object, isType) { + if (isType === void 0) { isType = false; } + var className = null; + var moduleName = null; + if (!isType && object.getClassName) { + className = object.getClassName(); + } + else { + if (object instanceof Object) { + var classObj = isType ? object : Object.getPrototypeOf(object); + className = classObj.constructor["__bjsclassName__"]; + moduleName = classObj.constructor["__bjsmoduleName__"]; + } + if (!className) { + className = typeof object; + } + } + if (!className) { + return null; + } + return ((moduleName != null) ? (moduleName + ".") : "") + className; + }; + /** + * Returns a promise that resolves after the given amount of time. + * @param delay Number of milliseconds to delay + * @returns Promise that resolves after the given amount of time + */ + Tools.DelayAsync = function (delay) { + return new Promise(function (resolve) { + setTimeout(function () { + resolve(); + }, delay); + }); + }; + /** + * Gets the current gradient from an array of IValueGradient + * @param ratio defines the current ratio to get + * @param gradients defines the array of IValueGradient + * @param updateFunc defines the callback function used to get the final value from the selected gradients + */ + Tools.GetCurrentGradient = function (ratio, gradients, updateFunc) { + for (var gradientIndex = 0; gradientIndex < gradients.length - 1; gradientIndex++) { + var currentGradient = gradients[gradientIndex]; + var nextGradient = gradients[gradientIndex + 1]; + if (ratio >= currentGradient.gradient && ratio <= nextGradient.gradient) { + var scale = (ratio - currentGradient.gradient) / (nextGradient.gradient - currentGradient.gradient); + updateFunc(currentGradient, nextGradient, scale); + return; + } + } + // Use last index if over + var lastIndex = gradients.length - 1; + updateFunc(gradients[lastIndex], gradients[lastIndex], 1.0); + }; + /** + * Gets or sets the base URL to use to load assets + */ + Tools.BaseUrl = ""; + /** + * Gets or sets the retry strategy to apply when an error happens while loading an asset + */ + Tools.DefaultRetryStrategy = RetryStrategy.ExponentialBackoff(); + /** + * Default behaviour for cors in the application. + * It can be a string if the expected behavior is identical in the entire app. + * Or a callback to be able to set it per url or on a group of them (in case of Video source for instance) + */ + Tools.CorsBehavior = "anonymous"; + /** + * Gets or sets a global variable indicating if fallback texture must be used when a texture cannot be loaded + * @ignorenaming + */ + Tools.UseFallbackTexture = true; + /** + * Use this object to register external classes like custom textures or material + * to allow the laoders to instantiate them + */ + Tools.RegisteredExternalClasses = {}; + /** + * Texture content used if a texture cannot loaded + * @ignorenaming + */ + Tools.fallbackTexture = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z"; + Tools._tmpFloatArray = new Float32Array(1); + /** + * Gets or sets a function used to pre-process url before using them to load assets + */ + Tools.PreprocessUrl = function (url) { + return url; + }; + // Logs + /** + * No log + */ + Tools.NoneLogLevel = 0; + /** + * Only message logs + */ + Tools.MessageLogLevel = 1; + /** + * Only warning logs + */ + Tools.WarningLogLevel = 2; + /** + * Only error logs + */ + Tools.ErrorLogLevel = 4; + /** + * All logs + */ + Tools.AllLogLevel = 7; + Tools._LogCache = ""; + /** + * Gets a value indicating the number of loading errors + * @ignorenaming + */ + Tools.errorsCount = 0; + /** + * Log a message to the console + */ + Tools.Log = Tools._LogEnabled; + /** + * Write a warning message to the console + */ + Tools.Warn = Tools._WarnEnabled; + /** + * Write an error message to the console + */ + Tools.Error = Tools._ErrorEnabled; + // Performances + /** + * No performance log + */ + Tools.PerformanceNoneLogLevel = 0; + /** + * Use user marks to log performance + */ + Tools.PerformanceUserMarkLogLevel = 1; + /** + * Log performance to the console + */ + Tools.PerformanceConsoleLogLevel = 2; + /** + * Starts a performance counter + */ + Tools.StartPerformanceCounter = Tools._StartPerformanceCounterDisabled; + /** + * Ends a specific performance coutner + */ + Tools.EndPerformanceCounter = Tools._EndPerformanceCounterDisabled; + return Tools; + }()); + BABYLON.Tools = Tools; + /** + * This class is used to track a performance counter which is number based. + * The user has access to many properties which give statistics of different nature. + * + * The implementer can track two kinds of Performance Counter: time and count. + * For time you can optionally call fetchNewFrame() to notify the start of a new frame to monitor, then call beginMonitoring() to start and endMonitoring() to record the lapsed time. endMonitoring takes a newFrame parameter for you to specify if the monitored time should be set for a new frame or accumulated to the current frame being monitored. + * For count you first have to call fetchNewFrame() to notify the start of a new frame to monitor, then call addCount() how many time required to increment the count value you monitor. + */ + var PerfCounter = /** @class */ (function () { + /** + * Creates a new counter + */ + function PerfCounter() { + this._startMonitoringTime = 0; + this._min = 0; + this._max = 0; + this._average = 0; + this._lastSecAverage = 0; + this._current = 0; + this._totalValueCount = 0; + this._totalAccumulated = 0; + this._lastSecAccumulated = 0; + this._lastSecTime = 0; + this._lastSecValueCount = 0; + } + Object.defineProperty(PerfCounter.prototype, "min", { + /** + * Returns the smallest value ever + */ + get: function () { + return this._min; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "max", { + /** + * Returns the biggest value ever + */ + get: function () { + return this._max; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "average", { + /** + * Returns the average value since the performance counter is running + */ + get: function () { + return this._average; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "lastSecAverage", { + /** + * Returns the average value of the last second the counter was monitored + */ + get: function () { + return this._lastSecAverage; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "current", { + /** + * Returns the current value + */ + get: function () { + return this._current; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "total", { + /** + * Gets the accumulated total + */ + get: function () { + return this._totalAccumulated; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerfCounter.prototype, "count", { + /** + * Gets the total value count + */ + get: function () { + return this._totalValueCount; + }, + enumerable: true, + configurable: true + }); + /** + * Call this method to start monitoring a new frame. + * This scenario is typically used when you accumulate monitoring time many times for a single frame, you call this method at the start of the frame, then beginMonitoring to start recording and endMonitoring(false) to accumulated the recorded time to the PerfCounter or addCount() to accumulate a monitored count. + */ + PerfCounter.prototype.fetchNewFrame = function () { + this._totalValueCount++; + this._current = 0; + this._lastSecValueCount++; + }; + /** + * Call this method to monitor a count of something (e.g. mesh drawn in viewport count) + * @param newCount the count value to add to the monitored count + * @param fetchResult true when it's the last time in the frame you add to the counter and you wish to update the statistics properties (min/max/average), false if you only want to update statistics. + */ + PerfCounter.prototype.addCount = function (newCount, fetchResult) { + if (!PerfCounter.Enabled) { + return; + } + this._current += newCount; + if (fetchResult) { + this._fetchResult(); + } + }; + /** + * Start monitoring this performance counter + */ + PerfCounter.prototype.beginMonitoring = function () { + if (!PerfCounter.Enabled) { + return; + } + this._startMonitoringTime = Tools.Now; + }; + /** + * Compute the time lapsed since the previous beginMonitoring() call. + * @param newFrame true by default to fetch the result and monitor a new frame, if false the time monitored will be added to the current frame counter + */ + PerfCounter.prototype.endMonitoring = function (newFrame) { + if (newFrame === void 0) { newFrame = true; } + if (!PerfCounter.Enabled) { + return; + } + if (newFrame) { + this.fetchNewFrame(); + } + var currentTime = Tools.Now; + this._current = currentTime - this._startMonitoringTime; + if (newFrame) { + this._fetchResult(); + } + }; + PerfCounter.prototype._fetchResult = function () { + this._totalAccumulated += this._current; + this._lastSecAccumulated += this._current; + // Min/Max update + this._min = Math.min(this._min, this._current); + this._max = Math.max(this._max, this._current); + this._average = this._totalAccumulated / this._totalValueCount; + // Reset last sec? + var now = Tools.Now; + if ((now - this._lastSecTime) > 1000) { + this._lastSecAverage = this._lastSecAccumulated / this._lastSecValueCount; + this._lastSecTime = now; + this._lastSecAccumulated = 0; + this._lastSecValueCount = 0; + } + }; + /** + * Gets or sets a global boolean to turn on and off all the counters + */ + PerfCounter.Enabled = true; + return PerfCounter; + }()); + BABYLON.PerfCounter = PerfCounter; + /** + * Use this className as a decorator on a given class definition to add it a name and optionally its module. + * You can then use the Tools.getClassName(obj) on an instance to retrieve its class name. + * This method is the only way to get it done in all cases, even if the .js file declaring the class is minified + * @param name The name of the class, case should be preserved + * @param module The name of the Module hosting the class, optional, but strongly recommended to specify if possible. Case should be preserved. + */ + function className(name, module) { + return function (target) { + target["__bjsclassName__"] = name; + target["__bjsmoduleName__"] = (module != null) ? module : null; + }; + } + BABYLON.className = className; + /** + * An implementation of a loop for asynchronous functions. + */ + var AsyncLoop = /** @class */ (function () { + /** + * Constructor. + * @param iterations the number of iterations. + * @param func the function to run each iteration + * @param successCallback the callback that will be called upon succesful execution + * @param offset starting offset. + */ + function AsyncLoop( + /** + * Defines the number of iterations for the loop + */ + iterations, func, successCallback, offset) { + if (offset === void 0) { offset = 0; } + this.iterations = iterations; + this.index = offset - 1; + this._done = false; + this._fn = func; + this._successCallback = successCallback; + } + /** + * Execute the next iteration. Must be called after the last iteration was finished. + */ + AsyncLoop.prototype.executeNext = function () { + if (!this._done) { + if (this.index + 1 < this.iterations) { + ++this.index; + this._fn(this); + } + else { + this.breakLoop(); + } + } + }; + /** + * Break the loop and run the success callback. + */ + AsyncLoop.prototype.breakLoop = function () { + this._done = true; + this._successCallback(); + }; + /** + * Create and run an async loop. + * @param iterations the number of iterations. + * @param fn the function to run each iteration + * @param successCallback the callback that will be called upon succesful execution + * @param offset starting offset. + * @returns the created async loop object + */ + AsyncLoop.Run = function (iterations, fn, successCallback, offset) { + if (offset === void 0) { offset = 0; } + var loop = new AsyncLoop(iterations, fn, successCallback, offset); + loop.executeNext(); + return loop; + }; + /** + * A for-loop that will run a given number of iterations synchronous and the rest async. + * @param iterations total number of iterations + * @param syncedIterations number of synchronous iterations in each async iteration. + * @param fn the function to call each iteration. + * @param callback a success call back that will be called when iterating stops. + * @param breakFunction a break condition (optional) + * @param timeout timeout settings for the setTimeout function. default - 0. + * @returns the created async loop object + */ + AsyncLoop.SyncAsyncForLoop = function (iterations, syncedIterations, fn, callback, breakFunction, timeout) { + if (timeout === void 0) { timeout = 0; } + return AsyncLoop.Run(Math.ceil(iterations / syncedIterations), function (loop) { + if (breakFunction && breakFunction()) { + loop.breakLoop(); + } + else { + setTimeout(function () { + for (var i = 0; i < syncedIterations; ++i) { + var iteration = (loop.index * syncedIterations) + i; + if (iteration >= iterations) { + break; + } + fn(iteration); + if (breakFunction && breakFunction()) { + loop.breakLoop(); + break; + } + } + loop.executeNext(); + }, timeout); + } + }, callback); + }; + return AsyncLoop; + }()); + BABYLON.AsyncLoop = AsyncLoop; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.tools.js.map + +var BABYLON; +(function (BABYLON) { + var PromiseStates; + (function (PromiseStates) { + PromiseStates[PromiseStates["Pending"] = 0] = "Pending"; + PromiseStates[PromiseStates["Fulfilled"] = 1] = "Fulfilled"; + PromiseStates[PromiseStates["Rejected"] = 2] = "Rejected"; + })(PromiseStates || (PromiseStates = {})); + var FulFillmentAgregator = /** @class */ (function () { + function FulFillmentAgregator() { + this.count = 0; + this.target = 0; + this.results = []; + } + return FulFillmentAgregator; + }()); + var InternalPromise = /** @class */ (function () { + function InternalPromise(resolver) { + var _this = this; + this._state = PromiseStates.Pending; + this._children = new Array(); + this._rejectWasConsumed = false; + if (!resolver) { + return; + } + try { + resolver(function (value) { + _this._resolve(value); + }, function (reason) { + _this._reject(reason); + }); + } + catch (e) { + this._reject(e); + } + } + Object.defineProperty(InternalPromise.prototype, "_result", { + get: function () { + return this._resultValue; + }, + set: function (value) { + this._resultValue = value; + if (this._parent && this._parent._result === undefined) { + this._parent._result = value; + } + }, + enumerable: true, + configurable: true + }); + InternalPromise.prototype.catch = function (onRejected) { + return this.then(undefined, onRejected); + }; + InternalPromise.prototype.then = function (onFulfilled, onRejected) { + var _this = this; + var newPromise = new InternalPromise(); + newPromise._onFulfilled = onFulfilled; + newPromise._onRejected = onRejected; + // Composition + this._children.push(newPromise); + newPromise._parent = this; + if (this._state !== PromiseStates.Pending) { + BABYLON.Tools.SetImmediate(function () { + if (_this._state === PromiseStates.Fulfilled || _this._rejectWasConsumed) { + var returnedValue = newPromise._resolve(_this._result); + if (returnedValue !== undefined && returnedValue !== null) { + if (returnedValue._state !== undefined) { + var returnedPromise = returnedValue; + newPromise._children.push(returnedPromise); + returnedPromise._parent = newPromise; + newPromise = returnedPromise; + } + else { + newPromise._result = returnedValue; + } + } + } + else { + newPromise._reject(_this._reason); + } + }); + } + return newPromise; + }; + InternalPromise.prototype._moveChildren = function (children) { + var _this = this; + var _a; + (_a = this._children).push.apply(_a, children.splice(0, children.length)); + this._children.forEach(function (child) { + child._parent = _this; + }); + if (this._state === PromiseStates.Fulfilled) { + for (var _i = 0, _b = this._children; _i < _b.length; _i++) { + var child = _b[_i]; + child._resolve(this._result); + } + } + else if (this._state === PromiseStates.Rejected) { + for (var _c = 0, _d = this._children; _c < _d.length; _c++) { + var child = _d[_c]; + child._reject(this._reason); + } + } + }; + InternalPromise.prototype._resolve = function (value) { + try { + this._state = PromiseStates.Fulfilled; + var returnedValue = null; + if (this._onFulfilled) { + returnedValue = this._onFulfilled(value); + } + if (returnedValue !== undefined && returnedValue !== null) { + if (returnedValue._state !== undefined) { + // Transmit children + var returnedPromise = returnedValue; + returnedPromise._parent = this; + returnedPromise._moveChildren(this._children); + value = returnedPromise._result; + } + else { + value = returnedValue; + } + } + this._result = value; + for (var _i = 0, _a = this._children; _i < _a.length; _i++) { + var child = _a[_i]; + child._resolve(value); + } + this._children.length = 0; + delete this._onFulfilled; + delete this._onRejected; + } + catch (e) { + this._reject(e, true); + } + }; + InternalPromise.prototype._reject = function (reason, onLocalThrow) { + if (onLocalThrow === void 0) { onLocalThrow = false; } + this._state = PromiseStates.Rejected; + this._reason = reason; + if (this._onRejected && !onLocalThrow) { + try { + this._onRejected(reason); + this._rejectWasConsumed = true; + } + catch (e) { + reason = e; + } + } + for (var _i = 0, _a = this._children; _i < _a.length; _i++) { + var child = _a[_i]; + if (this._rejectWasConsumed) { + child._resolve(null); + } + else { + child._reject(reason); + } + } + this._children.length = 0; + delete this._onFulfilled; + delete this._onRejected; + }; + InternalPromise.resolve = function (value) { + var newPromise = new InternalPromise(); + newPromise._resolve(value); + return newPromise; + }; + InternalPromise._RegisterForFulfillment = function (promise, agregator, index) { + promise.then(function (value) { + agregator.results[index] = value; + agregator.count++; + if (agregator.count === agregator.target) { + agregator.rootPromise._resolve(agregator.results); + } + return null; + }, function (reason) { + if (agregator.rootPromise._state !== PromiseStates.Rejected) { + agregator.rootPromise._reject(reason); + } + }); + }; + InternalPromise.all = function (promises) { + var newPromise = new InternalPromise(); + var agregator = new FulFillmentAgregator(); + agregator.target = promises.length; + agregator.rootPromise = newPromise; + if (promises.length) { + for (var index = 0; index < promises.length; index++) { + InternalPromise._RegisterForFulfillment(promises[index], agregator, index); + } + } + else { + newPromise._resolve([]); + } + return newPromise; + }; + InternalPromise.race = function (promises) { + var newPromise = new InternalPromise(); + if (promises.length) { + for (var _i = 0, promises_1 = promises; _i < promises_1.length; _i++) { + var promise = promises_1[_i]; + promise.then(function (value) { + if (newPromise) { + newPromise._resolve(value); + newPromise = null; + } + return null; + }, function (reason) { + if (newPromise) { + newPromise._reject(reason); + newPromise = null; + } + }); + } + } + return newPromise; + }; + return InternalPromise; + }()); + /** + * Helper class that provides a small promise polyfill + */ + var PromisePolyfill = /** @class */ (function () { + function PromisePolyfill() { + } + /** + * Static function used to check if the polyfill is required + * If this is the case then the function will inject the polyfill to window.Promise + * @param force defines a boolean used to force the injection (mostly for testing purposes) + */ + PromisePolyfill.Apply = function (force) { + if (force === void 0) { force = false; } + if (force || typeof Promise === 'undefined') { + var root = window; + root.Promise = InternalPromise; + } + }; + return PromisePolyfill; + }()); + BABYLON.PromisePolyfill = PromisePolyfill; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.promise.js.map + +/// +var BABYLON; +(function (BABYLON) { + /** + * Helper class to push actions to a pool of workers. + */ + var WorkerPool = /** @class */ (function () { + /** + * Constructor + * @param workers Array of workers to use for actions + */ + function WorkerPool(workers) { + this._pendingActions = new Array(); + this._workerInfos = workers.map(function (worker) { return ({ + worker: worker, + active: false + }); }); + } + /** + * Terminates all workers and clears any pending actions. + */ + WorkerPool.prototype.dispose = function () { + for (var _i = 0, _a = this._workerInfos; _i < _a.length; _i++) { + var workerInfo = _a[_i]; + workerInfo.worker.terminate(); + } + delete this._workerInfos; + delete this._pendingActions; + }; + /** + * Pushes an action to the worker pool. If all the workers are active, the action will be + * pended until a worker has completed its action. + * @param action The action to perform. Call onComplete when the action is complete. + */ + WorkerPool.prototype.push = function (action) { + for (var _i = 0, _a = this._workerInfos; _i < _a.length; _i++) { + var workerInfo = _a[_i]; + if (!workerInfo.active) { + this._execute(workerInfo, action); + return; + } + } + this._pendingActions.push(action); + }; + WorkerPool.prototype._execute = function (workerInfo, action) { + var _this = this; + workerInfo.active = true; + action(workerInfo.worker, function () { + workerInfo.active = false; + var nextAction = _this._pendingActions.shift(); + if (nextAction) { + _this._execute(workerInfo, nextAction); + } + }); + }; + return WorkerPool; + }()); + BABYLON.WorkerPool = WorkerPool; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.workerPool.js.map + +var BABYLON; +(function (BABYLON) { + /** + * @hidden + **/ + var _AlphaState = /** @class */ (function () { + /** + * Initializes the state. + */ + function _AlphaState() { + this._isAlphaBlendDirty = false; + this._isBlendFunctionParametersDirty = false; + this._isBlendEquationParametersDirty = false; + this._isBlendConstantsDirty = false; + this._alphaBlend = false; + this._blendFunctionParameters = new Array(4); + this._blendEquationParameters = new Array(2); + this._blendConstants = new Array(4); + this.reset(); + } + Object.defineProperty(_AlphaState.prototype, "isDirty", { + get: function () { + return this._isAlphaBlendDirty || this._isBlendFunctionParametersDirty; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_AlphaState.prototype, "alphaBlend", { + get: function () { + return this._alphaBlend; + }, + set: function (value) { + if (this._alphaBlend === value) { + return; + } + this._alphaBlend = value; + this._isAlphaBlendDirty = true; + }, + enumerable: true, + configurable: true + }); + _AlphaState.prototype.setAlphaBlendConstants = function (r, g, b, a) { + if (this._blendConstants[0] === r && + this._blendConstants[1] === g && + this._blendConstants[2] === b && + this._blendConstants[3] === a) { + return; + } + this._blendConstants[0] = r; + this._blendConstants[1] = g; + this._blendConstants[2] = b; + this._blendConstants[3] = a; + this._isBlendConstantsDirty = true; + }; + _AlphaState.prototype.setAlphaBlendFunctionParameters = function (value0, value1, value2, value3) { + if (this._blendFunctionParameters[0] === value0 && + this._blendFunctionParameters[1] === value1 && + this._blendFunctionParameters[2] === value2 && + this._blendFunctionParameters[3] === value3) { + return; + } + this._blendFunctionParameters[0] = value0; + this._blendFunctionParameters[1] = value1; + this._blendFunctionParameters[2] = value2; + this._blendFunctionParameters[3] = value3; + this._isBlendFunctionParametersDirty = true; + }; + _AlphaState.prototype.setAlphaEquationParameters = function (rgb, alpha) { + if (this._blendEquationParameters[0] === rgb && + this._blendEquationParameters[1] === alpha) { + return; + } + this._blendEquationParameters[0] = rgb; + this._blendEquationParameters[1] = alpha; + this._isBlendEquationParametersDirty = true; + }; + _AlphaState.prototype.reset = function () { + this._alphaBlend = false; + this._blendFunctionParameters[0] = null; + this._blendFunctionParameters[1] = null; + this._blendFunctionParameters[2] = null; + this._blendFunctionParameters[3] = null; + this._blendEquationParameters[0] = null; + this._blendEquationParameters[1] = null; + this._blendConstants[0] = null; + this._blendConstants[1] = null; + this._blendConstants[2] = null; + this._blendConstants[3] = null; + this._isAlphaBlendDirty = true; + this._isBlendFunctionParametersDirty = false; + this._isBlendEquationParametersDirty = false; + this._isBlendConstantsDirty = false; + }; + _AlphaState.prototype.apply = function (gl) { + if (!this.isDirty) { + return; + } + // Alpha blend + if (this._isAlphaBlendDirty) { + if (this._alphaBlend) { + gl.enable(gl.BLEND); + } + else { + gl.disable(gl.BLEND); + } + this._isAlphaBlendDirty = false; + } + // Alpha function + if (this._isBlendFunctionParametersDirty) { + gl.blendFuncSeparate(this._blendFunctionParameters[0], this._blendFunctionParameters[1], this._blendFunctionParameters[2], this._blendFunctionParameters[3]); + this._isBlendFunctionParametersDirty = false; + } + // Alpha equation + if (this._isBlendEquationParametersDirty) { + gl.blendEquationSeparate(this._blendEquationParameters[0], this._blendEquationParameters[1]); + this._isBlendEquationParametersDirty = false; + } + // Constants + if (this._isBlendConstantsDirty) { + gl.blendColor(this._blendConstants[0], this._blendConstants[1], this._blendConstants[2], this._blendConstants[3]); + this._isBlendConstantsDirty = false; + } + }; + return _AlphaState; + }()); + BABYLON._AlphaState = _AlphaState; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.alphaCullingState.js.map + +var BABYLON; +(function (BABYLON) { + /** + * @hidden + **/ + var _DepthCullingState = /** @class */ (function () { + /** + * Initializes the state. + */ + function _DepthCullingState() { + this._isDepthTestDirty = false; + this._isDepthMaskDirty = false; + this._isDepthFuncDirty = false; + this._isCullFaceDirty = false; + this._isCullDirty = false; + this._isZOffsetDirty = false; + this._isFrontFaceDirty = false; + this.reset(); + } + Object.defineProperty(_DepthCullingState.prototype, "isDirty", { + get: function () { + return this._isDepthFuncDirty || this._isDepthTestDirty || this._isDepthMaskDirty || this._isCullFaceDirty || this._isCullDirty || this._isZOffsetDirty || this._isFrontFaceDirty; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "zOffset", { + get: function () { + return this._zOffset; + }, + set: function (value) { + if (this._zOffset === value) { + return; + } + this._zOffset = value; + this._isZOffsetDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "cullFace", { + get: function () { + return this._cullFace; + }, + set: function (value) { + if (this._cullFace === value) { + return; + } + this._cullFace = value; + this._isCullFaceDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "cull", { + get: function () { + return this._cull; + }, + set: function (value) { + if (this._cull === value) { + return; + } + this._cull = value; + this._isCullDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "depthFunc", { + get: function () { + return this._depthFunc; + }, + set: function (value) { + if (this._depthFunc === value) { + return; + } + this._depthFunc = value; + this._isDepthFuncDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "depthMask", { + get: function () { + return this._depthMask; + }, + set: function (value) { + if (this._depthMask === value) { + return; + } + this._depthMask = value; + this._isDepthMaskDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "depthTest", { + get: function () { + return this._depthTest; + }, + set: function (value) { + if (this._depthTest === value) { + return; + } + this._depthTest = value; + this._isDepthTestDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_DepthCullingState.prototype, "frontFace", { + get: function () { + return this._frontFace; + }, + set: function (value) { + if (this._frontFace === value) { + return; + } + this._frontFace = value; + this._isFrontFaceDirty = true; + }, + enumerable: true, + configurable: true + }); + _DepthCullingState.prototype.reset = function () { + this._depthMask = true; + this._depthTest = true; + this._depthFunc = null; + this._cullFace = null; + this._cull = null; + this._zOffset = 0; + this._frontFace = null; + this._isDepthTestDirty = true; + this._isDepthMaskDirty = true; + this._isDepthFuncDirty = false; + this._isCullFaceDirty = false; + this._isCullDirty = false; + this._isZOffsetDirty = false; + this._isFrontFaceDirty = false; + }; + _DepthCullingState.prototype.apply = function (gl) { + if (!this.isDirty) { + return; + } + // Cull + if (this._isCullDirty) { + if (this.cull) { + gl.enable(gl.CULL_FACE); + } + else { + gl.disable(gl.CULL_FACE); + } + this._isCullDirty = false; + } + // Cull face + if (this._isCullFaceDirty) { + gl.cullFace(this.cullFace); + this._isCullFaceDirty = false; + } + // Depth mask + if (this._isDepthMaskDirty) { + gl.depthMask(this.depthMask); + this._isDepthMaskDirty = false; + } + // Depth test + if (this._isDepthTestDirty) { + if (this.depthTest) { + gl.enable(gl.DEPTH_TEST); + } + else { + gl.disable(gl.DEPTH_TEST); + } + this._isDepthTestDirty = false; + } + // Depth func + if (this._isDepthFuncDirty) { + gl.depthFunc(this.depthFunc); + this._isDepthFuncDirty = false; + } + // zOffset + if (this._isZOffsetDirty) { + if (this.zOffset) { + gl.enable(gl.POLYGON_OFFSET_FILL); + gl.polygonOffset(this.zOffset, 0); + } + else { + gl.disable(gl.POLYGON_OFFSET_FILL); + } + this._isZOffsetDirty = false; + } + // Front face + if (this._isFrontFaceDirty) { + gl.frontFace(this.frontFace); + this._isFrontFaceDirty = false; + } + }; + return _DepthCullingState; + }()); + BABYLON._DepthCullingState = _DepthCullingState; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.depthCullingState.js.map + +var BABYLON; +(function (BABYLON) { + /** + * @hidden + **/ + var _StencilState = /** @class */ (function () { + function _StencilState() { + this._isStencilTestDirty = false; + this._isStencilMaskDirty = false; + this._isStencilFuncDirty = false; + this._isStencilOpDirty = false; + this.reset(); + } + Object.defineProperty(_StencilState.prototype, "isDirty", { + get: function () { + return this._isStencilTestDirty || this._isStencilMaskDirty || this._isStencilFuncDirty || this._isStencilOpDirty; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilFunc", { + get: function () { + return this._stencilFunc; + }, + set: function (value) { + if (this._stencilFunc === value) { + return; + } + this._stencilFunc = value; + this._isStencilFuncDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilFuncRef", { + get: function () { + return this._stencilFuncRef; + }, + set: function (value) { + if (this._stencilFuncRef === value) { + return; + } + this._stencilFuncRef = value; + this._isStencilFuncDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilFuncMask", { + get: function () { + return this._stencilFuncMask; + }, + set: function (value) { + if (this._stencilFuncMask === value) { + return; + } + this._stencilFuncMask = value; + this._isStencilFuncDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilOpStencilFail", { + get: function () { + return this._stencilOpStencilFail; + }, + set: function (value) { + if (this._stencilOpStencilFail === value) { + return; + } + this._stencilOpStencilFail = value; + this._isStencilOpDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilOpDepthFail", { + get: function () { + return this._stencilOpDepthFail; + }, + set: function (value) { + if (this._stencilOpDepthFail === value) { + return; + } + this._stencilOpDepthFail = value; + this._isStencilOpDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilOpStencilDepthPass", { + get: function () { + return this._stencilOpStencilDepthPass; + }, + set: function (value) { + if (this._stencilOpStencilDepthPass === value) { + return; + } + this._stencilOpStencilDepthPass = value; + this._isStencilOpDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilMask", { + get: function () { + return this._stencilMask; + }, + set: function (value) { + if (this._stencilMask === value) { + return; + } + this._stencilMask = value; + this._isStencilMaskDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(_StencilState.prototype, "stencilTest", { + get: function () { + return this._stencilTest; + }, + set: function (value) { + if (this._stencilTest === value) { + return; + } + this._stencilTest = value; + this._isStencilTestDirty = true; + }, + enumerable: true, + configurable: true + }); + _StencilState.prototype.reset = function () { + this._stencilTest = false; + this._stencilMask = 0xFF; + this._stencilFunc = BABYLON.Engine.ALWAYS; + this._stencilFuncRef = 1; + this._stencilFuncMask = 0xFF; + this._stencilOpStencilFail = BABYLON.Engine.KEEP; + this._stencilOpDepthFail = BABYLON.Engine.KEEP; + this._stencilOpStencilDepthPass = BABYLON.Engine.REPLACE; + this._isStencilTestDirty = true; + this._isStencilMaskDirty = true; + this._isStencilFuncDirty = true; + this._isStencilOpDirty = true; + }; + _StencilState.prototype.apply = function (gl) { + if (!this.isDirty) { + return; + } + // Stencil test + if (this._isStencilTestDirty) { + if (this.stencilTest) { + gl.enable(gl.STENCIL_TEST); + } + else { + gl.disable(gl.STENCIL_TEST); + } + this._isStencilTestDirty = false; + } + // Stencil mask + if (this._isStencilMaskDirty) { + gl.stencilMask(this.stencilMask); + this._isStencilMaskDirty = false; + } + // Stencil func + if (this._isStencilFuncDirty) { + gl.stencilFunc(this.stencilFunc, this.stencilFuncRef, this.stencilFuncMask); + this._isStencilFuncDirty = false; + } + // Stencil op + if (this._isStencilOpDirty) { + gl.stencilOp(this.stencilOpStencilFail, this.stencilOpDepthFail, this.stencilOpStencilDepthPass); + this._isStencilOpDirty = false; + } + }; + return _StencilState; + }()); + BABYLON._StencilState = _StencilState; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.stencilState.js.map + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var BABYLON; +(function (BABYLON) { + /** + * Keeps track of all the buffer info used in engine. + */ + var BufferPointer = /** @class */ (function () { + function BufferPointer() { + } + return BufferPointer; + }()); + /** + * Interface for attribute information associated with buffer instanciation + */ + var InstancingAttributeInfo = /** @class */ (function () { + function InstancingAttributeInfo() { + } + return InstancingAttributeInfo; + }()); + BABYLON.InstancingAttributeInfo = InstancingAttributeInfo; + /** + * Define options used to create a render target texture + */ + var RenderTargetCreationOptions = /** @class */ (function () { + function RenderTargetCreationOptions() { + } + return RenderTargetCreationOptions; + }()); + BABYLON.RenderTargetCreationOptions = RenderTargetCreationOptions; + /** + * Define options used to create a depth texture + */ + var DepthTextureCreationOptions = /** @class */ (function () { + function DepthTextureCreationOptions() { + } + return DepthTextureCreationOptions; + }()); + BABYLON.DepthTextureCreationOptions = DepthTextureCreationOptions; + /** + * Class used to describe the capabilities of the engine relatively to the current browser + */ + var EngineCapabilities = /** @class */ (function () { + function EngineCapabilities() { + } + return EngineCapabilities; + }()); + BABYLON.EngineCapabilities = EngineCapabilities; + /** + * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio + */ + var Engine = /** @class */ (function () { + /** + * Creates a new engine + * @param canvasOrContext defines the canvas or WebGL context to use for rendering. If you provide a WebGL context, Babylon.js will not hook events on the canvas (like pointers, keyboards, etc...) so no event observables will be available. This is mostly used when Babylon.js is used as a plugin on a system which alreay used the WebGL context + * @param antialias defines enable antialiasing (default: false) + * @param options defines further options to be sent to the getContext() function + * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false) + */ + function Engine(canvasOrContext, antialias, options, adaptToDeviceRatio) { + if (adaptToDeviceRatio === void 0) { adaptToDeviceRatio = false; } + var _this = this; + // Public members + /** + * Gets or sets a boolean that indicates if textures must be forced to power of 2 size even if not required + */ + this.forcePOTTextures = false; + /** + * Gets a boolean indicating if the engine is currently rendering in fullscreen mode + */ + this.isFullscreen = false; + /** + * Gets a boolean indicating if the pointer is currently locked + */ + this.isPointerLock = false; + /** + * Gets or sets a boolean indicating if back faces must be culled (true by default) + */ + this.cullBackFaces = true; + /** + * Gets or sets a boolean indicating if the engine must keep rendering even if the window is not in foregroun + */ + this.renderEvenInBackground = true; + /** + * Gets or sets a boolean indicating that cache can be kept between frames + */ + this.preventCacheWipeBetweenFrames = false; + /** + * Gets or sets a boolean to enable/disable IndexedDB support and avoid XHR on .manifest + **/ + this.enableOfflineSupport = false; + /** + * Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (Babylon.js will always consider the database is up to date) + **/ + this.disableManifestCheck = false; + /** + * Gets the list of created scenes + */ + this.scenes = new Array(); + /** + * Gets the list of created postprocesses + */ + this.postProcesses = new Array(); + /** Gets or sets a boolean indicating if the engine should validate programs after compilation */ + this.validateShaderPrograms = false; + // Observables + /** + * Observable event triggered each time the rendering canvas is resized + */ + this.onResizeObservable = new BABYLON.Observable(); + /** + * Observable event triggered each time the canvas loses focus + */ + this.onCanvasBlurObservable = new BABYLON.Observable(); + /** + * Observable event triggered each time the canvas gains focus + */ + this.onCanvasFocusObservable = new BABYLON.Observable(); + /** + * Observable event triggered each time the canvas receives pointerout event + */ + this.onCanvasPointerOutObservable = new BABYLON.Observable(); + /** + * Observable event triggered before each texture is initialized + */ + this.onBeforeTextureInitObservable = new BABYLON.Observable(); + //WebVR + this._vrDisplay = undefined; + this._vrSupported = false; + this._vrExclusivePointerMode = false; + // Uniform buffers list + /** + * Gets or sets a boolean indicating that uniform buffers must be disabled even if they are supported + */ + this.disableUniformBuffers = false; + /** @hidden */ + this._uniformBuffers = new Array(); + // Observables + /** + * Observable raised when the engine begins a new frame + */ + this.onBeginFrameObservable = new BABYLON.Observable(); + /** + * Observable raised when the engine ends the current frame + */ + this.onEndFrameObservable = new BABYLON.Observable(); + /** + * Observable raised when the engine is about to compile a shader + */ + this.onBeforeShaderCompilationObservable = new BABYLON.Observable(); + /** + * Observable raised when the engine has jsut compiled a shader + */ + this.onAfterShaderCompilationObservable = new BABYLON.Observable(); + this._windowIsBackground = false; + this._webGLVersion = 1.0; + /** @hidden */ + this._badOS = false; + /** @hidden */ + this._badDesktopOS = false; + /** + * Gets or sets a value indicating if we want to disable texture binding optmization. + * This could be required on some buggy drivers which wants to have textures bound in a progressive order. + * By default Babylon.js will try to let textures bound where they are and only update the samplers to point where the texture is + */ + this.disableTextureBindingOptimization = false; + /** + * Observable signaled when VR display mode changes + */ + this.onVRDisplayChangedObservable = new BABYLON.Observable(); + /** + * Observable signaled when VR request present is complete + */ + this.onVRRequestPresentComplete = new BABYLON.Observable(); + /** + * Observable signaled when VR request present starts + */ + this.onVRRequestPresentStart = new BABYLON.Observable(); + this._colorWrite = true; + /** @hidden */ + this._drawCalls = new BABYLON.PerfCounter(); + /** @hidden */ + this._textureCollisions = new BABYLON.PerfCounter(); + this._renderingQueueLaunched = false; + this._activeRenderLoops = new Array(); + // Deterministic lockstepMaxSteps + this._deterministicLockstep = false; + this._lockstepMaxSteps = 4; + // Lost context + /** + * Observable signaled when a context lost event is raised + */ + this.onContextLostObservable = new BABYLON.Observable(); + /** + * Observable signaled when a context restored event is raised + */ + this.onContextRestoredObservable = new BABYLON.Observable(); + this._contextWasLost = false; + this._doNotHandleContextLost = false; + // FPS + this._performanceMonitor = new BABYLON.PerformanceMonitor(); + this._fps = 60; + this._deltaTime = 0; + /** + * Turn this value on if you want to pause FPS computation when in background + */ + this.disablePerformanceMonitorInBackground = false; + // States + /** @hidden */ + this._depthCullingState = new BABYLON._DepthCullingState(); + /** @hidden */ + this._stencilState = new BABYLON._StencilState(); + /** @hidden */ + this._alphaState = new BABYLON._AlphaState(); + /** @hidden */ + this._alphaMode = Engine.ALPHA_DISABLE; + // Cache + this._internalTexturesCache = new Array(); + /** @hidden */ + this._activeChannel = 0; + this._currentTextureChannel = -1; + /** @hidden */ + this._boundTexturesCache = {}; + this._compiledEffects = {}; + this._vertexAttribArraysEnabled = []; + this._uintIndicesCurrentlySet = false; + this._currentBoundBuffer = new Array(); + /** @hidden */ + this._currentFramebuffer = null; + this._currentBufferPointers = new Array(); + this._currentInstanceLocations = new Array(); + this._currentInstanceBuffers = new Array(); + this._firstBoundInternalTextureTracker = new BABYLON.DummyInternalTextureTracker(); + this._lastBoundInternalTextureTracker = new BABYLON.DummyInternalTextureTracker(); + this._vaoRecordInProgress = false; + this._mustWipeVertexAttributes = false; + this._nextFreeTextureSlots = new Array(); + this._maxSimultaneousTextures = 0; + this._activeRequests = new Array(); + // Hardware supported Compressed Textures + this._texturesSupported = new Array(); + /** + * Defines whether the engine has been created with the premultipliedAlpha option on or not. + */ + this.premultipliedAlpha = true; + this._viewportCached = new BABYLON.Vector4(0, 0, 0, 0); + this._onVRFullScreenTriggered = function () { + if (_this._vrDisplay && _this._vrDisplay.isPresenting) { + //get the old size before we change + _this._oldSize = new BABYLON.Size(_this.getRenderWidth(), _this.getRenderHeight()); + _this._oldHardwareScaleFactor = _this.getHardwareScalingLevel(); + //get the width and height, change the render size + var leftEye = _this._vrDisplay.getEyeParameters('left'); + _this.setHardwareScalingLevel(1); + _this.setSize(leftEye.renderWidth * 2, leftEye.renderHeight); + } + else { + _this.setHardwareScalingLevel(_this._oldHardwareScaleFactor); + _this.setSize(_this._oldSize.width, _this._oldSize.height); + } + }; + this._unpackFlipYCached = null; + /** + * In case you are sharing the context with other applications, it might + * be interested to not cache the unpack flip y state to ensure a consistent + * value would be set. + */ + this.enableUnpackFlipYCached = true; + this._boundUniforms = {}; + // Register promises + BABYLON.PromisePolyfill.Apply(); + var canvas = null; + Engine.Instances.push(this); + if (!canvasOrContext) { + return; + } + options = options || {}; + if (canvasOrContext.getContext) { + canvas = canvasOrContext; + this._renderingCanvas = canvas; + if (antialias != null) { + options.antialias = antialias; + } + if (options.deterministicLockstep === undefined) { + options.deterministicLockstep = false; + } + if (options.lockstepMaxSteps === undefined) { + options.lockstepMaxSteps = 4; + } + if (options.preserveDrawingBuffer === undefined) { + options.preserveDrawingBuffer = false; + } + if (options.audioEngine === undefined) { + options.audioEngine = true; + } + if (options.stencil === undefined) { + options.stencil = true; + } + if (options.premultipliedAlpha === false) { + this.premultipliedAlpha = false; + } + this._deterministicLockstep = options.deterministicLockstep; + this._lockstepMaxSteps = options.lockstepMaxSteps; + this._doNotHandleContextLost = options.doNotHandleContextLost ? true : false; + // Exceptions + if (navigator && navigator.userAgent) { + var ua = navigator.userAgent; + for (var _i = 0, _a = Engine.ExceptionList; _i < _a.length; _i++) { + var exception = _a[_i]; + var key = exception.key; + var targets = exception.targets; + if (ua.indexOf(key) > -1) { + if (exception.capture && exception.captureConstraint) { + var capture = exception.capture; + var constraint = exception.captureConstraint; + var regex = new RegExp(capture); + var matches = regex.exec(ua); + if (matches && matches.length > 0) { + var capturedValue = parseInt(matches[matches.length - 1]); + if (capturedValue >= constraint) { + continue; + } + } + } + for (var _b = 0, targets_1 = targets; _b < targets_1.length; _b++) { + var target = targets_1[_b]; + switch (target) { + case "uniformBuffer": + this.disableUniformBuffers = true; + break; + case "textureBindingOptimization": + this.disableTextureBindingOptimization = true; + break; + } + } + } + } + } + // GL + if (!options.disableWebGL2Support) { + try { + this._gl = (canvas.getContext("webgl2", options) || canvas.getContext("experimental-webgl2", options)); + if (this._gl) { + this._webGLVersion = 2.0; + // Prevent weird browsers to lie :-) + if (!this._gl.deleteQuery) { + this._webGLVersion = 1.0; + } + } + } + catch (e) { + // Do nothing + } + } + if (!this._gl) { + if (!canvas) { + throw new Error("The provided canvas is null or undefined."); + } + try { + this._gl = (canvas.getContext("webgl", options) || canvas.getContext("experimental-webgl", options)); + } + catch (e) { + throw new Error("WebGL not supported"); + } + } + if (!this._gl) { + throw new Error("WebGL not supported"); + } + this._onCanvasFocus = function () { + _this.onCanvasFocusObservable.notifyObservers(_this); + }; + this._onCanvasBlur = function () { + _this.onCanvasBlurObservable.notifyObservers(_this); + }; + canvas.addEventListener("focus", this._onCanvasFocus); + canvas.addEventListener("blur", this._onCanvasBlur); + this._onBlur = function () { + if (_this.disablePerformanceMonitorInBackground) { + _this._performanceMonitor.disable(); + } + _this._windowIsBackground = true; + }; + this._onFocus = function () { + if (_this.disablePerformanceMonitorInBackground) { + _this._performanceMonitor.enable(); + } + _this._windowIsBackground = false; + }; + this._onCanvasPointerOut = function (ev) { + _this.onCanvasPointerOutObservable.notifyObservers(ev); + }; + window.addEventListener("blur", this._onBlur); + window.addEventListener("focus", this._onFocus); + canvas.addEventListener("pointerout", this._onCanvasPointerOut); + // Context lost + if (!this._doNotHandleContextLost) { + this._onContextLost = function (evt) { + evt.preventDefault(); + _this._contextWasLost = true; + BABYLON.Tools.Warn("WebGL context lost."); + _this.onContextLostObservable.notifyObservers(_this); + }; + this._onContextRestored = function (evt) { + // Adding a timeout to avoid race condition at browser level + setTimeout(function () { + // Rebuild gl context + _this._initGLContext(); + // Rebuild effects + _this._rebuildEffects(); + // Rebuild textures + _this._rebuildInternalTextures(); + // Rebuild buffers + _this._rebuildBuffers(); + // Cache + _this.wipeCaches(true); + BABYLON.Tools.Warn("WebGL context successfully restored."); + _this.onContextRestoredObservable.notifyObservers(_this); + _this._contextWasLost = false; + }, 0); + }; + canvas.addEventListener("webglcontextlost", this._onContextLost, false); + canvas.addEventListener("webglcontextrestored", this._onContextRestored, false); + } + } + else { + this._gl = canvasOrContext; + this._renderingCanvas = this._gl.canvas; + if (this._gl.renderbufferStorageMultisample) { + this._webGLVersion = 2.0; + } + var attributes = this._gl.getContextAttributes(); + if (attributes) { + options.stencil = attributes.stencil; + } + } + // Viewport + var limitDeviceRatio = options.limitDeviceRatio || window.devicePixelRatio || 1.0; + this._hardwareScalingLevel = adaptToDeviceRatio ? 1.0 / Math.min(limitDeviceRatio, window.devicePixelRatio || 1.0) : 1.0; + this.resize(); + this._isStencilEnable = options.stencil ? true : false; + this._initGLContext(); + if (canvas) { + // Fullscreen + this._onFullscreenChange = function () { + if (document.fullscreen !== undefined) { + _this.isFullscreen = document.fullscreen; + } + else if (document.mozFullScreen !== undefined) { + _this.isFullscreen = document.mozFullScreen; + } + else if (document.webkitIsFullScreen !== undefined) { + _this.isFullscreen = document.webkitIsFullScreen; + } + else if (document.msIsFullScreen !== undefined) { + _this.isFullscreen = document.msIsFullScreen; + } + // Pointer lock + if (_this.isFullscreen && _this._pointerLockRequested && canvas) { + canvas.requestPointerLock = canvas.requestPointerLock || + canvas.msRequestPointerLock || + canvas.mozRequestPointerLock || + canvas.webkitRequestPointerLock; + if (canvas.requestPointerLock) { + canvas.requestPointerLock(); + } + } + }; + document.addEventListener("fullscreenchange", this._onFullscreenChange, false); + document.addEventListener("mozfullscreenchange", this._onFullscreenChange, false); + document.addEventListener("webkitfullscreenchange", this._onFullscreenChange, false); + document.addEventListener("msfullscreenchange", this._onFullscreenChange, false); + // Pointer lock + this._onPointerLockChange = function () { + _this.isPointerLock = (document.mozPointerLockElement === canvas || + document.webkitPointerLockElement === canvas || + document.msPointerLockElement === canvas || + document.pointerLockElement === canvas); + }; + document.addEventListener("pointerlockchange", this._onPointerLockChange, false); + document.addEventListener("mspointerlockchange", this._onPointerLockChange, false); + document.addEventListener("mozpointerlockchange", this._onPointerLockChange, false); + document.addEventListener("webkitpointerlockchange", this._onPointerLockChange, false); + this._onVRDisplayPointerRestricted = function () { + if (canvas) { + canvas.requestPointerLock(); + } + }; + this._onVRDisplayPointerUnrestricted = function () { + document.exitPointerLock(); + }; + window.addEventListener('vrdisplaypointerrestricted', this._onVRDisplayPointerRestricted, false); + window.addEventListener('vrdisplaypointerunrestricted', this._onVRDisplayPointerUnrestricted, false); + } + // Create Audio Engine if needed. + if (!Engine.audioEngine && options.audioEngine && Engine.AudioEngineFactory) { + Engine.audioEngine = Engine.AudioEngineFactory(this.getRenderingCanvas()); + } + // Prepare buffer pointers + for (var i = 0; i < this._caps.maxVertexAttribs; i++) { + this._currentBufferPointers[i] = new BufferPointer(); + } + this._linkTrackers(this._firstBoundInternalTextureTracker, this._lastBoundInternalTextureTracker); + // Load WebVR Devices + if (options.autoEnableWebVR) { + this.initWebVR(); + } + // Detect if we are running on a faulty buggy OS. + this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent); + // Detect if we are running on a faulty buggy desktop OS. + this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); + console.log("Babylon.js engine (v" + Engine.Version + ") launched"); + this.enableOfflineSupport = (BABYLON.Database !== undefined); + } + Object.defineProperty(Engine, "LastCreatedEngine", { + /** + * Gets the latest created engine + */ + get: function () { + if (Engine.Instances.length === 0) { + return null; + } + return Engine.Instances[Engine.Instances.length - 1]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine, "LastCreatedScene", { + /** + * Gets the latest created scene + */ + get: function () { + var lastCreatedEngine = Engine.LastCreatedEngine; + if (!lastCreatedEngine) { + return null; + } + if (lastCreatedEngine.scenes.length === 0) { + return null; + } + return lastCreatedEngine.scenes[lastCreatedEngine.scenes.length - 1]; + }, + enumerable: true, + configurable: true + }); + /** + * Will flag all materials in all scenes in all engines as dirty to trigger new shader compilation + * @param flag defines which part of the materials must be marked as dirty + * @param predicate defines a predicate used to filter which materials should be affected + */ + Engine.MarkAllMaterialsAsDirty = function (flag, predicate) { + for (var engineIndex = 0; engineIndex < Engine.Instances.length; engineIndex++) { + var engine = Engine.Instances[engineIndex]; + for (var sceneIndex = 0; sceneIndex < engine.scenes.length; sceneIndex++) { + engine.scenes[sceneIndex].markAllMaterialsAsDirty(flag, predicate); + } + } + }; + Object.defineProperty(Engine, "Version", { + /** + * Returns the current version of the framework + */ + get: function () { + return "3.3.0"; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "isInVRExclusivePointerMode", { + /** + * Gets a boolean indicating that the engine is currently in VR exclusive mode for the pointers + * @see https://docs.microsoft.com/en-us/microsoft-edge/webvr/essentials#mouse-input + */ + get: function () { + return this._vrExclusivePointerMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "supportsUniformBuffers", { + /** + * Gets a boolean indicating that the engine supports uniform buffers + * @see http://doc.babylonjs.com/features/webgl2#uniform-buffer-objets + */ + get: function () { + return this.webGLVersion > 1 && !this.disableUniformBuffers; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "needPOTTextures", { + /** + * Gets a boolean indicating that only power of 2 textures are supported + * Please note that you can still use non power of 2 textures but in this case the engine will forcefully convert them + */ + get: function () { + return this._webGLVersion < 2 || this.forcePOTTextures; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "doNotHandleContextLost", { + /** + * Gets or sets a boolean indicating if resources should be retained to be able to handle context lost events + * @see http://doc.babylonjs.com/how_to/optimizing_your_scene#handling-webgl-context-lost + */ + get: function () { + return this._doNotHandleContextLost; + }, + set: function (value) { + this._doNotHandleContextLost = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "performanceMonitor", { + /** + * Gets the performance monitor attached to this engine + * @see http://doc.babylonjs.com/how_to/optimizing_your_scene#engineinstrumentation + */ + get: function () { + return this._performanceMonitor; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "texturesSupported", { + /** + * Gets the list of texture formats supported + */ + get: function () { + return this._texturesSupported; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "textureFormatInUse", { + /** + * Gets the list of texture formats in use + */ + get: function () { + return this._textureFormatInUse; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "currentViewport", { + /** + * Gets the current viewport + */ + get: function () { + return this._cachedViewport; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "emptyTexture", { + /** + * Gets the default empty texture + */ + get: function () { + if (!this._emptyTexture) { + this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE); + } + return this._emptyTexture; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "emptyTexture3D", { + /** + * Gets the default empty 3D texture + */ + get: function () { + if (!this._emptyTexture3D) { + this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE); + } + return this._emptyTexture3D; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "emptyCubeTexture", { + /** + * Gets the default empty cube texture + */ + get: function () { + if (!this._emptyCubeTexture) { + var faceData = new Uint8Array(4); + var cubeData = [faceData, faceData, faceData, faceData, faceData, faceData]; + this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE); + } + return this._emptyCubeTexture; + }, + enumerable: true, + configurable: true + }); + Engine.prototype._rebuildInternalTextures = function () { + var currentState = this._internalTexturesCache.slice(); // Do a copy because the rebuild will add proxies + for (var _i = 0, currentState_1 = currentState; _i < currentState_1.length; _i++) { + var internalTexture = currentState_1[_i]; + internalTexture._rebuild(); + } + }; + Engine.prototype._rebuildEffects = function () { + for (var key in this._compiledEffects) { + var effect = this._compiledEffects[key]; + effect._prepareEffect(); + } + BABYLON.Effect.ResetCache(); + }; + Engine.prototype._rebuildBuffers = function () { + // Index / Vertex + for (var _i = 0, _a = this.scenes; _i < _a.length; _i++) { + var scene = _a[_i]; + scene.resetCachedMaterial(); + scene._rebuildGeometries(); + scene._rebuildTextures(); + } + // Uniforms + for (var _b = 0, _c = this._uniformBuffers; _b < _c.length; _b++) { + var uniformBuffer = _c[_b]; + uniformBuffer._rebuild(); + } + }; + Engine.prototype._initGLContext = function () { + // Caps + this._caps = new EngineCapabilities(); + this._caps.maxTexturesImageUnits = this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS); + this._caps.maxCombinedTexturesImageUnits = this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); + this._caps.maxVertexTextureImageUnits = this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS); + this._caps.maxTextureSize = this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE); + this._caps.maxCubemapTextureSize = this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE); + this._caps.maxRenderTextureSize = this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE); + this._caps.maxVertexAttribs = this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS); + this._caps.maxVaryingVectors = this._gl.getParameter(this._gl.MAX_VARYING_VECTORS); + this._caps.maxFragmentUniformVectors = this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS); + this._caps.maxVertexUniformVectors = this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS); + // Infos + this._glVersion = this._gl.getParameter(this._gl.VERSION); + var rendererInfo = this._gl.getExtension("WEBGL_debug_renderer_info"); + if (rendererInfo != null) { + this._glRenderer = this._gl.getParameter(rendererInfo.UNMASKED_RENDERER_WEBGL); + this._glVendor = this._gl.getParameter(rendererInfo.UNMASKED_VENDOR_WEBGL); + } + if (!this._glVendor) { + this._glVendor = "Unknown vendor"; + } + if (!this._glRenderer) { + this._glRenderer = "Unknown renderer"; + } + // Constants + this._gl.HALF_FLOAT_OES = 0x8D61; // Half floating-point type (16-bit). + if (this._gl.RGBA16F !== 0x881A) { + this._gl.RGBA16F = 0x881A; // RGBA 16-bit floating-point color-renderable internal sized format. + } + if (this._gl.RGBA32F !== 0x8814) { + this._gl.RGBA32F = 0x8814; // RGBA 32-bit floating-point color-renderable internal sized format. + } + if (this._gl.DEPTH24_STENCIL8 !== 35056) { + this._gl.DEPTH24_STENCIL8 = 35056; + } + // Extensions + this._caps.standardDerivatives = this._webGLVersion > 1 || (this._gl.getExtension('OES_standard_derivatives') !== null); + this._caps.astc = this._gl.getExtension('WEBGL_compressed_texture_astc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_astc'); + this._caps.s3tc = this._gl.getExtension('WEBGL_compressed_texture_s3tc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc'); + this._caps.pvrtc = this._gl.getExtension('WEBGL_compressed_texture_pvrtc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'); + this._caps.etc1 = this._gl.getExtension('WEBGL_compressed_texture_etc1') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc1'); + this._caps.etc2 = this._gl.getExtension('WEBGL_compressed_texture_etc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc') || + this._gl.getExtension('WEBGL_compressed_texture_es3_0'); // also a requirement of OpenGL ES 3 + this._caps.textureAnisotropicFilterExtension = this._gl.getExtension('EXT_texture_filter_anisotropic') || this._gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic') || this._gl.getExtension('MOZ_EXT_texture_filter_anisotropic'); + this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0; + this._caps.uintIndices = this._webGLVersion > 1 || this._gl.getExtension('OES_element_index_uint') !== null; + this._caps.fragmentDepthSupported = this._webGLVersion > 1 || this._gl.getExtension('EXT_frag_depth') !== null; + this._caps.highPrecisionShaderSupported = true; + this._caps.timerQuery = this._gl.getExtension('EXT_disjoint_timer_query_webgl2') || this._gl.getExtension("EXT_disjoint_timer_query"); + if (this._caps.timerQuery) { + if (this._webGLVersion === 1) { + this._gl.getQuery = this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery); + } + this._caps.canUseTimestampForTimerQuery = this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT, this._caps.timerQuery.QUERY_COUNTER_BITS_EXT) > 0; + } + // Checks if some of the format renders first to allow the use of webgl inspector. + this._caps.colorBufferFloat = this._webGLVersion > 1 && this._gl.getExtension('EXT_color_buffer_float'); + this._caps.textureFloat = (this._webGLVersion > 1 || this._gl.getExtension('OES_texture_float')) ? true : false; + this._caps.textureFloatLinearFiltering = this._caps.textureFloat && this._gl.getExtension('OES_texture_float_linear') ? true : false; + this._caps.textureFloatRender = this._caps.textureFloat && this._canRenderToFloatFramebuffer() ? true : false; + this._caps.textureHalfFloat = (this._webGLVersion > 1 || this._gl.getExtension('OES_texture_half_float')) ? true : false; + this._caps.textureHalfFloatLinearFiltering = (this._webGLVersion > 1 || (this._caps.textureHalfFloat && this._gl.getExtension('OES_texture_half_float_linear'))) ? true : false; + if (this._webGLVersion > 1) { + this._gl.HALF_FLOAT_OES = 0x140B; + } + this._caps.textureHalfFloatRender = this._caps.textureHalfFloat && this._canRenderToHalfFloatFramebuffer(); + this._caps.textureLOD = (this._webGLVersion > 1 || this._gl.getExtension('EXT_shader_texture_lod')) ? true : false; + // Draw buffers + if (this._webGLVersion > 1) { + this._caps.drawBuffersExtension = true; + } + else { + var drawBuffersExtension = this._gl.getExtension('WEBGL_draw_buffers'); + if (drawBuffersExtension !== null) { + this._caps.drawBuffersExtension = true; + this._gl.drawBuffers = drawBuffersExtension.drawBuffersWEBGL.bind(drawBuffersExtension); + this._gl.DRAW_FRAMEBUFFER = this._gl.FRAMEBUFFER; + for (var i = 0; i < 16; i++) { + this._gl["COLOR_ATTACHMENT" + i + "_WEBGL"] = drawBuffersExtension["COLOR_ATTACHMENT" + i + "_WEBGL"]; + } + } + else { + this._caps.drawBuffersExtension = false; + } + } + // Depth Texture + if (this._webGLVersion > 1) { + this._caps.depthTextureExtension = true; + } + else { + var depthTextureExtension = this._gl.getExtension('WEBGL_depth_texture'); + if (depthTextureExtension != null) { + this._caps.depthTextureExtension = true; + this._gl.UNSIGNED_INT_24_8 = depthTextureExtension.UNSIGNED_INT_24_8_WEBGL; + } + } + // Vertex array object + if (this._webGLVersion > 1) { + this._caps.vertexArrayObject = true; + } + else { + var vertexArrayObjectExtension = this._gl.getExtension('OES_vertex_array_object'); + if (vertexArrayObjectExtension != null) { + this._caps.vertexArrayObject = true; + this._gl.createVertexArray = vertexArrayObjectExtension.createVertexArrayOES.bind(vertexArrayObjectExtension); + this._gl.bindVertexArray = vertexArrayObjectExtension.bindVertexArrayOES.bind(vertexArrayObjectExtension); + this._gl.deleteVertexArray = vertexArrayObjectExtension.deleteVertexArrayOES.bind(vertexArrayObjectExtension); + } + else { + this._caps.vertexArrayObject = false; + } + } + // Instances count + if (this._webGLVersion > 1) { + this._caps.instancedArrays = true; + } + else { + var instanceExtension = this._gl.getExtension('ANGLE_instanced_arrays'); + if (instanceExtension != null) { + this._caps.instancedArrays = true; + this._gl.drawArraysInstanced = instanceExtension.drawArraysInstancedANGLE.bind(instanceExtension); + this._gl.drawElementsInstanced = instanceExtension.drawElementsInstancedANGLE.bind(instanceExtension); + this._gl.vertexAttribDivisor = instanceExtension.vertexAttribDivisorANGLE.bind(instanceExtension); + } + else { + this._caps.instancedArrays = false; + } + } + // Intelligently add supported compressed formats in order to check for. + // Check for ASTC support first as it is most powerful and to be very cross platform. + // Next PVRTC & DXT, which are probably superior to ETC1/2. + // Likely no hardware which supports both PVR & DXT, so order matters little. + // ETC2 is newer and handles ETC1 (no alpha capability), so check for first. + if (this._caps.astc) { + this.texturesSupported.push('-astc.ktx'); + } + if (this._caps.s3tc) { + this.texturesSupported.push('-dxt.ktx'); + } + if (this._caps.pvrtc) { + this.texturesSupported.push('-pvrtc.ktx'); + } + if (this._caps.etc2) { + this.texturesSupported.push('-etc2.ktx'); + } + if (this._caps.etc1) { + this.texturesSupported.push('-etc1.ktx'); + } + if (this._gl.getShaderPrecisionFormat) { + var highp = this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT); + if (highp) { + this._caps.highPrecisionShaderSupported = highp.precision !== 0; + } + } + // Depth buffer + this.setDepthBuffer(true); + this.setDepthFunctionToLessOrEqual(); + this.setDepthWrite(true); + // Texture maps + this._maxSimultaneousTextures = this._caps.maxCombinedTexturesImageUnits; + for (var slot = 0; slot < this._maxSimultaneousTextures; slot++) { + this._nextFreeTextureSlots.push(slot); + } + }; + Object.defineProperty(Engine.prototype, "webGLVersion", { + /** + * Gets version of the current webGL context + */ + get: function () { + return this._webGLVersion; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "isStencilEnable", { + /** + * Returns true if the stencil buffer has been enabled through the creation option of the context. + */ + get: function () { + return this._isStencilEnable; + }, + enumerable: true, + configurable: true + }); + Engine.prototype._prepareWorkingCanvas = function () { + if (this._workingCanvas) { + return; + } + this._workingCanvas = document.createElement("canvas"); + var context = this._workingCanvas.getContext("2d"); + if (context) { + this._workingContext = context; + } + }; + /** + * Reset the texture cache to empty state + */ + Engine.prototype.resetTextureCache = function () { + for (var key in this._boundTexturesCache) { + if (!this._boundTexturesCache.hasOwnProperty(key)) { + continue; + } + var boundTexture = this._boundTexturesCache[key]; + if (boundTexture) { + this._removeDesignatedSlot(boundTexture); + } + this._boundTexturesCache[key] = null; + } + if (!this.disableTextureBindingOptimization) { + this._nextFreeTextureSlots = []; + for (var slot = 0; slot < this._maxSimultaneousTextures; slot++) { + this._nextFreeTextureSlots.push(slot); + } + } + this._currentTextureChannel = -1; + }; + /** + * Gets a boolean indicating that the engine is running in deterministic lock step mode + * @see http://doc.babylonjs.com/babylon101/animations#deterministic-lockstep + * @returns true if engine is in deterministic lock step mode + */ + Engine.prototype.isDeterministicLockStep = function () { + return this._deterministicLockstep; + }; + /** + * Gets the max steps when engine is running in deterministic lock step + * @see http://doc.babylonjs.com/babylon101/animations#deterministic-lockstep + * @returns the max steps + */ + Engine.prototype.getLockstepMaxSteps = function () { + return this._lockstepMaxSteps; + }; + /** + * Gets an object containing information about the current webGL context + * @returns an object containing the vender, the renderer and the version of the current webGL context + */ + Engine.prototype.getGlInfo = function () { + return { + vendor: this._glVendor, + renderer: this._glRenderer, + version: this._glVersion + }; + }; + /** + * Gets current aspect ratio + * @param camera defines the camera to use to get the aspect ratio + * @param useScreen defines if screen size must be used (or the current render target if any) + * @returns a number defining the aspect ratio + */ + Engine.prototype.getAspectRatio = function (camera, useScreen) { + if (useScreen === void 0) { useScreen = false; } + var viewport = camera.viewport; + return (this.getRenderWidth(useScreen) * viewport.width) / (this.getRenderHeight(useScreen) * viewport.height); + }; + /** + * Gets current screen aspect ratio + * @returns a number defining the aspect ratio + */ + Engine.prototype.getScreenAspectRatio = function () { + return (this.getRenderWidth(true)) / (this.getRenderHeight(true)); + }; + /** + * Gets the current render width + * @param useScreen defines if screen size must be used (or the current render target if any) + * @returns a number defining the current render width + */ + Engine.prototype.getRenderWidth = function (useScreen) { + if (useScreen === void 0) { useScreen = false; } + if (!useScreen && this._currentRenderTarget) { + return this._currentRenderTarget.width; + } + return this._gl.drawingBufferWidth; + }; + /** + * Gets the current render height + * @param useScreen defines if screen size must be used (or the current render target if any) + * @returns a number defining the current render height + */ + Engine.prototype.getRenderHeight = function (useScreen) { + if (useScreen === void 0) { useScreen = false; } + if (!useScreen && this._currentRenderTarget) { + return this._currentRenderTarget.height; + } + return this._gl.drawingBufferHeight; + }; + /** + * Gets the HTML canvas attached with the current webGL context + * @returns a HTML canvas + */ + Engine.prototype.getRenderingCanvas = function () { + return this._renderingCanvas; + }; + /** + * Gets the client rect of the HTML canvas attached with the current webGL context + * @returns a client rectanglee + */ + Engine.prototype.getRenderingCanvasClientRect = function () { + if (!this._renderingCanvas) { + return null; + } + return this._renderingCanvas.getBoundingClientRect(); + }; + /** + * Defines the hardware scaling level. + * By default the hardware scaling level is computed from the window device ratio. + * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas. + * @param level defines the level to use + */ + Engine.prototype.setHardwareScalingLevel = function (level) { + this._hardwareScalingLevel = level; + this.resize(); + }; + /** + * Gets the current hardware scaling level. + * By default the hardware scaling level is computed from the window device ratio. + * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas. + * @returns a number indicating the current hardware scaling level + */ + Engine.prototype.getHardwareScalingLevel = function () { + return this._hardwareScalingLevel; + }; + /** + * Gets the list of loaded textures + * @returns an array containing all loaded textures + */ + Engine.prototype.getLoadedTexturesCache = function () { + return this._internalTexturesCache; + }; + /** + * Gets the object containing all engine capabilities + * @returns the EngineCapabilities object + */ + Engine.prototype.getCaps = function () { + return this._caps; + }; + Object.defineProperty(Engine.prototype, "drawCalls", { + /** @hidden */ + get: function () { + BABYLON.Tools.Warn("drawCalls is deprecated. Please use SceneInstrumentation class"); + return 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "drawCallsPerfCounter", { + /** @hidden */ + get: function () { + BABYLON.Tools.Warn("drawCallsPerfCounter is deprecated. Please use SceneInstrumentation class"); + return null; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the current depth function + * @returns a number defining the depth function + */ + Engine.prototype.getDepthFunction = function () { + return this._depthCullingState.depthFunc; + }; + /** + * Sets the current depth function + * @param depthFunc defines the function to use + */ + Engine.prototype.setDepthFunction = function (depthFunc) { + this._depthCullingState.depthFunc = depthFunc; + }; + /** + * Sets the current depth function to GREATER + */ + Engine.prototype.setDepthFunctionToGreater = function () { + this._depthCullingState.depthFunc = this._gl.GREATER; + }; + /** + * Sets the current depth function to GEQUAL + */ + Engine.prototype.setDepthFunctionToGreaterOrEqual = function () { + this._depthCullingState.depthFunc = this._gl.GEQUAL; + }; + /** + * Sets the current depth function to LESS + */ + Engine.prototype.setDepthFunctionToLess = function () { + this._depthCullingState.depthFunc = this._gl.LESS; + }; + /** + * Sets the current depth function to LEQUAL + */ + Engine.prototype.setDepthFunctionToLessOrEqual = function () { + this._depthCullingState.depthFunc = this._gl.LEQUAL; + }; + /** + * Gets a boolean indicating if stencil buffer is enabled + * @returns the current stencil buffer state + */ + Engine.prototype.getStencilBuffer = function () { + return this._stencilState.stencilTest; + }; + /** + * Enable or disable the stencil buffer + * @param enable defines if the stencil buffer must be enabled or disabled + */ + Engine.prototype.setStencilBuffer = function (enable) { + this._stencilState.stencilTest = enable; + }; + /** + * Gets the current stencil mask + * @returns a number defining the new stencil mask to use + */ + Engine.prototype.getStencilMask = function () { + return this._stencilState.stencilMask; + }; + /** + * Sets the current stencil mask + * @param mask defines the new stencil mask to use + */ + Engine.prototype.setStencilMask = function (mask) { + this._stencilState.stencilMask = mask; + }; + /** + * Gets the current stencil function + * @returns a number defining the stencil function to use + */ + Engine.prototype.getStencilFunction = function () { + return this._stencilState.stencilFunc; + }; + /** + * Gets the current stencil reference value + * @returns a number defining the stencil reference value to use + */ + Engine.prototype.getStencilFunctionReference = function () { + return this._stencilState.stencilFuncRef; + }; + /** + * Gets the current stencil mask + * @returns a number defining the stencil mask to use + */ + Engine.prototype.getStencilFunctionMask = function () { + return this._stencilState.stencilFuncMask; + }; + /** + * Sets the current stencil function + * @param stencilFunc defines the new stencil function to use + */ + Engine.prototype.setStencilFunction = function (stencilFunc) { + this._stencilState.stencilFunc = stencilFunc; + }; + /** + * Sets the current stencil reference + * @param reference defines the new stencil reference to use + */ + Engine.prototype.setStencilFunctionReference = function (reference) { + this._stencilState.stencilFuncRef = reference; + }; + /** + * Sets the current stencil mask + * @param mask defines the new stencil mask to use + */ + Engine.prototype.setStencilFunctionMask = function (mask) { + this._stencilState.stencilFuncMask = mask; + }; + /** + * Gets the current stencil operation when stencil fails + * @returns a number defining stencil operation to use when stencil fails + */ + Engine.prototype.getStencilOperationFail = function () { + return this._stencilState.stencilOpStencilFail; + }; + /** + * Gets the current stencil operation when depth fails + * @returns a number defining stencil operation to use when depth fails + */ + Engine.prototype.getStencilOperationDepthFail = function () { + return this._stencilState.stencilOpDepthFail; + }; + /** + * Gets the current stencil operation when stencil passes + * @returns a number defining stencil operation to use when stencil passes + */ + Engine.prototype.getStencilOperationPass = function () { + return this._stencilState.stencilOpStencilDepthPass; + }; + /** + * Sets the stencil operation to use when stencil fails + * @param operation defines the stencil operation to use when stencil fails + */ + Engine.prototype.setStencilOperationFail = function (operation) { + this._stencilState.stencilOpStencilFail = operation; + }; + /** + * Sets the stencil operation to use when depth fails + * @param operation defines the stencil operation to use when depth fails + */ + Engine.prototype.setStencilOperationDepthFail = function (operation) { + this._stencilState.stencilOpDepthFail = operation; + }; + /** + * Sets the stencil operation to use when stencil passes + * @param operation defines the stencil operation to use when stencil passes + */ + Engine.prototype.setStencilOperationPass = function (operation) { + this._stencilState.stencilOpStencilDepthPass = operation; + }; + /** + * Sets a boolean indicating if the dithering state is enabled or disabled + * @param value defines the dithering state + */ + Engine.prototype.setDitheringState = function (value) { + if (value) { + this._gl.enable(this._gl.DITHER); + } + else { + this._gl.disable(this._gl.DITHER); + } + }; + /** + * Sets a boolean indicating if the rasterizer state is enabled or disabled + * @param value defines the rasterizer state + */ + Engine.prototype.setRasterizerState = function (value) { + if (value) { + this._gl.disable(this._gl.RASTERIZER_DISCARD); + } + else { + this._gl.enable(this._gl.RASTERIZER_DISCARD); + } + }; + /** + * stop executing a render loop function and remove it from the execution array + * @param renderFunction defines the function to be removed. If not provided all functions will be removed. + */ + Engine.prototype.stopRenderLoop = function (renderFunction) { + if (!renderFunction) { + this._activeRenderLoops = []; + return; + } + var index = this._activeRenderLoops.indexOf(renderFunction); + if (index >= 0) { + this._activeRenderLoops.splice(index, 1); + } + }; + /** @hidden */ + Engine.prototype._renderLoop = function () { + if (!this._contextWasLost) { + var shouldRender = true; + if (!this.renderEvenInBackground && this._windowIsBackground) { + shouldRender = false; + } + if (shouldRender) { + // Start new frame + this.beginFrame(); + for (var index = 0; index < this._activeRenderLoops.length; index++) { + var renderFunction = this._activeRenderLoops[index]; + renderFunction(); + } + // Present + this.endFrame(); + } + } + if (this._activeRenderLoops.length > 0) { + // Register new frame + var requester = null; + if (this._vrDisplay && this._vrDisplay.isPresenting) { + requester = this._vrDisplay; + } + this._frameHandler = BABYLON.Tools.QueueNewFrame(this._bindedRenderFunction, requester); + } + else { + this._renderingQueueLaunched = false; + } + }; + /** + * Register and execute a render loop. The engine can have more than one render function + * @param renderFunction defines the function to continuously execute + */ + Engine.prototype.runRenderLoop = function (renderFunction) { + if (this._activeRenderLoops.indexOf(renderFunction) !== -1) { + return; + } + this._activeRenderLoops.push(renderFunction); + if (!this._renderingQueueLaunched) { + this._renderingQueueLaunched = true; + this._bindedRenderFunction = this._renderLoop.bind(this); + this._frameHandler = BABYLON.Tools.QueueNewFrame(this._bindedRenderFunction); + } + }; + /** + * Toggle full screen mode + * @param requestPointerLock defines if a pointer lock should be requested from the user + */ + Engine.prototype.switchFullscreen = function (requestPointerLock) { + if (this.isFullscreen) { + BABYLON.Tools.ExitFullscreen(); + } + else { + this._pointerLockRequested = requestPointerLock; + if (this._renderingCanvas) { + BABYLON.Tools.RequestFullscreen(this._renderingCanvas); + } + } + }; + /** + * Clear the current render buffer or the current render target (if any is set up) + * @param color defines the color to use + * @param backBuffer defines if the back buffer must be cleared + * @param depth defines if the depth buffer must be cleared + * @param stencil defines if the stencil buffer must be cleared + */ + Engine.prototype.clear = function (color, backBuffer, depth, stencil) { + if (stencil === void 0) { stencil = false; } + this.applyStates(); + var mode = 0; + if (backBuffer && color) { + this._gl.clearColor(color.r, color.g, color.b, color.a !== undefined ? color.a : 1.0); + mode |= this._gl.COLOR_BUFFER_BIT; + } + if (depth) { + this._gl.clearDepth(1.0); + mode |= this._gl.DEPTH_BUFFER_BIT; + } + if (stencil) { + this._gl.clearStencil(0); + mode |= this._gl.STENCIL_BUFFER_BIT; + } + this._gl.clear(mode); + }; + /** + * Executes a scissor clear (ie. a clear on a specific portion of the screen) + * @param x defines the x-coordinate of the top left corner of the clear rectangle + * @param y defines the y-coordinate of the corner of the clear rectangle + * @param width defines the width of the clear rectangle + * @param height defines the height of the clear rectangle + * @param clearColor defines the clear color + */ + Engine.prototype.scissorClear = function (x, y, width, height, clearColor) { + var gl = this._gl; + // Save state + var curScissor = gl.getParameter(gl.SCISSOR_TEST); + var curScissorBox = gl.getParameter(gl.SCISSOR_BOX); + // Change state + gl.enable(gl.SCISSOR_TEST); + gl.scissor(x, y, width, height); + // Clear + this.clear(clearColor, true, true, true); + // Restore state + gl.scissor(curScissorBox[0], curScissorBox[1], curScissorBox[2], curScissorBox[3]); + if (curScissor === true) { + gl.enable(gl.SCISSOR_TEST); + } + else { + gl.disable(gl.SCISSOR_TEST); + } + }; + /** @hidden */ + Engine.prototype._viewport = function (x, y, width, height) { + if (x !== this._viewportCached.x || + y !== this._viewportCached.y || + width !== this._viewportCached.z || + height !== this._viewportCached.w) { + this._viewportCached.x = x; + this._viewportCached.y = y; + this._viewportCached.z = width; + this._viewportCached.w = height; + this._gl.viewport(x, y, width, height); + } + }; + /** + * Set the WebGL's viewport + * @param viewport defines the viewport element to be used + * @param requiredWidth defines the width required for rendering. If not provided the rendering canvas' width is used + * @param requiredHeight defines the height required for rendering. If not provided the rendering canvas' height is used + */ + Engine.prototype.setViewport = function (viewport, requiredWidth, requiredHeight) { + var width = requiredWidth || this.getRenderWidth(); + var height = requiredHeight || this.getRenderHeight(); + var x = viewport.x || 0; + var y = viewport.y || 0; + this._cachedViewport = viewport; + this._viewport(x * width, y * height, width * viewport.width, height * viewport.height); + }; + /** + * Directly set the WebGL Viewport + * @param x defines the x coordinate of the viewport (in screen space) + * @param y defines the y coordinate of the viewport (in screen space) + * @param width defines the width of the viewport (in screen space) + * @param height defines the height of the viewport (in screen space) + * @return the current viewport Object (if any) that is being replaced by this call. You can restore this viewport later on to go back to the original state + */ + Engine.prototype.setDirectViewport = function (x, y, width, height) { + var currentViewport = this._cachedViewport; + this._cachedViewport = null; + this._viewport(x, y, width, height); + return currentViewport; + }; + /** + * Begin a new frame + */ + Engine.prototype.beginFrame = function () { + this.onBeginFrameObservable.notifyObservers(this); + this._measureFps(); + }; + /** + * Enf the current frame + */ + Engine.prototype.endFrame = function () { + // Force a flush in case we are using a bad OS. + if (this._badOS) { + this.flushFramebuffer(); + } + // Submit frame to the vr device, if enabled + if (this._vrDisplay && this._vrDisplay.isPresenting) { + // TODO: We should only submit the frame if we read frameData successfully. + this._vrDisplay.submitFrame(); + } + this.onEndFrameObservable.notifyObservers(this); + }; + /** + * Resize the view according to the canvas' size + */ + Engine.prototype.resize = function () { + // We're not resizing the size of the canvas while in VR mode & presenting + if (!(this._vrDisplay && this._vrDisplay.isPresenting)) { + var width = this._renderingCanvas ? this._renderingCanvas.clientWidth : window.innerWidth; + var height = this._renderingCanvas ? this._renderingCanvas.clientHeight : window.innerHeight; + this.setSize(width / this._hardwareScalingLevel, height / this._hardwareScalingLevel); + } + }; + /** + * Force a specific size of the canvas + * @param width defines the new canvas' width + * @param height defines the new canvas' height + */ + Engine.prototype.setSize = function (width, height) { + if (!this._renderingCanvas) { + return; + } + if (this._renderingCanvas.width === width && this._renderingCanvas.height === height) { + return; + } + this._renderingCanvas.width = width; + this._renderingCanvas.height = height; + for (var index = 0; index < this.scenes.length; index++) { + var scene = this.scenes[index]; + for (var camIndex = 0; camIndex < scene.cameras.length; camIndex++) { + var cam = scene.cameras[camIndex]; + cam._currentRenderId = 0; + } + } + if (this.onResizeObservable.hasObservers) { + this.onResizeObservable.notifyObservers(this); + } + }; + // WebVR functions + /** + * Gets a boolean indicating if a webVR device was detected + * @returns true if a webVR device was detected + */ + Engine.prototype.isVRDevicePresent = function () { + return !!this._vrDisplay; + }; + /** + * Gets the current webVR device + * @returns the current webVR device (or null) + */ + Engine.prototype.getVRDevice = function () { + return this._vrDisplay; + }; + /** + * Initializes a webVR display and starts listening to display change events + * The onVRDisplayChangedObservable will be notified upon these changes + * @returns The onVRDisplayChangedObservable + */ + Engine.prototype.initWebVR = function () { + this.initWebVRAsync(); + return this.onVRDisplayChangedObservable; + }; + /** + * Initializes a webVR display and starts listening to display change events + * The onVRDisplayChangedObservable will be notified upon these changes + * @returns A promise containing a VRDisplay and if vr is supported + */ + Engine.prototype.initWebVRAsync = function () { + var _this = this; + var notifyObservers = function () { + var eventArgs = { + vrDisplay: _this._vrDisplay, + vrSupported: _this._vrSupported + }; + _this.onVRDisplayChangedObservable.notifyObservers(eventArgs); + _this._webVRInitPromise = new Promise(function (res) { res(eventArgs); }); + }; + if (!this._onVrDisplayConnect) { + this._onVrDisplayConnect = function (event) { + _this._vrDisplay = event.display; + notifyObservers(); + }; + this._onVrDisplayDisconnect = function () { + _this._vrDisplay.cancelAnimationFrame(_this._frameHandler); + _this._vrDisplay = undefined; + _this._frameHandler = BABYLON.Tools.QueueNewFrame(_this._bindedRenderFunction); + notifyObservers(); + }; + this._onVrDisplayPresentChange = function () { + _this._vrExclusivePointerMode = _this._vrDisplay && _this._vrDisplay.isPresenting; + }; + window.addEventListener('vrdisplayconnect', this._onVrDisplayConnect); + window.addEventListener('vrdisplaydisconnect', this._onVrDisplayDisconnect); + window.addEventListener('vrdisplaypresentchange', this._onVrDisplayPresentChange); + } + this._webVRInitPromise = this._webVRInitPromise || this._getVRDisplaysAsync(); + this._webVRInitPromise.then(notifyObservers); + return this._webVRInitPromise; + }; + /** + * Call this function to switch to webVR mode + * Will do nothing if webVR is not supported or if there is no webVR device + * @see http://doc.babylonjs.com/how_to/webvr_camera + */ + Engine.prototype.enableVR = function () { + var _this = this; + if (this._vrDisplay && !this._vrDisplay.isPresenting) { + var onResolved = function () { + _this.onVRRequestPresentComplete.notifyObservers(true); + _this._onVRFullScreenTriggered(); + }; + var onRejected = function () { + _this.onVRRequestPresentComplete.notifyObservers(false); + }; + this.onVRRequestPresentStart.notifyObservers(this); + this._vrDisplay.requestPresent([{ source: this.getRenderingCanvas() }]).then(onResolved).catch(onRejected); + } + }; + /** + * Call this function to leave webVR mode + * Will do nothing if webVR is not supported or if there is no webVR device + * @see http://doc.babylonjs.com/how_to/webvr_camera + */ + Engine.prototype.disableVR = function () { + if (this._vrDisplay && this._vrDisplay.isPresenting) { + this._vrDisplay.exitPresent().then(this._onVRFullScreenTriggered).catch(this._onVRFullScreenTriggered); + } + }; + Engine.prototype._getVRDisplaysAsync = function () { + var _this = this; + return new Promise(function (res, rej) { + if (navigator.getVRDisplays) { + navigator.getVRDisplays().then(function (devices) { + _this._vrSupported = true; + // note that devices may actually be an empty array. This is fine; + // we expect this._vrDisplay to be undefined in this case. + _this._vrDisplay = devices[0]; + res({ + vrDisplay: _this._vrDisplay, + vrSupported: _this._vrSupported + }); + }); + } + else { + _this._vrDisplay = undefined; + _this._vrSupported = false; + res({ + vrDisplay: _this._vrDisplay, + vrSupported: _this._vrSupported + }); + } + }); + }; + /** + * Binds the frame buffer to the specified texture. + * @param texture The texture to render to or null for the default canvas + * @param faceIndex The face of the texture to render to in case of cube texture + * @param requiredWidth The width of the target to render to + * @param requiredHeight The height of the target to render to + * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true + * @param depthStencilTexture The depth stencil texture to use to render + * @param lodLevel defines le lod level to bind to the frame buffer + */ + Engine.prototype.bindFramebuffer = function (texture, faceIndex, requiredWidth, requiredHeight, forceFullscreenViewport, depthStencilTexture, lodLevel) { + if (lodLevel === void 0) { lodLevel = 0; } + if (this._currentRenderTarget) { + this.unBindFramebuffer(this._currentRenderTarget); + } + this._currentRenderTarget = texture; + this.bindUnboundFramebuffer(texture._MSAAFramebuffer ? texture._MSAAFramebuffer : texture._framebuffer); + var gl = this._gl; + if (texture.isCube) { + if (faceIndex === undefined) { + faceIndex = 0; + } + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, texture._webGLTexture, lodLevel); + if (depthStencilTexture) { + if (depthStencilTexture._generateStencilBuffer) { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, depthStencilTexture._webGLTexture, lodLevel); + } + else { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, depthStencilTexture._webGLTexture, lodLevel); + } + } + } + if (this._cachedViewport && !forceFullscreenViewport) { + this.setViewport(this._cachedViewport, requiredWidth, requiredHeight); + } + else { + if (!requiredWidth) { + requiredWidth = texture.width; + if (lodLevel) { + requiredWidth = requiredWidth / Math.pow(2, lodLevel); + } + } + if (!requiredHeight) { + requiredHeight = texture.height; + if (lodLevel) { + requiredHeight = requiredHeight / Math.pow(2, lodLevel); + } + } + this._viewport(0, 0, requiredWidth, requiredHeight); + } + this.wipeCaches(); + }; + Engine.prototype.bindUnboundFramebuffer = function (framebuffer) { + if (this._currentFramebuffer !== framebuffer) { + this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, framebuffer); + this._currentFramebuffer = framebuffer; + } + }; + /** + * Unbind the current render target texture from the webGL context + * @param texture defines the render target texture to unbind + * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated + * @param onBeforeUnbind defines a function which will be called before the effective unbind + */ + Engine.prototype.unBindFramebuffer = function (texture, disableGenerateMipMaps, onBeforeUnbind) { + if (disableGenerateMipMaps === void 0) { disableGenerateMipMaps = false; } + this._currentRenderTarget = null; + // If MSAA, we need to bitblt back to main texture + var gl = this._gl; + if (texture._MSAAFramebuffer) { + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, texture._MSAAFramebuffer); + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, texture._framebuffer); + gl.blitFramebuffer(0, 0, texture.width, texture.height, 0, 0, texture.width, texture.height, gl.COLOR_BUFFER_BIT, gl.NEAREST); + } + if (texture.generateMipMaps && !disableGenerateMipMaps && !texture.isCube) { + this._bindTextureDirectly(gl.TEXTURE_2D, texture, true); + gl.generateMipmap(gl.TEXTURE_2D); + this._bindTextureDirectly(gl.TEXTURE_2D, null); + } + if (onBeforeUnbind) { + if (texture._MSAAFramebuffer) { + // Bind the correct framebuffer + this.bindUnboundFramebuffer(texture._framebuffer); + } + onBeforeUnbind(); + } + this.bindUnboundFramebuffer(null); + }; + /** + * Unbind a list of render target textures from the webGL context + * This is used only when drawBuffer extension or webGL2 are active + * @param textures defines the render target textures to unbind + * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated + * @param onBeforeUnbind defines a function which will be called before the effective unbind + */ + Engine.prototype.unBindMultiColorAttachmentFramebuffer = function (textures, disableGenerateMipMaps, onBeforeUnbind) { + if (disableGenerateMipMaps === void 0) { disableGenerateMipMaps = false; } + this._currentRenderTarget = null; + // If MSAA, we need to bitblt back to main texture + var gl = this._gl; + if (textures[0]._MSAAFramebuffer) { + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, textures[0]._MSAAFramebuffer); + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, textures[0]._framebuffer); + var attachments = textures[0]._attachments; + if (!attachments) { + attachments = new Array(textures.length); + textures[0]._attachments = attachments; + } + for (var i = 0; i < textures.length; i++) { + var texture = textures[i]; + for (var j = 0; j < attachments.length; j++) { + attachments[j] = gl.NONE; + } + attachments[i] = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; + gl.readBuffer(attachments[i]); + gl.drawBuffers(attachments); + gl.blitFramebuffer(0, 0, texture.width, texture.height, 0, 0, texture.width, texture.height, gl.COLOR_BUFFER_BIT, gl.NEAREST); + } + for (var i = 0; i < attachments.length; i++) { + attachments[i] = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; + } + gl.drawBuffers(attachments); + } + for (var i = 0; i < textures.length; i++) { + var texture = textures[i]; + if (texture.generateMipMaps && !disableGenerateMipMaps && !texture.isCube) { + this._bindTextureDirectly(gl.TEXTURE_2D, texture); + gl.generateMipmap(gl.TEXTURE_2D); + this._bindTextureDirectly(gl.TEXTURE_2D, null); + } + } + if (onBeforeUnbind) { + if (textures[0]._MSAAFramebuffer) { + // Bind the correct framebuffer + this.bindUnboundFramebuffer(textures[0]._framebuffer); + } + onBeforeUnbind(); + } + this.bindUnboundFramebuffer(null); + }; + /** + * Force the mipmap generation for the given render target texture + * @param texture defines the render target texture to use + */ + Engine.prototype.generateMipMapsForCubemap = function (texture) { + if (texture.generateMipMaps) { + var gl = this._gl; + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + } + }; + /** + * Force a webGL flush (ie. a flush of all waiting webGL commands) + */ + Engine.prototype.flushFramebuffer = function () { + this._gl.flush(); + }; + /** + * Unbind the current render target and bind the default framebuffer + */ + Engine.prototype.restoreDefaultFramebuffer = function () { + if (this._currentRenderTarget) { + this.unBindFramebuffer(this._currentRenderTarget); + } + else { + this.bindUnboundFramebuffer(null); + } + if (this._cachedViewport) { + this.setViewport(this._cachedViewport); + } + this.wipeCaches(); + }; + // UBOs + /** + * Create an uniform buffer + * @see http://doc.babylonjs.com/features/webgl2#uniform-buffer-objets + * @param elements defines the content of the uniform buffer + * @returns the webGL uniform buffer + */ + Engine.prototype.createUniformBuffer = function (elements) { + var ubo = this._gl.createBuffer(); + if (!ubo) { + throw new Error("Unable to create uniform buffer"); + } + this.bindUniformBuffer(ubo); + if (elements instanceof Float32Array) { + this._gl.bufferData(this._gl.UNIFORM_BUFFER, elements, this._gl.STATIC_DRAW); + } + else { + this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(elements), this._gl.STATIC_DRAW); + } + this.bindUniformBuffer(null); + ubo.references = 1; + return ubo; + }; + /** + * Create a dynamic uniform buffer + * @see http://doc.babylonjs.com/features/webgl2#uniform-buffer-objets + * @param elements defines the content of the uniform buffer + * @returns the webGL uniform buffer + */ + Engine.prototype.createDynamicUniformBuffer = function (elements) { + var ubo = this._gl.createBuffer(); + if (!ubo) { + throw new Error("Unable to create dynamic uniform buffer"); + } + this.bindUniformBuffer(ubo); + if (elements instanceof Float32Array) { + this._gl.bufferData(this._gl.UNIFORM_BUFFER, elements, this._gl.DYNAMIC_DRAW); + } + else { + this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(elements), this._gl.DYNAMIC_DRAW); + } + this.bindUniformBuffer(null); + ubo.references = 1; + return ubo; + }; + /** + * Update an existing uniform buffer + * @see http://doc.babylonjs.com/features/webgl2#uniform-buffer-objets + * @param uniformBuffer defines the target uniform buffer + * @param elements defines the content to update + * @param offset defines the offset in the uniform buffer where update should start + * @param count defines the size of the data to update + */ + Engine.prototype.updateUniformBuffer = function (uniformBuffer, elements, offset, count) { + this.bindUniformBuffer(uniformBuffer); + if (offset === undefined) { + offset = 0; + } + if (count === undefined) { + if (elements instanceof Float32Array) { + this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, elements); + } + else { + this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, new Float32Array(elements)); + } + } + else { + if (elements instanceof Float32Array) { + this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, elements.subarray(offset, offset + count)); + } + else { + this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, new Float32Array(elements).subarray(offset, offset + count)); + } + } + this.bindUniformBuffer(null); + }; + // VBOs + Engine.prototype._resetVertexBufferBinding = function () { + this.bindArrayBuffer(null); + this._cachedVertexBuffers = null; + }; + /** + * Creates a vertex buffer + * @param data the data for the vertex buffer + * @returns the new WebGL static buffer + */ + Engine.prototype.createVertexBuffer = function (data) { + var vbo = this._gl.createBuffer(); + if (!vbo) { + throw new Error("Unable to create vertex buffer"); + } + this.bindArrayBuffer(vbo); + if (data instanceof Array) { + this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(data), this._gl.STATIC_DRAW); + } + else { + this._gl.bufferData(this._gl.ARRAY_BUFFER, data, this._gl.STATIC_DRAW); + } + this._resetVertexBufferBinding(); + vbo.references = 1; + return vbo; + }; + /** + * Creates a dynamic vertex buffer + * @param data the data for the dynamic vertex buffer + * @returns the new WebGL dynamic buffer + */ + Engine.prototype.createDynamicVertexBuffer = function (data) { + var vbo = this._gl.createBuffer(); + if (!vbo) { + throw new Error("Unable to create dynamic vertex buffer"); + } + this.bindArrayBuffer(vbo); + if (data instanceof Array) { + this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(data), this._gl.DYNAMIC_DRAW); + } + else { + this._gl.bufferData(this._gl.ARRAY_BUFFER, data, this._gl.DYNAMIC_DRAW); + } + this._resetVertexBufferBinding(); + vbo.references = 1; + return vbo; + }; + /** + * Update a dynamic index buffer + * @param indexBuffer defines the target index buffer + * @param indices defines the data to update + * @param offset defines the offset in the target index buffer where update should start + */ + Engine.prototype.updateDynamicIndexBuffer = function (indexBuffer, indices, offset) { + if (offset === void 0) { offset = 0; } + // Force cache update + this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null; + this.bindIndexBuffer(indexBuffer); + var arrayBuffer; + if (indices instanceof Uint16Array || indices instanceof Uint32Array) { + arrayBuffer = indices; + } + else { + arrayBuffer = indexBuffer.is32Bits ? new Uint32Array(indices) : new Uint16Array(indices); + } + this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, arrayBuffer, this._gl.DYNAMIC_DRAW); + this._resetIndexBufferBinding(); + }; + /** + * Updates a dynamic vertex buffer. + * @param vertexBuffer the vertex buffer to update + * @param data the data used to update the vertex buffer + * @param byteOffset the byte offset of the data + * @param byteLength the byte length of the data + */ + Engine.prototype.updateDynamicVertexBuffer = function (vertexBuffer, data, byteOffset, byteLength) { + this.bindArrayBuffer(vertexBuffer); + if (byteOffset === undefined) { + byteOffset = 0; + } + if (byteLength === undefined) { + if (data instanceof Array) { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, byteOffset, new Float32Array(data)); + } + else { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, byteOffset, data); + } + } + else { + if (data instanceof Array) { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, new Float32Array(data).subarray(byteOffset, byteOffset + byteLength)); + } + else { + if (data instanceof ArrayBuffer) { + data = new Uint8Array(data, byteOffset, byteLength); + } + else { + data = new Uint8Array(data.buffer, data.byteOffset + byteOffset, byteLength); + } + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data); + } + } + this._resetVertexBufferBinding(); + }; + Engine.prototype._resetIndexBufferBinding = function () { + this.bindIndexBuffer(null); + this._cachedIndexBuffer = null; + }; + /** + * Creates a new index buffer + * @param indices defines the content of the index buffer + * @param updatable defines if the index buffer must be updatable + * @returns a new webGL buffer + */ + Engine.prototype.createIndexBuffer = function (indices, updatable) { + var vbo = this._gl.createBuffer(); + if (!vbo) { + throw new Error("Unable to create index buffer"); + } + this.bindIndexBuffer(vbo); + // Check for 32 bits indices + var arrayBuffer; + var need32Bits = false; + if (indices instanceof Uint16Array) { + arrayBuffer = indices; + } + else { + //check 32 bit support + if (this._caps.uintIndices) { + if (indices instanceof Uint32Array) { + arrayBuffer = indices; + need32Bits = true; + } + else { + //number[] or Int32Array, check if 32 bit is necessary + for (var index = 0; index < indices.length; index++) { + if (indices[index] > 65535) { + need32Bits = true; + break; + } + } + arrayBuffer = need32Bits ? new Uint32Array(indices) : new Uint16Array(indices); + } + } + else { + //no 32 bit support, force conversion to 16 bit (values greater 16 bit are lost) + arrayBuffer = new Uint16Array(indices); + } + } + this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, arrayBuffer, updatable ? this._gl.DYNAMIC_DRAW : this._gl.STATIC_DRAW); + this._resetIndexBufferBinding(); + vbo.references = 1; + vbo.is32Bits = need32Bits; + return vbo; + }; + /** + * Bind a webGL buffer to the webGL context + * @param buffer defines the buffer to bind + */ + Engine.prototype.bindArrayBuffer = function (buffer) { + if (!this._vaoRecordInProgress) { + this._unbindVertexArrayObject(); + } + this.bindBuffer(buffer, this._gl.ARRAY_BUFFER); + }; + /** + * Bind an uniform buffer to the current webGL context + * @param buffer defines the buffer to bind + */ + Engine.prototype.bindUniformBuffer = function (buffer) { + this._gl.bindBuffer(this._gl.UNIFORM_BUFFER, buffer); + }; + /** + * Bind a buffer to the current webGL context at a given location + * @param buffer defines the buffer to bind + * @param location defines the index where to bind the buffer + */ + Engine.prototype.bindUniformBufferBase = function (buffer, location) { + this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER, location, buffer); + }; + /** + * Bind a specific block at a given index in a specific shader program + * @param shaderProgram defines the shader program + * @param blockName defines the block name + * @param index defines the index where to bind the block + */ + Engine.prototype.bindUniformBlock = function (shaderProgram, blockName, index) { + var uniformLocation = this._gl.getUniformBlockIndex(shaderProgram, blockName); + this._gl.uniformBlockBinding(shaderProgram, uniformLocation, index); + }; + Engine.prototype.bindIndexBuffer = function (buffer) { + if (!this._vaoRecordInProgress) { + this._unbindVertexArrayObject(); + } + this.bindBuffer(buffer, this._gl.ELEMENT_ARRAY_BUFFER); + }; + Engine.prototype.bindBuffer = function (buffer, target) { + if (this._vaoRecordInProgress || this._currentBoundBuffer[target] !== buffer) { + this._gl.bindBuffer(target, buffer); + this._currentBoundBuffer[target] = buffer; + } + }; + /** + * update the bound buffer with the given data + * @param data defines the data to update + */ + Engine.prototype.updateArrayBuffer = function (data) { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data); + }; + Engine.prototype._vertexAttribPointer = function (buffer, indx, size, type, normalized, stride, offset) { + var pointer = this._currentBufferPointers[indx]; + var changed = false; + if (!pointer.active) { + changed = true; + pointer.active = true; + pointer.index = indx; + pointer.size = size; + pointer.type = type; + pointer.normalized = normalized; + pointer.stride = stride; + pointer.offset = offset; + pointer.buffer = buffer; + } + else { + if (pointer.buffer !== buffer) { + pointer.buffer = buffer; + changed = true; + } + if (pointer.size !== size) { + pointer.size = size; + changed = true; + } + if (pointer.type !== type) { + pointer.type = type; + changed = true; + } + if (pointer.normalized !== normalized) { + pointer.normalized = normalized; + changed = true; + } + if (pointer.stride !== stride) { + pointer.stride = stride; + changed = true; + } + if (pointer.offset !== offset) { + pointer.offset = offset; + changed = true; + } + } + if (changed || this._vaoRecordInProgress) { + this.bindArrayBuffer(buffer); + this._gl.vertexAttribPointer(indx, size, type, normalized, stride, offset); + } + }; + Engine.prototype._bindIndexBufferWithCache = function (indexBuffer) { + if (indexBuffer == null) { + return; + } + if (this._cachedIndexBuffer !== indexBuffer) { + this._cachedIndexBuffer = indexBuffer; + this.bindIndexBuffer(indexBuffer); + this._uintIndicesCurrentlySet = indexBuffer.is32Bits; + } + }; + Engine.prototype._bindVertexBuffersAttributes = function (vertexBuffers, effect) { + var attributes = effect.getAttributesNames(); + if (!this._vaoRecordInProgress) { + this._unbindVertexArrayObject(); + } + this.unbindAllAttributes(); + for (var index = 0; index < attributes.length; index++) { + var order = effect.getAttributeLocation(index); + if (order >= 0) { + var vertexBuffer = vertexBuffers[attributes[index]]; + if (!vertexBuffer) { + continue; + } + this._gl.enableVertexAttribArray(order); + if (!this._vaoRecordInProgress) { + this._vertexAttribArraysEnabled[order] = true; + } + var buffer = vertexBuffer.getBuffer(); + if (buffer) { + this._vertexAttribPointer(buffer, order, vertexBuffer.getSize(), vertexBuffer.type, vertexBuffer.normalized, vertexBuffer.byteStride, vertexBuffer.byteOffset); + if (vertexBuffer.getIsInstanced()) { + this._gl.vertexAttribDivisor(order, vertexBuffer.getInstanceDivisor()); + if (!this._vaoRecordInProgress) { + this._currentInstanceLocations.push(order); + this._currentInstanceBuffers.push(buffer); + } + } + } + } + } + }; + /** + * Records a vertex array object + * @see http://doc.babylonjs.com/features/webgl2#vertex-array-objects + * @param vertexBuffers defines the list of vertex buffers to store + * @param indexBuffer defines the index buffer to store + * @param effect defines the effect to store + * @returns the new vertex array object + */ + Engine.prototype.recordVertexArrayObject = function (vertexBuffers, indexBuffer, effect) { + var vao = this._gl.createVertexArray(); + this._vaoRecordInProgress = true; + this._gl.bindVertexArray(vao); + this._mustWipeVertexAttributes = true; + this._bindVertexBuffersAttributes(vertexBuffers, effect); + this.bindIndexBuffer(indexBuffer); + this._vaoRecordInProgress = false; + this._gl.bindVertexArray(null); + return vao; + }; + /** + * Bind a specific vertex array object + * @see http://doc.babylonjs.com/features/webgl2#vertex-array-objects + * @param vertexArrayObject defines the vertex array object to bind + * @param indexBuffer defines the index buffer to bind + */ + Engine.prototype.bindVertexArrayObject = function (vertexArrayObject, indexBuffer) { + if (this._cachedVertexArrayObject !== vertexArrayObject) { + this._cachedVertexArrayObject = vertexArrayObject; + this._gl.bindVertexArray(vertexArrayObject); + this._cachedVertexBuffers = null; + this._cachedIndexBuffer = null; + this._uintIndicesCurrentlySet = indexBuffer != null && indexBuffer.is32Bits; + this._mustWipeVertexAttributes = true; + } + }; + /** + * Bind webGl buffers directly to the webGL context + * @param vertexBuffer defines the vertex buffer to bind + * @param indexBuffer defines the index buffer to bind + * @param vertexDeclaration defines the vertex declaration to use with the vertex buffer + * @param vertexStrideSize defines the vertex stride of the vertex buffer + * @param effect defines the effect associated with the vertex buffer + */ + Engine.prototype.bindBuffersDirectly = function (vertexBuffer, indexBuffer, vertexDeclaration, vertexStrideSize, effect) { + if (this._cachedVertexBuffers !== vertexBuffer || this._cachedEffectForVertexBuffers !== effect) { + this._cachedVertexBuffers = vertexBuffer; + this._cachedEffectForVertexBuffers = effect; + var attributesCount = effect.getAttributesCount(); + this._unbindVertexArrayObject(); + this.unbindAllAttributes(); + var offset = 0; + for (var index = 0; index < attributesCount; index++) { + if (index < vertexDeclaration.length) { + var order = effect.getAttributeLocation(index); + if (order >= 0) { + this._gl.enableVertexAttribArray(order); + this._vertexAttribArraysEnabled[order] = true; + this._vertexAttribPointer(vertexBuffer, order, vertexDeclaration[index], this._gl.FLOAT, false, vertexStrideSize, offset); + } + offset += vertexDeclaration[index] * 4; + } + } + } + this._bindIndexBufferWithCache(indexBuffer); + }; + Engine.prototype._unbindVertexArrayObject = function () { + if (!this._cachedVertexArrayObject) { + return; + } + this._cachedVertexArrayObject = null; + this._gl.bindVertexArray(null); + }; + /** + * Bind a list of vertex buffers to the webGL context + * @param vertexBuffers defines the list of vertex buffers to bind + * @param indexBuffer defines the index buffer to bind + * @param effect defines the effect associated with the vertex buffers + */ + Engine.prototype.bindBuffers = function (vertexBuffers, indexBuffer, effect) { + if (this._cachedVertexBuffers !== vertexBuffers || this._cachedEffectForVertexBuffers !== effect) { + this._cachedVertexBuffers = vertexBuffers; + this._cachedEffectForVertexBuffers = effect; + this._bindVertexBuffersAttributes(vertexBuffers, effect); + } + this._bindIndexBufferWithCache(indexBuffer); + }; + /** + * Unbind all instance attributes + */ + Engine.prototype.unbindInstanceAttributes = function () { + var boundBuffer; + for (var i = 0, ul = this._currentInstanceLocations.length; i < ul; i++) { + var instancesBuffer = this._currentInstanceBuffers[i]; + if (boundBuffer != instancesBuffer && instancesBuffer.references) { + boundBuffer = instancesBuffer; + this.bindArrayBuffer(instancesBuffer); + } + var offsetLocation = this._currentInstanceLocations[i]; + this._gl.vertexAttribDivisor(offsetLocation, 0); + } + this._currentInstanceBuffers.length = 0; + this._currentInstanceLocations.length = 0; + }; + /** + * Release and free the memory of a vertex array object + * @param vao defines the vertex array object to delete + */ + Engine.prototype.releaseVertexArrayObject = function (vao) { + this._gl.deleteVertexArray(vao); + }; + /** @hidden */ + Engine.prototype._releaseBuffer = function (buffer) { + buffer.references--; + if (buffer.references === 0) { + this._gl.deleteBuffer(buffer); + return true; + } + return false; + }; + /** + * Creates a webGL buffer to use with instanciation + * @param capacity defines the size of the buffer + * @returns the webGL buffer + */ + Engine.prototype.createInstancesBuffer = function (capacity) { + var buffer = this._gl.createBuffer(); + if (!buffer) { + throw new Error("Unable to create instance buffer"); + } + buffer.capacity = capacity; + this.bindArrayBuffer(buffer); + this._gl.bufferData(this._gl.ARRAY_BUFFER, capacity, this._gl.DYNAMIC_DRAW); + return buffer; + }; + /** + * Delete a webGL buffer used with instanciation + * @param buffer defines the webGL buffer to delete + */ + Engine.prototype.deleteInstancesBuffer = function (buffer) { + this._gl.deleteBuffer(buffer); + }; + /** + * Update the content of a webGL buffer used with instanciation and bind it to the webGL context + * @param instancesBuffer defines the webGL buffer to update and bind + * @param data defines the data to store in the buffer + * @param offsetLocations defines the offsets or attributes information used to determine where data must be stored in the buffer + */ + Engine.prototype.updateAndBindInstancesBuffer = function (instancesBuffer, data, offsetLocations) { + this.bindArrayBuffer(instancesBuffer); + if (data) { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data); + } + if (offsetLocations[0].index !== undefined) { + var stride = 0; + for (var i = 0; i < offsetLocations.length; i++) { + var ai = offsetLocations[i]; + stride += ai.attributeSize * 4; + } + for (var i = 0; i < offsetLocations.length; i++) { + var ai = offsetLocations[i]; + if (!this._vertexAttribArraysEnabled[ai.index]) { + this._gl.enableVertexAttribArray(ai.index); + this._vertexAttribArraysEnabled[ai.index] = true; + } + this._vertexAttribPointer(instancesBuffer, ai.index, ai.attributeSize, ai.attribyteType || this._gl.FLOAT, ai.normalized || false, stride, ai.offset); + this._gl.vertexAttribDivisor(ai.index, 1); + this._currentInstanceLocations.push(ai.index); + this._currentInstanceBuffers.push(instancesBuffer); + } + } + else { + for (var index = 0; index < 4; index++) { + var offsetLocation = offsetLocations[index]; + if (!this._vertexAttribArraysEnabled[offsetLocation]) { + this._gl.enableVertexAttribArray(offsetLocation); + this._vertexAttribArraysEnabled[offsetLocation] = true; + } + this._vertexAttribPointer(instancesBuffer, offsetLocation, 4, this._gl.FLOAT, false, 64, index * 16); + this._gl.vertexAttribDivisor(offsetLocation, 1); + this._currentInstanceLocations.push(offsetLocation); + this._currentInstanceBuffers.push(instancesBuffer); + } + } + }; + /** + * Apply all cached states (depth, culling, stencil and alpha) + */ + Engine.prototype.applyStates = function () { + this._depthCullingState.apply(this._gl); + this._stencilState.apply(this._gl); + this._alphaState.apply(this._gl); + }; + /** + * Send a draw order + * @param useTriangles defines if triangles must be used to draw (else wireframe will be used) + * @param indexStart defines the starting index + * @param indexCount defines the number of index to draw + * @param instancesCount defines the number of instances to draw (if instanciation is enabled) + */ + Engine.prototype.draw = function (useTriangles, indexStart, indexCount, instancesCount) { + this.drawElementsType(useTriangles ? BABYLON.Material.TriangleFillMode : BABYLON.Material.WireFrameFillMode, indexStart, indexCount, instancesCount); + }; + /** + * Draw a list of points + * @param verticesStart defines the index of first vertex to draw + * @param verticesCount defines the count of vertices to draw + * @param instancesCount defines the number of instances to draw (if instanciation is enabled) + */ + Engine.prototype.drawPointClouds = function (verticesStart, verticesCount, instancesCount) { + this.drawArraysType(BABYLON.Material.PointFillMode, verticesStart, verticesCount, instancesCount); + }; + /** + * Draw a list of unindexed primitives + * @param useTriangles defines if triangles must be used to draw (else wireframe will be used) + * @param verticesStart defines the index of first vertex to draw + * @param verticesCount defines the count of vertices to draw + * @param instancesCount defines the number of instances to draw (if instanciation is enabled) + */ + Engine.prototype.drawUnIndexed = function (useTriangles, verticesStart, verticesCount, instancesCount) { + this.drawArraysType(useTriangles ? BABYLON.Material.TriangleFillMode : BABYLON.Material.WireFrameFillMode, verticesStart, verticesCount, instancesCount); + }; + /** + * Draw a list of indexed primitives + * @param fillMode defines the primitive to use + * @param indexStart defines the starting index + * @param indexCount defines the number of index to draw + * @param instancesCount defines the number of instances to draw (if instanciation is enabled) + */ + Engine.prototype.drawElementsType = function (fillMode, indexStart, indexCount, instancesCount) { + // Apply states + this.applyStates(); + this._drawCalls.addCount(1, false); + // Render + var drawMode = this._drawMode(fillMode); + var indexFormat = this._uintIndicesCurrentlySet ? this._gl.UNSIGNED_INT : this._gl.UNSIGNED_SHORT; + var mult = this._uintIndicesCurrentlySet ? 4 : 2; + if (instancesCount) { + this._gl.drawElementsInstanced(drawMode, indexCount, indexFormat, indexStart * mult, instancesCount); + } + else { + this._gl.drawElements(drawMode, indexCount, indexFormat, indexStart * mult); + } + }; + /** + * Draw a list of unindexed primitives + * @param fillMode defines the primitive to use + * @param verticesStart defines the index of first vertex to draw + * @param verticesCount defines the count of vertices to draw + * @param instancesCount defines the number of instances to draw (if instanciation is enabled) + */ + Engine.prototype.drawArraysType = function (fillMode, verticesStart, verticesCount, instancesCount) { + // Apply states + this.applyStates(); + this._drawCalls.addCount(1, false); + var drawMode = this._drawMode(fillMode); + if (instancesCount) { + this._gl.drawArraysInstanced(drawMode, verticesStart, verticesCount, instancesCount); + } + else { + this._gl.drawArrays(drawMode, verticesStart, verticesCount); + } + }; + Engine.prototype._drawMode = function (fillMode) { + switch (fillMode) { + // Triangle views + case BABYLON.Material.TriangleFillMode: + return this._gl.TRIANGLES; + case BABYLON.Material.PointFillMode: + return this._gl.POINTS; + case BABYLON.Material.WireFrameFillMode: + return this._gl.LINES; + // Draw modes + case BABYLON.Material.PointListDrawMode: + return this._gl.POINTS; + case BABYLON.Material.LineListDrawMode: + return this._gl.LINES; + case BABYLON.Material.LineLoopDrawMode: + return this._gl.LINE_LOOP; + case BABYLON.Material.LineStripDrawMode: + return this._gl.LINE_STRIP; + case BABYLON.Material.TriangleStripDrawMode: + return this._gl.TRIANGLE_STRIP; + case BABYLON.Material.TriangleFanDrawMode: + return this._gl.TRIANGLE_FAN; + default: + return this._gl.TRIANGLES; + } + }; + // Shaders + /** @hidden */ + Engine.prototype._releaseEffect = function (effect) { + if (this._compiledEffects[effect._key]) { + delete this._compiledEffects[effect._key]; + this._deleteProgram(effect.getProgram()); + } + }; + /** @hidden */ + Engine.prototype._deleteProgram = function (program) { + if (program) { + program.__SPECTOR_rebuildProgram = null; + if (program.transformFeedback) { + this.deleteTransformFeedback(program.transformFeedback); + program.transformFeedback = null; + } + this._gl.deleteProgram(program); + } + }; + /** + * Create a new effect (used to store vertex/fragment shaders) + * @param baseName defines the base name of the effect (The name of file without .fragment.fx or .vertex.fx) + * @param attributesNamesOrOptions defines either a list of attribute names or an EffectCreationOptions object + * @param uniformsNamesOrEngine defines either a list of uniform names or the engine to use + * @param samplers defines an array of string used to represent textures + * @param defines defines the string containing the defines to use to compile the shaders + * @param fallbacks defines the list of potential fallbacks to use if shader conmpilation fails + * @param onCompiled defines a function to call when the effect creation is successful + * @param onError defines a function to call when the effect creation has failed + * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights) + * @returns the new Effect + */ + Engine.prototype.createEffect = function (baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, defines, fallbacks, onCompiled, onError, indexParameters) { + var vertex = baseName.vertexElement || baseName.vertex || baseName; + var fragment = baseName.fragmentElement || baseName.fragment || baseName; + var name = vertex + "+" + fragment + "@" + (defines ? defines : attributesNamesOrOptions.defines); + if (this._compiledEffects[name]) { + var compiledEffect = this._compiledEffects[name]; + if (onCompiled && compiledEffect.isReady()) { + onCompiled(compiledEffect); + } + return compiledEffect; + } + var effect = new BABYLON.Effect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters); + effect._key = name; + this._compiledEffects[name] = effect; + return effect; + }; + Engine.prototype._compileShader = function (source, type, defines, shaderVersion) { + return this._compileRawShader(shaderVersion + (defines ? defines + "\n" : "") + source, type); + }; + Engine.prototype._compileRawShader = function (source, type) { + var gl = this._gl; + var shader = gl.createShader(type === "vertex" ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER); + if (!shader) { + throw new Error("Something went wrong while compile the shader."); + } + gl.shaderSource(shader, source); + gl.compileShader(shader); + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { + var log = gl.getShaderInfoLog(shader); + if (log) { + throw new Error(log); + } + } + return shader; + }; + /** + * Directly creates a webGL program + * @param vertexCode defines the vertex shader code to use + * @param fragmentCode defines the fragment shader code to use + * @param context defines the webGL context to use (if not set, the current one will be used) + * @param transformFeedbackVaryings defines the list of transform feedback varyings to use + * @returns the new webGL program + */ + Engine.prototype.createRawShaderProgram = function (vertexCode, fragmentCode, context, transformFeedbackVaryings) { + if (transformFeedbackVaryings === void 0) { transformFeedbackVaryings = null; } + context = context || this._gl; + var vertexShader = this._compileRawShader(vertexCode, "vertex"); + var fragmentShader = this._compileRawShader(fragmentCode, "fragment"); + return this._createShaderProgram(vertexShader, fragmentShader, context, transformFeedbackVaryings); + }; + /** + * Creates a webGL program + * @param vertexCode defines the vertex shader code to use + * @param fragmentCode defines the fragment shader code to use + * @param defines defines the string containing the defines to use to compile the shaders + * @param context defines the webGL context to use (if not set, the current one will be used) + * @param transformFeedbackVaryings defines the list of transform feedback varyings to use + * @returns the new webGL program + */ + Engine.prototype.createShaderProgram = function (vertexCode, fragmentCode, defines, context, transformFeedbackVaryings) { + if (transformFeedbackVaryings === void 0) { transformFeedbackVaryings = null; } + context = context || this._gl; + this.onBeforeShaderCompilationObservable.notifyObservers(this); + var shaderVersion = (this._webGLVersion > 1) ? "#version 300 es\n#define WEBGL2 \n" : ""; + var vertexShader = this._compileShader(vertexCode, "vertex", defines, shaderVersion); + var fragmentShader = this._compileShader(fragmentCode, "fragment", defines, shaderVersion); + var program = this._createShaderProgram(vertexShader, fragmentShader, context, transformFeedbackVaryings); + this.onAfterShaderCompilationObservable.notifyObservers(this); + return program; + }; + Engine.prototype._createShaderProgram = function (vertexShader, fragmentShader, context, transformFeedbackVaryings) { + if (transformFeedbackVaryings === void 0) { transformFeedbackVaryings = null; } + var shaderProgram = context.createProgram(); + if (!shaderProgram) { + throw new Error("Unable to create program"); + } + context.attachShader(shaderProgram, vertexShader); + context.attachShader(shaderProgram, fragmentShader); + if (this.webGLVersion > 1 && transformFeedbackVaryings) { + var transformFeedback = this.createTransformFeedback(); + this.bindTransformFeedback(transformFeedback); + this.setTranformFeedbackVaryings(shaderProgram, transformFeedbackVaryings); + shaderProgram.transformFeedback = transformFeedback; + } + context.linkProgram(shaderProgram); + if (this.webGLVersion > 1 && transformFeedbackVaryings) { + this.bindTransformFeedback(null); + } + var linked = context.getProgramParameter(shaderProgram, context.LINK_STATUS); + if (!linked) { + var error = context.getProgramInfoLog(shaderProgram); + if (error) { + throw new Error(error); + } + } + if (this.validateShaderPrograms) { + context.validateProgram(shaderProgram); + var validated = context.getProgramParameter(shaderProgram, context.VALIDATE_STATUS); + if (!validated) { + var error = context.getProgramInfoLog(shaderProgram); + if (error) { + throw new Error(error); + } + } + } + context.deleteShader(vertexShader); + context.deleteShader(fragmentShader); + return shaderProgram; + }; + /** + * Gets the list of webGL uniform locations associated with a specific program based on a list of uniform names + * @param shaderProgram defines the webGL program to use + * @param uniformsNames defines the list of uniform names + * @returns an array of webGL uniform locations + */ + Engine.prototype.getUniforms = function (shaderProgram, uniformsNames) { + var results = new Array(); + for (var index = 0; index < uniformsNames.length; index++) { + results.push(this._gl.getUniformLocation(shaderProgram, uniformsNames[index])); + } + return results; + }; + /** + * Gets the lsit of active attributes for a given webGL program + * @param shaderProgram defines the webGL program to use + * @param attributesNames defines the list of attribute names to get + * @returns an array of indices indicating the offset of each attribute + */ + Engine.prototype.getAttributes = function (shaderProgram, attributesNames) { + var results = []; + for (var index = 0; index < attributesNames.length; index++) { + try { + results.push(this._gl.getAttribLocation(shaderProgram, attributesNames[index])); + } + catch (e) { + results.push(-1); + } + } + return results; + }; + /** + * Activates an effect, mkaing it the current one (ie. the one used for rendering) + * @param effect defines the effect to activate + */ + Engine.prototype.enableEffect = function (effect) { + if (!effect || effect === this._currentEffect) { + return; + } + // Use program + this.bindSamplers(effect); + this._currentEffect = effect; + if (effect.onBind) { + effect.onBind(effect); + } + if (effect._onBindObservable) { + effect._onBindObservable.notifyObservers(effect); + } + }; + /** + * Set the value of an uniform to an array of int32 + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of int32 to store + */ + Engine.prototype.setIntArray = function (uniform, array) { + if (!uniform) { + return; + } + this._gl.uniform1iv(uniform, array); + }; + /** + * Set the value of an uniform to an array of int32 (stored as vec2) + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of int32 to store + */ + Engine.prototype.setIntArray2 = function (uniform, array) { + if (!uniform || array.length % 2 !== 0) { + return; + } + this._gl.uniform2iv(uniform, array); + }; + /** + * Set the value of an uniform to an array of int32 (stored as vec3) + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of int32 to store + */ + Engine.prototype.setIntArray3 = function (uniform, array) { + if (!uniform || array.length % 3 !== 0) { + return; + } + this._gl.uniform3iv(uniform, array); + }; + /** + * Set the value of an uniform to an array of int32 (stored as vec4) + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of int32 to store + */ + Engine.prototype.setIntArray4 = function (uniform, array) { + if (!uniform || array.length % 4 !== 0) { + return; + } + this._gl.uniform4iv(uniform, array); + }; + /** + * Set the value of an uniform to an array of float32 + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of float32 to store + */ + Engine.prototype.setFloatArray = function (uniform, array) { + if (!uniform) { + return; + } + this._gl.uniform1fv(uniform, array); + }; + /** + * Set the value of an uniform to an array of float32 (stored as vec2) + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of float32 to store + */ + Engine.prototype.setFloatArray2 = function (uniform, array) { + if (!uniform || array.length % 2 !== 0) { + return; + } + this._gl.uniform2fv(uniform, array); + }; + /** + * Set the value of an uniform to an array of float32 (stored as vec3) + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of float32 to store + */ + Engine.prototype.setFloatArray3 = function (uniform, array) { + if (!uniform || array.length % 3 !== 0) { + return; + } + this._gl.uniform3fv(uniform, array); + }; + /** + * Set the value of an uniform to an array of float32 (stored as vec4) + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of float32 to store + */ + Engine.prototype.setFloatArray4 = function (uniform, array) { + if (!uniform || array.length % 4 !== 0) { + return; + } + this._gl.uniform4fv(uniform, array); + }; + /** + * Set the value of an uniform to an array of number + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of number to store + */ + Engine.prototype.setArray = function (uniform, array) { + if (!uniform) { + return; + } + this._gl.uniform1fv(uniform, array); + }; + /** + * Set the value of an uniform to an array of number (stored as vec2) + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of number to store + */ + Engine.prototype.setArray2 = function (uniform, array) { + if (!uniform || array.length % 2 !== 0) { + return; + } + this._gl.uniform2fv(uniform, array); + }; + /** + * Set the value of an uniform to an array of number (stored as vec3) + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of number to store + */ + Engine.prototype.setArray3 = function (uniform, array) { + if (!uniform || array.length % 3 !== 0) { + return; + } + this._gl.uniform3fv(uniform, array); + }; + /** + * Set the value of an uniform to an array of number (stored as vec4) + * @param uniform defines the webGL uniform location where to store the value + * @param array defines the array of number to store + */ + Engine.prototype.setArray4 = function (uniform, array) { + if (!uniform || array.length % 4 !== 0) { + return; + } + this._gl.uniform4fv(uniform, array); + }; + /** + * Set the value of an uniform to an array of float32 (stored as matrices) + * @param uniform defines the webGL uniform location where to store the value + * @param matrices defines the array of float32 to store + */ + Engine.prototype.setMatrices = function (uniform, matrices) { + if (!uniform) { + return; + } + this._gl.uniformMatrix4fv(uniform, false, matrices); + }; + /** + * Set the value of an uniform to a matrix + * @param uniform defines the webGL uniform location where to store the value + * @param matrix defines the matrix to store + */ + Engine.prototype.setMatrix = function (uniform, matrix) { + if (!uniform) { + return; + } + this._gl.uniformMatrix4fv(uniform, false, matrix.toArray()); + }; + /** + * Set the value of an uniform to a matrix (3x3) + * @param uniform defines the webGL uniform location where to store the value + * @param matrix defines the Float32Array representing the 3x3 matrix to store + */ + Engine.prototype.setMatrix3x3 = function (uniform, matrix) { + if (!uniform) { + return; + } + this._gl.uniformMatrix3fv(uniform, false, matrix); + }; + /** + * Set the value of an uniform to a matrix (2x2) + * @param uniform defines the webGL uniform location where to store the value + * @param matrix defines the Float32Array representing the 2x2 matrix to store + */ + Engine.prototype.setMatrix2x2 = function (uniform, matrix) { + if (!uniform) { + return; + } + this._gl.uniformMatrix2fv(uniform, false, matrix); + }; + /** + * Set the value of an uniform to a number (int) + * @param uniform defines the webGL uniform location where to store the value + * @param value defines the int number to store + */ + Engine.prototype.setInt = function (uniform, value) { + if (!uniform) { + return; + } + this._gl.uniform1i(uniform, value); + }; + /** + * Set the value of an uniform to a number (float) + * @param uniform defines the webGL uniform location where to store the value + * @param value defines the float number to store + */ + Engine.prototype.setFloat = function (uniform, value) { + if (!uniform) { + return; + } + this._gl.uniform1f(uniform, value); + }; + /** + * Set the value of an uniform to a vec2 + * @param uniform defines the webGL uniform location where to store the value + * @param x defines the 1st component of the value + * @param y defines the 2nd component of the value + */ + Engine.prototype.setFloat2 = function (uniform, x, y) { + if (!uniform) { + return; + } + this._gl.uniform2f(uniform, x, y); + }; + /** + * Set the value of an uniform to a vec3 + * @param uniform defines the webGL uniform location where to store the value + * @param x defines the 1st component of the value + * @param y defines the 2nd component of the value + * @param z defines the 3rd component of the value + */ + Engine.prototype.setFloat3 = function (uniform, x, y, z) { + if (!uniform) { + return; + } + this._gl.uniform3f(uniform, x, y, z); + }; + /** + * Set the value of an uniform to a boolean + * @param uniform defines the webGL uniform location where to store the value + * @param bool defines the boolean to store + */ + Engine.prototype.setBool = function (uniform, bool) { + if (!uniform) { + return; + } + this._gl.uniform1i(uniform, bool); + }; + /** + * Set the value of an uniform to a vec4 + * @param uniform defines the webGL uniform location where to store the value + * @param x defines the 1st component of the value + * @param y defines the 2nd component of the value + * @param z defines the 3rd component of the value + * @param w defines the 4th component of the value + */ + Engine.prototype.setFloat4 = function (uniform, x, y, z, w) { + if (!uniform) { + return; + } + this._gl.uniform4f(uniform, x, y, z, w); + }; + /** + * Set the value of an uniform to a Color3 + * @param uniform defines the webGL uniform location where to store the value + * @param color3 defines the color to store + */ + Engine.prototype.setColor3 = function (uniform, color3) { + if (!uniform) { + return; + } + this._gl.uniform3f(uniform, color3.r, color3.g, color3.b); + }; + /** + * Set the value of an uniform to a Color3 and an alpha value + * @param uniform defines the webGL uniform location where to store the value + * @param color3 defines the color to store + * @param alpha defines the alpha component to store + */ + Engine.prototype.setColor4 = function (uniform, color3, alpha) { + if (!uniform) { + return; + } + this._gl.uniform4f(uniform, color3.r, color3.g, color3.b, alpha); + }; + /** + * Sets a Color4 on a uniform variable + * @param uniform defines the uniform location + * @param color4 defines the value to be set + */ + Engine.prototype.setDirectColor4 = function (uniform, color4) { + if (!uniform) { + return; + } + this._gl.uniform4f(uniform, color4.r, color4.g, color4.b, color4.a); + }; + // States + /** + * Set various states to the webGL context + * @param culling defines backface culling state + * @param zOffset defines the value to apply to zOffset (0 by default) + * @param force defines if states must be applied even if cache is up to date + * @param reverseSide defines if culling must be reversed (CCW instead of CW and CW instead of CCW) + */ + Engine.prototype.setState = function (culling, zOffset, force, reverseSide) { + if (zOffset === void 0) { zOffset = 0; } + if (reverseSide === void 0) { reverseSide = false; } + // Culling + if (this._depthCullingState.cull !== culling || force) { + this._depthCullingState.cull = culling; + } + // Cull face + var cullFace = this.cullBackFaces ? this._gl.BACK : this._gl.FRONT; + if (this._depthCullingState.cullFace !== cullFace || force) { + this._depthCullingState.cullFace = cullFace; + } + // Z offset + this.setZOffset(zOffset); + // Front face + var frontFace = reverseSide ? this._gl.CW : this._gl.CCW; + if (this._depthCullingState.frontFace !== frontFace || force) { + this._depthCullingState.frontFace = frontFace; + } + }; + /** + * Set the z offset to apply to current rendering + * @param value defines the offset to apply + */ + Engine.prototype.setZOffset = function (value) { + this._depthCullingState.zOffset = value; + }; + /** + * Gets the current value of the zOffset + * @returns the current zOffset state + */ + Engine.prototype.getZOffset = function () { + return this._depthCullingState.zOffset; + }; + /** + * Enable or disable depth buffering + * @param enable defines the state to set + */ + Engine.prototype.setDepthBuffer = function (enable) { + this._depthCullingState.depthTest = enable; + }; + /** + * Gets a boolean indicating if depth writing is enabled + * @returns the current depth writing state + */ + Engine.prototype.getDepthWrite = function () { + return this._depthCullingState.depthMask; + }; + /** + * Enable or disable depth writing + * @param enable defines the state to set + */ + Engine.prototype.setDepthWrite = function (enable) { + this._depthCullingState.depthMask = enable; + }; + /** + * Enable or disable color writing + * @param enable defines the state to set + */ + Engine.prototype.setColorWrite = function (enable) { + this._gl.colorMask(enable, enable, enable, enable); + this._colorWrite = enable; + }; + /** + * Gets a boolean indicating if color writing is enabled + * @returns the current color writing state + */ + Engine.prototype.getColorWrite = function () { + return this._colorWrite; + }; + /** + * Sets alpha constants used by some alpha blending modes + * @param r defines the red component + * @param g defines the green component + * @param b defines the blue component + * @param a defines the alpha component + */ + Engine.prototype.setAlphaConstants = function (r, g, b, a) { + this._alphaState.setAlphaBlendConstants(r, g, b, a); + }; + /** + * Sets the current alpha mode + * @param mode defines the mode to use (one of the BABYLON.Engine.ALPHA_XXX) + * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default) + * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered + */ + Engine.prototype.setAlphaMode = function (mode, noDepthWriteChange) { + if (noDepthWriteChange === void 0) { noDepthWriteChange = false; } + if (this._alphaMode === mode) { + return; + } + switch (mode) { + case Engine.ALPHA_DISABLE: + this._alphaState.alphaBlend = false; + break; + case Engine.ALPHA_PREMULTIPLIED: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_PREMULTIPLIED_PORTERDUFF: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_COMBINE: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_ONEONE: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_ADD: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_SUBTRACT: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_MULTIPLY: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_MAXIMIZED: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_INTERPOLATE: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA); + this._alphaState.alphaBlend = true; + break; + case Engine.ALPHA_SCREENMODE: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA); + this._alphaState.alphaBlend = true; + break; + } + if (!noDepthWriteChange) { + this.setDepthWrite(mode === Engine.ALPHA_DISABLE); + } + this._alphaMode = mode; + }; + /** + * Gets the current alpha mode + * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered + * @returns the current alpha mode + */ + Engine.prototype.getAlphaMode = function () { + return this._alphaMode; + }; + // Textures + /** + * Clears the list of texture accessible through engine. + * This can help preventing texture load conflict due to name collision. + */ + Engine.prototype.clearInternalTexturesCache = function () { + this._internalTexturesCache = []; + }; + /** + * Force the entire cache to be cleared + * You should not have to use this function unless your engine needs to share the webGL context with another engine + * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states) + */ + Engine.prototype.wipeCaches = function (bruteForce) { + if (this.preventCacheWipeBetweenFrames && !bruteForce) { + return; + } + this._currentEffect = null; + this._viewportCached.x = 0; + this._viewportCached.y = 0; + this._viewportCached.z = 0; + this._viewportCached.w = 0; + if (bruteForce) { + this.resetTextureCache(); + this._currentProgram = null; + this._stencilState.reset(); + this._depthCullingState.reset(); + this.setDepthFunctionToLessOrEqual(); + this._alphaState.reset(); + this._unpackFlipYCached = null; + } + this._resetVertexBufferBinding(); + this._cachedIndexBuffer = null; + this._cachedEffectForVertexBuffers = null; + this._unbindVertexArrayObject(); + this.bindIndexBuffer(null); + }; + /** + * Set the compressed texture format to use, based on the formats you have, and the formats + * supported by the hardware / browser. + * + * Khronos Texture Container (.ktx) files are used to support this. This format has the + * advantage of being specifically designed for OpenGL. Header elements directly correspond + * to API arguments needed to compressed textures. This puts the burden on the container + * generator to house the arcane code for determining these for current & future formats. + * + * for description see https://www.khronos.org/opengles/sdk/tools/KTX/ + * for file layout see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ + * + * Note: The result of this call is not taken into account when a texture is base64. + * + * @param formatsAvailable defines the list of those format families you have created + * on your server. Syntax: '-' + format family + '.ktx'. (Case and order do not matter.) + * + * Current families are astc, dxt, pvrtc, etc2, & etc1. + * @returns The extension selected. + */ + Engine.prototype.setTextureFormatToUse = function (formatsAvailable) { + for (var i = 0, len1 = this.texturesSupported.length; i < len1; i++) { + for (var j = 0, len2 = formatsAvailable.length; j < len2; j++) { + if (this._texturesSupported[i] === formatsAvailable[j].toLowerCase()) { + return this._textureFormatInUse = this._texturesSupported[i]; + } + } + } + // actively set format to nothing, to allow this to be called more than once + // and possibly fail the 2nd time + this._textureFormatInUse = null; + return null; + }; + Engine.prototype._getSamplingParameters = function (samplingMode, generateMipMaps) { + var gl = this._gl; + var magFilter = gl.NEAREST; + var minFilter = gl.NEAREST; + switch (samplingMode) { + case Engine.TEXTURE_BILINEAR_SAMPLINGMODE: + magFilter = gl.LINEAR; + if (generateMipMaps) { + minFilter = gl.LINEAR_MIPMAP_NEAREST; + } + else { + minFilter = gl.LINEAR; + } + break; + case Engine.TEXTURE_TRILINEAR_SAMPLINGMODE: + magFilter = gl.LINEAR; + if (generateMipMaps) { + minFilter = gl.LINEAR_MIPMAP_LINEAR; + } + else { + minFilter = gl.LINEAR; + } + break; + case Engine.TEXTURE_NEAREST_SAMPLINGMODE: + magFilter = gl.NEAREST; + if (generateMipMaps) { + minFilter = gl.NEAREST_MIPMAP_LINEAR; + } + else { + minFilter = gl.NEAREST; + } + break; + case Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST: + magFilter = gl.NEAREST; + if (generateMipMaps) { + minFilter = gl.NEAREST_MIPMAP_NEAREST; + } + else { + minFilter = gl.NEAREST; + } + break; + case Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST: + magFilter = gl.NEAREST; + if (generateMipMaps) { + minFilter = gl.LINEAR_MIPMAP_NEAREST; + } + else { + minFilter = gl.LINEAR; + } + break; + case Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR: + magFilter = gl.NEAREST; + if (generateMipMaps) { + minFilter = gl.LINEAR_MIPMAP_LINEAR; + } + else { + minFilter = gl.LINEAR; + } + break; + case Engine.TEXTURE_NEAREST_LINEAR: + magFilter = gl.NEAREST; + minFilter = gl.LINEAR; + break; + case Engine.TEXTURE_NEAREST_NEAREST: + magFilter = gl.NEAREST; + minFilter = gl.NEAREST; + break; + case Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST: + magFilter = gl.LINEAR; + if (generateMipMaps) { + minFilter = gl.NEAREST_MIPMAP_NEAREST; + } + else { + minFilter = gl.NEAREST; + } + break; + case Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR: + magFilter = gl.LINEAR; + if (generateMipMaps) { + minFilter = gl.NEAREST_MIPMAP_LINEAR; + } + else { + minFilter = gl.NEAREST; + } + break; + case Engine.TEXTURE_LINEAR_LINEAR: + magFilter = gl.LINEAR; + minFilter = gl.LINEAR; + break; + case Engine.TEXTURE_LINEAR_NEAREST: + magFilter = gl.LINEAR; + minFilter = gl.NEAREST; + break; + } + return { + min: minFilter, + mag: magFilter + }; + }; + Engine.prototype._partialLoadImg = function (url, index, loadedImages, scene, onfinish, onErrorCallBack) { + if (onErrorCallBack === void 0) { onErrorCallBack = null; } + var img; + var onload = function () { + loadedImages[index] = img; + loadedImages._internalCount++; + if (scene) { + scene._removePendingData(img); + } + if (loadedImages._internalCount === 6) { + onfinish(loadedImages); + } + }; + var onerror = function (message, exception) { + if (scene) { + scene._removePendingData(img); + } + if (onErrorCallBack) { + onErrorCallBack(message, exception); + } + }; + img = BABYLON.Tools.LoadImage(url, onload, onerror, scene ? scene.database : null); + if (scene) { + scene._addPendingData(img); + } + }; + Engine.prototype._cascadeLoadImgs = function (rootUrl, scene, onfinish, files, onError) { + if (onError === void 0) { onError = null; } + var loadedImages = []; + loadedImages._internalCount = 0; + for (var index = 0; index < 6; index++) { + this._partialLoadImg(files[index], index, loadedImages, scene, onfinish, onError); + } + }; + /** @hidden */ + Engine.prototype._createTexture = function () { + var texture = this._gl.createTexture(); + if (!texture) { + throw new Error("Unable to create texture"); + } + return texture; + }; + /** + * Usually called from BABYLON.Texture.ts. + * Passed information to create a WebGLTexture + * @param urlArg defines a value which contains one of the following: + * * A conventional http URL, e.g. 'http://...' or 'file://...' + * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...' + * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg' + * @param noMipmap defines a boolean indicating that no mipmaps shall be generated. Ignored for compressed textures. They must be in the file + * @param invertY when true, image is flipped when loaded. You probably want true. Ignored for compressed textures. Must be flipped in the file + * @param scene needed for loading to the correct scene + * @param samplingMode mode with should be used sample / access the texture (Default: BABYLON.Texture.TRILINEAR_SAMPLINGMODE) + * @param onLoad optional callback to be called upon successful completion + * @param onError optional callback to be called upon failure + * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob + * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities + * @param format internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures + * @param forcedExtension defines the extension to use to pick the right loader + * @returns a InternalTexture for assignment back into BABYLON.Texture + */ + Engine.prototype.createTexture = function (urlArg, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallback, format, forcedExtension) { + var _this = this; + if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; } + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + if (buffer === void 0) { buffer = null; } + if (fallback === void 0) { fallback = null; } + if (format === void 0) { format = null; } + if (forcedExtension === void 0) { forcedExtension = null; } + var url = String(urlArg); // assign a new string, so that the original is still available in case of fallback + var fromData = url.substr(0, 5) === "data:"; + var fromBlob = url.substr(0, 5) === "blob:"; + var isBase64 = fromData && url.indexOf(";base64,") !== -1; + var texture = fallback ? fallback : new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_URL); + // establish the file extension, if possible + var lastDot = url.lastIndexOf('.'); + var extension = forcedExtension ? forcedExtension : (lastDot > -1 ? url.substring(lastDot).toLowerCase() : ""); + var loader = null; + for (var _i = 0, _a = Engine._TextureLoaders; _i < _a.length; _i++) { + var availableLoader = _a[_i]; + if (availableLoader.canLoad(extension, this._textureFormatInUse, fallback, isBase64, buffer ? true : false)) { + loader = availableLoader; + break; + } + } + if (loader) { + url = loader.transformUrl(url, this._textureFormatInUse); + } + if (scene) { + scene._addPendingData(texture); + } + texture.url = url; + texture.generateMipMaps = !noMipmap; + texture.samplingMode = samplingMode; + texture.invertY = invertY; + if (!this._doNotHandleContextLost) { + // Keep a link to the buffer only if we plan to handle context lost + texture._buffer = buffer; + } + var onLoadObserver = null; + if (onLoad && !fallback) { + onLoadObserver = texture.onLoadedObservable.add(onLoad); + } + if (!fallback) { + this._internalTexturesCache.push(texture); + } + var onInternalError = function (message, exception) { + if (scene) { + scene._removePendingData(texture); + } + var customFallback = false; + if (loader) { + var fallbackUrl = loader.getFallbackTextureUrl(url, _this._textureFormatInUse); + if (fallbackUrl) { + // Add Back + customFallback = true; + _this.createTexture(urlArg, noMipmap, invertY, scene, samplingMode, null, onError, buffer, texture); + } + } + if (!customFallback) { + if (onLoadObserver) { + texture.onLoadedObservable.remove(onLoadObserver); + } + if (BABYLON.Tools.UseFallbackTexture) { + _this.createTexture(BABYLON.Tools.fallbackTexture, noMipmap, invertY, scene, samplingMode, null, onError, buffer, texture); + } + } + if (onError) { + onError(message || "Unknown error", exception); + } + }; + // processing for non-image formats + if (loader) { + var callback = function (data) { + loader.loadData(data, texture, function (width, height, loadMipmap, isCompressed, done) { + _this._prepareWebGLTexture(texture, scene, width, height, invertY, !loadMipmap, isCompressed, function () { + done(); + return false; + }, samplingMode); + }); + }; + if (!buffer) { + this._loadFile(url, callback, undefined, scene ? scene.database : undefined, true, function (request, exception) { + onInternalError("Unable to load " + (request ? request.responseURL : url, exception)); + }); + } + else { + callback(buffer); + } + } + else { + var onload = function (img) { + if (fromBlob && !_this._doNotHandleContextLost) { + // We need to store the image if we need to rebuild the texture + // in case of a webgl context lost + texture._buffer = img; + } + _this._prepareWebGLTexture(texture, scene, img.width, img.height, invertY, noMipmap, false, function (potWidth, potHeight, continuationCallback) { + var gl = _this._gl; + var isPot = (img.width === potWidth && img.height === potHeight); + var internalFormat = format ? _this._getInternalFormat(format) : ((extension === ".jpg") ? gl.RGB : gl.RGBA); + if (isPot) { + gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, internalFormat, gl.UNSIGNED_BYTE, img); + return false; + } + var maxTextureSize = _this._caps.maxTextureSize; + if (img.width > maxTextureSize || img.height > maxTextureSize) { + _this._prepareWorkingCanvas(); + if (!_this._workingCanvas || !_this._workingContext) { + return false; + } + _this._workingCanvas.width = potWidth; + _this._workingCanvas.height = potHeight; + _this._workingContext.drawImage(img, 0, 0, img.width, img.height, 0, 0, potWidth, potHeight); + gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, internalFormat, gl.UNSIGNED_BYTE, _this._workingCanvas); + texture.width = potWidth; + texture.height = potHeight; + return false; + } + else { + // Using shaders when possible to rescale because canvas.drawImage is lossy + var source_1 = new BABYLON.InternalTexture(_this, BABYLON.InternalTexture.DATASOURCE_TEMP); + _this._bindTextureDirectly(gl.TEXTURE_2D, source_1, true); + gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, internalFormat, gl.UNSIGNED_BYTE, img); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + _this._rescaleTexture(source_1, texture, scene, internalFormat, function () { + _this._releaseTexture(source_1); + _this._bindTextureDirectly(gl.TEXTURE_2D, texture, true); + continuationCallback(); + }); + } + return true; + }, samplingMode); + }; + if (!fromData || isBase64) { + if (buffer instanceof HTMLImageElement) { + onload(buffer); + } + else { + BABYLON.Tools.LoadImage(url, onload, onInternalError, scene ? scene.database : null); + } + } + else if (typeof buffer === "string" || buffer instanceof ArrayBuffer || buffer instanceof Blob) { + BABYLON.Tools.LoadImage(buffer, onload, onInternalError, scene ? scene.database : null); + } + else { + onload(buffer); + } + } + return texture; + }; + Engine.prototype._rescaleTexture = function (source, destination, scene, internalFormat, onComplete) { + var _this = this; + var rtt = this.createRenderTargetTexture({ + width: destination.width, + height: destination.height, + }, { + generateMipMaps: false, + type: Engine.TEXTURETYPE_UNSIGNED_INT, + samplingMode: Engine.TEXTURE_BILINEAR_SAMPLINGMODE, + generateDepthBuffer: false, + generateStencilBuffer: false + }); + if (!this._rescalePostProcess) { + this._rescalePostProcess = new BABYLON.PassPostProcess("rescale", 1, null, Engine.TEXTURE_BILINEAR_SAMPLINGMODE, this, false, Engine.TEXTURETYPE_UNSIGNED_INT); + } + this._rescalePostProcess.getEffect().executeWhenCompiled(function () { + _this._rescalePostProcess.onApply = function (effect) { + effect._bindTexture("textureSampler", source); + }; + var hostingScene = scene; + if (!hostingScene) { + hostingScene = _this.scenes[_this.scenes.length - 1]; + } + hostingScene.postProcessManager.directRender([_this._rescalePostProcess], rtt, true); + _this._bindTextureDirectly(_this._gl.TEXTURE_2D, destination, true); + _this._gl.copyTexImage2D(_this._gl.TEXTURE_2D, 0, internalFormat, 0, 0, destination.width, destination.height, 0); + _this.unBindFramebuffer(rtt); + _this._releaseTexture(rtt); + if (onComplete) { + onComplete(); + } + }); + }; + /** + * Update a raw texture + * @param texture defines the texture to update + * @param data defines the data to store in the texture + * @param format defines the format of the data + * @param invertY defines if data must be stored with Y axis inverted + * @param compression defines the compression used (null by default) + * @param type defines the type fo the data (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default) + */ + Engine.prototype.updateRawTexture = function (texture, data, format, invertY, compression, type) { + if (compression === void 0) { compression = null; } + if (type === void 0) { type = Engine.TEXTURETYPE_UNSIGNED_INT; } + if (!texture) { + return; + } + // babylon's internalSizedFomat but gl's texImage2D internalFormat + var internalSizedFomat = this._getRGBABufferInternalSizedFormat(type, format); + // babylon's internalFormat but gl's texImage2D format + var internalFormat = this._getInternalFormat(format); + var textureType = this._getWebGLTextureType(type); + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true); + this._unpackFlipY(invertY === undefined ? true : (invertY ? true : false)); + if (!this._doNotHandleContextLost) { + texture._bufferView = data; + texture.format = format; + texture.type = type; + texture.invertY = invertY; + texture._compression = compression; + } + if (texture.width % 4 !== 0) { + this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1); + } + if (compression && data) { + this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, 0, data); + } + else { + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, data); + } + if (texture.generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + // this.resetTextureCache(); + texture.isReady = true; + }; + /** + * Creates a raw texture + * @param data defines the data to store in the texture + * @param width defines the width of the texture + * @param height defines the height of the texture + * @param format defines the format of the data + * @param generateMipMaps defines if the engine should generate the mip levels + * @param invertY defines if data must be stored with Y axis inverted + * @param samplingMode defines the required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default) + * @param compression defines the compression used (null by default) + * @param type defines the type fo the data (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default) + * @returns the raw texture inside an InternalTexture + */ + Engine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type) { + if (compression === void 0) { compression = null; } + if (type === void 0) { type = Engine.TEXTURETYPE_UNSIGNED_INT; } + var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW); + texture.baseWidth = width; + texture.baseHeight = height; + texture.width = width; + texture.height = height; + texture.format = format; + texture.generateMipMaps = generateMipMaps; + texture.samplingMode = samplingMode; + texture.invertY = invertY; + texture._compression = compression; + texture.type = type; + if (!this._doNotHandleContextLost) { + texture._bufferView = data; + } + this.updateRawTexture(texture, data, format, invertY, compression, type); + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true); + // Filters + var filters = this._getSamplingParameters(samplingMode, generateMipMaps); + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag); + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min); + if (generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + this._internalTexturesCache.push(texture); + return texture; + }; + /** @hidden */ + Engine.prototype._unpackFlipY = function (value) { + if (this._unpackFlipYCached !== value) { + this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, value ? 1 : 0); + if (this.enableUnpackFlipYCached) { + this._unpackFlipYCached = value; + } + } + }; + /** @hidden */ + Engine.prototype._getUnpackAlignement = function () { + return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT); + }; + /** + * Creates a dynamic texture + * @param width defines the width of the texture + * @param height defines the height of the texture + * @param generateMipMaps defines if the engine should generate the mip levels + * @param samplingMode defines the required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default) + * @returns the dynamic texture inside an InternalTexture + */ + Engine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) { + var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_DYNAMIC); + texture.baseWidth = width; + texture.baseHeight = height; + if (generateMipMaps) { + width = this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(width, this._caps.maxTextureSize) : width; + height = this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(height, this._caps.maxTextureSize) : height; + } + // this.resetTextureCache(); + texture.width = width; + texture.height = height; + texture.isReady = false; + texture.generateMipMaps = generateMipMaps; + texture.samplingMode = samplingMode; + this.updateTextureSamplingMode(samplingMode, texture); + this._internalTexturesCache.push(texture); + return texture; + }; + /** + * Update the sampling mode of a given texture + * @param samplingMode defines the required sampling mode + * @param texture defines the texture to update + */ + Engine.prototype.updateTextureSamplingMode = function (samplingMode, texture) { + var filters = this._getSamplingParameters(samplingMode, texture.generateMipMaps); + if (texture.isCube) { + this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_MAG_FILTER, filters.mag, texture); + this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_MIN_FILTER, filters.min); + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); + } + else if (texture.is3D) { + this._setTextureParameterInteger(this._gl.TEXTURE_3D, this._gl.TEXTURE_MAG_FILTER, filters.mag, texture); + this._setTextureParameterInteger(this._gl.TEXTURE_3D, this._gl.TEXTURE_MIN_FILTER, filters.min); + this._bindTextureDirectly(this._gl.TEXTURE_3D, null); + } + else { + this._setTextureParameterInteger(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag, texture); + this._setTextureParameterInteger(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min); + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + } + texture.samplingMode = samplingMode; + }; + /** + * Update the content of a dynamic texture + * @param texture defines the texture to update + * @param canvas defines the canvas containing the source + * @param invertY defines if data must be stored with Y axis inverted + * @param premulAlpha defines if alpha is stored as premultiplied + * @param format defines the format of the data + */ + Engine.prototype.updateDynamicTexture = function (texture, canvas, invertY, premulAlpha, format) { + if (premulAlpha === void 0) { premulAlpha = false; } + if (!texture) { + return; + } + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true); + this._unpackFlipY(invertY); + if (premulAlpha) { + this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1); + } + var internalFormat = format ? this._getInternalFormat(format) : this._gl.RGBA; + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, internalFormat, this._gl.UNSIGNED_BYTE, canvas); + if (texture.generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + if (premulAlpha) { + this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0); + } + texture.isReady = true; + }; + /** + * Update a video texture + * @param texture defines the texture to update + * @param video defines the video element to use + * @param invertY defines if data must be stored with Y axis inverted + */ + Engine.prototype.updateVideoTexture = function (texture, video, invertY) { + if (!texture || texture._isDisabled) { + return; + } + var wasPreviouslyBound = this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true); + this._unpackFlipY(!invertY); // Video are upside down by default + try { + // Testing video texture support + if (this._videoTextureSupported === undefined) { + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, video); + if (this._gl.getError() !== 0) { + this._videoTextureSupported = false; + } + else { + this._videoTextureSupported = true; + } + } + // Copy video through the current working canvas if video texture is not supported + if (!this._videoTextureSupported) { + if (!texture._workingCanvas) { + texture._workingCanvas = document.createElement("canvas"); + var context = texture._workingCanvas.getContext("2d"); + if (!context) { + throw new Error("Unable to get 2d context"); + } + texture._workingContext = context; + texture._workingCanvas.width = texture.width; + texture._workingCanvas.height = texture.height; + } + texture._workingContext.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, texture.width, texture.height); + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, texture._workingCanvas); + } + else { + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, video); + } + if (texture.generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + if (!wasPreviouslyBound) { + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + } + // this.resetTextureCache(); + texture.isReady = true; + } + catch (ex) { + // Something unexpected + // Let's disable the texture + texture._isDisabled = true; + } + }; + /** + * Updates a depth texture Comparison Mode and Function. + * If the comparison Function is equal to 0, the mode will be set to none. + * Otherwise, this only works in webgl 2 and requires a shadow sampler in the shader. + * @param texture The texture to set the comparison function for + * @param comparisonFunction The comparison function to set, 0 if no comparison required + */ + Engine.prototype.updateTextureComparisonFunction = function (texture, comparisonFunction) { + if (this.webGLVersion === 1) { + BABYLON.Tools.Error("WebGL 1 does not support texture comparison."); + return; + } + var gl = this._gl; + if (texture.isCube) { + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true); + if (comparisonFunction === 0) { + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, Engine.LEQUAL); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.NONE); + } + else { + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, comparisonFunction); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE); + } + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); + } + else { + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true); + if (comparisonFunction === 0) { + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, Engine.LEQUAL); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.NONE); + } + else { + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, comparisonFunction); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE); + } + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + } + texture._comparisonFunction = comparisonFunction; + }; + Engine.prototype._setupDepthStencilTexture = function (internalTexture, size, generateStencil, bilinearFiltering, comparisonFunction) { + var width = size.width || size; + var height = size.height || size; + internalTexture.baseWidth = width; + internalTexture.baseHeight = height; + internalTexture.width = width; + internalTexture.height = height; + internalTexture.isReady = true; + internalTexture.samples = 1; + internalTexture.generateMipMaps = false; + internalTexture._generateDepthBuffer = true; + internalTexture._generateStencilBuffer = generateStencil; + internalTexture.samplingMode = bilinearFiltering ? Engine.TEXTURE_BILINEAR_SAMPLINGMODE : Engine.TEXTURE_NEAREST_SAMPLINGMODE; + internalTexture.type = Engine.TEXTURETYPE_UNSIGNED_INT; + internalTexture._comparisonFunction = comparisonFunction; + var gl = this._gl; + var target = internalTexture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D; + var samplingParameters = this._getSamplingParameters(internalTexture.samplingMode, false); + gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, samplingParameters.mag); + gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, samplingParameters.min); + gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + if (comparisonFunction === 0) { + gl.texParameteri(target, gl.TEXTURE_COMPARE_FUNC, Engine.LEQUAL); + gl.texParameteri(target, gl.TEXTURE_COMPARE_MODE, gl.NONE); + } + else { + gl.texParameteri(target, gl.TEXTURE_COMPARE_FUNC, comparisonFunction); + gl.texParameteri(target, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE); + } + }; + /** + * Creates a depth stencil texture. + * This is only available in WebGL 2 or with the depth texture extension available. + * @param size The size of face edge in the texture. + * @param options The options defining the texture. + * @returns The texture + */ + Engine.prototype.createDepthStencilTexture = function (size, options) { + if (options.isCube) { + var width = size.width || size; + return this._createDepthStencilCubeTexture(width, options); + } + else { + return this._createDepthStencilTexture(size, options); + } + }; + /** + * Creates a depth stencil texture. + * This is only available in WebGL 2 or with the depth texture extension available. + * @param size The size of face edge in the texture. + * @param options The options defining the texture. + * @returns The texture + */ + Engine.prototype._createDepthStencilTexture = function (size, options) { + var internalTexture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_DEPTHTEXTURE); + if (!this._caps.depthTextureExtension) { + BABYLON.Tools.Error("Depth texture is not supported by your browser or hardware."); + return internalTexture; + } + var internalOptions = __assign({ bilinearFiltering: false, comparisonFunction: 0, generateStencil: false }, options); + var gl = this._gl; + this._bindTextureDirectly(gl.TEXTURE_2D, internalTexture, true); + this._setupDepthStencilTexture(internalTexture, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction); + if (this.webGLVersion > 1) { + if (internalOptions.generateStencil) { + gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH24_STENCIL8, internalTexture.width, internalTexture.height, 0, gl.DEPTH_STENCIL, gl.UNSIGNED_INT_24_8, null); + } + else { + gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT24, internalTexture.width, internalTexture.height, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null); + } + } + else { + if (internalOptions.generateStencil) { + gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_STENCIL, internalTexture.width, internalTexture.height, 0, gl.DEPTH_STENCIL, gl.UNSIGNED_INT_24_8, null); + } + else { + gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT, internalTexture.width, internalTexture.height, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null); + } + } + this._bindTextureDirectly(gl.TEXTURE_2D, null); + return internalTexture; + }; + /** + * Creates a depth stencil cube texture. + * This is only available in WebGL 2. + * @param size The size of face edge in the cube texture. + * @param options The options defining the cube texture. + * @returns The cube texture + */ + Engine.prototype._createDepthStencilCubeTexture = function (size, options) { + var internalTexture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_UNKNOWN); + internalTexture.isCube = true; + if (this.webGLVersion === 1) { + BABYLON.Tools.Error("Depth cube texture is not supported by WebGL 1."); + return internalTexture; + } + var internalOptions = __assign({ bilinearFiltering: false, comparisonFunction: 0, generateStencil: false }, options); + var gl = this._gl; + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, internalTexture, true); + this._setupDepthStencilTexture(internalTexture, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction); + // Create the depth/stencil buffer + for (var face = 0; face < 6; face++) { + if (internalOptions.generateStencil) { + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, gl.DEPTH24_STENCIL8, size, size, 0, gl.DEPTH_STENCIL, gl.UNSIGNED_INT_24_8, null); + } + else { + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, gl.DEPTH_COMPONENT24, size, size, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null); + } + } + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + return internalTexture; + }; + /** + * Sets the frame buffer Depth / Stencil attachement of the render target to the defined depth stencil texture. + * @param renderTarget The render target to set the frame buffer for + */ + Engine.prototype.setFrameBufferDepthStencilTexture = function (renderTarget) { + // Create the framebuffer + var internalTexture = renderTarget.getInternalTexture(); + if (!internalTexture || !internalTexture._framebuffer || !renderTarget.depthStencilTexture) { + return; + } + var gl = this._gl; + var depthStencilTexture = renderTarget.depthStencilTexture; + this.bindUnboundFramebuffer(internalTexture._framebuffer); + if (depthStencilTexture.isCube) { + if (depthStencilTexture._generateStencilBuffer) { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.TEXTURE_CUBE_MAP_POSITIVE_X, depthStencilTexture._webGLTexture, 0); + } + else { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_CUBE_MAP_POSITIVE_X, depthStencilTexture._webGLTexture, 0); + } + } + else { + if (depthStencilTexture._generateStencilBuffer) { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.TEXTURE_2D, depthStencilTexture._webGLTexture, 0); + } + else { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthStencilTexture._webGLTexture, 0); + } + } + this.bindUnboundFramebuffer(null); + }; + /** + * Creates a new render target texture + * @param size defines the size of the texture + * @param options defines the options used to create the texture + * @returns a new render target texture stored in an InternalTexture + */ + Engine.prototype.createRenderTargetTexture = function (size, options) { + var fullOptions = new RenderTargetCreationOptions(); + if (options !== undefined && typeof options === "object") { + fullOptions.generateMipMaps = options.generateMipMaps; + fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; + fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer; + fullOptions.type = options.type === undefined ? Engine.TEXTURETYPE_UNSIGNED_INT : options.type; + fullOptions.samplingMode = options.samplingMode === undefined ? Engine.TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode; + fullOptions.format = options.format === undefined ? Engine.TEXTUREFORMAT_RGBA : options.format; + } + else { + fullOptions.generateMipMaps = options; + fullOptions.generateDepthBuffer = true; + fullOptions.generateStencilBuffer = false; + fullOptions.type = Engine.TEXTURETYPE_UNSIGNED_INT; + fullOptions.samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; + fullOptions.format = Engine.TEXTUREFORMAT_RGBA; + } + if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) { + // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE + fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE; + } + else if (fullOptions.type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) { + // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE + fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE; + } + var gl = this._gl; + var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RENDERTARGET); + this._bindTextureDirectly(gl.TEXTURE_2D, texture, true); + var width = size.width || size; + var height = size.height || size; + var filters = this._getSamplingParameters(fullOptions.samplingMode, fullOptions.generateMipMaps ? true : false); + if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloat) { + fullOptions.type = Engine.TEXTURETYPE_UNSIGNED_INT; + BABYLON.Tools.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"); + } + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filters.min); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texImage2D(gl.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(fullOptions.type, fullOptions.format), width, height, 0, this._getInternalFormat(fullOptions.format), this._getWebGLTextureType(fullOptions.type), null); + // Create the framebuffer + var currentFrameBuffer = this._currentFramebuffer; + var framebuffer = gl.createFramebuffer(); + this.bindUnboundFramebuffer(framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture._webGLTexture, 0); + texture._depthStencilBuffer = this._setupFramebufferDepthAttachments(fullOptions.generateStencilBuffer ? true : false, fullOptions.generateDepthBuffer, width, height); + if (fullOptions.generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + // Unbind + this._bindTextureDirectly(gl.TEXTURE_2D, null); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + this.bindUnboundFramebuffer(currentFrameBuffer); + texture._framebuffer = framebuffer; + texture.baseWidth = width; + texture.baseHeight = height; + texture.width = width; + texture.height = height; + texture.isReady = true; + texture.samples = 1; + texture.generateMipMaps = fullOptions.generateMipMaps ? true : false; + texture.samplingMode = fullOptions.samplingMode; + texture.type = fullOptions.type; + texture.format = fullOptions.format; + texture._generateDepthBuffer = fullOptions.generateDepthBuffer; + texture._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false; + // this.resetTextureCache(); + this._internalTexturesCache.push(texture); + return texture; + }; + /** + * Create a multi render target texture + * @see http://doc.babylonjs.com/features/webgl2#multiple-render-target + * @param size defines the size of the texture + * @param options defines the creation options + * @returns the cube texture as an InternalTexture + */ + Engine.prototype.createMultipleRenderTarget = function (size, options) { + var generateMipMaps = false; + var generateDepthBuffer = true; + var generateStencilBuffer = false; + var generateDepthTexture = false; + var textureCount = 1; + var defaultType = Engine.TEXTURETYPE_UNSIGNED_INT; + var defaultSamplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; + var types = new Array(); + var samplingModes = new Array(); + if (options !== undefined) { + generateMipMaps = options.generateMipMaps === undefined ? false : options.generateMipMaps; + generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; + generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer; + generateDepthTexture = options.generateDepthTexture === undefined ? false : options.generateDepthTexture; + textureCount = options.textureCount || 1; + if (options.types) { + types = options.types; + } + if (options.samplingModes) { + samplingModes = options.samplingModes; + } + } + var gl = this._gl; + // Create the framebuffer + var framebuffer = gl.createFramebuffer(); + this.bindUnboundFramebuffer(framebuffer); + var width = size.width || size; + var height = size.height || size; + var textures = []; + var attachments = []; + var depthStencilBuffer = this._setupFramebufferDepthAttachments(generateStencilBuffer, generateDepthBuffer, width, height); + for (var i = 0; i < textureCount; i++) { + var samplingMode = samplingModes[i] || defaultSamplingMode; + var type = types[i] || defaultType; + if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) { + // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE + samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE; + } + else if (type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) { + // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE + samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE; + } + var filters = this._getSamplingParameters(samplingMode, generateMipMaps); + if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloat) { + type = Engine.TEXTURETYPE_UNSIGNED_INT; + BABYLON.Tools.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"); + } + var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_MULTIRENDERTARGET); + var attachment = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; + textures.push(texture); + attachments.push(attachment); + gl.activeTexture(gl["TEXTURE" + i]); + gl.bindTexture(gl.TEXTURE_2D, texture._webGLTexture); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filters.min); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texImage2D(gl.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(type), width, height, 0, gl.RGBA, this._getWebGLTextureType(type), null); + gl.framebufferTexture2D(gl.DRAW_FRAMEBUFFER, attachment, gl.TEXTURE_2D, texture._webGLTexture, 0); + if (generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + // Unbind + this._bindTextureDirectly(gl.TEXTURE_2D, null); + texture._framebuffer = framebuffer; + texture._depthStencilBuffer = depthStencilBuffer; + texture.baseWidth = width; + texture.baseHeight = height; + texture.width = width; + texture.height = height; + texture.isReady = true; + texture.samples = 1; + texture.generateMipMaps = generateMipMaps; + texture.samplingMode = samplingMode; + texture.type = type; + texture._generateDepthBuffer = generateDepthBuffer; + texture._generateStencilBuffer = generateStencilBuffer; + texture._attachments = attachments; + this._internalTexturesCache.push(texture); + } + if (generateDepthTexture && this._caps.depthTextureExtension) { + // Depth texture + var depthTexture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_MULTIRENDERTARGET); + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, depthTexture._webGLTexture); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texImage2D(gl.TEXTURE_2D, 0, this.webGLVersion < 2 ? gl.DEPTH_COMPONENT : gl.DEPTH_COMPONENT16, width, height, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_SHORT, null); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthTexture._webGLTexture, 0); + depthTexture._framebuffer = framebuffer; + depthTexture.baseWidth = width; + depthTexture.baseHeight = height; + depthTexture.width = width; + depthTexture.height = height; + depthTexture.isReady = true; + depthTexture.samples = 1; + depthTexture.generateMipMaps = generateMipMaps; + depthTexture.samplingMode = gl.NEAREST; + depthTexture._generateDepthBuffer = generateDepthBuffer; + depthTexture._generateStencilBuffer = generateStencilBuffer; + textures.push(depthTexture); + this._internalTexturesCache.push(depthTexture); + } + gl.drawBuffers(attachments); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + this.bindUnboundFramebuffer(null); + this.resetTextureCache(); + return textures; + }; + Engine.prototype._setupFramebufferDepthAttachments = function (generateStencilBuffer, generateDepthBuffer, width, height, samples) { + if (samples === void 0) { samples = 1; } + var depthStencilBuffer = null; + var gl = this._gl; + // Create the depth/stencil buffer + if (generateStencilBuffer) { + depthStencilBuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); + if (samples > 1) { + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, gl.DEPTH24_STENCIL8, width, height); + } + else { + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height); + } + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + } + else if (generateDepthBuffer) { + depthStencilBuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); + if (samples > 1) { + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, gl.DEPTH_COMPONENT16, width, height); + } + else { + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height); + } + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + } + return depthStencilBuffer; + }; + /** + * Updates the sample count of a render target texture + * @see http://doc.babylonjs.com/features/webgl2#multisample-render-targets + * @param texture defines the texture to update + * @param samples defines the sample count to set + * @returns the effective sample count (could be 0 if multisample render targets are not supported) + */ + Engine.prototype.updateRenderTargetTextureSampleCount = function (texture, samples) { + if (this.webGLVersion < 2 || !texture) { + return 1; + } + if (texture.samples === samples) { + return samples; + } + var gl = this._gl; + samples = Math.min(samples, gl.getParameter(gl.MAX_SAMPLES)); + // Dispose previous render buffers + if (texture._depthStencilBuffer) { + gl.deleteRenderbuffer(texture._depthStencilBuffer); + texture._depthStencilBuffer = null; + } + if (texture._MSAAFramebuffer) { + gl.deleteFramebuffer(texture._MSAAFramebuffer); + texture._MSAAFramebuffer = null; + } + if (texture._MSAARenderBuffer) { + gl.deleteRenderbuffer(texture._MSAARenderBuffer); + texture._MSAARenderBuffer = null; + } + if (samples > 1) { + var framebuffer = gl.createFramebuffer(); + if (!framebuffer) { + throw new Error("Unable to create multi sampled framebuffer"); + } + texture._MSAAFramebuffer = framebuffer; + this.bindUnboundFramebuffer(texture._MSAAFramebuffer); + var colorRenderbuffer = gl.createRenderbuffer(); + if (!colorRenderbuffer) { + throw new Error("Unable to create multi sampled framebuffer"); + } + gl.bindRenderbuffer(gl.RENDERBUFFER, colorRenderbuffer); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, this._getRGBAMultiSampleBufferFormat(texture.type), texture.width, texture.height); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRenderbuffer); + texture._MSAARenderBuffer = colorRenderbuffer; + } + else { + this.bindUnboundFramebuffer(texture._framebuffer); + } + texture.samples = samples; + texture._depthStencilBuffer = this._setupFramebufferDepthAttachments(texture._generateStencilBuffer, texture._generateDepthBuffer, texture.width, texture.height, samples); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + this.bindUnboundFramebuffer(null); + return samples; + }; + /** + * Update the sample count for a given multiple render target texture + * @see http://doc.babylonjs.com/features/webgl2#multisample-render-targets + * @param textures defines the textures to update + * @param samples defines the sample count to set + * @returns the effective sample count (could be 0 if multisample render targets are not supported) + */ + Engine.prototype.updateMultipleRenderTargetTextureSampleCount = function (textures, samples) { + if (this.webGLVersion < 2 || !textures || textures.length == 0) { + return 1; + } + if (textures[0].samples === samples) { + return samples; + } + var gl = this._gl; + samples = Math.min(samples, gl.getParameter(gl.MAX_SAMPLES)); + // Dispose previous render buffers + if (textures[0]._depthStencilBuffer) { + gl.deleteRenderbuffer(textures[0]._depthStencilBuffer); + textures[0]._depthStencilBuffer = null; + } + if (textures[0]._MSAAFramebuffer) { + gl.deleteFramebuffer(textures[0]._MSAAFramebuffer); + textures[0]._MSAAFramebuffer = null; + } + for (var i = 0; i < textures.length; i++) { + if (textures[i]._MSAARenderBuffer) { + gl.deleteRenderbuffer(textures[i]._MSAARenderBuffer); + textures[i]._MSAARenderBuffer = null; + } + } + if (samples > 1) { + var framebuffer = gl.createFramebuffer(); + if (!framebuffer) { + throw new Error("Unable to create multi sampled framebuffer"); + } + this.bindUnboundFramebuffer(framebuffer); + var depthStencilBuffer = this._setupFramebufferDepthAttachments(textures[0]._generateStencilBuffer, textures[0]._generateDepthBuffer, textures[0].width, textures[0].height, samples); + var attachments = []; + for (var i = 0; i < textures.length; i++) { + var texture = textures[i]; + var attachment = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; + var colorRenderbuffer = gl.createRenderbuffer(); + if (!colorRenderbuffer) { + throw new Error("Unable to create multi sampled framebuffer"); + } + gl.bindRenderbuffer(gl.RENDERBUFFER, colorRenderbuffer); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, this._getRGBAMultiSampleBufferFormat(texture.type), texture.width, texture.height); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, colorRenderbuffer); + texture._MSAAFramebuffer = framebuffer; + texture._MSAARenderBuffer = colorRenderbuffer; + texture.samples = samples; + texture._depthStencilBuffer = depthStencilBuffer; + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + attachments.push(attachment); + } + gl.drawBuffers(attachments); + } + else { + this.bindUnboundFramebuffer(textures[0]._framebuffer); + } + this.bindUnboundFramebuffer(null); + return samples; + }; + /** @hidden */ + Engine.prototype._uploadCompressedDataToTextureDirectly = function (texture, internalFormat, width, height, data, faceIndex, lod) { + if (faceIndex === void 0) { faceIndex = 0; } + if (lod === void 0) { lod = 0; } + var gl = this._gl; + var target = gl.TEXTURE_2D; + if (texture.isCube) { + target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex; + } + this._gl.compressedTexImage2D(target, lod, internalFormat, width, height, 0, data); + }; + /** @hidden */ + Engine.prototype._uploadDataToTextureDirectly = function (texture, imageData, faceIndex, lod) { + if (faceIndex === void 0) { faceIndex = 0; } + if (lod === void 0) { lod = 0; } + var gl = this._gl; + var textureType = this._getWebGLTextureType(texture.type); + var format = this._getInternalFormat(texture.format); + var internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, format); + this._unpackFlipY(texture.invertY); + var target = gl.TEXTURE_2D; + if (texture.isCube) { + target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex; + } + var lodMaxWidth = Math.round(BABYLON.Scalar.Log2(texture.width)); + var lodMaxHeight = Math.round(BABYLON.Scalar.Log2(texture.height)); + var width = Math.pow(2, Math.max(lodMaxWidth - lod, 0)); + var height = Math.pow(2, Math.max(lodMaxHeight - lod, 0)); + gl.texImage2D(target, lod, internalFormat, width, height, 0, format, textureType, imageData); + }; + /** @hidden */ + Engine.prototype._uploadArrayBufferViewToTexture = function (texture, imageData, faceIndex, lod) { + if (faceIndex === void 0) { faceIndex = 0; } + if (lod === void 0) { lod = 0; } + var gl = this._gl; + var bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D; + this._bindTextureDirectly(bindTarget, texture, true); + this._uploadDataToTextureDirectly(texture, imageData, faceIndex, lod); + this._bindTextureDirectly(bindTarget, null, true); + }; + /** @hidden */ + Engine.prototype._uploadImageToTexture = function (texture, image, faceIndex, lod) { + if (faceIndex === void 0) { faceIndex = 0; } + if (lod === void 0) { lod = 0; } + var gl = this._gl; + var textureType = this._getWebGLTextureType(texture.type); + var format = this._getInternalFormat(texture.format); + var internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, format); + var bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D; + this._bindTextureDirectly(bindTarget, texture, true); + this._unpackFlipY(texture.invertY); + var target = gl.TEXTURE_2D; + if (texture.isCube) { + target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex; + } + gl.texImage2D(target, lod, internalFormat, format, textureType, image); + this._bindTextureDirectly(bindTarget, null, true); + }; + /** + * Creates a new render target cube texture + * @param size defines the size of the texture + * @param options defines the options used to create the texture + * @returns a new render target cube texture stored in an InternalTexture + */ + Engine.prototype.createRenderTargetCubeTexture = function (size, options) { + var fullOptions = __assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: Engine.TEXTURETYPE_UNSIGNED_INT, samplingMode: Engine.TEXTURE_TRILINEAR_SAMPLINGMODE, format: Engine.TEXTUREFORMAT_RGBA }, options); + fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer; + if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) { + // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE + fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE; + } + else if (fullOptions.type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) { + // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE + fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE; + } + var gl = this._gl; + var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RENDERTARGET); + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); + var filters = this._getSamplingParameters(fullOptions.samplingMode, fullOptions.generateMipMaps); + if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloat) { + fullOptions.type = Engine.TEXTURETYPE_UNSIGNED_INT; + BABYLON.Tools.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type"); + } + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + for (var face = 0; face < 6; face++) { + gl.texImage2D((gl.TEXTURE_CUBE_MAP_POSITIVE_X + face), 0, this._getRGBABufferInternalSizedFormat(fullOptions.type, fullOptions.format), size, size, 0, this._getInternalFormat(fullOptions.format), this._getWebGLTextureType(fullOptions.type), null); + } + // Create the framebuffer + var framebuffer = gl.createFramebuffer(); + this.bindUnboundFramebuffer(framebuffer); + texture._depthStencilBuffer = this._setupFramebufferDepthAttachments(fullOptions.generateStencilBuffer, fullOptions.generateDepthBuffer, size, size); + // MipMaps + if (fullOptions.generateMipMaps) { + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + } + // Unbind + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + this.bindUnboundFramebuffer(null); + texture._framebuffer = framebuffer; + texture.width = size; + texture.height = size; + texture.isReady = true; + texture.isCube = true; + texture.samples = 1; + texture.generateMipMaps = fullOptions.generateMipMaps; + texture.samplingMode = fullOptions.samplingMode; + texture.type = fullOptions.type; + texture.format = fullOptions.format; + texture._generateDepthBuffer = fullOptions.generateDepthBuffer; + texture._generateStencilBuffer = fullOptions.generateStencilBuffer; + this._internalTexturesCache.push(texture); + return texture; + }; + /** + * Create a cube texture from prefiltered data (ie. the mipmaps contain ready to use data for PBR reflection) + * @param rootUrl defines the url where the file to load is located + * @param scene defines the current scene + * @param lodScale defines scale to apply to the mip map selection + * @param lodOffset defines offset to apply to the mip map selection + * @param onLoad defines an optional callback raised when the texture is loaded + * @param onError defines an optional callback raised if there is an issue to load the texture + * @param format defines the format of the data + * @param forcedExtension defines the extension to use to pick the right loader + * @param createPolynomials defines wheter or not to create polynomails harmonics for the texture + * @returns the cube texture as an InternalTexture + */ + Engine.prototype.createPrefilteredCubeTexture = function (rootUrl, scene, lodScale, lodOffset, onLoad, onError, format, forcedExtension, createPolynomials) { + var _this = this; + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + if (forcedExtension === void 0) { forcedExtension = null; } + if (createPolynomials === void 0) { createPolynomials = true; } + var callback = function (loadData) { + if (!loadData) { + if (onLoad) { + onLoad(null); + } + return; + } + var texture = loadData.texture; + if (!createPolynomials) { + texture._sphericalPolynomial = new BABYLON.SphericalPolynomial(); + } + else if (loadData.info.sphericalPolynomial) { + texture._sphericalPolynomial = loadData.info.sphericalPolynomial; + } + texture._dataSource = BABYLON.InternalTexture.DATASOURCE_CUBEPREFILTERED; + if (_this._caps.textureLOD) { + // Do not add extra process if texture lod is supported. + if (onLoad) { + onLoad(texture); + } + return; + } + var mipSlices = 3; + var gl = _this._gl; + var width = loadData.width; + if (!width) { + return; + } + var textures = []; + for (var i = 0; i < mipSlices; i++) { + //compute LOD from even spacing in smoothness (matching shader calculation) + var smoothness = i / (mipSlices - 1); + var roughness = 1 - smoothness; + var minLODIndex = lodOffset; // roughness = 0 + var maxLODIndex = BABYLON.Scalar.Log2(width) * lodScale + lodOffset; // roughness = 1 + var lodIndex = minLODIndex + (maxLODIndex - minLODIndex) * roughness; + var mipmapIndex = Math.round(Math.min(Math.max(lodIndex, 0), maxLODIndex)); + var glTextureFromLod = new BABYLON.InternalTexture(_this, BABYLON.InternalTexture.DATASOURCE_TEMP); + glTextureFromLod.type = texture.type; + glTextureFromLod.format = texture.format; + glTextureFromLod.width = Math.pow(2, Math.max(BABYLON.Scalar.Log2(width) - mipmapIndex, 0)); + glTextureFromLod.height = glTextureFromLod.width; + glTextureFromLod.isCube = true; + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, glTextureFromLod, true); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + if (loadData.isDDS) { + var info = loadData.info; + var data = loadData.data; + _this._unpackFlipY(info.isCompressed); + BABYLON.DDSTools.UploadDDSLevels(_this, glTextureFromLod, data, info, true, 6, mipmapIndex); + } + else { + BABYLON.Tools.Warn("DDS is the only prefiltered cube map supported so far."); + } + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + // Wrap in a base texture for easy binding. + var lodTexture = new BABYLON.BaseTexture(scene); + lodTexture.isCube = true; + lodTexture._texture = glTextureFromLod; + glTextureFromLod.isReady = true; + textures.push(lodTexture); + } + texture._lodTextureHigh = textures[2]; + texture._lodTextureMid = textures[1]; + texture._lodTextureLow = textures[0]; + if (onLoad) { + onLoad(texture); + } + }; + return this.createCubeTexture(rootUrl, scene, null, false, callback, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset); + }; + /** + * Creates a cube texture + * @param rootUrl defines the url where the files to load is located + * @param scene defines the current scene + * @param files defines the list of files to load (1 per face) + * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default) + * @param onLoad defines an optional callback raised when the texture is loaded + * @param onError defines an optional callback raised if there is an issue to load the texture + * @param format defines the format of the data + * @param forcedExtension defines the extension to use to pick the right loader + * @param createPolynomials if a polynomial sphere should be created for the cube texture + * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness + * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness + * @param fallback defines texture to use while falling back when (compressed) texture file not found. + * @returns the cube texture as an InternalTexture + */ + Engine.prototype.createCubeTexture = function (rootUrl, scene, files, noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, fallback) { + var _this = this; + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + if (forcedExtension === void 0) { forcedExtension = null; } + if (createPolynomials === void 0) { createPolynomials = false; } + if (lodScale === void 0) { lodScale = 0; } + if (lodOffset === void 0) { lodOffset = 0; } + if (fallback === void 0) { fallback = null; } + var gl = this._gl; + var texture = fallback ? fallback : new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_CUBE); + texture.isCube = true; + texture.url = rootUrl; + texture.generateMipMaps = !noMipmap; + texture._lodGenerationScale = lodScale; + texture._lodGenerationOffset = lodOffset; + if (!this._doNotHandleContextLost) { + texture._extension = forcedExtension; + texture._files = files; + } + var lastDot = rootUrl.lastIndexOf('.'); + var extension = forcedExtension ? forcedExtension : (lastDot > -1 ? rootUrl.substring(lastDot).toLowerCase() : ""); + var loader = null; + for (var _i = 0, _a = Engine._TextureLoaders; _i < _a.length; _i++) { + var availableLoader = _a[_i]; + if (availableLoader.canLoad(extension, this._textureFormatInUse, fallback, false, false)) { + loader = availableLoader; + break; + } + } + var onInternalError = function (request, exception) { + if (loader) { + var fallbackUrl = loader.getFallbackTextureUrl(rootUrl, _this._textureFormatInUse); + if (fallbackUrl) { + _this.createCubeTexture(fallbackUrl, scene, files, noMipmap, onLoad, onError, format, extension, createPolynomials, lodScale, lodOffset, texture); + } + } + if (onError && request) { + onError(request.status + " " + request.statusText, exception); + } + }; + if (loader) { + rootUrl = loader.transformUrl(rootUrl, this._textureFormatInUse); + var onloaddata = function (data) { + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); + loader.loadCubeData(data, texture, createPolynomials, onLoad, onError); + }; + if (files && files.length === 6) { + if (loader.supportCascades) { + this._cascadeLoadFiles(scene, onloaddata, files, onError); + } + else if (onError) { + onError("Textures type does not support cascades."); + } + } + else { + this._loadFile(rootUrl, onloaddata, undefined, undefined, true, onInternalError); + } + } + else { + if (!files) { + throw new Error("Cannot load cubemap because files were not defined"); + } + this._cascadeLoadImgs(rootUrl, scene, function (imgs) { + var width = _this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(imgs[0].width, _this._caps.maxCubemapTextureSize) : imgs[0].width; + var height = width; + _this._prepareWorkingCanvas(); + if (!_this._workingCanvas || !_this._workingContext) { + return; + } + _this._workingCanvas.width = width; + _this._workingCanvas.height = height; + var faces = [ + gl.TEXTURE_CUBE_MAP_POSITIVE_X, gl.TEXTURE_CUBE_MAP_POSITIVE_Y, gl.TEXTURE_CUBE_MAP_POSITIVE_Z, + gl.TEXTURE_CUBE_MAP_NEGATIVE_X, gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, gl.TEXTURE_CUBE_MAP_NEGATIVE_Z + ]; + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); + _this._unpackFlipY(false); + var internalFormat = format ? _this._getInternalFormat(format) : _this._gl.RGBA; + for (var index = 0; index < faces.length; index++) { + _this._workingContext.drawImage(imgs[index], 0, 0, imgs[index].width, imgs[index].height, 0, 0, width, height); + gl.texImage2D(faces[index], 0, internalFormat, internalFormat, gl.UNSIGNED_BYTE, _this._workingCanvas); + } + if (!noMipmap) { + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + } + _this._setCubeMapTextureParams(!noMipmap); + texture.width = width; + texture.height = height; + texture.isReady = true; + if (format) { + texture.format = format; + } + texture.onLoadedObservable.notifyObservers(texture); + texture.onLoadedObservable.clear(); + if (onLoad) { + onLoad(); + } + }, files, onError); + } + this._internalTexturesCache.push(texture); + return texture; + }; + /** + * @hidden + */ + Engine.prototype._setCubeMapTextureParams = function (loadMipmap) { + var gl = this._gl; + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + // this.resetTextureCache(); + }; + /** + * Update a raw cube texture + * @param texture defines the texture to udpdate + * @param data defines the data to store + * @param format defines the data format + * @param type defines the type fo the data (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default) + * @param invertY defines if data must be stored with Y axis inverted + * @param compression defines the compression used (null by default) + * @param level defines which level of the texture to update + */ + Engine.prototype.updateRawCubeTexture = function (texture, data, format, type, invertY, compression, level) { + if (compression === void 0) { compression = null; } + if (level === void 0) { level = 0; } + texture._bufferViewArray = data; + texture.format = format; + texture.type = type; + texture.invertY = invertY; + texture._compression = compression; + var gl = this._gl; + var textureType = this._getWebGLTextureType(type); + var internalFormat = this._getInternalFormat(format); + var internalSizedFomat = this._getRGBABufferInternalSizedFormat(type); + var needConversion = false; + if (internalFormat === gl.RGB) { + internalFormat = gl.RGBA; + needConversion = true; + } + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); + this._unpackFlipY(invertY === undefined ? true : (invertY ? true : false)); + if (texture.width % 4 !== 0) { + gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + } + // Data are known to be in +X +Y +Z -X -Y -Z + for (var faceIndex = 0; faceIndex < 6; faceIndex++) { + var faceData = data[faceIndex]; + if (compression) { + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, (this.getCaps().s3tc)[compression], texture.width, texture.height, 0, faceData); + } + else { + if (needConversion) { + faceData = this._convertRGBtoRGBATextureData(faceData, texture.width, texture.height, type); + } + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, faceData); + } + } + var isPot = !this.needPOTTextures || (BABYLON.Tools.IsExponentOfTwo(texture.width) && BABYLON.Tools.IsExponentOfTwo(texture.height)); + if (isPot && texture.generateMipMaps && level === 0) { + this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP); + } + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); + // this.resetTextureCache(); + texture.isReady = true; + }; + /** + * Creates a new raw cube texture + * @param data defines the array of data to use to create each face + * @param size defines the size of the textures + * @param format defines the format of the data + * @param type defines the type of the data (like BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT) + * @param generateMipMaps defines if the engine should generate the mip levels + * @param invertY defines if data must be stored with Y axis inverted + * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE) + * @param compression defines the compression used (null by default) + * @returns the cube texture as an InternalTexture + */ + Engine.prototype.createRawCubeTexture = function (data, size, format, type, generateMipMaps, invertY, samplingMode, compression) { + if (compression === void 0) { compression = null; } + var gl = this._gl; + var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_CUBERAW); + texture.isCube = true; + texture.format = format; + texture.type = type; + if (!this._doNotHandleContextLost) { + texture._bufferViewArray = data; + } + var textureType = this._getWebGLTextureType(type); + var internalFormat = this._getInternalFormat(format); + if (internalFormat === gl.RGB) { + internalFormat = gl.RGBA; + } + // Mipmap generation needs a sized internal format that is both color-renderable and texture-filterable + if (textureType === gl.FLOAT && !this._caps.textureFloatLinearFiltering) { + generateMipMaps = false; + samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE; + BABYLON.Tools.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."); + } + else if (textureType === this._gl.HALF_FLOAT_OES && !this._caps.textureHalfFloatLinearFiltering) { + generateMipMaps = false; + samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE; + BABYLON.Tools.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."); + } + else if (textureType === gl.FLOAT && !this._caps.textureFloatRender) { + generateMipMaps = false; + BABYLON.Tools.Warn("Render to float textures is not supported. Mipmap generation forced to false."); + } + else if (textureType === gl.HALF_FLOAT && !this._caps.colorBufferFloat) { + generateMipMaps = false; + BABYLON.Tools.Warn("Render to half float textures is not supported. Mipmap generation forced to false."); + } + var width = size; + var height = width; + texture.width = width; + texture.height = height; + // Double check on POT to generate Mips. + var isPot = !this.needPOTTextures || (BABYLON.Tools.IsExponentOfTwo(texture.width) && BABYLON.Tools.IsExponentOfTwo(texture.height)); + if (!isPot) { + generateMipMaps = false; + } + // Upload data if needed. The texture won't be ready until then. + if (data) { + this.updateRawCubeTexture(texture, data, format, type, invertY, compression); + } + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true); + // Filters + if (data && generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP); + } + var filters = this._getSamplingParameters(samplingMode, generateMipMaps); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + texture.generateMipMaps = generateMipMaps; + return texture; + }; + /** + * Creates a new raw cube texture from a specified url + * @param url defines the url where the data is located + * @param scene defines the current scene + * @param size defines the size of the textures + * @param format defines the format of the data + * @param type defines the type fo the data (like BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT) + * @param noMipmap defines if the engine should avoid generating the mip levels + * @param callback defines a callback used to extract texture data from loaded data + * @param mipmapGenerator defines to provide an optional tool to generate mip levels + * @param onLoad defines a callback called when texture is loaded + * @param onError defines a callback called if there is an error + * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE) + * @param invertY defines if data must be stored with Y axis inverted + * @returns the cube texture as an InternalTexture + */ + Engine.prototype.createRawCubeTextureFromUrl = function (url, scene, size, format, type, noMipmap, callback, mipmapGenerator, onLoad, onError, samplingMode, invertY) { + var _this = this; + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; } + if (invertY === void 0) { invertY = false; } + var gl = this._gl; + var texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode); + scene._addPendingData(texture); + texture.url = url; + this._internalTexturesCache.push(texture); + var onerror = function (request, exception) { + scene._removePendingData(texture); + if (onError && request) { + onError(request.status + " " + request.statusText, exception); + } + }; + var internalCallback = function (data) { + var width = texture.width; + var faceDataArrays = callback(data); + if (!faceDataArrays) { + return; + } + if (mipmapGenerator) { + var textureType = _this._getWebGLTextureType(type); + var internalFormat = _this._getInternalFormat(format); + var internalSizedFomat = _this._getRGBABufferInternalSizedFormat(type); + var needConversion = false; + if (internalFormat === gl.RGB) { + internalFormat = gl.RGBA; + needConversion = true; + } + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); + _this._unpackFlipY(false); + var mipData = mipmapGenerator(faceDataArrays); + for (var level = 0; level < mipData.length; level++) { + var mipSize = width >> level; + for (var faceIndex = 0; faceIndex < 6; faceIndex++) { + var mipFaceData = mipData[level][faceIndex]; + if (needConversion) { + mipFaceData = _this._convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type); + } + gl.texImage2D(faceIndex, level, internalSizedFomat, mipSize, mipSize, 0, internalFormat, textureType, mipFaceData); + } + } + _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + } + else { + _this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY); + } + texture.isReady = true; + // this.resetTextureCache(); + scene._removePendingData(texture); + if (onLoad) { + onLoad(); + } + }; + this._loadFile(url, function (data) { + internalCallback(data); + }, undefined, scene.database, true, onerror); + return texture; + }; + /** + * Update a raw 3D texture + * @param texture defines the texture to update + * @param data defines the data to store + * @param format defines the data format + * @param invertY defines if data must be stored with Y axis inverted + * @param compression defines the used compression (can be null) + * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...) + */ + Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression, textureType) { + if (compression === void 0) { compression = null; } + if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; } + var internalType = this._getWebGLTextureType(textureType); + var internalFormat = this._getInternalFormat(format); + var internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format); + this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true); + this._unpackFlipY(invertY === undefined ? true : (invertY ? true : false)); + if (!this._doNotHandleContextLost) { + texture._bufferView = data; + texture.format = format; + texture.invertY = invertY; + texture._compression = compression; + } + if (texture.width % 4 !== 0) { + this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1); + } + if (compression && data) { + this._gl.compressedTexImage3D(this._gl.TEXTURE_3D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data); + } + else { + this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data); + } + if (texture.generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_3D); + } + this._bindTextureDirectly(this._gl.TEXTURE_3D, null); + // this.resetTextureCache(); + texture.isReady = true; + }; + /** + * Creates a new raw 3D texture + * @param data defines the data used to create the texture + * @param width defines the width of the texture + * @param height defines the height of the texture + * @param depth defines the depth of the texture + * @param format defines the format of the texture + * @param generateMipMaps defines if the engine must generate mip levels + * @param invertY defines if data must be stored with Y axis inverted + * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE) + * @param compression defines the compressed used (can be null) + * @param textureType defines the compressed used (can be null) + * @returns a new raw 3D texture (stored in an InternalTexture) + */ + Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression, textureType) { + if (compression === void 0) { compression = null; } + if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; } + var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW3D); + texture.baseWidth = width; + texture.baseHeight = height; + texture.baseDepth = depth; + texture.width = width; + texture.height = height; + texture.depth = depth; + texture.format = format; + texture.type = textureType; + texture.generateMipMaps = generateMipMaps; + texture.samplingMode = samplingMode; + texture.is3D = true; + if (!this._doNotHandleContextLost) { + texture._bufferView = data; + } + this.updateRawTexture3D(texture, data, format, invertY, compression, textureType); + this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true); + // Filters + var filters = this._getSamplingParameters(samplingMode, generateMipMaps); + this._gl.texParameteri(this._gl.TEXTURE_3D, this._gl.TEXTURE_MAG_FILTER, filters.mag); + this._gl.texParameteri(this._gl.TEXTURE_3D, this._gl.TEXTURE_MIN_FILTER, filters.min); + if (generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_3D); + } + this._bindTextureDirectly(this._gl.TEXTURE_3D, null); + this._internalTexturesCache.push(texture); + return texture; + }; + Engine.prototype._prepareWebGLTextureContinuation = function (texture, scene, noMipmap, isCompressed, samplingMode) { + var gl = this._gl; + if (!gl) { + return; + } + var filters = this._getSamplingParameters(samplingMode, !noMipmap); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filters.min); + if (!noMipmap && !isCompressed) { + gl.generateMipmap(gl.TEXTURE_2D); + } + this._bindTextureDirectly(gl.TEXTURE_2D, null); + // this.resetTextureCache(); + if (scene) { + scene._removePendingData(texture); + } + texture.onLoadedObservable.notifyObservers(texture); + texture.onLoadedObservable.clear(); + }; + Engine.prototype._prepareWebGLTexture = function (texture, scene, width, height, invertY, noMipmap, isCompressed, processFunction, samplingMode) { + var _this = this; + if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; } + var maxTextureSize = this.getCaps().maxTextureSize; + var potWidth = Math.min(maxTextureSize, this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(width, maxTextureSize) : width); + var potHeight = Math.min(maxTextureSize, this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(height, maxTextureSize) : height); + var gl = this._gl; + if (!gl) { + return; + } + if (!texture._webGLTexture) { + // this.resetTextureCache(); + if (scene) { + scene._removePendingData(texture); + } + return; + } + this._bindTextureDirectly(gl.TEXTURE_2D, texture, true); + this._unpackFlipY(invertY === undefined ? true : (invertY ? true : false)); + texture.baseWidth = width; + texture.baseHeight = height; + texture.width = potWidth; + texture.height = potHeight; + texture.isReady = true; + if (processFunction(potWidth, potHeight, function () { + _this._prepareWebGLTextureContinuation(texture, scene, noMipmap, isCompressed, samplingMode); + })) { + // Returning as texture needs extra async steps + return; + } + this._prepareWebGLTextureContinuation(texture, scene, noMipmap, isCompressed, samplingMode); + }; + Engine.prototype._convertRGBtoRGBATextureData = function (rgbData, width, height, textureType) { + // Create new RGBA data container. + var rgbaData; + if (textureType === Engine.TEXTURETYPE_FLOAT) { + rgbaData = new Float32Array(width * height * 4); + } + else { + rgbaData = new Uint32Array(width * height * 4); + } + // Convert each pixel. + for (var x = 0; x < width; x++) { + for (var y = 0; y < height; y++) { + var index = (y * width + x) * 3; + var newIndex = (y * width + x) * 4; + // Map Old Value to new value. + rgbaData[newIndex + 0] = rgbData[index + 0]; + rgbaData[newIndex + 1] = rgbData[index + 1]; + rgbaData[newIndex + 2] = rgbData[index + 2]; + // Add fully opaque alpha channel. + rgbaData[newIndex + 3] = 1; + } + } + return rgbaData; + }; + /** @hidden */ + Engine.prototype._releaseFramebufferObjects = function (texture) { + var gl = this._gl; + if (texture._framebuffer) { + gl.deleteFramebuffer(texture._framebuffer); + texture._framebuffer = null; + } + if (texture._depthStencilBuffer) { + gl.deleteRenderbuffer(texture._depthStencilBuffer); + texture._depthStencilBuffer = null; + } + if (texture._MSAAFramebuffer) { + gl.deleteFramebuffer(texture._MSAAFramebuffer); + texture._MSAAFramebuffer = null; + } + if (texture._MSAARenderBuffer) { + gl.deleteRenderbuffer(texture._MSAARenderBuffer); + texture._MSAARenderBuffer = null; + } + }; + /** @hidden */ + Engine.prototype._releaseTexture = function (texture) { + var gl = this._gl; + this._releaseFramebufferObjects(texture); + gl.deleteTexture(texture._webGLTexture); + // Unbind channels + this.unbindAllTextures(); + var index = this._internalTexturesCache.indexOf(texture); + if (index !== -1) { + this._internalTexturesCache.splice(index, 1); + } + // Integrated fixed lod samplers. + if (texture._lodTextureHigh) { + texture._lodTextureHigh.dispose(); + } + if (texture._lodTextureMid) { + texture._lodTextureMid.dispose(); + } + if (texture._lodTextureLow) { + texture._lodTextureLow.dispose(); + } + // Set output texture of post process to null if the texture has been released/disposed + this.scenes.forEach(function (scene) { + scene.postProcesses.forEach(function (postProcess) { + if (postProcess._outputTexture == texture) { + postProcess._outputTexture = null; + } + }); + scene.cameras.forEach(function (camera) { + camera._postProcesses.forEach(function (postProcess) { + if (postProcess) { + if (postProcess._outputTexture == texture) { + postProcess._outputTexture = null; + } + } + }); + }); + }); + }; + Engine.prototype.setProgram = function (program) { + if (this._currentProgram !== program) { + this._gl.useProgram(program); + this._currentProgram = program; + } + }; + /** + * Binds an effect to the webGL context + * @param effect defines the effect to bind + */ + Engine.prototype.bindSamplers = function (effect) { + this.setProgram(effect.getProgram()); + var samplers = effect.getSamplers(); + for (var index = 0; index < samplers.length; index++) { + var uniform = effect.getUniform(samplers[index]); + if (uniform) { + this._boundUniforms[index] = uniform; + } + } + this._currentEffect = null; + }; + Engine.prototype._moveBoundTextureOnTop = function (internalTexture) { + if (this.disableTextureBindingOptimization || this._lastBoundInternalTextureTracker.previous === internalTexture) { + return; + } + // Remove + this._linkTrackers(internalTexture.previous, internalTexture.next); + // Bind last to it + this._linkTrackers(this._lastBoundInternalTextureTracker.previous, internalTexture); + // Bind to dummy + this._linkTrackers(internalTexture, this._lastBoundInternalTextureTracker); + }; + Engine.prototype._getCorrectTextureChannel = function (channel, internalTexture) { + if (!internalTexture) { + return -1; + } + internalTexture._initialSlot = channel; + if (this.disableTextureBindingOptimization) { // We want texture sampler ID === texture channel + if (channel !== internalTexture._designatedSlot) { + this._textureCollisions.addCount(1, false); + } + } + else { + if (channel !== internalTexture._designatedSlot) { + if (internalTexture._designatedSlot > -1) { // Texture is already assigned to a slot + return internalTexture._designatedSlot; + } + else { + // No slot for this texture, let's pick a new one (if we find a free slot) + if (this._nextFreeTextureSlots.length) { + return this._nextFreeTextureSlots[0]; + } + // We need to recycle the oldest bound texture, sorry. + this._textureCollisions.addCount(1, false); + return this._removeDesignatedSlot(this._firstBoundInternalTextureTracker.next); + } + } + } + return channel; + }; + Engine.prototype._linkTrackers = function (previous, next) { + previous.next = next; + next.previous = previous; + }; + Engine.prototype._removeDesignatedSlot = function (internalTexture) { + var currentSlot = internalTexture._designatedSlot; + if (currentSlot === -1) { + return -1; + } + internalTexture._designatedSlot = -1; + if (this.disableTextureBindingOptimization) { + return -1; + } + // Remove from bound list + this._linkTrackers(internalTexture.previous, internalTexture.next); + // Free the slot + this._boundTexturesCache[currentSlot] = null; + this._nextFreeTextureSlots.push(currentSlot); + return currentSlot; + }; + Engine.prototype._activateCurrentTexture = function () { + if (this._currentTextureChannel !== this._activeChannel) { + this._gl.activeTexture(this._gl.TEXTURE0 + this._activeChannel); + this._currentTextureChannel = this._activeChannel; + } + }; + /** @hidden */ + Engine.prototype._bindTextureDirectly = function (target, texture, forTextureDataUpdate, force) { + if (forTextureDataUpdate === void 0) { forTextureDataUpdate = false; } + if (force === void 0) { force = false; } + var wasPreviouslyBound = false; + if (forTextureDataUpdate && texture && texture._designatedSlot > -1) { + this._activeChannel = texture._designatedSlot; + } + var currentTextureBound = this._boundTexturesCache[this._activeChannel]; + var isTextureForRendering = texture && texture._initialSlot > -1; + if (currentTextureBound !== texture || force) { + if (currentTextureBound) { + this._removeDesignatedSlot(currentTextureBound); + } + this._activateCurrentTexture(); + this._gl.bindTexture(target, texture ? texture._webGLTexture : null); + this._boundTexturesCache[this._activeChannel] = texture; + if (texture) { + if (!this.disableTextureBindingOptimization) { + var slotIndex = this._nextFreeTextureSlots.indexOf(this._activeChannel); + if (slotIndex > -1) { + this._nextFreeTextureSlots.splice(slotIndex, 1); + } + this._linkTrackers(this._lastBoundInternalTextureTracker.previous, texture); + this._linkTrackers(texture, this._lastBoundInternalTextureTracker); + } + texture._designatedSlot = this._activeChannel; + } + } + else if (forTextureDataUpdate) { + wasPreviouslyBound = true; + this._activateCurrentTexture(); + } + if (isTextureForRendering && !forTextureDataUpdate) { + this._bindSamplerUniformToChannel(texture._initialSlot, this._activeChannel); + } + return wasPreviouslyBound; + }; + /** @hidden */ + Engine.prototype._bindTexture = function (channel, texture) { + if (channel < 0) { + return; + } + if (texture) { + channel = this._getCorrectTextureChannel(channel, texture); + } + this._activeChannel = channel; + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture); + }; + /** + * Sets a texture to the webGL context from a postprocess + * @param channel defines the channel to use + * @param postProcess defines the source postprocess + */ + Engine.prototype.setTextureFromPostProcess = function (channel, postProcess) { + this._bindTexture(channel, postProcess ? postProcess._textures.data[postProcess._currentRenderTextureInd] : null); + }; + /** + * Binds the output of the passed in post process to the texture channel specified + * @param channel The channel the texture should be bound to + * @param postProcess The post process which's output should be bound + */ + Engine.prototype.setTextureFromPostProcessOutput = function (channel, postProcess) { + this._bindTexture(channel, postProcess ? postProcess._outputTexture : null); + }; + /** + * Unbind all textures from the webGL context + */ + Engine.prototype.unbindAllTextures = function () { + for (var channel = 0; channel < this._maxSimultaneousTextures; channel++) { + this._activeChannel = channel; + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); + if (this.webGLVersion > 1) { + this._bindTextureDirectly(this._gl.TEXTURE_3D, null); + } + } + }; + /** + * Sets a texture to the according uniform. + * @param channel The texture channel + * @param uniform The uniform to set + * @param texture The texture to apply + */ + Engine.prototype.setTexture = function (channel, uniform, texture) { + if (channel < 0) { + return; + } + if (uniform) { + this._boundUniforms[channel] = uniform; + } + this._setTexture(channel, texture); + }; + /** + * Sets a depth stencil texture from a render target to the according uniform. + * @param channel The texture channel + * @param uniform The uniform to set + * @param texture The render target texture containing the depth stencil texture to apply + */ + Engine.prototype.setDepthStencilTexture = function (channel, uniform, texture) { + if (channel < 0) { + return; + } + if (uniform) { + this._boundUniforms[channel] = uniform; + } + if (!texture || !texture.depthStencilTexture) { + this._setTexture(channel, null); + } + else { + this._setTexture(channel, texture, false, true); + } + }; + Engine.prototype._bindSamplerUniformToChannel = function (sourceSlot, destination) { + var uniform = this._boundUniforms[sourceSlot]; + if (uniform._currentState === destination) { + return; + } + this._gl.uniform1i(uniform, destination); + uniform._currentState = destination; + }; + Engine.prototype._getTextureWrapMode = function (mode) { + switch (mode) { + case Engine.TEXTURE_WRAP_ADDRESSMODE: + return this._gl.REPEAT; + case Engine.TEXTURE_CLAMP_ADDRESSMODE: + return this._gl.CLAMP_TO_EDGE; + case Engine.TEXTURE_MIRROR_ADDRESSMODE: + return this._gl.MIRRORED_REPEAT; + } + return this._gl.REPEAT; + }; + Engine.prototype._setTexture = function (channel, texture, isPartOfTextureArray, depthStencilTexture) { + if (isPartOfTextureArray === void 0) { isPartOfTextureArray = false; } + if (depthStencilTexture === void 0) { depthStencilTexture = false; } + // Not ready? + if (!texture) { + if (this._boundTexturesCache[channel] != null) { + this._activeChannel = channel; + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); + if (this.webGLVersion > 1) { + this._bindTextureDirectly(this._gl.TEXTURE_3D, null); + } + } + return false; + } + // Video + if (texture.video) { + this._activeChannel = channel; + texture.update(); + } + else if (texture.delayLoadState === Engine.DELAYLOADSTATE_NOTLOADED) { // Delay loading + texture.delayLoad(); + return false; + } + var internalTexture; + if (depthStencilTexture) { + internalTexture = texture.depthStencilTexture; + } + else if (texture.isReady()) { + internalTexture = texture.getInternalTexture(); + } + else if (texture.isCube) { + internalTexture = this.emptyCubeTexture; + } + else if (texture.is3D) { + internalTexture = this.emptyTexture3D; + } + else { + internalTexture = this.emptyTexture; + } + if (!isPartOfTextureArray) { + channel = this._getCorrectTextureChannel(channel, internalTexture); + } + var needToBind = true; + if (this._boundTexturesCache[channel] === internalTexture) { + this._moveBoundTextureOnTop(internalTexture); + if (!isPartOfTextureArray) { + this._bindSamplerUniformToChannel(internalTexture._initialSlot, channel); + } + needToBind = false; + } + this._activeChannel = channel; + if (internalTexture && internalTexture.is3D) { + if (needToBind) { + this._bindTextureDirectly(this._gl.TEXTURE_3D, internalTexture, isPartOfTextureArray); + } + if (internalTexture && internalTexture._cachedWrapU !== texture.wrapU) { + internalTexture._cachedWrapU = texture.wrapU; + this._setTextureParameterInteger(this._gl.TEXTURE_3D, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(texture.wrapU), internalTexture); + } + if (internalTexture && internalTexture._cachedWrapV !== texture.wrapV) { + internalTexture._cachedWrapV = texture.wrapV; + this._setTextureParameterInteger(this._gl.TEXTURE_3D, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(texture.wrapV), internalTexture); + } + if (internalTexture && internalTexture._cachedWrapR !== texture.wrapR) { + internalTexture._cachedWrapR = texture.wrapR; + this._setTextureParameterInteger(this._gl.TEXTURE_3D, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(texture.wrapR), internalTexture); + } + this._setAnisotropicLevel(this._gl.TEXTURE_3D, texture); + } + else if (internalTexture && internalTexture.isCube) { + if (needToBind) { + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, internalTexture, isPartOfTextureArray); + } + if (internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) { + internalTexture._cachedCoordinatesMode = texture.coordinatesMode; + // CUBIC_MODE and SKYBOX_MODE both require CLAMP_TO_EDGE. All other modes use REPEAT. + var textureWrapMode = (texture.coordinatesMode !== Engine.TEXTURE_CUBIC_MODE && texture.coordinatesMode !== Engine.TEXTURE_SKYBOX_MODE) ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE; + this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_S, textureWrapMode, internalTexture); + this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_T, textureWrapMode); + } + this._setAnisotropicLevel(this._gl.TEXTURE_CUBE_MAP, texture); + } + else { + if (needToBind) { + this._bindTextureDirectly(this._gl.TEXTURE_2D, internalTexture, isPartOfTextureArray); + } + if (internalTexture && internalTexture._cachedWrapU !== texture.wrapU) { + internalTexture._cachedWrapU = texture.wrapU; + this._setTextureParameterInteger(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(texture.wrapU), internalTexture); + } + if (internalTexture && internalTexture._cachedWrapV !== texture.wrapV) { + internalTexture._cachedWrapV = texture.wrapV; + this._setTextureParameterInteger(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(texture.wrapV), internalTexture); + } + this._setAnisotropicLevel(this._gl.TEXTURE_2D, texture); + } + return true; + }; + /** + * Sets an array of texture to the webGL context + * @param channel defines the channel where the texture array must be set + * @param uniform defines the associated uniform location + * @param textures defines the array of textures to bind + */ + Engine.prototype.setTextureArray = function (channel, uniform, textures) { + if (channel < 0 || !uniform) { + return; + } + if (!this._textureUnits || this._textureUnits.length !== textures.length) { + this._textureUnits = new Int32Array(textures.length); + } + for (var i = 0; i < textures.length; i++) { + this._textureUnits[i] = this._getCorrectTextureChannel(channel + i, textures[i].getInternalTexture()); + } + this._gl.uniform1iv(uniform, this._textureUnits); + for (var index = 0; index < textures.length; index++) { + this._setTexture(this._textureUnits[index], textures[index], true); + } + }; + /** @hidden */ + Engine.prototype._setAnisotropicLevel = function (target, texture) { + var internalTexture = texture.getInternalTexture(); + if (!internalTexture) { + return; + } + var anisotropicFilterExtension = this._caps.textureAnisotropicFilterExtension; + var value = texture.anisotropicFilteringLevel; + if (internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST + && internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR + && internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR) { + value = 1; // Forcing the anisotropic to 1 because else webgl will force filters to linear + } + if (anisotropicFilterExtension && internalTexture._cachedAnisotropicFilteringLevel !== value) { + this._setTextureParameterFloat(target, anisotropicFilterExtension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(value, this._caps.maxAnisotropy), internalTexture); + internalTexture._cachedAnisotropicFilteringLevel = value; + } + }; + Engine.prototype._setTextureParameterFloat = function (target, parameter, value, texture) { + this._bindTextureDirectly(target, texture, true, true); + this._gl.texParameterf(target, parameter, value); + }; + Engine.prototype._setTextureParameterInteger = function (target, parameter, value, texture) { + if (texture) { + this._bindTextureDirectly(target, texture, true, true); + } + this._gl.texParameteri(target, parameter, value); + }; + /** + * Reads pixels from the current frame buffer. Please note that this function can be slow + * @param x defines the x coordinate of the rectangle where pixels must be read + * @param y defines the y coordinate of the rectangle where pixels must be read + * @param width defines the width of the rectangle where pixels must be read + * @param height defines the height of the rectangle where pixels must be read + * @returns a Uint8Array containing RGBA colors + */ + Engine.prototype.readPixels = function (x, y, width, height) { + var data = new Uint8Array(height * width * 4); + this._gl.readPixels(x, y, width, height, this._gl.RGBA, this._gl.UNSIGNED_BYTE, data); + return data; + }; + /** + * Add an externaly attached data from its key. + * This method call will fail and return false, if such key already exists. + * If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method. + * @param key the unique key that identifies the data + * @param data the data object to associate to the key for this Engine instance + * @return true if no such key were already present and the data was added successfully, false otherwise + */ + Engine.prototype.addExternalData = function (key, data) { + if (!this._externalData) { + this._externalData = new BABYLON.StringDictionary(); + } + return this._externalData.add(key, data); + }; + /** + * Get an externaly attached data from its key + * @param key the unique key that identifies the data + * @return the associated data, if present (can be null), or undefined if not present + */ + Engine.prototype.getExternalData = function (key) { + if (!this._externalData) { + this._externalData = new BABYLON.StringDictionary(); + } + return this._externalData.get(key); + }; + /** + * Get an externaly attached data from its key, create it using a factory if it's not already present + * @param key the unique key that identifies the data + * @param factory the factory that will be called to create the instance if and only if it doesn't exists + * @return the associated data, can be null if the factory returned null. + */ + Engine.prototype.getOrAddExternalDataWithFactory = function (key, factory) { + if (!this._externalData) { + this._externalData = new BABYLON.StringDictionary(); + } + return this._externalData.getOrAddWithFactory(key, factory); + }; + /** + * Remove an externaly attached data from the Engine instance + * @param key the unique key that identifies the data + * @return true if the data was successfully removed, false if it doesn't exist + */ + Engine.prototype.removeExternalData = function (key) { + if (!this._externalData) { + this._externalData = new BABYLON.StringDictionary(); + } + return this._externalData.remove(key); + }; + /** + * Unbind all vertex attributes from the webGL context + */ + Engine.prototype.unbindAllAttributes = function () { + if (this._mustWipeVertexAttributes) { + this._mustWipeVertexAttributes = false; + for (var i = 0; i < this._caps.maxVertexAttribs; i++) { + this._gl.disableVertexAttribArray(i); + this._vertexAttribArraysEnabled[i] = false; + this._currentBufferPointers[i].active = false; + } + return; + } + for (var i = 0, ul = this._vertexAttribArraysEnabled.length; i < ul; i++) { + if (i >= this._caps.maxVertexAttribs || !this._vertexAttribArraysEnabled[i]) { + continue; + } + this._gl.disableVertexAttribArray(i); + this._vertexAttribArraysEnabled[i] = false; + this._currentBufferPointers[i].active = false; + } + }; + /** + * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled + */ + Engine.prototype.releaseEffects = function () { + for (var name in this._compiledEffects) { + this._deleteProgram(this._compiledEffects[name]._program); + } + this._compiledEffects = {}; + }; + /** + * Dispose and release all associated resources + */ + Engine.prototype.dispose = function () { + this.hideLoadingUI(); + this.stopRenderLoop(); + // Release postProcesses + while (this.postProcesses.length) { + this.postProcesses[0].dispose(); + } + // Empty texture + if (this._emptyTexture) { + this._releaseTexture(this._emptyTexture); + this._emptyTexture = null; + } + if (this._emptyCubeTexture) { + this._releaseTexture(this._emptyCubeTexture); + this._emptyCubeTexture = null; + } + // Rescale PP + if (this._rescalePostProcess) { + this._rescalePostProcess.dispose(); + } + // Release scenes + while (this.scenes.length) { + this.scenes[0].dispose(); + } + // Release audio engine + if (Engine.Instances.length === 1 && Engine.audioEngine) { + Engine.audioEngine.dispose(); + } + // Release effects + this.releaseEffects(); + // Unbind + this.unbindAllAttributes(); + this._boundUniforms = []; + if (this._dummyFramebuffer) { + this._gl.deleteFramebuffer(this._dummyFramebuffer); + } + //WebVR + this.disableVR(); + // Events + if (BABYLON.Tools.IsWindowObjectExist()) { + window.removeEventListener("blur", this._onBlur); + window.removeEventListener("focus", this._onFocus); + window.removeEventListener('vrdisplaypointerrestricted', this._onVRDisplayPointerRestricted); + window.removeEventListener('vrdisplaypointerunrestricted', this._onVRDisplayPointerUnrestricted); + if (this._renderingCanvas) { + this._renderingCanvas.removeEventListener("focus", this._onCanvasFocus); + this._renderingCanvas.removeEventListener("blur", this._onCanvasBlur); + this._renderingCanvas.removeEventListener("pointerout", this._onCanvasPointerOut); + if (!this._doNotHandleContextLost) { + this._renderingCanvas.removeEventListener("webglcontextlost", this._onContextLost); + this._renderingCanvas.removeEventListener("webglcontextrestored", this._onContextRestored); + } + } + document.removeEventListener("fullscreenchange", this._onFullscreenChange); + document.removeEventListener("mozfullscreenchange", this._onFullscreenChange); + document.removeEventListener("webkitfullscreenchange", this._onFullscreenChange); + document.removeEventListener("msfullscreenchange", this._onFullscreenChange); + document.removeEventListener("pointerlockchange", this._onPointerLockChange); + document.removeEventListener("mspointerlockchange", this._onPointerLockChange); + document.removeEventListener("mozpointerlockchange", this._onPointerLockChange); + document.removeEventListener("webkitpointerlockchange", this._onPointerLockChange); + if (this._onVrDisplayConnect) { + window.removeEventListener('vrdisplayconnect', this._onVrDisplayConnect); + if (this._onVrDisplayDisconnect) { + window.removeEventListener('vrdisplaydisconnect', this._onVrDisplayDisconnect); + } + if (this._onVrDisplayPresentChange) { + window.removeEventListener('vrdisplaypresentchange', this._onVrDisplayPresentChange); + } + this._onVrDisplayConnect = null; + this._onVrDisplayDisconnect = null; + } + } + // Remove from Instances + var index = Engine.Instances.indexOf(this); + if (index >= 0) { + Engine.Instances.splice(index, 1); + } + this._workingCanvas = null; + this._workingContext = null; + this._currentBufferPointers = []; + this._renderingCanvas = null; + this._currentProgram = null; + this._bindedRenderFunction = null; + this.onResizeObservable.clear(); + this.onCanvasBlurObservable.clear(); + this.onCanvasFocusObservable.clear(); + this.onCanvasPointerOutObservable.clear(); + this.onBeginFrameObservable.clear(); + this.onEndFrameObservable.clear(); + BABYLON.Effect.ResetCache(); + // Abort active requests + for (var _i = 0, _a = this._activeRequests; _i < _a.length; _i++) { + var request = _a[_i]; + request.abort(); + } + }; + // Loading screen + /** + * Display the loading screen + * @see http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen + */ + Engine.prototype.displayLoadingUI = function () { + if (!BABYLON.Tools.IsWindowObjectExist()) { + return; + } + var loadingScreen = this.loadingScreen; + if (loadingScreen) { + loadingScreen.displayLoadingUI(); + } + }; + /** + * Hide the loading screen + * @see http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen + */ + Engine.prototype.hideLoadingUI = function () { + if (!BABYLON.Tools.IsWindowObjectExist()) { + return; + } + var loadingScreen = this.loadingScreen; + if (loadingScreen) { + loadingScreen.hideLoadingUI(); + } + }; + Object.defineProperty(Engine.prototype, "loadingScreen", { + /** + * Gets the current loading screen object + * @see http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen + */ + get: function () { + if (!this._loadingScreen && BABYLON.DefaultLoadingScreen && this._renderingCanvas) { + this._loadingScreen = new BABYLON.DefaultLoadingScreen(this._renderingCanvas); + } + return this._loadingScreen; + }, + /** + * Sets the current loading screen object + * @see http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen + */ + set: function (loadingScreen) { + this._loadingScreen = loadingScreen; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "loadingUIText", { + /** + * Sets the current loading screen text + * @see http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen + */ + set: function (text) { + this.loadingScreen.loadingUIText = text; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine.prototype, "loadingUIBackgroundColor", { + /** + * Sets the current loading screen background color + * @see http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen + */ + set: function (color) { + this.loadingScreen.loadingUIBackgroundColor = color; + }, + enumerable: true, + configurable: true + }); + /** + * Attach a new callback raised when context lost event is fired + * @param callback defines the callback to call + */ + Engine.prototype.attachContextLostEvent = function (callback) { + if (this._renderingCanvas) { + this._renderingCanvas.addEventListener("webglcontextlost", callback, false); + } + }; + /** + * Attach a new callback raised when context restored event is fired + * @param callback defines the callback to call + */ + Engine.prototype.attachContextRestoredEvent = function (callback) { + if (this._renderingCanvas) { + this._renderingCanvas.addEventListener("webglcontextrestored", callback, false); + } + }; + /** + * Gets the source code of the vertex shader associated with a specific webGL program + * @param program defines the program to use + * @returns a string containing the source code of the vertex shader associated with the program + */ + Engine.prototype.getVertexShaderSource = function (program) { + var shaders = this._gl.getAttachedShaders(program); + if (!shaders) { + return null; + } + return this._gl.getShaderSource(shaders[0]); + }; + /** + * Gets the source code of the fragment shader associated with a specific webGL program + * @param program defines the program to use + * @returns a string containing the source code of the fragment shader associated with the program + */ + Engine.prototype.getFragmentShaderSource = function (program) { + var shaders = this._gl.getAttachedShaders(program); + if (!shaders) { + return null; + } + return this._gl.getShaderSource(shaders[1]); + }; + /** + * Get the current error code of the webGL context + * @returns the error code + * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError + */ + Engine.prototype.getError = function () { + return this._gl.getError(); + }; + // FPS + /** + * Gets the current framerate + * @returns a number representing the framerate + */ + Engine.prototype.getFps = function () { + return this._fps; + }; + /** + * Gets the time spent between current and previous frame + * @returns a number representing the delta time in ms + */ + Engine.prototype.getDeltaTime = function () { + return this._deltaTime; + }; + Engine.prototype._measureFps = function () { + this._performanceMonitor.sampleFrame(); + this._fps = this._performanceMonitor.averageFPS; + this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0; + }; + /** @hidden */ + Engine.prototype._readTexturePixels = function (texture, width, height, faceIndex, level, buffer) { + if (faceIndex === void 0) { faceIndex = -1; } + if (level === void 0) { level = 0; } + if (buffer === void 0) { buffer = null; } + var gl = this._gl; + if (!this._dummyFramebuffer) { + var dummy = gl.createFramebuffer(); + if (!dummy) { + throw new Error("Unable to create dummy framebuffer"); + } + this._dummyFramebuffer = dummy; + } + gl.bindFramebuffer(gl.FRAMEBUFFER, this._dummyFramebuffer); + if (faceIndex > -1) { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, texture._webGLTexture, level); + } + else { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture._webGLTexture, level); + } + var readType = (texture.type !== undefined) ? this._getWebGLTextureType(texture.type) : gl.UNSIGNED_BYTE; + switch (readType) { + case gl.UNSIGNED_BYTE: + if (!buffer) { + buffer = new Uint8Array(4 * width * height); + } + readType = gl.UNSIGNED_BYTE; + break; + default: + if (!buffer) { + buffer = new Float32Array(4 * width * height); + } + readType = gl.FLOAT; + break; + } + gl.readPixels(0, 0, width, height, gl.RGBA, readType, buffer); + gl.bindFramebuffer(gl.FRAMEBUFFER, this._currentFramebuffer); + return buffer; + }; + Engine.prototype._canRenderToFloatFramebuffer = function () { + if (this._webGLVersion > 1) { + return this._caps.colorBufferFloat; + } + return this._canRenderToFramebuffer(Engine.TEXTURETYPE_FLOAT); + }; + Engine.prototype._canRenderToHalfFloatFramebuffer = function () { + if (this._webGLVersion > 1) { + return this._caps.colorBufferFloat; + } + return this._canRenderToFramebuffer(Engine.TEXTURETYPE_HALF_FLOAT); + }; + // Thank you : http://stackoverflow.com/questions/28827511/webgl-ios-render-to-floating-point-texture + Engine.prototype._canRenderToFramebuffer = function (type) { + var gl = this._gl; + //clear existing errors + while (gl.getError() !== gl.NO_ERROR) { } + var successful = true; + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + gl.texImage2D(gl.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(type), 1, 1, 0, gl.RGBA, this._getWebGLTextureType(type), null); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + var fb = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fb); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + successful = successful && (status === gl.FRAMEBUFFER_COMPLETE); + successful = successful && (gl.getError() === gl.NO_ERROR); + //try render by clearing frame buffer's color buffer + if (successful) { + gl.clear(gl.COLOR_BUFFER_BIT); + successful = successful && (gl.getError() === gl.NO_ERROR); + } + //try reading from frame to ensure render occurs (just creating the FBO is not sufficient to determine if rendering is supported) + if (successful) { + //in practice it's sufficient to just read from the backbuffer rather than handle potentially issues reading from the texture + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + var readFormat = gl.RGBA; + var readType = gl.UNSIGNED_BYTE; + var buffer = new Uint8Array(4); + gl.readPixels(0, 0, 1, 1, readFormat, readType, buffer); + successful = successful && (gl.getError() === gl.NO_ERROR); + } + //clean up + gl.deleteTexture(texture); + gl.deleteFramebuffer(fb); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + //clear accumulated errors + while (!successful && (gl.getError() !== gl.NO_ERROR)) { } + return successful; + }; + /** @hidden */ + Engine.prototype._getWebGLTextureType = function (type) { + if (this._webGLVersion === 1) { + switch (type) { + case Engine.TEXTURETYPE_FLOAT: + return this._gl.FLOAT; + case Engine.TEXTURETYPE_HALF_FLOAT: + return this._gl.HALF_FLOAT_OES; + case Engine.TEXTURETYPE_UNSIGNED_BYTE: + return this._gl.UNSIGNED_BYTE; + } + return this._gl.UNSIGNED_BYTE; + } + switch (type) { + case Engine.TEXTURETYPE_BYTE: + return this._gl.BYTE; + case Engine.TEXTURETYPE_UNSIGNED_BYTE: + return this._gl.UNSIGNED_BYTE; + case Engine.TEXTURETYPE_SHORT: + return this._gl.SHORT; + case Engine.TEXTURETYPE_UNSIGNED_SHORT: + return this._gl.UNSIGNED_SHORT; + case Engine.TEXTURETYPE_INT: + return this._gl.INT; + case Engine.TEXTURETYPE_UNSIGNED_INTEGER: // Refers to UNSIGNED_INT + return this._gl.UNSIGNED_INT; + case Engine.TEXTURETYPE_FLOAT: + return this._gl.FLOAT; + case Engine.TEXTURETYPE_HALF_FLOAT: + return this._gl.HALF_FLOAT; + case Engine.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4: + return this._gl.UNSIGNED_SHORT_4_4_4_4; + case Engine.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1: + return this._gl.UNSIGNED_SHORT_5_5_5_1; + case Engine.TEXTURETYPE_UNSIGNED_SHORT_5_6_5: + return this._gl.UNSIGNED_SHORT_5_6_5; + case Engine.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV: + return this._gl.UNSIGNED_INT_2_10_10_10_REV; + case Engine.TEXTURETYPE_UNSIGNED_INT_24_8: + return this._gl.UNSIGNED_INT_24_8; + case Engine.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV: + return this._gl.UNSIGNED_INT_10F_11F_11F_REV; + case Engine.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV: + return this._gl.UNSIGNED_INT_5_9_9_9_REV; + case Engine.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV: + return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV; + } + return this._gl.UNSIGNED_BYTE; + }; + Engine.prototype._getInternalFormat = function (format) { + var internalFormat = this._gl.RGBA; + switch (format) { + case Engine.TEXTUREFORMAT_ALPHA: + internalFormat = this._gl.ALPHA; + break; + case Engine.TEXTUREFORMAT_LUMINANCE: + internalFormat = this._gl.LUMINANCE; + break; + case Engine.TEXTUREFORMAT_LUMINANCE_ALPHA: + internalFormat = this._gl.LUMINANCE_ALPHA; + break; + case Engine.TEXTUREFORMAT_RED: + internalFormat = this._gl.RED; + break; + case Engine.TEXTUREFORMAT_RG: + internalFormat = this._gl.RG; + break; + case Engine.TEXTUREFORMAT_RGB: + internalFormat = this._gl.RGB; + break; + case Engine.TEXTUREFORMAT_RGBA: + internalFormat = this._gl.RGBA; + break; + } + if (this._webGLVersion > 1) { + switch (format) { + case Engine.TEXTUREFORMAT_RED_INTEGER: + internalFormat = this._gl.RED_INTEGER; + break; + case Engine.TEXTUREFORMAT_RG_INTEGER: + internalFormat = this._gl.RG_INTEGER; + break; + case Engine.TEXTUREFORMAT_RGB_INTEGER: + internalFormat = this._gl.RGB_INTEGER; + break; + case Engine.TEXTUREFORMAT_RGBA_INTEGER: + internalFormat = this._gl.RGBA_INTEGER; + break; + } + } + return internalFormat; + }; + /** @hidden */ + Engine.prototype._getRGBABufferInternalSizedFormat = function (type, format) { + if (this._webGLVersion === 1) { + if (format !== undefined) { + switch (format) { + case Engine.TEXTUREFORMAT_ALPHA: + return this._gl.ALPHA; + case Engine.TEXTUREFORMAT_LUMINANCE: + return this._gl.LUMINANCE; + case Engine.TEXTUREFORMAT_LUMINANCE_ALPHA: + return this._gl.LUMINANCE_ALPHA; + } + } + return this._gl.RGBA; + } + switch (type) { + case Engine.TEXTURETYPE_BYTE: + switch (format) { + case Engine.TEXTUREFORMAT_RED: + return this._gl.R8_SNORM; + case Engine.TEXTUREFORMAT_RG: + return this._gl.RG8_SNORM; + case Engine.TEXTUREFORMAT_RGB: + return this._gl.RGB8_SNORM; + case Engine.TEXTUREFORMAT_RED_INTEGER: + return this._gl.R8I; + case Engine.TEXTUREFORMAT_RG_INTEGER: + return this._gl.RG8I; + case Engine.TEXTUREFORMAT_RGB_INTEGER: + return this._gl.RGB8I; + case Engine.TEXTUREFORMAT_RGBA_INTEGER: + return this._gl.RGBA8I; + default: + return this._gl.RGBA8_SNORM; + } + case Engine.TEXTURETYPE_UNSIGNED_BYTE: + switch (format) { + case Engine.TEXTUREFORMAT_RED: + return this._gl.R8; + case Engine.TEXTUREFORMAT_RG: + return this._gl.RG8; + case Engine.TEXTUREFORMAT_RGB: + return this._gl.RGB8; // By default. Other possibilities are RGB565, SRGB8. + case Engine.TEXTUREFORMAT_RGBA: + return this._gl.RGBA8; // By default. Other possibilities are RGB5_A1, RGBA4, SRGB8_ALPHA8. + case Engine.TEXTUREFORMAT_RED_INTEGER: + return this._gl.R8UI; + case Engine.TEXTUREFORMAT_RG_INTEGER: + return this._gl.RG8UI; + case Engine.TEXTUREFORMAT_RGB_INTEGER: + return this._gl.RGB8UI; + case Engine.TEXTUREFORMAT_RGBA_INTEGER: + return this._gl.RGBA8UI; + default: + return this._gl.RGBA8; + } + case Engine.TEXTURETYPE_SHORT: + switch (format) { + case Engine.TEXTUREFORMAT_RED_INTEGER: + return this._gl.R16I; + case Engine.TEXTUREFORMAT_RG_INTEGER: + return this._gl.RG16I; + case Engine.TEXTUREFORMAT_RGB_INTEGER: + return this._gl.RGB16I; + case Engine.TEXTUREFORMAT_RGBA_INTEGER: + return this._gl.RGBA16I; + default: + return this._gl.RGBA16I; + } + case Engine.TEXTURETYPE_UNSIGNED_SHORT: + switch (format) { + case Engine.TEXTUREFORMAT_RED_INTEGER: + return this._gl.R16UI; + case Engine.TEXTUREFORMAT_RG_INTEGER: + return this._gl.RG16UI; + case Engine.TEXTUREFORMAT_RGB_INTEGER: + return this._gl.RGB16UI; + case Engine.TEXTUREFORMAT_RGBA_INTEGER: + return this._gl.RGBA16UI; + default: + return this._gl.RGBA16UI; + } + case Engine.TEXTURETYPE_INT: + switch (format) { + case Engine.TEXTUREFORMAT_RED_INTEGER: + return this._gl.R32I; + case Engine.TEXTUREFORMAT_RG_INTEGER: + return this._gl.RG32I; + case Engine.TEXTUREFORMAT_RGB_INTEGER: + return this._gl.RGB32I; + case Engine.TEXTUREFORMAT_RGBA_INTEGER: + return this._gl.RGBA32I; + default: + return this._gl.RGBA32I; + } + case Engine.TEXTURETYPE_UNSIGNED_INTEGER: // Refers to UNSIGNED_INT + switch (format) { + case Engine.TEXTUREFORMAT_RED_INTEGER: + return this._gl.R32UI; + case Engine.TEXTUREFORMAT_RG_INTEGER: + return this._gl.RG32UI; + case Engine.TEXTUREFORMAT_RGB_INTEGER: + return this._gl.RGB32UI; + case Engine.TEXTUREFORMAT_RGBA_INTEGER: + return this._gl.RGBA32UI; + default: + return this._gl.RGBA32UI; + } + case Engine.TEXTURETYPE_FLOAT: + switch (format) { + case Engine.TEXTUREFORMAT_RED: + return this._gl.R32F; // By default. Other possibility is R16F. + case Engine.TEXTUREFORMAT_RG: + return this._gl.RG32F; // By default. Other possibility is RG16F. + case Engine.TEXTUREFORMAT_RGB: + return this._gl.RGB32F; // By default. Other possibilities are RGB16F, R11F_G11F_B10F, RGB9_E5. + case Engine.TEXTUREFORMAT_RGBA: + return this._gl.RGBA32F; // By default. Other possibility is RGBA16F. + default: + return this._gl.RGBA32F; + } + case Engine.TEXTURETYPE_HALF_FLOAT: + switch (format) { + case Engine.TEXTUREFORMAT_RED: + return this._gl.R16F; + case Engine.TEXTUREFORMAT_RG: + return this._gl.RG16F; + case Engine.TEXTUREFORMAT_RGB: + return this._gl.RGB16F; // By default. Other possibilities are R11F_G11F_B10F, RGB9_E5. + case Engine.TEXTUREFORMAT_RGBA: + return this._gl.RGBA16F; + default: + return this._gl.RGBA16F; + } + case Engine.TEXTURETYPE_UNSIGNED_SHORT_5_6_5: + return this._gl.RGB565; + case Engine.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV: + return this._gl.R11F_G11F_B10F; + case Engine.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV: + return this._gl.RGB9_E5; + case Engine.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4: + return this._gl.RGBA4; + case Engine.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1: + return this._gl.RGB5_A1; + case Engine.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV: + switch (format) { + case Engine.TEXTUREFORMAT_RGBA: + return this._gl.RGB10_A2; // By default. Other possibility is RGB5_A1. + case Engine.TEXTUREFORMAT_RGBA_INTEGER: + return this._gl.RGB10_A2UI; + default: + return this._gl.RGB10_A2; + } + } + return this._gl.RGBA8; + }; + /** @hidden */ + Engine.prototype._getRGBAMultiSampleBufferFormat = function (type) { + if (type === Engine.TEXTURETYPE_FLOAT) { + return this._gl.RGBA32F; + } + else if (type === Engine.TEXTURETYPE_HALF_FLOAT) { + return this._gl.RGBA16F; + } + return this._gl.RGBA8; + }; + /** @hidden */ + Engine.prototype._loadFile = function (url, onSuccess, onProgress, database, useArrayBuffer, onError) { + var _this = this; + var request = BABYLON.Tools.LoadFile(url, onSuccess, onProgress, database, useArrayBuffer, onError); + this._activeRequests.push(request); + request.onCompleteObservable.add(function (request) { + _this._activeRequests.splice(_this._activeRequests.indexOf(request), 1); + }); + return request; + }; + /** @hidden */ + Engine.prototype._loadFileAsync = function (url, database, useArrayBuffer) { + var _this = this; + return new Promise(function (resolve, reject) { + _this._loadFile(url, function (data) { + resolve(data); + }, undefined, database, useArrayBuffer, function (request, exception) { + reject(exception); + }); + }); + }; + Engine.prototype._partialLoadFile = function (url, index, loadedFiles, scene, onfinish, onErrorCallBack) { + if (onErrorCallBack === void 0) { onErrorCallBack = null; } + var onload = function (data) { + loadedFiles[index] = data; + loadedFiles._internalCount++; + if (loadedFiles._internalCount === 6) { + onfinish(loadedFiles); + } + }; + var onerror = function (request, exception) { + if (onErrorCallBack && request) { + onErrorCallBack(request.status + " " + request.statusText, exception); + } + }; + this._loadFile(url, onload, undefined, undefined, true, onerror); + }; + Engine.prototype._cascadeLoadFiles = function (scene, onfinish, files, onError) { + if (onError === void 0) { onError = null; } + var loadedFiles = []; + loadedFiles._internalCount = 0; + for (var index = 0; index < 6; index++) { + this._partialLoadFile(files[index], index, loadedFiles, scene, onfinish, onError); + } + }; + // Statics + /** + * Gets a boolean indicating if the engine can be instanciated (ie. if a webGL context can be found) + * @returns true if the engine can be created + * @ignorenaming + */ + Engine.isSupported = function () { + try { + var tempcanvas = document.createElement("canvas"); + var gl = tempcanvas.getContext("webgl") || tempcanvas.getContext("experimental-webgl"); + return gl != null && !!window.WebGLRenderingContext; + } + catch (e) { + return false; + } + }; + /** Use this array to turn off some WebGL2 features on known buggy browsers version */ + Engine.ExceptionList = [ + { key: "Chrome/63.0", capture: "63\\.0\\.3239\\.(\\d+)", captureConstraint: 108, targets: ["uniformBuffer"] }, + { key: "Firefox/58", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, + { key: "Firefox/59", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, + { key: "Macintosh", capture: null, captureConstraint: null, targets: ["textureBindingOptimization"] }, + { key: "iPhone", capture: null, captureConstraint: null, targets: ["textureBindingOptimization"] }, + { key: "iPad", capture: null, captureConstraint: null, targets: ["textureBindingOptimization"] } + ]; + /** Gets the list of created engines */ + Engine.Instances = new Array(); + /** + * Hidden + */ + Engine._TextureLoaders = []; + // Const statics + /** Defines that alpha blending is disabled */ + Engine.ALPHA_DISABLE = 0; + /** Defines that alpha blending to SRC ALPHA * SRC + DEST */ + Engine.ALPHA_ADD = 1; + /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */ + Engine.ALPHA_COMBINE = 2; + /** Defines that alpha blending to DEST - SRC * DEST */ + Engine.ALPHA_SUBTRACT = 3; + /** Defines that alpha blending to SRC * DEST */ + Engine.ALPHA_MULTIPLY = 4; + /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */ + Engine.ALPHA_MAXIMIZED = 5; + /** Defines that alpha blending to SRC + DEST */ + Engine.ALPHA_ONEONE = 6; + /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */ + Engine.ALPHA_PREMULTIPLIED = 7; + /** + * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST + * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA + */ + Engine.ALPHA_PREMULTIPLIED_PORTERDUFF = 8; + /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */ + Engine.ALPHA_INTERPOLATE = 9; + /** + * Defines that alpha blending to SRC + (1 - SRC) * DEST + * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA + */ + Engine.ALPHA_SCREENMODE = 10; + /** Defines that the ressource is not delayed*/ + Engine.DELAYLOADSTATE_NONE = 0; + /** Defines that the ressource was successfully delay loaded */ + Engine.DELAYLOADSTATE_LOADED = 1; + /** Defines that the ressource is currently delay loading */ + Engine.DELAYLOADSTATE_LOADING = 2; + /** Defines that the ressource is delayed and has not started loading */ + Engine.DELAYLOADSTATE_NOTLOADED = 4; + // Depht or Stencil test Constants. + /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */ + Engine.NEVER = 0x0200; + /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */ + Engine.ALWAYS = 0x0207; + /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */ + Engine.LESS = 0x0201; + /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */ + Engine.EQUAL = 0x0202; + /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */ + Engine.LEQUAL = 0x0203; + /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */ + Engine.GREATER = 0x0204; + /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */ + Engine.GEQUAL = 0x0206; + /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */ + Engine.NOTEQUAL = 0x0205; + // Stencil Actions Constants. + /** Passed to stencilOperation to specify that stencil value must be kept */ + Engine.KEEP = 0x1E00; + /** Passed to stencilOperation to specify that stencil value must be replaced */ + Engine.REPLACE = 0x1E01; + /** Passed to stencilOperation to specify that stencil value must be incremented */ + Engine.INCR = 0x1E02; + /** Passed to stencilOperation to specify that stencil value must be decremented */ + Engine.DECR = 0x1E03; + /** Passed to stencilOperation to specify that stencil value must be inverted */ + Engine.INVERT = 0x150A; + /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */ + Engine.INCR_WRAP = 0x8507; + /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */ + Engine.DECR_WRAP = 0x8508; + /** Texture is not repeating outside of 0..1 UVs */ + Engine.TEXTURE_CLAMP_ADDRESSMODE = 0; + /** Texture is repeating outside of 0..1 UVs */ + Engine.TEXTURE_WRAP_ADDRESSMODE = 1; + /** Texture is repeating and mirrored */ + Engine.TEXTURE_MIRROR_ADDRESSMODE = 2; + /** ALPHA */ + Engine.TEXTUREFORMAT_ALPHA = 0; + /** LUMINANCE */ + Engine.TEXTUREFORMAT_LUMINANCE = 1; + /** LUMINANCE_ALPHA */ + Engine.TEXTUREFORMAT_LUMINANCE_ALPHA = 2; + /** RGB */ + Engine.TEXTUREFORMAT_RGB = 4; + /** RGBA */ + Engine.TEXTUREFORMAT_RGBA = 5; + /** RED */ + Engine.TEXTUREFORMAT_RED = 6; + /** RED (2nd reference) */ + Engine.TEXTUREFORMAT_R = 6; + /** RG */ + Engine.TEXTUREFORMAT_RG = 7; + /** RED_INTEGER */ + Engine.TEXTUREFORMAT_RED_INTEGER = 8; + /** RED_INTEGER (2nd reference) */ + Engine.TEXTUREFORMAT_R_INTEGER = 8; + /** RG_INTEGER */ + Engine.TEXTUREFORMAT_RG_INTEGER = 9; + /** RGB_INTEGER */ + Engine.TEXTUREFORMAT_RGB_INTEGER = 10; + /** RGBA_INTEGER */ + Engine.TEXTUREFORMAT_RGBA_INTEGER = 11; + /** UNSIGNED_BYTE */ + Engine.TEXTURETYPE_UNSIGNED_BYTE = 0; + /** UNSIGNED_BYTE (2nd reference) */ + Engine.TEXTURETYPE_UNSIGNED_INT = 0; + /** FLOAT */ + Engine.TEXTURETYPE_FLOAT = 1; + /** HALF_FLOAT */ + Engine.TEXTURETYPE_HALF_FLOAT = 2; + /** BYTE */ + Engine.TEXTURETYPE_BYTE = 3; + /** SHORT */ + Engine.TEXTURETYPE_SHORT = 4; + /** UNSIGNED_SHORT */ + Engine.TEXTURETYPE_UNSIGNED_SHORT = 5; + /** INT */ + Engine.TEXTURETYPE_INT = 6; + /** UNSIGNED_INT */ + Engine.TEXTURETYPE_UNSIGNED_INTEGER = 7; + /** UNSIGNED_SHORT_4_4_4_4 */ + Engine.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8; + /** UNSIGNED_SHORT_5_5_5_1 */ + Engine.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9; + /** UNSIGNED_SHORT_5_6_5 */ + Engine.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10; + /** UNSIGNED_INT_2_10_10_10_REV */ + Engine.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11; + /** UNSIGNED_INT_24_8 */ + Engine.TEXTURETYPE_UNSIGNED_INT_24_8 = 12; + /** UNSIGNED_INT_10F_11F_11F_REV */ + Engine.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13; + /** UNSIGNED_INT_5_9_9_9_REV */ + Engine.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14; + /** FLOAT_32_UNSIGNED_INT_24_8_REV */ + Engine.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15; + /** nearest is mag = nearest and min = nearest and mip = linear */ + Engine.TEXTURE_NEAREST_SAMPLINGMODE = 1; + /** Bilinear is mag = linear and min = linear and mip = nearest */ + Engine.TEXTURE_BILINEAR_SAMPLINGMODE = 2; + /** Trilinear is mag = linear and min = linear and mip = linear */ + Engine.TEXTURE_TRILINEAR_SAMPLINGMODE = 3; + /** nearest is mag = nearest and min = nearest and mip = linear */ + Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 1; + /** Bilinear is mag = linear and min = linear and mip = nearest */ + Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 2; + /** Trilinear is mag = linear and min = linear and mip = linear */ + Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3; + /** mag = nearest and min = nearest and mip = nearest */ + Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4; + /** mag = nearest and min = linear and mip = nearest */ + Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5; + /** mag = nearest and min = linear and mip = linear */ + Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6; + /** mag = nearest and min = linear and mip = none */ + Engine.TEXTURE_NEAREST_LINEAR = 7; + /** mag = nearest and min = nearest and mip = none */ + Engine.TEXTURE_NEAREST_NEAREST = 8; + /** mag = linear and min = nearest and mip = nearest */ + Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9; + /** mag = linear and min = nearest and mip = linear */ + Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10; + /** mag = linear and min = linear and mip = none */ + Engine.TEXTURE_LINEAR_LINEAR = 11; + /** mag = linear and min = nearest and mip = none */ + Engine.TEXTURE_LINEAR_NEAREST = 12; + /** Explicit coordinates mode */ + Engine.TEXTURE_EXPLICIT_MODE = 0; + /** Spherical coordinates mode */ + Engine.TEXTURE_SPHERICAL_MODE = 1; + /** Planar coordinates mode */ + Engine.TEXTURE_PLANAR_MODE = 2; + /** Cubic coordinates mode */ + Engine.TEXTURE_CUBIC_MODE = 3; + /** Projection coordinates mode */ + Engine.TEXTURE_PROJECTION_MODE = 4; + /** Skybox coordinates mode */ + Engine.TEXTURE_SKYBOX_MODE = 5; + /** Inverse Cubic coordinates mode */ + Engine.TEXTURE_INVCUBIC_MODE = 6; + /** Equirectangular coordinates mode */ + Engine.TEXTURE_EQUIRECTANGULAR_MODE = 7; + /** Equirectangular Fixed coordinates mode */ + Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8; + /** Equirectangular Fixed Mirrored coordinates mode */ + Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9; + // Texture rescaling mode + /** Defines that texture rescaling will use a floor to find the closer power of 2 size */ + Engine.SCALEMODE_FLOOR = 1; + /** Defines that texture rescaling will look for the nearest power of 2 size */ + Engine.SCALEMODE_NEAREST = 2; + /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */ + Engine.SCALEMODE_CEILING = 3; + // Updatable statics so stick with vars here + /** + * Gets or sets the epsilon value used by collision engine + */ + Engine.CollisionsEpsilon = 0.001; + /** + * Gets or sets the relative url used to load code if using the engine in non-minified mode + */ + Engine.CodeRepository = "src/"; + /** + * Gets or sets the relative url used to load shaders if using the engine in non-minified mode + */ + Engine.ShadersRepository = "src/Shaders/"; + return Engine; + }()); + BABYLON.Engine = Engine; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.engine.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Node is the basic class for all scene objects (Mesh, Light, Camera.) + */ + var Node = /** @class */ (function () { + /** + * Creates a new Node + * @param name the name and id to be given to this node + * @param scene the scene this node will be added to + */ + function Node(name, scene) { + if (scene === void 0) { scene = null; } + /** + * Gets or sets a string used to store user defined state for the node + */ + this.state = ""; + /** + * Gets or sets an object used to store user defined information for the node + */ + this.metadata = null; + /** + * Gets or sets a boolean used to define if the node must be serialized + */ + this.doNotSerialize = false; + /** @hidden */ + this._isDisposed = false; + /** + * Gets a list of Animations associated with the node + */ + this.animations = new Array(); + this._ranges = {}; + this._isEnabled = true; + this._isParentEnabled = true; + this._isReady = true; + /** @hidden */ + this._currentRenderId = -1; + this._parentRenderId = -1; + this._childRenderId = -1; + /** @hidden */ + this._worldMatrix = BABYLON.Matrix.Identity(); + /** @hidden */ + this._worldMatrixDeterminant = 0; + /** @hidden */ + this._sceneRootNodesIndex = -1; + this._animationPropertiesOverride = null; + /** + * An event triggered when the mesh is disposed + */ + this.onDisposeObservable = new BABYLON.Observable(); + // Behaviors + this._behaviors = new Array(); + this.name = name; + this.id = name; + this._scene = (scene || BABYLON.Engine.LastCreatedScene); + this.uniqueId = this._scene.getUniqueId(); + this._initCache(); + this.addToSceneRootNodes(); + } + /** + * Add a new node constructor + * @param type defines the type name of the node to construct + * @param constructorFunc defines the constructor function + */ + Node.AddNodeConstructor = function (type, constructorFunc) { + this._NodeConstructors[type] = constructorFunc; + }; + /** + * Returns a node constructor based on type name + * @param type defines the type name + * @param name defines the new node name + * @param scene defines the hosting scene + * @param options defines optional options to transmit to constructors + * @returns the new constructor or null + */ + Node.Construct = function (type, name, scene, options) { + var constructorFunc = this._NodeConstructors[type]; + if (!constructorFunc) { + return null; + } + return constructorFunc(name, scene, options); + }; + /** + * Gets a boolean indicating if the node has been disposed + * @returns true if the node was disposed + */ + Node.prototype.isDisposed = function () { + return this._isDisposed; + }; + Object.defineProperty(Node.prototype, "parent", { + get: function () { + return this._parentNode; + }, + /** + * Gets or sets the parent of the node + */ + set: function (parent) { + if (this._parentNode === parent) { + return; + } + var previousParentNode = this._parentNode; + // Remove self from list of children of parent + if (this._parentNode && this._parentNode._children !== undefined && this._parentNode._children !== null) { + var index = this._parentNode._children.indexOf(this); + if (index !== -1) { + this._parentNode._children.splice(index, 1); + } + if (!parent) { + this.addToSceneRootNodes(); + } + } + // Store new parent + this._parentNode = parent; + // Add as child to new parent + if (this._parentNode) { + if (this._parentNode._children === undefined || this._parentNode._children === null) { + this._parentNode._children = new Array(); + } + this._parentNode._children.push(this); + if (!previousParentNode) { + this.removeFromSceneRootNodes(); + } + } + // Enabled state + this._syncParentEnabledState(); + }, + enumerable: true, + configurable: true + }); + Node.prototype.addToSceneRootNodes = function () { + if (this._sceneRootNodesIndex === -1) { + this._sceneRootNodesIndex = this._scene.rootNodes.length; + this._scene.rootNodes.push(this); + } + }; + Node.prototype.removeFromSceneRootNodes = function () { + if (this._sceneRootNodesIndex !== -1) { + var rootNodes = this._scene.rootNodes; + var lastIdx = rootNodes.length - 1; + rootNodes[this._sceneRootNodesIndex] = rootNodes[lastIdx]; + rootNodes[this._sceneRootNodesIndex]._sceneRootNodesIndex = this._sceneRootNodesIndex; + this._scene.rootNodes.pop(); + this._sceneRootNodesIndex = -1; + } + }; + Object.defineProperty(Node.prototype, "animationPropertiesOverride", { + /** + * Gets or sets the animation properties override + */ + get: function () { + if (!this._animationPropertiesOverride) { + return this._scene.animationPropertiesOverride; + } + return this._animationPropertiesOverride; + }, + set: function (value) { + this._animationPropertiesOverride = value; + }, + enumerable: true, + configurable: true + }); + /** + * Gets a string idenfifying the name of the class + * @returns "Node" string + */ + Node.prototype.getClassName = function () { + return "Node"; + }; + Object.defineProperty(Node.prototype, "onDispose", { + /** + * Sets a callback that will be raised when the node will be disposed + */ + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + /** + * Gets the scene of the node + * @returns a scene + */ + Node.prototype.getScene = function () { + return this._scene; + }; + /** + * Gets the engine of the node + * @returns a Engine + */ + Node.prototype.getEngine = function () { + return this._scene.getEngine(); + }; + /** + * Attach a behavior to the node + * @see http://doc.babylonjs.com/features/behaviour + * @param behavior defines the behavior to attach + * @param attachImmediately defines that the behavior must be attached even if the scene is still loading + * @returns the current Node + */ + Node.prototype.addBehavior = function (behavior, attachImmediately) { + var _this = this; + if (attachImmediately === void 0) { attachImmediately = false; } + var index = this._behaviors.indexOf(behavior); + if (index !== -1) { + return this; + } + behavior.init(); + if (this._scene.isLoading && !attachImmediately) { + // We defer the attach when the scene will be loaded + this._scene.onDataLoadedObservable.addOnce(function () { + behavior.attach(_this); + }); + } + else { + behavior.attach(this); + } + this._behaviors.push(behavior); + return this; + }; + /** + * Remove an attached behavior + * @see http://doc.babylonjs.com/features/behaviour + * @param behavior defines the behavior to attach + * @returns the current Node + */ + Node.prototype.removeBehavior = function (behavior) { + var index = this._behaviors.indexOf(behavior); + if (index === -1) { + return this; + } + this._behaviors[index].detach(); + this._behaviors.splice(index, 1); + return this; + }; + Object.defineProperty(Node.prototype, "behaviors", { + /** + * Gets the list of attached behaviors + * @see http://doc.babylonjs.com/features/behaviour + */ + get: function () { + return this._behaviors; + }, + enumerable: true, + configurable: true + }); + /** + * Gets an attached behavior by name + * @param name defines the name of the behavior to look for + * @see http://doc.babylonjs.com/features/behaviour + * @returns null if behavior was not found else the requested behavior + */ + Node.prototype.getBehaviorByName = function (name) { + for (var _i = 0, _a = this._behaviors; _i < _a.length; _i++) { + var behavior = _a[_i]; + if (behavior.name === name) { + return behavior; + } + } + return null; + }; + /** + * Returns the latest update of the World matrix + * @returns a Matrix + */ + Node.prototype.getWorldMatrix = function () { + if (this._currentRenderId !== this._scene.getRenderId()) { + this.computeWorldMatrix(); + } + return this._worldMatrix; + }; + /** @hidden */ + Node.prototype._getWorldMatrixDeterminant = function () { + return this._worldMatrixDeterminant; + }; + Object.defineProperty(Node.prototype, "worldMatrixFromCache", { + /** + * Returns directly the latest state of the mesh World matrix. + * A Matrix is returned. + */ + get: function () { + return this._worldMatrix; + }, + enumerable: true, + configurable: true + }); + // override it in derived class if you add new variables to the cache + // and call the parent class method + /** @hidden */ + Node.prototype._initCache = function () { + this._cache = {}; + this._cache.parent = undefined; + }; + /** @hidden */ + Node.prototype.updateCache = function (force) { + if (!force && this.isSynchronized()) { + return; + } + this._cache.parent = this.parent; + this._updateCache(); + }; + // override it in derived class if you add new variables to the cache + // and call the parent class method if !ignoreParentClass + /** @hidden */ + Node.prototype._updateCache = function (ignoreParentClass) { + }; + // override it in derived class if you add new variables to the cache + /** @hidden */ + Node.prototype._isSynchronized = function () { + return true; + }; + /** @hidden */ + Node.prototype._markSyncedWithParent = function () { + if (this._parentNode) { + this._parentRenderId = this._parentNode._childRenderId; + } + }; + /** @hidden */ + Node.prototype.isSynchronizedWithParent = function () { + if (!this._parentNode) { + return true; + } + if (this._parentRenderId !== this._parentNode._childRenderId) { + return false; + } + return this._parentNode.isSynchronized(); + }; + /** @hidden */ + Node.prototype.isSynchronized = function () { + if (this._cache.parent != this._parentNode) { + this._cache.parent = this._parentNode; + return false; + } + if (this._parentNode && !this.isSynchronizedWithParent()) { + return false; + } + return this._isSynchronized(); + }; + /** + * Is this node ready to be used/rendered + * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default) + * @return true if the node is ready + */ + Node.prototype.isReady = function (completeCheck) { + if (completeCheck === void 0) { completeCheck = false; } + return this._isReady; + }; + /** + * Is this node enabled? + * If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true + * @param checkAncestors indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors + * @return whether this node (and its parent) is enabled + */ + Node.prototype.isEnabled = function (checkAncestors) { + if (checkAncestors === void 0) { checkAncestors = true; } + if (checkAncestors === false) { + return this._isEnabled; + } + if (!this._isEnabled) { + return false; + } + return this._isParentEnabled; + }; + /** @hidden */ + Node.prototype._syncParentEnabledState = function () { + this._isParentEnabled = this._parentNode ? this._parentNode.isEnabled() : true; + if (this._children) { + this._children.forEach(function (c) { + c._syncParentEnabledState(); // Force children to update accordingly + }); + } + }; + /** + * Set the enabled state of this node + * @param value defines the new enabled state + */ + Node.prototype.setEnabled = function (value) { + this._isEnabled = value; + this._syncParentEnabledState(); + }; + /** + * Is this node a descendant of the given node? + * The function will iterate up the hierarchy until the ancestor was found or no more parents defined + * @param ancestor defines the parent node to inspect + * @returns a boolean indicating if this node is a descendant of the given node + */ + Node.prototype.isDescendantOf = function (ancestor) { + if (this.parent) { + if (this.parent === ancestor) { + return true; + } + return this.parent.isDescendantOf(ancestor); + } + return false; + }; + /** @hidden */ + Node.prototype._getDescendants = function (results, directDescendantsOnly, predicate) { + if (directDescendantsOnly === void 0) { directDescendantsOnly = false; } + if (!this._children) { + return; + } + for (var index = 0; index < this._children.length; index++) { + var item = this._children[index]; + if (!predicate || predicate(item)) { + results.push(item); + } + if (!directDescendantsOnly) { + item._getDescendants(results, false, predicate); + } + } + }; + /** + * Will return all nodes that have this node as ascendant + * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered + * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored + * @return all children nodes of all types + */ + Node.prototype.getDescendants = function (directDescendantsOnly, predicate) { + var results = new Array(); + this._getDescendants(results, directDescendantsOnly, predicate); + return results; + }; + /** + * Get all child-meshes of this node + * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered + * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored + * @returns an array of AbstractMesh + */ + Node.prototype.getChildMeshes = function (directDescendantsOnly, predicate) { + var results = []; + this._getDescendants(results, directDescendantsOnly, function (node) { + return ((!predicate || predicate(node)) && (node instanceof BABYLON.AbstractMesh)); + }); + return results; + }; + /** + * Get all child-transformNodes of this node + * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered + * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored + * @returns an array of TransformNode + */ + Node.prototype.getChildTransformNodes = function (directDescendantsOnly, predicate) { + var results = []; + this._getDescendants(results, directDescendantsOnly, function (node) { + return ((!predicate || predicate(node)) && (node instanceof BABYLON.TransformNode)); + }); + return results; + }; + /** + * Get all direct children of this node + * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored + * @returns an array of Node + */ + Node.prototype.getChildren = function (predicate) { + return this.getDescendants(true, predicate); + }; + /** @hidden */ + Node.prototype._setReady = function (state) { + if (state === this._isReady) { + return; + } + if (!state) { + this._isReady = false; + return; + } + if (this.onReady) { + this.onReady(this); + } + this._isReady = true; + }; + /** + * Get an animation by name + * @param name defines the name of the animation to look for + * @returns null if not found else the requested animation + */ + Node.prototype.getAnimationByName = function (name) { + for (var i = 0; i < this.animations.length; i++) { + var animation = this.animations[i]; + if (animation.name === name) { + return animation; + } + } + return null; + }; + /** + * Creates an animation range for this node + * @param name defines the name of the range + * @param from defines the starting key + * @param to defines the end key + */ + Node.prototype.createAnimationRange = function (name, from, to) { + // check name not already in use + if (!this._ranges[name]) { + this._ranges[name] = new BABYLON.AnimationRange(name, from, to); + for (var i = 0, nAnimations = this.animations.length; i < nAnimations; i++) { + if (this.animations[i]) { + this.animations[i].createRange(name, from, to); + } + } + } + }; + /** + * Delete a specific animation range + * @param name defines the name of the range to delete + * @param deleteFrames defines if animation frames from the range must be deleted as well + */ + Node.prototype.deleteAnimationRange = function (name, deleteFrames) { + if (deleteFrames === void 0) { deleteFrames = true; } + for (var i = 0, nAnimations = this.animations.length; i < nAnimations; i++) { + if (this.animations[i]) { + this.animations[i].deleteRange(name, deleteFrames); + } + } + this._ranges[name] = null; // said much faster than 'delete this._range[name]' + }; + /** + * Get an animation range by name + * @param name defines the name of the animation range to look for + * @returns null if not found else the requested animation range + */ + Node.prototype.getAnimationRange = function (name) { + return this._ranges[name]; + }; + /** + * Will start the animation sequence + * @param name defines the range frames for animation sequence + * @param loop defines if the animation should loop (false by default) + * @param speedRatio defines the speed factor in which to run the animation (1 by default) + * @param onAnimationEnd defines a function to be executed when the animation ended (undefined by default) + * @returns the object created for this animation. If range does not exist, it will return null + */ + Node.prototype.beginAnimation = function (name, loop, speedRatio, onAnimationEnd) { + var range = this.getAnimationRange(name); + if (!range) { + return null; + } + return this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd); + }; + /** + * Serialize animation ranges into a JSON compatible object + * @returns serialization object + */ + Node.prototype.serializeAnimationRanges = function () { + var serializationRanges = []; + for (var name in this._ranges) { + var localRange = this._ranges[name]; + if (!localRange) { + continue; + } + var range = {}; + range.name = name; + range.from = localRange.from; + range.to = localRange.to; + serializationRanges.push(range); + } + return serializationRanges; + }; + /** + * Computes the world matrix of the node + * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch + * @returns the world matrix + */ + Node.prototype.computeWorldMatrix = function (force) { + if (!this._worldMatrix) { + this._worldMatrix = BABYLON.Matrix.Identity(); + } + return this._worldMatrix; + }; + /** + * Releases resources associated with this node. + * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default) + * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default) + */ + Node.prototype.dispose = function (doNotRecurse, disposeMaterialAndTextures) { + if (disposeMaterialAndTextures === void 0) { disposeMaterialAndTextures = false; } + if (!doNotRecurse) { + var nodes = this.getDescendants(true); + for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { + var node = nodes_1[_i]; + node.dispose(doNotRecurse, disposeMaterialAndTextures); + } + } + else { + var transformNodes = this.getChildTransformNodes(true); + for (var _a = 0, transformNodes_1 = transformNodes; _a < transformNodes_1.length; _a++) { + var transformNode = transformNodes_1[_a]; + transformNode.parent = null; + transformNode.computeWorldMatrix(true); + } + } + if (!this.parent) { + this.removeFromSceneRootNodes(); + } + else { + this.parent = null; + } + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + // Behaviors + for (var _b = 0, _c = this._behaviors; _b < _c.length; _b++) { + var behavior = _c[_b]; + behavior.detach(); + } + this._behaviors = []; + this._isDisposed = true; + }; + /** + * Parse animation range data from a serialization object and store them into a given node + * @param node defines where to store the animation ranges + * @param parsedNode defines the serialization object to read data from + * @param scene defines the hosting scene + */ + Node.ParseAnimationRanges = function (node, parsedNode, scene) { + if (parsedNode.ranges) { + for (var index = 0; index < parsedNode.ranges.length; index++) { + var data = parsedNode.ranges[index]; + node.createAnimationRange(data.name, data.from, data.to); + } + } + }; + Node._NodeConstructors = {}; + __decorate([ + BABYLON.serialize() + ], Node.prototype, "name", void 0); + __decorate([ + BABYLON.serialize() + ], Node.prototype, "id", void 0); + __decorate([ + BABYLON.serialize() + ], Node.prototype, "uniqueId", void 0); + __decorate([ + BABYLON.serialize() + ], Node.prototype, "state", void 0); + __decorate([ + BABYLON.serialize() + ], Node.prototype, "metadata", void 0); + return Node; + }()); + BABYLON.Node = Node; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.node.js.map + +var BABYLON; +(function (BABYLON) { + // This matrix is used as a value to reset the bounding box. + var _identityMatrix = BABYLON.Matrix.Identity(); + /** + * Class used to store bounding sphere information + */ + var BoundingSphere = /** @class */ (function () { + /** + * Creates a new bounding sphere + * @param min defines the minimum vector (in local space) + * @param max defines the maximum vector (in local space) + */ + function BoundingSphere(min, max) { + /** + * Gets the center of the bounding sphere in local space + */ + this.center = BABYLON.Vector3.Zero(); + /** + * Gets the center of the bounding sphere in world space + */ + this.centerWorld = BABYLON.Vector3.Zero(); + /** + * Gets the minimum vector in local space + */ + this.minimum = BABYLON.Vector3.Zero(); + /** + * Gets the maximum vector in local space + */ + this.maximum = BABYLON.Vector3.Zero(); + this.reConstruct(min, max); + } + /** + * Recreates the entire bounding sphere from scratch + * @param min defines the new minimum vector (in local space) + * @param max defines the new maximum vector (in local space) + */ + BoundingSphere.prototype.reConstruct = function (min, max) { + this.minimum.copyFrom(min); + this.maximum.copyFrom(max); + var distance = BABYLON.Vector3.Distance(min, max); + BABYLON.Vector3.LerpToRef(min, max, 0.5, this.center); + this.radius = distance * 0.5; + this.centerWorld.set(0, 0, 0); + this._update(_identityMatrix); + }; + /** + * Scale the current bounding sphere by applying a scale factor + * @param factor defines the scale factor to apply + * @returns the current bounding box + */ + BoundingSphere.prototype.scale = function (factor) { + var newRadius = this.radius * factor; + var tempRadiusVector = BABYLON.Tmp.Vector3[0].set(newRadius, newRadius, newRadius); + var min = BABYLON.Tmp.Vector3[1].copyFrom(this.center).subtractInPlace(tempRadiusVector); + var max = BABYLON.Tmp.Vector3[2].copyFrom(this.center).addInPlace(tempRadiusVector); + this.reConstruct(min, max); + return this; + }; + // Methods + /** @hidden */ + BoundingSphere.prototype._update = function (world) { + BABYLON.Vector3.TransformCoordinatesToRef(this.center, world, this.centerWorld); + var tempVector = BABYLON.Tmp.Vector3[0]; + BABYLON.Vector3.TransformNormalFromFloatsToRef(1.0, 1.0, 1.0, world, tempVector); + this.radiusWorld = Math.max(Math.abs(tempVector.x), Math.abs(tempVector.y), Math.abs(tempVector.z)) * this.radius; + }; + /** + * Tests if the bounding sphere is intersecting the frustum planes + * @param frustumPlanes defines the frustum planes to test + * @returns true if there is an intersection + */ + BoundingSphere.prototype.isInFrustum = function (frustumPlanes) { + for (var i = 0; i < 6; i++) { + if (frustumPlanes[i].dotCoordinate(this.centerWorld) <= -this.radiusWorld) { + return false; + } + } + return true; + }; + /** + * Tests if a point is inside the bounding sphere + * @param point defines the point to test + * @returns true if the point is inside the bounding sphere + */ + BoundingSphere.prototype.intersectsPoint = function (point) { + var x = this.centerWorld.x - point.x; + var y = this.centerWorld.y - point.y; + var z = this.centerWorld.z - point.z; + var distance = Math.sqrt((x * x) + (y * y) + (z * z)); + if (this.radiusWorld < distance) { + return false; + } + return true; + }; + // Statics + /** + * Checks if two sphere intersct + * @param sphere0 sphere 0 + * @param sphere1 sphere 1 + * @returns true if the speres intersect + */ + BoundingSphere.Intersects = function (sphere0, sphere1) { + var x = sphere0.centerWorld.x - sphere1.centerWorld.x; + var y = sphere0.centerWorld.y - sphere1.centerWorld.y; + var z = sphere0.centerWorld.z - sphere1.centerWorld.z; + var distance = Math.sqrt((x * x) + (y * y) + (z * z)); + if (sphere0.radiusWorld + sphere1.radiusWorld < distance) { + return false; + } + return true; + }; + return BoundingSphere; + }()); + BABYLON.BoundingSphere = BoundingSphere; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boundingSphere.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Class used to store bounding box information + */ + var BoundingBox = /** @class */ (function () { + /** + * Creates a new bounding box + * @param min defines the minimum vector (in local space) + * @param max defines the maximum vector (in local space) + */ + function BoundingBox(min, max) { + /** + * Gets the 8 vectors representing the bounding box in local space + */ + this.vectors = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()]; + /** + * Gets the center of the bounding box in local space + */ + this.center = BABYLON.Vector3.Zero(); + /** + * Gets the center of the bounding box in world space + */ + this.centerWorld = BABYLON.Vector3.Zero(); + /** + * Gets the extend size in local space + */ + this.extendSize = BABYLON.Vector3.Zero(); + /** + * Gets the extend size in world space + */ + this.extendSizeWorld = BABYLON.Vector3.Zero(); + /** + * Gets the OBB (object bounding box) directions + */ + this.directions = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()]; + /** + * Gets the 8 vectors representing the bounding box in world space + */ + this.vectorsWorld = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()]; + /** + * Gets the minimum vector in world space + */ + this.minimumWorld = BABYLON.Vector3.Zero(); + /** + * Gets the maximum vector in world space + */ + this.maximumWorld = BABYLON.Vector3.Zero(); + /** + * Gets the minimum vector in local space + */ + this.minimum = BABYLON.Vector3.Zero(); + /** + * Gets the maximum vector in local space + */ + this.maximum = BABYLON.Vector3.Zero(); + this.reConstruct(min, max); + } + // Methods + /** + * Recreates the entire bounding box from scratch + * @param min defines the new minimum vector (in local space) + * @param max defines the new maximum vector (in local space) + */ + BoundingBox.prototype.reConstruct = function (min, max) { + this.minimum.copyFrom(min); + this.maximum.copyFrom(max); + // Bounding vectors + this.vectors[0].copyFrom(this.minimum); + this.vectors[1].copyFrom(this.maximum); + this.vectors[2].copyFrom(this.minimum); + this.vectors[3].copyFrom(this.minimum); + this.vectors[4].copyFrom(this.minimum); + this.vectors[5].copyFrom(this.maximum); + this.vectors[6].copyFrom(this.maximum); + this.vectors[7].copyFrom(this.maximum); + this.vectors[2].x = this.maximum.x; + this.vectors[3].y = this.maximum.y; + this.vectors[4].z = this.maximum.z; + this.vectors[5].z = this.minimum.z; + this.vectors[6].x = this.minimum.x; + this.vectors[7].y = this.minimum.y; + // OBB + this.center.copyFrom(this.maximum).addInPlace(this.minimum).scaleInPlace(0.5); + this.extendSize.copyFrom(this.maximum).subtractInPlace(this.minimum).scaleInPlace(0.5); + for (var index = 0; index < 3; index++) { + this.directions[index].copyFromFloats(0, 0, 0); + } + // World + for (var index = 0; index < 8; index++) { + this.vectorsWorld[index].copyFromFloats(0, 0, 0); + } + this.minimumWorld.copyFromFloats(0, 0, 0); + this.maximumWorld.copyFromFloats(0, 0, 0); + this.centerWorld.copyFromFloats(0, 0, 0); + this.extendSizeWorld.copyFromFloats(0, 0, 0); + this._update(this._worldMatrix || BABYLON.Matrix.Identity()); + }; + /** + * Scale the current bounding box by applying a scale factor + * @param factor defines the scale factor to apply + * @returns the current bounding box + */ + BoundingBox.prototype.scale = function (factor) { + var diff = BABYLON.Tmp.Vector3[0].copyFrom(this.maximum).subtractInPlace(this.minimum); + var distance = diff.length() * factor; + diff.normalize(); + var newRadius = diff.scaleInPlace(distance * 0.5); + var min = BABYLON.Tmp.Vector3[1].copyFrom(this.center).subtractInPlace(newRadius); + var max = BABYLON.Tmp.Vector3[2].copyFrom(this.center).addInPlace(newRadius); + this.reConstruct(min, max); + return this; + }; + /** + * Gets the world matrix of the bounding box + * @returns a matrix + */ + BoundingBox.prototype.getWorldMatrix = function () { + return this._worldMatrix; + }; + /** + * Sets the world matrix stored in the bounding box + * @param matrix defines the matrix to store + * @returns current bounding box + */ + BoundingBox.prototype.setWorldMatrix = function (matrix) { + this._worldMatrix.copyFrom(matrix); + return this; + }; + /** @hidden */ + BoundingBox.prototype._update = function (world) { + BABYLON.Vector3.FromFloatsToRef(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, this.minimumWorld); + BABYLON.Vector3.FromFloatsToRef(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, this.maximumWorld); + for (var index = 0; index < 8; index++) { + var v = this.vectorsWorld[index]; + BABYLON.Vector3.TransformCoordinatesToRef(this.vectors[index], world, v); + this.minimumWorld.minimizeInPlace(v); + this.maximumWorld.maximizeInPlace(v); + } + // Extend + this.maximumWorld.subtractToRef(this.minimumWorld, this.extendSizeWorld); + this.extendSizeWorld.scaleInPlace(0.5); + // OBB + this.maximumWorld.addToRef(this.minimumWorld, this.centerWorld); + this.centerWorld.scaleInPlace(0.5); + BABYLON.Vector3.FromFloatArrayToRef(world.m, 0, this.directions[0]); + BABYLON.Vector3.FromFloatArrayToRef(world.m, 4, this.directions[1]); + BABYLON.Vector3.FromFloatArrayToRef(world.m, 8, this.directions[2]); + this._worldMatrix = world; + }; + /** + * Tests if the bounding box is intersecting the frustum planes + * @param frustumPlanes defines the frustum planes to test + * @returns true if there is an intersection + */ + BoundingBox.prototype.isInFrustum = function (frustumPlanes) { + return BoundingBox.IsInFrustum(this.vectorsWorld, frustumPlanes); + }; + /** + * Tests if the bounding box is entirely inside the frustum planes + * @param frustumPlanes defines the frustum planes to test + * @returns true if there is an inclusion + */ + BoundingBox.prototype.isCompletelyInFrustum = function (frustumPlanes) { + return BoundingBox.IsCompletelyInFrustum(this.vectorsWorld, frustumPlanes); + }; + /** + * Tests if a point is inside the bounding box + * @param point defines the point to test + * @returns true if the point is inside the bounding box + */ + BoundingBox.prototype.intersectsPoint = function (point) { + var delta = -BABYLON.Epsilon; + if (this.maximumWorld.x - point.x < delta || delta > point.x - this.minimumWorld.x) { + return false; + } + if (this.maximumWorld.y - point.y < delta || delta > point.y - this.minimumWorld.y) { + return false; + } + if (this.maximumWorld.z - point.z < delta || delta > point.z - this.minimumWorld.z) { + return false; + } + return true; + }; + /** + * Tests if the bounding box intersects with a bounding sphere + * @param sphere defines the sphere to test + * @returns true if there is an intersection + */ + BoundingBox.prototype.intersectsSphere = function (sphere) { + return BoundingBox.IntersectsSphere(this.minimumWorld, this.maximumWorld, sphere.centerWorld, sphere.radiusWorld); + }; + /** + * Tests if the bounding box intersects with a box defined by a min and max vectors + * @param min defines the min vector to use + * @param max defines the max vector to use + * @returns true if there is an intersection + */ + BoundingBox.prototype.intersectsMinMax = function (min, max) { + if (this.maximumWorld.x < min.x || this.minimumWorld.x > max.x) { + return false; + } + if (this.maximumWorld.y < min.y || this.minimumWorld.y > max.y) { + return false; + } + if (this.maximumWorld.z < min.z || this.minimumWorld.z > max.z) { + return false; + } + return true; + }; + // Statics + /** + * Tests if two bounding boxes are intersections + * @param box0 defines the first box to test + * @param box1 defines the second box to test + * @returns true if there is an intersection + */ + BoundingBox.Intersects = function (box0, box1) { + if (box0.maximumWorld.x < box1.minimumWorld.x || box0.minimumWorld.x > box1.maximumWorld.x) { + return false; + } + if (box0.maximumWorld.y < box1.minimumWorld.y || box0.minimumWorld.y > box1.maximumWorld.y) { + return false; + } + if (box0.maximumWorld.z < box1.minimumWorld.z || box0.minimumWorld.z > box1.maximumWorld.z) { + return false; + } + return true; + }; + /** + * Tests if a bounding box defines by a min/max vectors intersects a sphere + * @param minPoint defines the minimum vector of the bounding box + * @param maxPoint defines the maximum vector of the bounding box + * @param sphereCenter defines the sphere center + * @param sphereRadius defines the sphere radius + * @returns true if there is an intersection + */ + BoundingBox.IntersectsSphere = function (minPoint, maxPoint, sphereCenter, sphereRadius) { + var vector = BABYLON.Vector3.Clamp(sphereCenter, minPoint, maxPoint); + var num = BABYLON.Vector3.DistanceSquared(sphereCenter, vector); + return (num <= (sphereRadius * sphereRadius)); + }; + /** + * Tests if a bounding box defined with 8 vectors is entirely inside frustum planes + * @param boundingVectors defines an array of 8 vectors representing a bounding box + * @param frustumPlanes defines the frustum planes to test + * @return true if there is an inclusion + */ + BoundingBox.IsCompletelyInFrustum = function (boundingVectors, frustumPlanes) { + for (var p = 0; p < 6; p++) { + for (var i = 0; i < 8; i++) { + if (frustumPlanes[p].dotCoordinate(boundingVectors[i]) < 0) { + return false; + } + } + } + return true; + }; + /** + * Tests if a bounding box defined with 8 vectors intersects frustum planes + * @param boundingVectors defines an array of 8 vectors representing a bounding box + * @param frustumPlanes defines the frustum planes to test + * @return true if there is an intersection + */ + BoundingBox.IsInFrustum = function (boundingVectors, frustumPlanes) { + for (var p = 0; p < 6; p++) { + var inCount = 8; + for (var i = 0; i < 8; i++) { + if (frustumPlanes[p].dotCoordinate(boundingVectors[i]) < 0) { + --inCount; + } + else { + break; + } + } + if (inCount === 0) { + return false; + } + } + return true; + }; + return BoundingBox; + }()); + BABYLON.BoundingBox = BoundingBox; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boundingBox.js.map + +var BABYLON; +(function (BABYLON) { + var computeBoxExtents = function (axis, box) { + var p = BABYLON.Vector3.Dot(box.centerWorld, axis); + var r0 = Math.abs(BABYLON.Vector3.Dot(box.directions[0], axis)) * box.extendSize.x; + var r1 = Math.abs(BABYLON.Vector3.Dot(box.directions[1], axis)) * box.extendSize.y; + var r2 = Math.abs(BABYLON.Vector3.Dot(box.directions[2], axis)) * box.extendSize.z; + var r = r0 + r1 + r2; + return { + min: p - r, + max: p + r + }; + }; + var extentsOverlap = function (min0, max0, min1, max1) { return !(min0 > max1 || min1 > max0); }; + var axisOverlap = function (axis, box0, box1) { + var result0 = computeBoxExtents(axis, box0); + var result1 = computeBoxExtents(axis, box1); + return extentsOverlap(result0.min, result0.max, result1.min, result1.max); + }; + /** + * Info for a bounding data of a mesh + */ + var BoundingInfo = /** @class */ (function () { + /** + * Constructs bounding info + * @param minimum min vector of the bounding box/sphere + * @param maximum max vector of the bounding box/sphere + */ + function BoundingInfo(minimum, maximum) { + this._isLocked = false; + this.boundingBox = new BABYLON.BoundingBox(minimum, maximum); + this.boundingSphere = new BABYLON.BoundingSphere(minimum, maximum); + } + Object.defineProperty(BoundingInfo.prototype, "minimum", { + /** + * min vector of the bounding box/sphere + */ + get: function () { + return this.boundingBox.minimum; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BoundingInfo.prototype, "maximum", { + /** + * max vector of the bounding box/sphere + */ + get: function () { + return this.boundingBox.maximum; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BoundingInfo.prototype, "isLocked", { + /** + * If the info is locked and won't be updated to avoid perf overhead + */ + get: function () { + return this._isLocked; + }, + set: function (value) { + this._isLocked = value; + }, + enumerable: true, + configurable: true + }); + // Methods + /** + * Updates the boudning sphere and box + * @param world world matrix to be used to update + */ + BoundingInfo.prototype.update = function (world) { + if (this._isLocked) { + return; + } + this.boundingBox._update(world); + this.boundingSphere._update(world); + }; + /** + * Recreate the bounding info to be centered around a specific point given a specific extend. + * @param center New center of the bounding info + * @param extend New extend of the bounding info + * @returns the current bounding info + */ + BoundingInfo.prototype.centerOn = function (center, extend) { + var minimum = BABYLON.Tmp.Vector3[0].copyFrom(center).subtractInPlace(extend); + var maximum = BABYLON.Tmp.Vector3[1].copyFrom(center).addInPlace(extend); + this.boundingBox.reConstruct(minimum, maximum); + this.boundingSphere.reConstruct(minimum, maximum); + return this; + }; + /** + * Scale the current bounding info by applying a scale factor + * @param factor defines the scale factor to apply + * @returns the current bounding info + */ + BoundingInfo.prototype.scale = function (factor) { + this.boundingBox.scale(factor); + this.boundingSphere.scale(factor); + return this; + }; + /** + * Returns `true` if the bounding info is within the frustum defined by the passed array of planes. + * @param frustumPlanes defines the frustum to test + * @param strategy defines the strategy to use for the culling (default is BABYLON.Scene.CULLINGSTRATEGY_STANDARD) + * @returns true if the bounding info is in the frustum planes + */ + BoundingInfo.prototype.isInFrustum = function (frustumPlanes, strategy) { + if (strategy === void 0) { strategy = BABYLON.AbstractMesh.CULLINGSTRATEGY_STANDARD; } + if (!this.boundingSphere.isInFrustum(frustumPlanes)) { + return false; + } + if (strategy === BABYLON.AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY) { + return true; + } + return this.boundingBox.isInFrustum(frustumPlanes); + }; + Object.defineProperty(BoundingInfo.prototype, "diagonalLength", { + /** + * Gets the world distance between the min and max points of the bounding box + */ + get: function () { + var boundingBox = this.boundingBox; + var size = boundingBox.maximumWorld.subtract(boundingBox.minimumWorld); + return size.length(); + }, + enumerable: true, + configurable: true + }); + /** + * Checks if a cullable object (mesh...) is in the camera frustum + * Unlike isInFrustum this cheks the full bounding box + * @param frustumPlanes Camera near/planes + * @returns true if the object is in frustum otherwise false + */ + BoundingInfo.prototype.isCompletelyInFrustum = function (frustumPlanes) { + return this.boundingBox.isCompletelyInFrustum(frustumPlanes); + }; + /** @hidden */ + BoundingInfo.prototype._checkCollision = function (collider) { + return collider._canDoCollision(this.boundingSphere.centerWorld, this.boundingSphere.radiusWorld, this.boundingBox.minimumWorld, this.boundingBox.maximumWorld); + }; + /** + * Checks if a point is inside the bounding box and bounding sphere or the mesh + * @see https://doc.babylonjs.com/babylon101/intersect_collisions_-_mesh + * @param point the point to check intersection with + * @returns if the point intersects + */ + BoundingInfo.prototype.intersectsPoint = function (point) { + if (!this.boundingSphere.centerWorld) { + return false; + } + if (!this.boundingSphere.intersectsPoint(point)) { + return false; + } + if (!this.boundingBox.intersectsPoint(point)) { + return false; + } + return true; + }; + /** + * Checks if another bounding info intersects the bounding box and bounding sphere or the mesh + * @see https://doc.babylonjs.com/babylon101/intersect_collisions_-_mesh + * @param boundingInfo the bounding info to check intersection with + * @param precise if the intersection should be done using OBB + * @returns if the bounding info intersects + */ + BoundingInfo.prototype.intersects = function (boundingInfo, precise) { + if (!this.boundingSphere.centerWorld || !boundingInfo.boundingSphere.centerWorld) { + return false; + } + if (!BABYLON.BoundingSphere.Intersects(this.boundingSphere, boundingInfo.boundingSphere)) { + return false; + } + if (!BABYLON.BoundingBox.Intersects(this.boundingBox, boundingInfo.boundingBox)) { + return false; + } + if (!precise) { + return true; + } + var box0 = this.boundingBox; + var box1 = boundingInfo.boundingBox; + if (!axisOverlap(box0.directions[0], box0, box1)) { + return false; + } + if (!axisOverlap(box0.directions[1], box0, box1)) { + return false; + } + if (!axisOverlap(box0.directions[2], box0, box1)) { + return false; + } + if (!axisOverlap(box1.directions[0], box0, box1)) { + return false; + } + if (!axisOverlap(box1.directions[1], box0, box1)) { + return false; + } + if (!axisOverlap(box1.directions[2], box0, box1)) { + return false; + } + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[0], box1.directions[0]), box0, box1)) { + return false; + } + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[0], box1.directions[1]), box0, box1)) { + return false; + } + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[0], box1.directions[2]), box0, box1)) { + return false; + } + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[1], box1.directions[0]), box0, box1)) { + return false; + } + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[1], box1.directions[1]), box0, box1)) { + return false; + } + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[1], box1.directions[2]), box0, box1)) { + return false; + } + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[2], box1.directions[0]), box0, box1)) { + return false; + } + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[2], box1.directions[1]), box0, box1)) { + return false; + } + if (!axisOverlap(BABYLON.Vector3.Cross(box0.directions[2], box1.directions[2]), box0, box1)) { + return false; + } + return true; + }; + return BoundingInfo; + }()); + BABYLON.BoundingInfo = BoundingInfo; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boundingInfo.js.map + + + +var BABYLON; +(function (BABYLON) { + /** + * A TransformNode is an object that is not rendered but can be used as a center of transformation. This can decrease memory usage and increase rendering speed compared to using an empty mesh as a parent and is less complicated than using a pivot matrix. + * @see https://doc.babylonjs.com/how_to/transformnode + */ + var TransformNode = /** @class */ (function (_super) { + __extends(TransformNode, _super); + function TransformNode(name, scene, isPure) { + if (scene === void 0) { scene = null; } + if (isPure === void 0) { isPure = true; } + var _this = _super.call(this, name, scene) || this; + _this._forward = new BABYLON.Vector3(0, 0, 1); + _this._forwardInverted = new BABYLON.Vector3(0, 0, -1); + _this._up = new BABYLON.Vector3(0, 1, 0); + _this._right = new BABYLON.Vector3(1, 0, 0); + _this._rightInverted = new BABYLON.Vector3(-1, 0, 0); + // Properties + _this._position = BABYLON.Vector3.Zero(); + _this._rotation = BABYLON.Vector3.Zero(); + _this._scaling = BABYLON.Vector3.One(); + _this._isDirty = false; + /** + * Set the billboard mode. Default is 0. + * + * | Value | Type | Description | + * | --- | --- | --- | + * | 0 | BILLBOARDMODE_NONE | | + * | 1 | BILLBOARDMODE_X | | + * | 2 | BILLBOARDMODE_Y | | + * | 4 | BILLBOARDMODE_Z | | + * | 7 | BILLBOARDMODE_ALL | | + * + */ + _this.billboardMode = TransformNode.BILLBOARDMODE_NONE; + /** + * Multiplication factor on scale x/y/z when computing the world matrix. Eg. for a 1x1x1 cube setting this to 2 will make it a 2x2x2 cube + */ + _this.scalingDeterminant = 1; + /** + * Sets the distance of the object to max, often used by skybox + */ + _this.infiniteDistance = false; + /** + * Gets or sets a boolean indicating that non uniform scaling (when at least one component is different from others) should be ignored. + * By default the system will update normals to compensate + */ + _this.ignoreNonUniformScaling = false; + _this._localWorld = BABYLON.Matrix.Zero(); + _this._absolutePosition = BABYLON.Vector3.Zero(); + _this._pivotMatrix = BABYLON.Matrix.Identity(); + _this._postMultiplyPivotMatrix = false; + _this._isWorldMatrixFrozen = false; + /** + * An event triggered after the world matrix is updated + */ + _this.onAfterWorldMatrixUpdateObservable = new BABYLON.Observable(); + _this._nonUniformScaling = false; + if (isPure) { + _this.getScene().addTransformNode(_this); + } + return _this; + } + /** + * Gets a string identifying the name of the class + * @returns "TransformNode" string + */ + TransformNode.prototype.getClassName = function () { + return "TransformNode"; + }; + Object.defineProperty(TransformNode.prototype, "position", { + /** + * Gets or set the node position (default is (0.0, 0.0, 0.0)) + */ + get: function () { + return this._position; + }, + set: function (newPosition) { + this._position = newPosition; + this._isDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransformNode.prototype, "rotation", { + /** + * Gets or sets the rotation property : a Vector3 defining the rotation value in radians around each local axis X, Y, Z (default is (0.0, 0.0, 0.0)). + * If rotation quaternion is set, this Vector3 will be ignored and copy from the quaternion + */ + get: function () { + return this._rotation; + }, + set: function (newRotation) { + this._rotation = newRotation; + this._isDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransformNode.prototype, "scaling", { + /** + * Gets or sets the scaling property : a Vector3 defining the node scaling along each local axis X, Y, Z (default is (0.0, 0.0, 0.0)). + */ + get: function () { + return this._scaling; + }, + set: function (newScaling) { + this._scaling = newScaling; + this._isDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransformNode.prototype, "rotationQuaternion", { + /** + * Gets or sets the rotation Quaternion property : this a Quaternion object defining the node rotation by using a unit quaternion (null by default). + * If set, only the rotationQuaternion is then used to compute the node rotation (ie. node.rotation will be ignored) + */ + get: function () { + return this._rotationQuaternion; + }, + set: function (quaternion) { + this._rotationQuaternion = quaternion; + //reset the rotation vector. + if (quaternion && this.rotation.length()) { + this.rotation.copyFromFloats(0.0, 0.0, 0.0); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransformNode.prototype, "forward", { + /** + * The forward direction of that transform in world space. + */ + get: function () { + return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._forwardInverted : this._forward, this.getWorldMatrix())); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransformNode.prototype, "up", { + /** + * The up direction of that transform in world space. + */ + get: function () { + return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this._up, this.getWorldMatrix())); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransformNode.prototype, "right", { + /** + * The right direction of that transform in world space. + */ + get: function () { + return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._rightInverted : this._right, this.getWorldMatrix())); + }, + enumerable: true, + configurable: true + }); + /** + * Copies the parameter passed Matrix into the mesh Pose matrix. + * @param matrix the matrix to copy the pose from + * @returns this TransformNode. + */ + TransformNode.prototype.updatePoseMatrix = function (matrix) { + this._poseMatrix.copyFrom(matrix); + return this; + }; + /** + * Returns the mesh Pose matrix. + * @returns the pose matrix + */ + TransformNode.prototype.getPoseMatrix = function () { + return this._poseMatrix; + }; + /** @hidden */ + TransformNode.prototype._isSynchronized = function () { + if (this._isDirty) { + return false; + } + if (this.billboardMode !== this._cache.billboardMode || this.billboardMode !== TransformNode.BILLBOARDMODE_NONE) { + return false; + } + if (this._cache.pivotMatrixUpdated) { + return false; + } + if (this.infiniteDistance) { + return false; + } + if (!this._cache.position.equals(this._position)) { + return false; + } + if (this._rotationQuaternion) { + if (!this._cache.rotationQuaternion.equals(this._rotationQuaternion)) { + return false; + } + } + if (!this._cache.rotation.equals(this._rotation)) { + return false; + } + if (!this._cache.scaling.equals(this._scaling)) { + return false; + } + return true; + }; + /** @hidden */ + TransformNode.prototype._initCache = function () { + _super.prototype._initCache.call(this); + this._cache.localMatrixUpdated = false; + this._cache.position = BABYLON.Vector3.Zero(); + this._cache.scaling = BABYLON.Vector3.Zero(); + this._cache.rotation = BABYLON.Vector3.Zero(); + this._cache.rotationQuaternion = new BABYLON.Quaternion(0, 0, 0, 0); + this._cache.billboardMode = -1; + }; + /** + * Flag the transform node as dirty (Forcing it to update everything) + * @param property if set to "rotation" the objects rotationQuaternion will be set to null + * @returns this transform node + */ + TransformNode.prototype.markAsDirty = function (property) { + if (property === "rotation") { + this.rotationQuaternion = null; + } + this._currentRenderId = Number.MAX_VALUE; + this._isDirty = true; + return this; + }; + Object.defineProperty(TransformNode.prototype, "absolutePosition", { + /** + * Returns the current mesh absolute position. + * Returns a Vector3. + */ + get: function () { + return this._absolutePosition; + }, + enumerable: true, + configurable: true + }); + /** + * Sets a new matrix to apply before all other transformation + * @param matrix defines the transform matrix + * @returns the current TransformNode + */ + TransformNode.prototype.setPreTransformMatrix = function (matrix) { + return this.setPivotMatrix(matrix, false); + }; + /** + * Sets a new pivot matrix to the current node + * @param matrix defines the new pivot matrix to use + * @param postMultiplyPivotMatrix defines if the pivot matrix must be cancelled in the world matrix. When this parameter is set to true (default), the inverse of the pivot matrix is also applied at the end to cancel the transformation effect + * @returns the current TransformNode + */ + TransformNode.prototype.setPivotMatrix = function (matrix, postMultiplyPivotMatrix) { + if (postMultiplyPivotMatrix === void 0) { postMultiplyPivotMatrix = true; } + this._pivotMatrix = matrix.clone(); + this._cache.pivotMatrixUpdated = true; + this._postMultiplyPivotMatrix = postMultiplyPivotMatrix; + if (this._postMultiplyPivotMatrix) { + if (!this._pivotMatrixInverse) { + this._pivotMatrixInverse = BABYLON.Matrix.Invert(this._pivotMatrix); + } + else { + this._pivotMatrix.invertToRef(this._pivotMatrixInverse); + } + } + return this; + }; + /** + * Returns the mesh pivot matrix. + * Default : Identity. + * @returns the matrix + */ + TransformNode.prototype.getPivotMatrix = function () { + return this._pivotMatrix; + }; + /** + * Prevents the World matrix to be computed any longer. + * @returns the TransformNode. + */ + TransformNode.prototype.freezeWorldMatrix = function () { + this._isWorldMatrixFrozen = false; // no guarantee world is not already frozen, switch off temporarily + this.computeWorldMatrix(true); + this._isWorldMatrixFrozen = true; + return this; + }; + /** + * Allows back the World matrix computation. + * @returns the TransformNode. + */ + TransformNode.prototype.unfreezeWorldMatrix = function () { + this._isWorldMatrixFrozen = false; + this.computeWorldMatrix(true); + return this; + }; + Object.defineProperty(TransformNode.prototype, "isWorldMatrixFrozen", { + /** + * True if the World matrix has been frozen. + */ + get: function () { + return this._isWorldMatrixFrozen; + }, + enumerable: true, + configurable: true + }); + /** + * Retuns the mesh absolute position in the World. + * @returns a Vector3. + */ + TransformNode.prototype.getAbsolutePosition = function () { + this.computeWorldMatrix(); + return this._absolutePosition; + }; + /** + * Sets the mesh absolute position in the World from a Vector3 or an Array(3). + * @param absolutePosition the absolute position to set + * @returns the TransformNode. + */ + TransformNode.prototype.setAbsolutePosition = function (absolutePosition) { + if (!absolutePosition) { + return this; + } + var absolutePositionX; + var absolutePositionY; + var absolutePositionZ; + if (absolutePosition.x === undefined) { + if (arguments.length < 3) { + return this; + } + absolutePositionX = arguments[0]; + absolutePositionY = arguments[1]; + absolutePositionZ = arguments[2]; + } + else { + absolutePositionX = absolutePosition.x; + absolutePositionY = absolutePosition.y; + absolutePositionZ = absolutePosition.z; + } + if (this.parent) { + var invertParentWorldMatrix = this.parent.getWorldMatrix().clone(); + invertParentWorldMatrix.invert(); + var worldPosition = new BABYLON.Vector3(absolutePositionX, absolutePositionY, absolutePositionZ); + this.position = BABYLON.Vector3.TransformCoordinates(worldPosition, invertParentWorldMatrix); + } + else { + this.position.x = absolutePositionX; + this.position.y = absolutePositionY; + this.position.z = absolutePositionZ; + } + return this; + }; + /** + * Sets the mesh position in its local space. + * @param vector3 the position to set in localspace + * @returns the TransformNode. + */ + TransformNode.prototype.setPositionWithLocalVector = function (vector3) { + this.computeWorldMatrix(); + this.position = BABYLON.Vector3.TransformNormal(vector3, this._localWorld); + return this; + }; + /** + * Returns the mesh position in the local space from the current World matrix values. + * @returns a new Vector3. + */ + TransformNode.prototype.getPositionExpressedInLocalSpace = function () { + this.computeWorldMatrix(); + var invLocalWorldMatrix = this._localWorld.clone(); + invLocalWorldMatrix.invert(); + return BABYLON.Vector3.TransformNormal(this.position, invLocalWorldMatrix); + }; + /** + * Translates the mesh along the passed Vector3 in its local space. + * @param vector3 the distance to translate in localspace + * @returns the TransformNode. + */ + TransformNode.prototype.locallyTranslate = function (vector3) { + this.computeWorldMatrix(true); + this.position = BABYLON.Vector3.TransformCoordinates(vector3, this._localWorld); + return this; + }; + /** + * Orients a mesh towards a target point. Mesh must be drawn facing user. + * @param targetPoint the position (must be in same space as current mesh) to look at + * @param yawCor optional yaw (y-axis) correction in radians + * @param pitchCor optional pitch (x-axis) correction in radians + * @param rollCor optional roll (z-axis) correction in radians + * @param space the choosen space of the target + * @returns the TransformNode. + */ + TransformNode.prototype.lookAt = function (targetPoint, yawCor, pitchCor, rollCor, space) { + if (yawCor === void 0) { yawCor = 0; } + if (pitchCor === void 0) { pitchCor = 0; } + if (rollCor === void 0) { rollCor = 0; } + if (space === void 0) { space = BABYLON.Space.LOCAL; } + var dv = TransformNode._lookAtVectorCache; + var pos = space === BABYLON.Space.LOCAL ? this.position : this.getAbsolutePosition(); + targetPoint.subtractToRef(pos, dv); + var yaw = -Math.atan2(dv.z, dv.x) - Math.PI / 2; + var len = Math.sqrt(dv.x * dv.x + dv.z * dv.z); + var pitch = Math.atan2(dv.y, len); + if (this.rotationQuaternion) { + BABYLON.Quaternion.RotationYawPitchRollToRef(yaw + yawCor, pitch + pitchCor, rollCor, this.rotationQuaternion); + } + else { + this.rotation.x = pitch + pitchCor; + this.rotation.y = yaw + yawCor; + this.rotation.z = rollCor; + } + return this; + }; + /** + * Returns a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh. + * This Vector3 is expressed in the World space. + * @param localAxis axis to rotate + * @returns a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh. + */ + TransformNode.prototype.getDirection = function (localAxis) { + var result = BABYLON.Vector3.Zero(); + this.getDirectionToRef(localAxis, result); + return result; + }; + /** + * Sets the Vector3 "result" as the rotated Vector3 "localAxis" in the same rotation than the mesh. + * localAxis is expressed in the mesh local space. + * result is computed in the Wordl space from the mesh World matrix. + * @param localAxis axis to rotate + * @param result the resulting transformnode + * @returns this TransformNode. + */ + TransformNode.prototype.getDirectionToRef = function (localAxis, result) { + BABYLON.Vector3.TransformNormalToRef(localAxis, this.getWorldMatrix(), result); + return this; + }; + /** + * Sets a new pivot point to the current node + * @param point defines the new pivot point to use + * @param space defines if the point is in world or local space (local by default) + * @returns the current TransformNode + */ + TransformNode.prototype.setPivotPoint = function (point, space) { + if (space === void 0) { space = BABYLON.Space.LOCAL; } + if (this.getScene().getRenderId() == 0) { + this.computeWorldMatrix(true); + } + var wm = this.getWorldMatrix(); + if (space == BABYLON.Space.WORLD) { + var tmat = BABYLON.Tmp.Matrix[0]; + wm.invertToRef(tmat); + point = BABYLON.Vector3.TransformCoordinates(point, tmat); + } + return this.setPivotMatrix(BABYLON.Matrix.Translation(-point.x, -point.y, -point.z), true); + }; + /** + * Returns a new Vector3 set with the mesh pivot point coordinates in the local space. + * @returns the pivot point + */ + TransformNode.prototype.getPivotPoint = function () { + var point = BABYLON.Vector3.Zero(); + this.getPivotPointToRef(point); + return point; + }; + /** + * Sets the passed Vector3 "result" with the coordinates of the mesh pivot point in the local space. + * @param result the vector3 to store the result + * @returns this TransformNode. + */ + TransformNode.prototype.getPivotPointToRef = function (result) { + result.x = -this._pivotMatrix.m[12]; + result.y = -this._pivotMatrix.m[13]; + result.z = -this._pivotMatrix.m[14]; + return this; + }; + /** + * Returns a new Vector3 set with the mesh pivot point World coordinates. + * @returns a new Vector3 set with the mesh pivot point World coordinates. + */ + TransformNode.prototype.getAbsolutePivotPoint = function () { + var point = BABYLON.Vector3.Zero(); + this.getAbsolutePivotPointToRef(point); + return point; + }; + /** + * Sets the Vector3 "result" coordinates with the mesh pivot point World coordinates. + * @param result vector3 to store the result + * @returns this TransformNode. + */ + TransformNode.prototype.getAbsolutePivotPointToRef = function (result) { + result.x = this._pivotMatrix.m[12]; + result.y = this._pivotMatrix.m[13]; + result.z = this._pivotMatrix.m[14]; + this.getPivotPointToRef(result); + BABYLON.Vector3.TransformCoordinatesToRef(result, this.getWorldMatrix(), result); + return this; + }; + /** + * Defines the passed node as the parent of the current node. + * The node will remain exactly where it is and its position / rotation will be updated accordingly + * @param node the node ot set as the parent + * @returns this TransformNode. + */ + TransformNode.prototype.setParent = function (node) { + if (!node && !this.parent) { + return this; + } + if (!node) { + var rotation = BABYLON.Tmp.Quaternion[0]; + var position = BABYLON.Tmp.Vector3[0]; + var scale = BABYLON.Tmp.Vector3[1]; + if (this.parent && this.parent.computeWorldMatrix) { + this.parent.computeWorldMatrix(true); + } + this.computeWorldMatrix(true); + this.getWorldMatrix().decompose(scale, rotation, position); + if (this.rotationQuaternion) { + this.rotationQuaternion.copyFrom(rotation); + } + else { + rotation.toEulerAnglesToRef(this.rotation); + } + this.scaling.x = scale.x; + this.scaling.y = scale.y; + this.scaling.z = scale.z; + this.position.x = position.x; + this.position.y = position.y; + this.position.z = position.z; + } + else { + var rotation = BABYLON.Tmp.Quaternion[0]; + var position = BABYLON.Tmp.Vector3[0]; + var scale = BABYLON.Tmp.Vector3[1]; + var diffMatrix = BABYLON.Tmp.Matrix[0]; + var invParentMatrix = BABYLON.Tmp.Matrix[1]; + this.computeWorldMatrix(true); + node.computeWorldMatrix(true); + node.getWorldMatrix().invertToRef(invParentMatrix); + this.getWorldMatrix().multiplyToRef(invParentMatrix, diffMatrix); + diffMatrix.decompose(scale, rotation, position); + if (this.rotationQuaternion) { + this.rotationQuaternion.copyFrom(rotation); + } + else { + rotation.toEulerAnglesToRef(this.rotation); + } + this.position.x = position.x; + this.position.y = position.y; + this.position.z = position.z; + this.scaling.x = scale.x; + this.scaling.y = scale.y; + this.scaling.z = scale.z; + } + this.parent = node; + return this; + }; + Object.defineProperty(TransformNode.prototype, "nonUniformScaling", { + /** + * True if the scaling property of this object is non uniform eg. (1,2,1) + */ + get: function () { + return this._nonUniformScaling; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + TransformNode.prototype._updateNonUniformScalingState = function (value) { + if (this._nonUniformScaling === value) { + return false; + } + this._nonUniformScaling = value; + return true; + }; + /** + * Attach the current TransformNode to another TransformNode associated with a bone + * @param bone Bone affecting the TransformNode + * @param affectedTransformNode TransformNode associated with the bone + * @returns this object + */ + TransformNode.prototype.attachToBone = function (bone, affectedTransformNode) { + this._transformToBoneReferal = affectedTransformNode; + this.parent = bone; + if (bone.getWorldMatrix().determinant() < 0) { + this.scalingDeterminant *= -1; + } + return this; + }; + /** + * Detach the transform node if its associated with a bone + * @returns this object + */ + TransformNode.prototype.detachFromBone = function () { + if (!this.parent) { + return this; + } + if (this.parent.getWorldMatrix().determinant() < 0) { + this.scalingDeterminant *= -1; + } + this._transformToBoneReferal = null; + this.parent = null; + return this; + }; + /** + * Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in the given space. + * space (default LOCAL) can be either BABYLON.Space.LOCAL, either BABYLON.Space.WORLD. + * Note that the property `rotationQuaternion` is then automatically updated and the property `rotation` is set to (0,0,0) and no longer used. + * The passed axis is also normalized. + * @param axis the axis to rotate around + * @param amount the amount to rotate in radians + * @param space Space to rotate in (Default: local) + * @returns the TransformNode. + */ + TransformNode.prototype.rotate = function (axis, amount, space) { + axis.normalize(); + if (!this.rotationQuaternion) { + this.rotationQuaternion = BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z); + this.rotation = BABYLON.Vector3.Zero(); + } + var rotationQuaternion; + if (!space || space === BABYLON.Space.LOCAL) { + rotationQuaternion = BABYLON.Quaternion.RotationAxisToRef(axis, amount, TransformNode._rotationAxisCache); + this.rotationQuaternion.multiplyToRef(rotationQuaternion, this.rotationQuaternion); + } + else { + if (this.parent) { + var invertParentWorldMatrix = this.parent.getWorldMatrix().clone(); + invertParentWorldMatrix.invert(); + axis = BABYLON.Vector3.TransformNormal(axis, invertParentWorldMatrix); + } + rotationQuaternion = BABYLON.Quaternion.RotationAxisToRef(axis, amount, TransformNode._rotationAxisCache); + rotationQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion); + } + return this; + }; + /** + * Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in world space. + * Note that the property `rotationQuaternion` is then automatically updated and the property `rotation` is set to (0,0,0) and no longer used. + * The passed axis is also normalized. . + * Method is based on http://www.euclideanspace.com/maths/geometry/affine/aroundPoint/index.htm + * @param point the point to rotate around + * @param axis the axis to rotate around + * @param amount the amount to rotate in radians + * @returns the TransformNode + */ + TransformNode.prototype.rotateAround = function (point, axis, amount) { + axis.normalize(); + if (!this.rotationQuaternion) { + this.rotationQuaternion = BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z); + this.rotation.copyFromFloats(0, 0, 0); + } + point.subtractToRef(this.position, BABYLON.Tmp.Vector3[0]); + BABYLON.Matrix.TranslationToRef(BABYLON.Tmp.Vector3[0].x, BABYLON.Tmp.Vector3[0].y, BABYLON.Tmp.Vector3[0].z, BABYLON.Tmp.Matrix[0]); + BABYLON.Tmp.Matrix[0].invertToRef(BABYLON.Tmp.Matrix[2]); + BABYLON.Matrix.RotationAxisToRef(axis, amount, BABYLON.Tmp.Matrix[1]); + BABYLON.Tmp.Matrix[2].multiplyToRef(BABYLON.Tmp.Matrix[1], BABYLON.Tmp.Matrix[2]); + BABYLON.Tmp.Matrix[2].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[2]); + BABYLON.Tmp.Matrix[2].decompose(BABYLON.Tmp.Vector3[0], BABYLON.Tmp.Quaternion[0], BABYLON.Tmp.Vector3[1]); + this.position.addInPlace(BABYLON.Tmp.Vector3[1]); + BABYLON.Tmp.Quaternion[0].multiplyToRef(this.rotationQuaternion, this.rotationQuaternion); + return this; + }; + /** + * Translates the mesh along the axis vector for the passed distance in the given space. + * space (default LOCAL) can be either BABYLON.Space.LOCAL, either BABYLON.Space.WORLD. + * @param axis the axis to translate in + * @param distance the distance to translate + * @param space Space to rotate in (Default: local) + * @returns the TransformNode. + */ + TransformNode.prototype.translate = function (axis, distance, space) { + var displacementVector = axis.scale(distance); + if (!space || space === BABYLON.Space.LOCAL) { + var tempV3 = this.getPositionExpressedInLocalSpace().add(displacementVector); + this.setPositionWithLocalVector(tempV3); + } + else { + this.setAbsolutePosition(this.getAbsolutePosition().add(displacementVector)); + } + return this; + }; + /** + * Adds a rotation step to the mesh current rotation. + * x, y, z are Euler angles expressed in radians. + * This methods updates the current mesh rotation, either mesh.rotation, either mesh.rotationQuaternion if it's set. + * This means this rotation is made in the mesh local space only. + * It's useful to set a custom rotation order different from the BJS standard one YXZ. + * Example : this rotates the mesh first around its local X axis, then around its local Z axis, finally around its local Y axis. + * ```javascript + * mesh.addRotation(x1, 0, 0).addRotation(0, 0, z2).addRotation(0, 0, y3); + * ``` + * Note that `addRotation()` accumulates the passed rotation values to the current ones and computes the .rotation or .rotationQuaternion updated values. + * Under the hood, only quaternions are used. So it's a little faster is you use .rotationQuaternion because it doesn't need to translate them back to Euler angles. + * @param x Rotation to add + * @param y Rotation to add + * @param z Rotation to add + * @returns the TransformNode. + */ + TransformNode.prototype.addRotation = function (x, y, z) { + var rotationQuaternion; + if (this.rotationQuaternion) { + rotationQuaternion = this.rotationQuaternion; + } + else { + rotationQuaternion = BABYLON.Tmp.Quaternion[1]; + BABYLON.Quaternion.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, rotationQuaternion); + } + var accumulation = BABYLON.Tmp.Quaternion[0]; + BABYLON.Quaternion.RotationYawPitchRollToRef(y, x, z, accumulation); + rotationQuaternion.multiplyInPlace(accumulation); + if (!this.rotationQuaternion) { + rotationQuaternion.toEulerAnglesToRef(this.rotation); + } + return this; + }; + /** + * Computes the world matrix of the node + * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch + * @returns the world matrix + */ + TransformNode.prototype.computeWorldMatrix = function (force) { + if (this._isWorldMatrixFrozen) { + return this._worldMatrix; + } + if (!force && this.isSynchronized()) { + this._currentRenderId = this.getScene().getRenderId(); + return this._worldMatrix; + } + this._updateCache(); + this._cache.position.copyFrom(this.position); + this._cache.scaling.copyFrom(this.scaling); + this._cache.pivotMatrixUpdated = false; + this._cache.billboardMode = this.billboardMode; + this._currentRenderId = this.getScene().getRenderId(); + this._childRenderId = this.getScene().getRenderId(); + this._isDirty = false; + // Scaling + BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]); + // Rotation + //rotate, if quaternion is set and rotation was used + if (this.rotationQuaternion) { + var len = this.rotation.length(); + if (len) { + this.rotationQuaternion.multiplyInPlace(BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z)); + this.rotation.copyFromFloats(0, 0, 0); + } + } + if (this.rotationQuaternion) { + this.rotationQuaternion.toRotationMatrix(BABYLON.Tmp.Matrix[0]); + this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion); + } + else { + BABYLON.Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, BABYLON.Tmp.Matrix[0]); + this._cache.rotation.copyFrom(this.rotation); + } + // Translation + var camera = this.getScene().activeCamera; + if (this.infiniteDistance && !this.parent && camera) { + var cameraWorldMatrix = camera.getWorldMatrix(); + var cameraGlobalPosition = new BABYLON.Vector3(cameraWorldMatrix.m[12], cameraWorldMatrix.m[13], cameraWorldMatrix.m[14]); + BABYLON.Matrix.TranslationToRef(this.position.x + cameraGlobalPosition.x, this.position.y + cameraGlobalPosition.y, this.position.z + cameraGlobalPosition.z, BABYLON.Tmp.Matrix[2]); + } + else { + BABYLON.Matrix.TranslationToRef(this.position.x, this.position.y, this.position.z, BABYLON.Tmp.Matrix[2]); + } + // Composing transformations + this._pivotMatrix.multiplyToRef(BABYLON.Tmp.Matrix[1], BABYLON.Tmp.Matrix[4]); + BABYLON.Tmp.Matrix[4].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]); + // Billboarding (testing PG:http://www.babylonjs-playground.com/#UJEIL#13) + if (this.billboardMode !== TransformNode.BILLBOARDMODE_NONE && camera) { + if ((this.billboardMode & TransformNode.BILLBOARDMODE_ALL) !== TransformNode.BILLBOARDMODE_ALL) { + // Need to decompose each rotation here + var currentPosition = BABYLON.Tmp.Vector3[3]; + if (this.parent && this.parent.getWorldMatrix) { + if (this._transformToBoneReferal) { + this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), BABYLON.Tmp.Matrix[6]); + BABYLON.Vector3.TransformCoordinatesToRef(this.position, BABYLON.Tmp.Matrix[6], currentPosition); + } + else { + BABYLON.Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), currentPosition); + } + } + else { + currentPosition.copyFrom(this.position); + } + currentPosition.subtractInPlace(camera.globalPosition); + var finalEuler = BABYLON.Tmp.Vector3[4].copyFromFloats(0, 0, 0); + if ((this.billboardMode & TransformNode.BILLBOARDMODE_X) === TransformNode.BILLBOARDMODE_X) { + finalEuler.x = Math.atan2(-currentPosition.y, currentPosition.z); + } + if ((this.billboardMode & TransformNode.BILLBOARDMODE_Y) === TransformNode.BILLBOARDMODE_Y) { + finalEuler.y = Math.atan2(currentPosition.x, currentPosition.z); + } + if ((this.billboardMode & TransformNode.BILLBOARDMODE_Z) === TransformNode.BILLBOARDMODE_Z) { + finalEuler.z = Math.atan2(currentPosition.y, currentPosition.x); + } + BABYLON.Matrix.RotationYawPitchRollToRef(finalEuler.y, finalEuler.x, finalEuler.z, BABYLON.Tmp.Matrix[0]); + } + else { + BABYLON.Tmp.Matrix[1].copyFrom(camera.getViewMatrix()); + BABYLON.Tmp.Matrix[1].setTranslationFromFloats(0, 0, 0); + BABYLON.Tmp.Matrix[1].invertToRef(BABYLON.Tmp.Matrix[0]); + } + BABYLON.Tmp.Matrix[1].copyFrom(BABYLON.Tmp.Matrix[5]); + BABYLON.Tmp.Matrix[1].multiplyToRef(BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Matrix[5]); + } + // Post multiply inverse of pivotMatrix + if (this._postMultiplyPivotMatrix) { + BABYLON.Tmp.Matrix[5].multiplyToRef(this._pivotMatrixInverse, BABYLON.Tmp.Matrix[5]); + } + // Local world + BABYLON.Tmp.Matrix[5].multiplyToRef(BABYLON.Tmp.Matrix[2], this._localWorld); + // Parent + if (this.parent && this.parent.getWorldMatrix) { + if (this.billboardMode !== TransformNode.BILLBOARDMODE_NONE) { + if (this._transformToBoneReferal) { + this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), BABYLON.Tmp.Matrix[6]); + BABYLON.Tmp.Matrix[5].copyFrom(BABYLON.Tmp.Matrix[6]); + } + else { + BABYLON.Tmp.Matrix[5].copyFrom(this.parent.getWorldMatrix()); + } + this._localWorld.getTranslationToRef(BABYLON.Tmp.Vector3[5]); + BABYLON.Vector3.TransformCoordinatesToRef(BABYLON.Tmp.Vector3[5], BABYLON.Tmp.Matrix[5], BABYLON.Tmp.Vector3[5]); + this._worldMatrix.copyFrom(this._localWorld); + this._worldMatrix.setTranslation(BABYLON.Tmp.Vector3[5]); + } + else { + if (this._transformToBoneReferal) { + this._localWorld.multiplyToRef(this.parent.getWorldMatrix(), BABYLON.Tmp.Matrix[6]); + BABYLON.Tmp.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), this._worldMatrix); + } + else { + this._localWorld.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix); + } + } + this._markSyncedWithParent(); + } + else { + this._worldMatrix.copyFrom(this._localWorld); + } + // Normal matrix + if (!this.ignoreNonUniformScaling) { + if (this.scaling.isNonUniform) { + this._updateNonUniformScalingState(true); + } + else if (this.parent && this.parent._nonUniformScaling) { + this._updateNonUniformScalingState(this.parent._nonUniformScaling); + } + else { + this._updateNonUniformScalingState(false); + } + } + else { + this._updateNonUniformScalingState(false); + } + this._afterComputeWorldMatrix(); + // Absolute position + this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]); + // Callbacks + this.onAfterWorldMatrixUpdateObservable.notifyObservers(this); + if (!this._poseMatrix) { + this._poseMatrix = BABYLON.Matrix.Invert(this._worldMatrix); + } + // Cache the determinant + this._worldMatrixDeterminant = this._worldMatrix.determinant(); + return this._worldMatrix; + }; + TransformNode.prototype._afterComputeWorldMatrix = function () { + }; + /** + * If you'd like to be called back after the mesh position, rotation or scaling has been updated. + * @param func callback function to add + * + * @returns the TransformNode. + */ + TransformNode.prototype.registerAfterWorldMatrixUpdate = function (func) { + this.onAfterWorldMatrixUpdateObservable.add(func); + return this; + }; + /** + * Removes a registered callback function. + * @param func callback function to remove + * @returns the TransformNode. + */ + TransformNode.prototype.unregisterAfterWorldMatrixUpdate = function (func) { + this.onAfterWorldMatrixUpdateObservable.removeCallback(func); + return this; + }; + /** + * Clone the current transform node + * @param name Name of the new clone + * @param newParent New parent for the clone + * @param doNotCloneChildren Do not clone children hierarchy + * @returns the new transform node + */ + TransformNode.prototype.clone = function (name, newParent, doNotCloneChildren) { + var _this = this; + var result = BABYLON.SerializationHelper.Clone(function () { return new TransformNode(name, _this.getScene()); }, this); + result.name = name; + result.id = name; + if (newParent) { + result.parent = newParent; + } + if (!doNotCloneChildren) { + // Children + var directDescendants = this.getDescendants(true); + for (var index = 0; index < directDescendants.length; index++) { + var child = directDescendants[index]; + if (child.clone) { + child.clone(name + "." + child.name, result); + } + } + } + return result; + }; + /** + * Serializes the objects information. + * @param currentSerializationObject defines the object to serialize in + * @returns the serialized object + */ + TransformNode.prototype.serialize = function (currentSerializationObject) { + var serializationObject = BABYLON.SerializationHelper.Serialize(this, currentSerializationObject); + serializationObject.type = this.getClassName(); + // Parent + if (this.parent) { + serializationObject.parentId = this.parent.id; + } + if (BABYLON.Tags && BABYLON.Tags.HasTags(this)) { + serializationObject.tags = BABYLON.Tags.GetTags(this); + } + serializationObject.localMatrix = this.getPivotMatrix().asArray(); + serializationObject.isEnabled = this.isEnabled(); + // Parent + if (this.parent) { + serializationObject.parentId = this.parent.id; + } + return serializationObject; + }; + // Statics + /** + * Returns a new TransformNode object parsed from the source provided. + * @param parsedTransformNode is the source. + * @param scene the scne the object belongs to + * @param rootUrl is a string, it's the root URL to prefix the `delayLoadingFile` property with + * @returns a new TransformNode object parsed from the source provided. + */ + TransformNode.Parse = function (parsedTransformNode, scene, rootUrl) { + var transformNode = BABYLON.SerializationHelper.Parse(function () { return new TransformNode(parsedTransformNode.name, scene); }, parsedTransformNode, scene, rootUrl); + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(transformNode, parsedTransformNode.tags); + } + if (parsedTransformNode.localMatrix) { + transformNode.setPreTransformMatrix(BABYLON.Matrix.FromArray(parsedTransformNode.localMatrix)); + } + else if (parsedTransformNode.pivotMatrix) { + transformNode.setPivotMatrix(BABYLON.Matrix.FromArray(parsedTransformNode.pivotMatrix)); + } + transformNode.setEnabled(parsedTransformNode.isEnabled); + // Parent + if (parsedTransformNode.parentId) { + transformNode._waitingParentId = parsedTransformNode.parentId; + } + return transformNode; + }; + /** + * Releases resources associated with this transform node. + * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default) + * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default) + */ + TransformNode.prototype.dispose = function (doNotRecurse, disposeMaterialAndTextures) { + if (disposeMaterialAndTextures === void 0) { disposeMaterialAndTextures = false; } + // Animations + this.getScene().stopAnimation(this); + // Remove from scene + this.getScene().removeTransformNode(this); + this.onAfterWorldMatrixUpdateObservable.clear(); + _super.prototype.dispose.call(this, doNotRecurse, disposeMaterialAndTextures); + }; + // Statics + /** + * Object will not rotate to face the camera + */ + TransformNode.BILLBOARDMODE_NONE = 0; + /** + * Object will rotate to face the camera but only on the x axis + */ + TransformNode.BILLBOARDMODE_X = 1; + /** + * Object will rotate to face the camera but only on the y axis + */ + TransformNode.BILLBOARDMODE_Y = 2; + /** + * Object will rotate to face the camera but only on the z axis + */ + TransformNode.BILLBOARDMODE_Z = 4; + /** + * Object will rotate to face the camera + */ + TransformNode.BILLBOARDMODE_ALL = 7; + TransformNode._lookAtVectorCache = new BABYLON.Vector3(0, 0, 0); + TransformNode._rotationAxisCache = new BABYLON.Quaternion(); + __decorate([ + BABYLON.serializeAsVector3("position") + ], TransformNode.prototype, "_position", void 0); + __decorate([ + BABYLON.serializeAsVector3("rotation") + ], TransformNode.prototype, "_rotation", void 0); + __decorate([ + BABYLON.serializeAsQuaternion("rotationQuaternion") + ], TransformNode.prototype, "_rotationQuaternion", void 0); + __decorate([ + BABYLON.serializeAsVector3("scaling") + ], TransformNode.prototype, "_scaling", void 0); + __decorate([ + BABYLON.serialize() + ], TransformNode.prototype, "billboardMode", void 0); + __decorate([ + BABYLON.serialize() + ], TransformNode.prototype, "scalingDeterminant", void 0); + __decorate([ + BABYLON.serialize() + ], TransformNode.prototype, "infiniteDistance", void 0); + __decorate([ + BABYLON.serialize() + ], TransformNode.prototype, "ignoreNonUniformScaling", void 0); + return TransformNode; + }(BABYLON.Node)); + BABYLON.TransformNode = TransformNode; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.transformNode.js.map + + +var BABYLON; +(function (BABYLON) { + /** @hidden */ + var _FacetDataStorage = /** @class */ (function () { + function _FacetDataStorage() { + this.facetNb = 0; // facet number + this.partitioningSubdivisions = 10; // number of subdivisions per axis in the partioning space + this.partitioningBBoxRatio = 1.01; // the partioning array space is by default 1% bigger than the bounding box + this.facetDataEnabled = false; // is the facet data feature enabled on this mesh ? + this.facetParameters = {}; // keep a reference to the object parameters to avoid memory re-allocation + this.bbSize = BABYLON.Vector3.Zero(); // bbox size approximated for facet data + this.subDiv = { + max: 1, + X: 1, + Y: 1, + Z: 1 + }; + this.facetDepthSort = false; // is the facet depth sort to be computed + this.facetDepthSortEnabled = false; // is the facet depth sort initialized + } + return _FacetDataStorage; + }()); + /** + * Class used to store all common mesh properties + */ + var AbstractMesh = /** @class */ (function (_super) { + __extends(AbstractMesh, _super); + // Constructor + /** + * Creates a new AbstractMesh + * @param name defines the name of the mesh + * @param scene defines the hosting scene + */ + function AbstractMesh(name, scene) { + if (scene === void 0) { scene = null; } + var _this = _super.call(this, name, scene, false) || this; + _this._facetData = new _FacetDataStorage(); + /** Gets ot sets the culling strategy to use to find visible meshes */ + _this.cullingStrategy = AbstractMesh.CULLINGSTRATEGY_STANDARD; + // Events + /** + * An event triggered when this mesh collides with another one + */ + _this.onCollideObservable = new BABYLON.Observable(); + /** + * An event triggered when the collision's position changes + */ + _this.onCollisionPositionChangeObservable = new BABYLON.Observable(); + /** + * An event triggered when material is changed + */ + _this.onMaterialChangedObservable = new BABYLON.Observable(); + // Properties + /** + * Gets or sets the orientation for POV movement & rotation + */ + _this.definedFacingForward = true; + _this._visibility = 1.0; + /** Gets or sets the alpha index used to sort transparent meshes + * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#alpha-index + */ + _this.alphaIndex = Number.MAX_VALUE; + /** + * Gets or sets a boolean indicating if the mesh is visible (renderable). Default is true + */ + _this.isVisible = true; + /** + * Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true + */ + _this.isPickable = true; + /** Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default) */ + _this.showSubMeshesBoundingBox = false; + /** Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default) + * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares + */ + _this.isBlocker = false; + /** + * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default) + */ + _this.enablePointerMoveEvents = false; + /** + * Specifies the rendering group id for this mesh (0 by default) + * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups + */ + _this.renderingGroupId = 0; + _this._receiveShadows = false; + /** Defines color to use when rendering outline */ + _this.outlineColor = BABYLON.Color3.Red(); + /** Define width to use when rendering outline */ + _this.outlineWidth = 0.02; + /** Defines color to use when rendering overlay */ + _this.overlayColor = BABYLON.Color3.Red(); + /** Defines alpha to use when rendering overlay */ + _this.overlayAlpha = 0.5; + _this._hasVertexAlpha = false; + _this._useVertexColors = true; + _this._computeBonesUsingShaders = true; + _this._numBoneInfluencers = 4; + _this._applyFog = true; + /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default) */ + _this.useOctreeForRenderingSelection = true; + /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes picking (true by default) */ + _this.useOctreeForPicking = true; + /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */ + _this.useOctreeForCollisions = true; + _this._layerMask = 0x0FFFFFFF; + /** + * True if the mesh must be rendered in any case (this will shortcut the frustum clipping phase) + */ + _this.alwaysSelectAsActiveMesh = false; + /** + * Gets or sets the current action manager + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + _this.actionManager = null; + // Collisions + _this._checkCollisions = false; + _this._collisionMask = -1; + _this._collisionGroup = -1; + /** + * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5)) + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity + */ + _this.ellipsoid = new BABYLON.Vector3(0.5, 1, 0.5); + /** + * Gets or sets the ellipsoid offset used to impersonate this mesh when using collision engine (default is (0, 0, 0)) + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity + */ + _this.ellipsoidOffset = new BABYLON.Vector3(0, 0, 0); + _this._oldPositionForCollisions = new BABYLON.Vector3(0, 0, 0); + _this._diffPositionForCollisions = new BABYLON.Vector3(0, 0, 0); + // Edges + /** + * Defines edge width used when edgesRenderer is enabled + * @see https://www.babylonjs-playground.com/#10OJSG#13 + */ + _this.edgesWidth = 1; + /** + * Defines edge color used when edgesRenderer is enabled + * @see https://www.babylonjs-playground.com/#10OJSG#13 + */ + _this.edgesColor = new BABYLON.Color4(1, 0, 0, 1); + /** @hidden */ + _this._renderId = 0; + /** @hidden */ + _this._intersectionsInProgress = new Array(); + /** @hidden */ + _this._unIndexed = false; + /** @hidden */ + _this._lightSources = new Array(); + /** + * An event triggered when the mesh is rebuilt. + */ + _this.onRebuildObservable = new BABYLON.Observable(); + _this._onCollisionPositionChange = function (collisionId, newPosition, collidedMesh) { + if (collidedMesh === void 0) { collidedMesh = null; } + //TODO move this to the collision coordinator! + if (_this.getScene().workerCollisions) { + newPosition.multiplyInPlace(_this._collider._radius); + } + newPosition.subtractToRef(_this._oldPositionForCollisions, _this._diffPositionForCollisions); + if (_this._diffPositionForCollisions.length() > BABYLON.Engine.CollisionsEpsilon) { + _this.position.addInPlace(_this._diffPositionForCollisions); + } + if (collidedMesh) { + _this.onCollideObservable.notifyObservers(collidedMesh); + } + _this.onCollisionPositionChangeObservable.notifyObservers(_this.position); + }; + _this.getScene().addMesh(_this); + _this._resyncLightSources(); + return _this; + } + Object.defineProperty(AbstractMesh, "BILLBOARDMODE_NONE", { + /** + * No billboard + */ + get: function () { + return BABYLON.TransformNode.BILLBOARDMODE_NONE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh, "BILLBOARDMODE_X", { + /** Billboard on X axis */ + get: function () { + return BABYLON.TransformNode.BILLBOARDMODE_X; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh, "BILLBOARDMODE_Y", { + /** Billboard on Y axis */ + get: function () { + return BABYLON.TransformNode.BILLBOARDMODE_Y; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh, "BILLBOARDMODE_Z", { + /** Billboard on Z axis */ + get: function () { + return BABYLON.TransformNode.BILLBOARDMODE_Z; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh, "BILLBOARDMODE_ALL", { + /** Billboard on all axes */ + get: function () { + return BABYLON.TransformNode.BILLBOARDMODE_ALL; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "facetNb", { + /** + * Gets the number of facets in the mesh + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#what-is-a-mesh-facet + */ + get: function () { + return this._facetData.facetNb; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "partitioningSubdivisions", { + /** + * Gets or set the number (integer) of subdivisions per axis in the partioning space + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#tweaking-the-partitioning + */ + get: function () { + return this._facetData.partitioningSubdivisions; + }, + set: function (nb) { + this._facetData.partitioningSubdivisions = nb; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "partitioningBBoxRatio", { + /** + * The ratio (float) to apply to the bouding box size to set to the partioning space. + * Ex : 1.01 (default) the partioning space is 1% bigger than the bounding box + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#tweaking-the-partitioning + */ + get: function () { + return this._facetData.partitioningBBoxRatio; + }, + set: function (ratio) { + this._facetData.partitioningBBoxRatio = ratio; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "mustDepthSortFacets", { + /** + * Gets or sets a boolean indicating that the facets must be depth sorted on next call to `updateFacetData()`. + * Works only for updatable meshes. + * Doesn't work with multi-materials + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#facet-depth-sort + */ + get: function () { + return this._facetData.facetDepthSort; + }, + set: function (sort) { + this._facetData.facetDepthSort = sort; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "facetDepthSortFrom", { + /** + * The location (Vector3) where the facet depth sort must be computed from. + * By default, the active camera position. + * Used only when facet depth sort is enabled + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#facet-depth-sort + */ + get: function () { + return this._facetData.facetDepthSortFrom; + }, + set: function (location) { + this._facetData.facetDepthSortFrom = location; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "isFacetDataEnabled", { + /** + * gets a boolean indicating if facetData is enabled + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#what-is-a-mesh-facet + */ + get: function () { + return this._facetData.facetDataEnabled; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + AbstractMesh.prototype._updateNonUniformScalingState = function (value) { + if (!_super.prototype._updateNonUniformScalingState.call(this, value)) { + return false; + } + this._markSubMeshesAsMiscDirty(); + return true; + }; + Object.defineProperty(AbstractMesh.prototype, "onCollide", { + /** Set a function to call when this mesh collides with another one */ + set: function (callback) { + if (this._onCollideObserver) { + this.onCollideObservable.remove(this._onCollideObserver); + } + this._onCollideObserver = this.onCollideObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "onCollisionPositionChange", { + /** Set a function to call when the collision's position changes */ + set: function (callback) { + if (this._onCollisionPositionChangeObserver) { + this.onCollisionPositionChangeObservable.remove(this._onCollisionPositionChangeObserver); + } + this._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "visibility", { + /** + * Gets or sets mesh visibility between 0 and 1 (default is 1) + */ + get: function () { + return this._visibility; + }, + /** + * Gets or sets mesh visibility between 0 and 1 (default is 1) + */ + set: function (value) { + if (this._visibility === value) { + return; + } + this._visibility = value; + this._markSubMeshesAsMiscDirty(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "material", { + /** Gets or sets current material */ + get: function () { + return this._material; + }, + set: function (value) { + if (this._material === value) { + return; + } + this._material = value; + if (this.onMaterialChangedObservable.hasObservers) { + this.onMaterialChangedObservable.notifyObservers(this); + } + if (!this.subMeshes) { + return; + } + this._unBindEffect(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "receiveShadows", { + /** + * Gets or sets a boolean indicating that this mesh can receive realtime shadows + * @see http://doc.babylonjs.com/babylon101/shadows + */ + get: function () { + return this._receiveShadows; + }, + set: function (value) { + if (this._receiveShadows === value) { + return; + } + this._receiveShadows = value; + this._markSubMeshesAsLightDirty(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "hasVertexAlpha", { + /** Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values */ + get: function () { + return this._hasVertexAlpha; + }, + set: function (value) { + if (this._hasVertexAlpha === value) { + return; + } + this._hasVertexAlpha = value; + this._markSubMeshesAsAttributesDirty(); + this._markSubMeshesAsMiscDirty(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "useVertexColors", { + /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */ + get: function () { + return this._useVertexColors; + }, + set: function (value) { + if (this._useVertexColors === value) { + return; + } + this._useVertexColors = value; + this._markSubMeshesAsAttributesDirty(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "computeBonesUsingShaders", { + /** + * Gets or sets a boolean indicating that bone animations must be computed by the CPU (false by default) + */ + get: function () { + return this._computeBonesUsingShaders; + }, + set: function (value) { + if (this._computeBonesUsingShaders === value) { + return; + } + this._computeBonesUsingShaders = value; + this._markSubMeshesAsAttributesDirty(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "numBoneInfluencers", { + /** Gets or sets the number of allowed bone influences per vertex (4 by default) */ + get: function () { + return this._numBoneInfluencers; + }, + set: function (value) { + if (this._numBoneInfluencers === value) { + return; + } + this._numBoneInfluencers = value; + this._markSubMeshesAsAttributesDirty(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "applyFog", { + /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */ + get: function () { + return this._applyFog; + }, + set: function (value) { + if (this._applyFog === value) { + return; + } + this._applyFog = value; + this._markSubMeshesAsMiscDirty(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "layerMask", { + /** + * Gets or sets the current layer mask (default is 0x0FFFFFFF) + * @see http://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures + */ + get: function () { + return this._layerMask; + }, + set: function (value) { + if (value === this._layerMask) { + return; + } + this._layerMask = value; + this._resyncLightSources(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "collisionMask", { + /** + * Gets or sets a collision mask used to mask collisions (default is -1). + * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0 + */ + get: function () { + return this._collisionMask; + }, + set: function (mask) { + this._collisionMask = !isNaN(mask) ? mask : -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "collisionGroup", { + /** + * Gets or sets the current collision group mask (-1 by default). + * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0 + */ + get: function () { + return this._collisionGroup; + }, + set: function (mask) { + this._collisionGroup = !isNaN(mask) ? mask : -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "_positions", { + /** @hidden */ + get: function () { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "skeleton", { + get: function () { + return this._skeleton; + }, + /** + * Gets or sets a skeleton to apply skining transformations + * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons + */ + set: function (value) { + if (this._skeleton && this._skeleton.needInitialSkinMatrix) { + this._skeleton._unregisterMeshWithPoseMatrix(this); + } + if (value && value.needInitialSkinMatrix) { + value._registerMeshWithPoseMatrix(this); + } + this._skeleton = value; + if (!this._skeleton) { + this._bonesTransformMatrices = null; + } + this._markSubMeshesAsAttributesDirty(); + }, + enumerable: true, + configurable: true + }); + /** + * Returns the string "AbstractMesh" + * @returns "AbstractMesh" + */ + AbstractMesh.prototype.getClassName = function () { + return "AbstractMesh"; + }; + /** + * Gets a string representation of the current mesh + * @param fullDetails defines a boolean indicating if full details must be included + * @returns a string representation of the current mesh + */ + AbstractMesh.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name + ", isInstance: " + (this instanceof BABYLON.InstancedMesh ? "YES" : "NO"); + ret += ", # of submeshes: " + (this.subMeshes ? this.subMeshes.length : 0); + if (this._skeleton) { + ret += ", skeleton: " + this._skeleton.name; + } + if (fullDetails) { + ret += ", billboard mode: " + (["NONE", "X", "Y", null, "Z", null, null, "ALL"])[this.billboardMode]; + ret += ", freeze wrld mat: " + (this._isWorldMatrixFrozen || this._waitingFreezeWorldMatrix ? "YES" : "NO"); + } + return ret; + }; + /** @hidden */ + AbstractMesh.prototype._rebuild = function () { + this.onRebuildObservable.notifyObservers(this); + if (this._occlusionQuery) { + this._occlusionQuery = null; + } + if (!this.subMeshes) { + return; + } + for (var _i = 0, _a = this.subMeshes; _i < _a.length; _i++) { + var subMesh = _a[_i]; + subMesh._rebuild(); + } + }; + /** @hidden */ + AbstractMesh.prototype._resyncLightSources = function () { + this._lightSources.length = 0; + for (var _i = 0, _a = this.getScene().lights; _i < _a.length; _i++) { + var light = _a[_i]; + if (!light.isEnabled()) { + continue; + } + if (light.canAffectMesh(this)) { + this._lightSources.push(light); + } + } + this._markSubMeshesAsLightDirty(); + }; + /** @hidden */ + AbstractMesh.prototype._resyncLighSource = function (light) { + var isIn = light.isEnabled() && light.canAffectMesh(this); + var index = this._lightSources.indexOf(light); + if (index === -1) { + if (!isIn) { + return; + } + this._lightSources.push(light); + } + else { + if (isIn) { + return; + } + this._lightSources.splice(index, 1); + } + this._markSubMeshesAsLightDirty(); + }; + /** @hidden */ + AbstractMesh.prototype._unBindEffect = function () { + for (var _i = 0, _a = this.subMeshes; _i < _a.length; _i++) { + var subMesh = _a[_i]; + subMesh.setEffect(null); + } + }; + /** @hidden */ + AbstractMesh.prototype._removeLightSource = function (light) { + var index = this._lightSources.indexOf(light); + if (index === -1) { + return; + } + this._lightSources.splice(index, 1); + this._markSubMeshesAsLightDirty(); + }; + AbstractMesh.prototype._markSubMeshesAsDirty = function (func) { + if (!this.subMeshes) { + return; + } + for (var _i = 0, _a = this.subMeshes; _i < _a.length; _i++) { + var subMesh = _a[_i]; + if (subMesh._materialDefines) { + func(subMesh._materialDefines); + } + } + }; + /** @hidden */ + AbstractMesh.prototype._markSubMeshesAsLightDirty = function () { + this._markSubMeshesAsDirty(function (defines) { return defines.markAsLightDirty(); }); + }; + /** @hidden */ + AbstractMesh.prototype._markSubMeshesAsAttributesDirty = function () { + this._markSubMeshesAsDirty(function (defines) { return defines.markAsAttributesDirty(); }); + }; + /** @hidden */ + AbstractMesh.prototype._markSubMeshesAsMiscDirty = function () { + if (!this.subMeshes) { + return; + } + for (var _i = 0, _a = this.subMeshes; _i < _a.length; _i++) { + var subMesh = _a[_i]; + var material = subMesh.getMaterial(); + if (material) { + material.markAsDirty(BABYLON.Material.MiscDirtyFlag); + } + } + }; + Object.defineProperty(AbstractMesh.prototype, "scaling", { + /** + * Gets or sets a Vector3 depicting the mesh scaling along each local axis X, Y, Z. Default is (1.0, 1.0, 1.0) + */ + get: function () { + return this._scaling; + }, + set: function (newScaling) { + this._scaling = newScaling; + if (this.physicsImpostor) { + this.physicsImpostor.forceUpdate(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "isBlocked", { + // Methods + /** + * Returns true if the mesh is blocked. Implemented by child classes + */ + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + /** + * Returns the mesh itself by default. Implemented by child classes + * @param camera defines the camera to use to pick the right LOD level + * @returns the currentAbstractMesh + */ + AbstractMesh.prototype.getLOD = function (camera) { + return this; + }; + /** + * Returns 0 by default. Implemented by child classes + * @returns an integer + */ + AbstractMesh.prototype.getTotalVertices = function () { + return 0; + }; + /** + * Returns null by default. Implemented by child classes + * @returns null + */ + AbstractMesh.prototype.getIndices = function () { + return null; + }; + /** + * Returns the array of the requested vertex data kind. Implemented by child classes + * @param kind defines the vertex data kind to use + * @returns null + */ + AbstractMesh.prototype.getVerticesData = function (kind) { + return null; + }; + /** + * Sets the vertex data of the mesh geometry for the requested `kind`. + * If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data. + * Note that a new underlying VertexBuffer object is created each call. + * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed. + * @param kind defines vertex data kind: + * * BABYLON.VertexBuffer.PositionKind + * * BABYLON.VertexBuffer.UVKind + * * BABYLON.VertexBuffer.UV2Kind + * * BABYLON.VertexBuffer.UV3Kind + * * BABYLON.VertexBuffer.UV4Kind + * * BABYLON.VertexBuffer.UV5Kind + * * BABYLON.VertexBuffer.UV6Kind + * * BABYLON.VertexBuffer.ColorKind + * * BABYLON.VertexBuffer.MatricesIndicesKind + * * BABYLON.VertexBuffer.MatricesIndicesExtraKind + * * BABYLON.VertexBuffer.MatricesWeightsKind + * * BABYLON.VertexBuffer.MatricesWeightsExtraKind + * @param data defines the data source + * @param updatable defines if the data must be flagged as updatable (or static) + * @param stride defines the vertex stride (size of an entire vertex). Can be null and in this case will be deduced from vertex data kind + * @returns the current mesh + */ + AbstractMesh.prototype.setVerticesData = function (kind, data, updatable, stride) { + return this; + }; + /** + * Updates the existing vertex data of the mesh geometry for the requested `kind`. + * If the mesh has no geometry, it is simply returned as it is. + * @param kind defines vertex data kind: + * * BABYLON.VertexBuffer.PositionKind + * * BABYLON.VertexBuffer.UVKind + * * BABYLON.VertexBuffer.UV2Kind + * * BABYLON.VertexBuffer.UV3Kind + * * BABYLON.VertexBuffer.UV4Kind + * * BABYLON.VertexBuffer.UV5Kind + * * BABYLON.VertexBuffer.UV6Kind + * * BABYLON.VertexBuffer.ColorKind + * * BABYLON.VertexBuffer.MatricesIndicesKind + * * BABYLON.VertexBuffer.MatricesIndicesExtraKind + * * BABYLON.VertexBuffer.MatricesWeightsKind + * * BABYLON.VertexBuffer.MatricesWeightsExtraKind + * @param data defines the data source + * @param updateExtends If `kind` is `PositionKind` and if `updateExtends` is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed + * @param makeItUnique If true, a new global geometry is created from this data and is set to the mesh + * @returns the current mesh + */ + AbstractMesh.prototype.updateVerticesData = function (kind, data, updateExtends, makeItUnique) { + return this; + }; + /** + * Sets the mesh indices, + * If the mesh has no geometry, a new Geometry object is created and set to the mesh. + * @param indices Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array) + * @param totalVertices Defines the total number of vertices + * @returns the current mesh + */ + AbstractMesh.prototype.setIndices = function (indices, totalVertices) { + return this; + }; + /** + * Gets a boolean indicating if specific vertex data is present + * @param kind defines the vertex data kind to use + * @returns true is data kind is present + */ + AbstractMesh.prototype.isVerticesDataPresent = function (kind) { + return false; + }; + /** + * Returns the mesh BoundingInfo object or creates a new one and returns if it was undefined + * @returns a BoundingInfo + */ + AbstractMesh.prototype.getBoundingInfo = function () { + if (this._masterMesh) { + return this._masterMesh.getBoundingInfo(); + } + if (!this._boundingInfo) { + // this._boundingInfo is being created here + this._updateBoundingInfo(); + } + // cannot be null. + return this._boundingInfo; + }; + /** + * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units) + * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box + * @returns the current mesh + */ + AbstractMesh.prototype.normalizeToUnitCube = function (includeDescendants) { + if (includeDescendants === void 0) { includeDescendants = true; } + var boundingVectors = this.getHierarchyBoundingVectors(includeDescendants); + var sizeVec = boundingVectors.max.subtract(boundingVectors.min); + var maxDimension = Math.max(sizeVec.x, sizeVec.y, sizeVec.z); + if (maxDimension === 0) { + return this; + } + var scale = 1 / maxDimension; + this.scaling.scaleInPlace(scale); + return this; + }; + /** + * Overwrite the current bounding info + * @param boundingInfo defines the new bounding info + * @returns the current mesh + */ + AbstractMesh.prototype.setBoundingInfo = function (boundingInfo) { + this._boundingInfo = boundingInfo; + return this; + }; + Object.defineProperty(AbstractMesh.prototype, "useBones", { + /** Gets a boolean indicating if this mesh has skinning data and an attached skeleton */ + get: function () { + return (this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind) && this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)); + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + AbstractMesh.prototype._preActivate = function () { + }; + /** @hidden */ + AbstractMesh.prototype._preActivateForIntermediateRendering = function (renderId) { + }; + /** @hidden */ + AbstractMesh.prototype._activate = function (renderId) { + this._renderId = renderId; + }; + /** + * Gets the current world matrix + * @returns a Matrix + */ + AbstractMesh.prototype.getWorldMatrix = function () { + if (this._masterMesh) { + return this._masterMesh.getWorldMatrix(); + } + return _super.prototype.getWorldMatrix.call(this); + }; + /** @hidden */ + AbstractMesh.prototype._getWorldMatrixDeterminant = function () { + if (this._masterMesh) { + return this._masterMesh._getWorldMatrixDeterminant(); + } + return _super.prototype._getWorldMatrixDeterminant.call(this); + }; + // ================================== Point of View Movement ================================= + /** + * Perform relative position change from the point of view of behind the front of the mesh. + * This is performed taking into account the meshes current rotation, so you do not have to care. + * Supports definition of mesh facing forward or backward + * @param amountRight defines the distance on the right axis + * @param amountUp defines the distance on the up axis + * @param amountForward defines the distance on the forward axis + * @returns the current mesh + */ + AbstractMesh.prototype.movePOV = function (amountRight, amountUp, amountForward) { + this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward)); + return this; + }; + /** + * Calculate relative position change from the point of view of behind the front of the mesh. + * This is performed taking into account the meshes current rotation, so you do not have to care. + * Supports definition of mesh facing forward or backward + * @param amountRight defines the distance on the right axis + * @param amountUp defines the distance on the up axis + * @param amountForward defines the distance on the forward axis + * @returns the new displacement vector + */ + AbstractMesh.prototype.calcMovePOV = function (amountRight, amountUp, amountForward) { + var rotMatrix = new BABYLON.Matrix(); + var rotQuaternion = (this.rotationQuaternion) ? this.rotationQuaternion : BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z); + rotQuaternion.toRotationMatrix(rotMatrix); + var translationDelta = BABYLON.Vector3.Zero(); + var defForwardMult = this.definedFacingForward ? -1 : 1; + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta); + return translationDelta; + }; + // ================================== Point of View Rotation ================================= + /** + * Perform relative rotation change from the point of view of behind the front of the mesh. + * Supports definition of mesh facing forward or backward + * @param flipBack defines the flip + * @param twirlClockwise defines the twirl + * @param tiltRight defines the tilt + * @returns the current mesh + */ + AbstractMesh.prototype.rotatePOV = function (flipBack, twirlClockwise, tiltRight) { + this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight)); + return this; + }; + /** + * Calculate relative rotation change from the point of view of behind the front of the mesh. + * Supports definition of mesh facing forward or backward. + * @param flipBack defines the flip + * @param twirlClockwise defines the twirl + * @param tiltRight defines the tilt + * @returns the new rotation vector + */ + AbstractMesh.prototype.calcRotatePOV = function (flipBack, twirlClockwise, tiltRight) { + var defForwardMult = this.definedFacingForward ? 1 : -1; + return new BABYLON.Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult); + }; + /** + * Return the minimum and maximum world vectors of the entire hierarchy under current mesh + * @param includeDescendants Include bounding info from descendants as well (true by default) + * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors + * @returns the new bounding vectors + */ + AbstractMesh.prototype.getHierarchyBoundingVectors = function (includeDescendants, predicate) { + if (includeDescendants === void 0) { includeDescendants = true; } + if (predicate === void 0) { predicate = null; } + // Ensures that all world matrix will be recomputed. + this.getScene().incrementRenderId(); + this.computeWorldMatrix(true); + var min; + var max; + var boundingInfo = this.getBoundingInfo(); + if (!this.subMeshes) { + min = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + max = new BABYLON.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); + } + else { + min = boundingInfo.boundingBox.minimumWorld; + max = boundingInfo.boundingBox.maximumWorld; + } + if (includeDescendants) { + var descendants = this.getDescendants(false); + for (var _i = 0, descendants_1 = descendants; _i < descendants_1.length; _i++) { + var descendant = descendants_1[_i]; + var childMesh = descendant; + childMesh.computeWorldMatrix(true); + // Filters meshes based on custom predicate function. + if (predicate && !predicate(childMesh)) { + continue; + } + //make sure we have the needed params to get mix and max + if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) { + continue; + } + var childBoundingInfo = childMesh.getBoundingInfo(); + var boundingBox = childBoundingInfo.boundingBox; + var minBox = boundingBox.minimumWorld; + var maxBox = boundingBox.maximumWorld; + BABYLON.Tools.CheckExtends(minBox, min, max); + BABYLON.Tools.CheckExtends(maxBox, min, max); + } + } + return { + min: min, + max: max + }; + }; + /** @hidden */ + AbstractMesh.prototype._updateBoundingInfo = function () { + this._boundingInfo = this._boundingInfo || new BABYLON.BoundingInfo(this.absolutePosition, this.absolutePosition); + this._boundingInfo.update(this.worldMatrixFromCache); + this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache); + return this; + }; + /** @hidden */ + AbstractMesh.prototype._updateSubMeshesBoundingInfo = function (matrix) { + if (!this.subMeshes) { + return this; + } + var count = this.subMeshes.length; + for (var subIndex = 0; subIndex < count; subIndex++) { + var subMesh = this.subMeshes[subIndex]; + if (count > 1 || !subMesh.IsGlobal) { + subMesh.updateBoundingInfo(matrix); + } + } + return this; + }; + /** @hidden */ + AbstractMesh.prototype._afterComputeWorldMatrix = function () { + // Bounding info + this._updateBoundingInfo(); + }; + /** + * Returns `true` if the mesh is within the frustum defined by the passed array of planes. + * A mesh is in the frustum if its bounding box intersects the frustum + * @param frustumPlanes defines the frustum to test + * @returns true if the mesh is in the frustum planes + */ + AbstractMesh.prototype.isInFrustum = function (frustumPlanes) { + return this._boundingInfo !== null && this._boundingInfo.isInFrustum(frustumPlanes, this.cullingStrategy); + }; + /** + * Returns `true` if the mesh is completely in the frustum defined be the passed array of planes. + * A mesh is completely in the frustum if its bounding box it completely inside the frustum. + * @param frustumPlanes defines the frustum to test + * @returns true if the mesh is completely in the frustum planes + */ + AbstractMesh.prototype.isCompletelyInFrustum = function (frustumPlanes) { + return this._boundingInfo !== null && this._boundingInfo.isCompletelyInFrustum(frustumPlanes); + }; + /** + * True if the mesh intersects another mesh or a SolidParticle object + * @param mesh defines a target mesh or SolidParticle to test + * @param precise Unless the parameter `precise` is set to `true` the intersection is computed according to Axis Aligned Bounding Boxes (AABB), else according to OBB (Oriented BBoxes) + * @param includeDescendants Can be set to true to test if the mesh defined in parameters intersects with the current mesh or any child meshes + * @returns true if there is an intersection + */ + AbstractMesh.prototype.intersectsMesh = function (mesh, precise, includeDescendants) { + if (precise === void 0) { precise = false; } + if (!this._boundingInfo || !mesh._boundingInfo) { + return false; + } + if (this._boundingInfo.intersects(mesh._boundingInfo, precise)) { + return true; + } + if (includeDescendants) { + for (var _i = 0, _a = this.getChildMeshes(); _i < _a.length; _i++) { + var child = _a[_i]; + if (child.intersectsMesh(mesh, precise, true)) { + return true; + } + } + } + return false; + }; + /** + * Returns true if the passed point (Vector3) is inside the mesh bounding box + * @param point defines the point to test + * @returns true if there is an intersection + */ + AbstractMesh.prototype.intersectsPoint = function (point) { + if (!this._boundingInfo) { + return false; + } + return this._boundingInfo.intersectsPoint(point); + }; + /** + * Gets the position of the current mesh in camera space + * @param camera defines the camera to use + * @returns a position + */ + AbstractMesh.prototype.getPositionInCameraSpace = function (camera) { + if (camera === void 0) { camera = null; } + if (!camera) { + camera = this.getScene().activeCamera; + } + return BABYLON.Vector3.TransformCoordinates(this.absolutePosition, camera.getViewMatrix()); + }; + /** + * Returns the distance from the mesh to the active camera + * @param camera defines the camera to use + * @returns the distance + */ + AbstractMesh.prototype.getDistanceToCamera = function (camera) { + if (camera === void 0) { camera = null; } + if (!camera) { + camera = this.getScene().activeCamera; + } + return this.absolutePosition.subtract(camera.position).length(); + }; + Object.defineProperty(AbstractMesh.prototype, "checkCollisions", { + // Collisions + /** + * Gets or sets a boolean indicating that this mesh can be used in the collision engine + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity + */ + get: function () { + return this._checkCollisions; + }, + set: function (collisionEnabled) { + this._checkCollisions = collisionEnabled; + if (this.getScene().workerCollisions) { + this.getScene().collisionCoordinator.onMeshUpdated(this); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "collider", { + /** + * Gets Collider object used to compute collisions (not physics) + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity + */ + get: function () { + return this._collider; + }, + enumerable: true, + configurable: true + }); + /** + * Move the mesh using collision engine + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity + * @param displacement defines the requested displacement vector + * @returns the current mesh + */ + AbstractMesh.prototype.moveWithCollisions = function (displacement) { + var globalPosition = this.getAbsolutePosition(); + globalPosition.addToRef(this.ellipsoidOffset, this._oldPositionForCollisions); + if (!this._collider) { + this._collider = new BABYLON.Collider(); + } + this._collider._radius = this.ellipsoid; + this.getScene().collisionCoordinator.getNewPosition(this._oldPositionForCollisions, displacement, this._collider, 3, this, this._onCollisionPositionChange, this.uniqueId); + return this; + }; + // Collisions + /** @hidden */ + AbstractMesh.prototype._collideForSubMesh = function (subMesh, transformMatrix, collider) { + this._generatePointsArray(); + if (!this._positions) { + return this; + } + // Transformation + if (!subMesh._lastColliderWorldVertices || !subMesh._lastColliderTransformMatrix.equals(transformMatrix)) { + subMesh._lastColliderTransformMatrix = transformMatrix.clone(); + subMesh._lastColliderWorldVertices = []; + subMesh._trianglePlanes = []; + var start = subMesh.verticesStart; + var end = (subMesh.verticesStart + subMesh.verticesCount); + for (var i = start; i < end; i++) { + subMesh._lastColliderWorldVertices.push(BABYLON.Vector3.TransformCoordinates(this._positions[i], transformMatrix)); + } + } + // Collide + collider._collide(subMesh._trianglePlanes, subMesh._lastColliderWorldVertices, this.getIndices(), subMesh.indexStart, subMesh.indexStart + subMesh.indexCount, subMesh.verticesStart, !!subMesh.getMaterial()); + if (collider.collisionFound) { + collider.collidedMesh = this; + } + return this; + }; + /** @hidden */ + AbstractMesh.prototype._processCollisionsForSubMeshes = function (collider, transformMatrix) { + var subMeshes = this._scene.getCollidingSubMeshCandidates(this, collider); + var len = subMeshes.length; + for (var index = 0; index < len; index++) { + var subMesh = subMeshes.data[index]; + // Bounding test + if (len > 1 && !subMesh._checkCollision(collider)) { + continue; + } + this._collideForSubMesh(subMesh, transformMatrix, collider); + } + return this; + }; + /** @hidden */ + AbstractMesh.prototype._checkCollision = function (collider) { + // Bounding box test + if (!this._boundingInfo || !this._boundingInfo._checkCollision(collider)) { + return this; + } + // Transformation matrix + var collisionsScalingMatrix = BABYLON.Tmp.Matrix[0]; + var collisionsTransformMatrix = BABYLON.Tmp.Matrix[1]; + BABYLON.Matrix.ScalingToRef(1.0 / collider._radius.x, 1.0 / collider._radius.y, 1.0 / collider._radius.z, collisionsScalingMatrix); + this.worldMatrixFromCache.multiplyToRef(collisionsScalingMatrix, collisionsTransformMatrix); + this._processCollisionsForSubMeshes(collider, collisionsTransformMatrix); + return this; + }; + // Picking + /** @hidden */ + AbstractMesh.prototype._generatePointsArray = function () { + return false; + }; + /** + * Checks if the passed Ray intersects with the mesh + * @param ray defines the ray to use + * @param fastCheck defines if fast mode (but less precise) must be used (false by default) + * @returns the picking info + * @see http://doc.babylonjs.com/babylon101/intersect_collisions_-_mesh + */ + AbstractMesh.prototype.intersects = function (ray, fastCheck) { + var pickingInfo = new BABYLON.PickingInfo(); + if (!this.subMeshes || !this._boundingInfo || !ray.intersectsSphere(this._boundingInfo.boundingSphere) || !ray.intersectsBox(this._boundingInfo.boundingBox)) { + return pickingInfo; + } + if (!this._generatePointsArray()) { + return pickingInfo; + } + var intersectInfo = null; + var subMeshes = this._scene.getIntersectingSubMeshCandidates(this, ray); + var len = subMeshes.length; + for (var index = 0; index < len; index++) { + var subMesh = subMeshes.data[index]; + // Bounding test + if (len > 1 && !subMesh.canIntersects(ray)) { + continue; + } + var currentIntersectInfo = subMesh.intersects(ray, this._positions, this.getIndices(), fastCheck); + if (currentIntersectInfo) { + if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) { + intersectInfo = currentIntersectInfo; + intersectInfo.subMeshId = index; + if (fastCheck) { + break; + } + } + } + } + if (intersectInfo) { + // Get picked point + var world = this.getWorldMatrix(); + var worldOrigin = BABYLON.Vector3.TransformCoordinates(ray.origin, world); + var direction = ray.direction.clone(); + direction = direction.scale(intersectInfo.distance); + var worldDirection = BABYLON.Vector3.TransformNormal(direction, world); + var pickedPoint = worldOrigin.add(worldDirection); + // Return result + pickingInfo.hit = true; + pickingInfo.distance = BABYLON.Vector3.Distance(worldOrigin, pickedPoint); + pickingInfo.pickedPoint = pickedPoint; + pickingInfo.pickedMesh = this; + pickingInfo.bu = intersectInfo.bu || 0; + pickingInfo.bv = intersectInfo.bv || 0; + pickingInfo.faceId = intersectInfo.faceId; + pickingInfo.subMeshId = intersectInfo.subMeshId; + return pickingInfo; + } + return pickingInfo; + }; + /** + * Clones the current mesh + * @param name defines the mesh name + * @param newParent defines the new mesh parent + * @param doNotCloneChildren defines a boolean indicating that children must not be cloned (false by default) + * @returns the new mesh + */ + AbstractMesh.prototype.clone = function (name, newParent, doNotCloneChildren) { + return null; + }; + /** + * Disposes all the submeshes of the current meshnp + * @returns the current mesh + */ + AbstractMesh.prototype.releaseSubMeshes = function () { + if (this.subMeshes) { + while (this.subMeshes.length) { + this.subMeshes[0].dispose(); + } + } + else { + this.subMeshes = new Array(); + } + return this; + }; + /** + * Releases resources associated with this abstract mesh. + * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default) + * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default) + */ + AbstractMesh.prototype.dispose = function (doNotRecurse, disposeMaterialAndTextures) { + var _this = this; + if (disposeMaterialAndTextures === void 0) { disposeMaterialAndTextures = false; } + var index; + // Smart Array Retainers. + this.getScene().freeActiveMeshes(); + this.getScene().freeRenderingGroups(); + // Action manager + if (this.actionManager !== undefined && this.actionManager !== null) { + this.actionManager.dispose(); + this.actionManager = null; + } + // Skeleton + this._skeleton = null; + // Intersections in progress + for (index = 0; index < this._intersectionsInProgress.length; index++) { + var other = this._intersectionsInProgress[index]; + var pos = other._intersectionsInProgress.indexOf(this); + other._intersectionsInProgress.splice(pos, 1); + } + this._intersectionsInProgress = []; + // Lights + var lights = this.getScene().lights; + lights.forEach(function (light) { + var meshIndex = light.includedOnlyMeshes.indexOf(_this); + if (meshIndex !== -1) { + light.includedOnlyMeshes.splice(meshIndex, 1); + } + meshIndex = light.excludedMeshes.indexOf(_this); + if (meshIndex !== -1) { + light.excludedMeshes.splice(meshIndex, 1); + } + // Shadow generators + var generator = light.getShadowGenerator(); + if (generator) { + var shadowMap = generator.getShadowMap(); + if (shadowMap && shadowMap.renderList) { + meshIndex = shadowMap.renderList.indexOf(_this); + if (meshIndex !== -1) { + shadowMap.renderList.splice(meshIndex, 1); + } + } + } + }); + // SubMeshes + if (this.getClassName() !== "InstancedMesh") { + this.releaseSubMeshes(); + } + // Query + var engine = this.getScene().getEngine(); + if (this._occlusionQuery) { + this.isOcclusionQueryInProgress = false; + engine.deleteQuery(this._occlusionQuery); + this._occlusionQuery = null; + } + // Engine + engine.wipeCaches(); + // Remove from scene + this.getScene().removeMesh(this); + if (disposeMaterialAndTextures) { + if (this.material) { + this.material.dispose(false, true); + } + } + if (!doNotRecurse) { + // Particles + for (index = 0; index < this.getScene().particleSystems.length; index++) { + if (this.getScene().particleSystems[index].emitter === this) { + this.getScene().particleSystems[index].dispose(); + index--; + } + } + } + // facet data + if (this._facetData.facetDataEnabled) { + this.disableFacetData(); + } + this.onAfterWorldMatrixUpdateObservable.clear(); + this.onCollideObservable.clear(); + this.onCollisionPositionChangeObservable.clear(); + this.onRebuildObservable.clear(); + _super.prototype.dispose.call(this, doNotRecurse, disposeMaterialAndTextures); + }; + /** + * Adds the passed mesh as a child to the current mesh + * @param mesh defines the child mesh + * @returns the current mesh + */ + AbstractMesh.prototype.addChild = function (mesh) { + mesh.setParent(this); + return this; + }; + /** + * Removes the passed mesh from the current mesh children list + * @param mesh defines the child mesh + * @returns the current mesh + */ + AbstractMesh.prototype.removeChild = function (mesh) { + mesh.setParent(null); + return this; + }; + // Facet data + /** @hidden */ + AbstractMesh.prototype._initFacetData = function () { + var data = this._facetData; + if (!data.facetNormals) { + data.facetNormals = new Array(); + } + if (!data.facetPositions) { + data.facetPositions = new Array(); + } + if (!data.facetPartitioning) { + data.facetPartitioning = new Array(); + } + data.facetNb = (this.getIndices().length / 3) | 0; + data.partitioningSubdivisions = (data.partitioningSubdivisions) ? data.partitioningSubdivisions : 10; // default nb of partitioning subdivisions = 10 + data.partitioningBBoxRatio = (data.partitioningBBoxRatio) ? data.partitioningBBoxRatio : 1.01; // default ratio 1.01 = the partitioning is 1% bigger than the bounding box + for (var f = 0; f < data.facetNb; f++) { + data.facetNormals[f] = BABYLON.Vector3.Zero(); + data.facetPositions[f] = BABYLON.Vector3.Zero(); + } + data.facetDataEnabled = true; + return this; + }; + /** + * Updates the mesh facetData arrays and the internal partitioning when the mesh is morphed or updated. + * This method can be called within the render loop. + * You don't need to call this method by yourself in the render loop when you update/morph a mesh with the methods CreateXXX() as they automatically manage this computation + * @returns the current mesh + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.updateFacetData = function () { + var data = this._facetData; + if (!data.facetDataEnabled) { + this._initFacetData(); + } + var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var indices = this.getIndices(); + var normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + var bInfo = this.getBoundingInfo(); + if (data.facetDepthSort && !data.facetDepthSortEnabled) { + // init arrays, matrix and sort function on first call + data.facetDepthSortEnabled = true; + if (indices instanceof Uint16Array) { + data.depthSortedIndices = new Uint16Array(indices); + } + else if (indices instanceof Uint32Array) { + data.depthSortedIndices = new Uint32Array(indices); + } + else { + var needs32bits = false; + for (var i = 0; i < indices.length; i++) { + if (indices[i] > 65535) { + needs32bits = true; + break; + } + } + if (needs32bits) { + data.depthSortedIndices = new Uint32Array(indices); + } + else { + data.depthSortedIndices = new Uint16Array(indices); + } + } + data.facetDepthSortFunction = function (f1, f2) { + return (f2.sqDistance - f1.sqDistance); + }; + if (!data.facetDepthSortFrom) { + var camera = this.getScene().activeCamera; + data.facetDepthSortFrom = (camera) ? camera.position : BABYLON.Vector3.Zero(); + } + data.depthSortedFacets = []; + for (var f = 0; f < data.facetNb; f++) { + var depthSortedFacet = { ind: f * 3, sqDistance: 0.0 }; + data.depthSortedFacets.push(depthSortedFacet); + } + data.invertedMatrix = BABYLON.Matrix.Identity(); + data.facetDepthSortOrigin = BABYLON.Vector3.Zero(); + } + data.bbSize.x = (bInfo.maximum.x - bInfo.minimum.x > BABYLON.Epsilon) ? bInfo.maximum.x - bInfo.minimum.x : BABYLON.Epsilon; + data.bbSize.y = (bInfo.maximum.y - bInfo.minimum.y > BABYLON.Epsilon) ? bInfo.maximum.y - bInfo.minimum.y : BABYLON.Epsilon; + data.bbSize.z = (bInfo.maximum.z - bInfo.minimum.z > BABYLON.Epsilon) ? bInfo.maximum.z - bInfo.minimum.z : BABYLON.Epsilon; + var bbSizeMax = (data.bbSize.x > data.bbSize.y) ? data.bbSize.x : data.bbSize.y; + bbSizeMax = (bbSizeMax > data.bbSize.z) ? bbSizeMax : data.bbSize.z; + data.subDiv.max = data.partitioningSubdivisions; + data.subDiv.X = Math.floor(data.subDiv.max * data.bbSize.x / bbSizeMax); // adjust the number of subdivisions per axis + data.subDiv.Y = Math.floor(data.subDiv.max * data.bbSize.y / bbSizeMax); // according to each bbox size per axis + data.subDiv.Z = Math.floor(data.subDiv.max * data.bbSize.z / bbSizeMax); + data.subDiv.X = data.subDiv.X < 1 ? 1 : data.subDiv.X; // at least one subdivision + data.subDiv.Y = data.subDiv.Y < 1 ? 1 : data.subDiv.Y; + data.subDiv.Z = data.subDiv.Z < 1 ? 1 : data.subDiv.Z; + // set the parameters for ComputeNormals() + data.facetParameters.facetNormals = this.getFacetLocalNormals(); + data.facetParameters.facetPositions = this.getFacetLocalPositions(); + data.facetParameters.facetPartitioning = this.getFacetLocalPartitioning(); + data.facetParameters.bInfo = bInfo; + data.facetParameters.bbSize = data.bbSize; + data.facetParameters.subDiv = data.subDiv; + data.facetParameters.ratio = this.partitioningBBoxRatio; + data.facetParameters.depthSort = data.facetDepthSort; + if (data.facetDepthSort && data.facetDepthSortEnabled) { + this.computeWorldMatrix(true); + this._worldMatrix.invertToRef(data.invertedMatrix); + BABYLON.Vector3.TransformCoordinatesToRef(data.facetDepthSortFrom, data.invertedMatrix, data.facetDepthSortOrigin); + data.facetParameters.distanceTo = data.facetDepthSortOrigin; + } + data.facetParameters.depthSortedFacets = data.depthSortedFacets; + BABYLON.VertexData.ComputeNormals(positions, indices, normals, data.facetParameters); + if (data.facetDepthSort && data.facetDepthSortEnabled) { + data.depthSortedFacets.sort(data.facetDepthSortFunction); + var l = (data.depthSortedIndices.length / 3) | 0; + for (var f = 0; f < l; f++) { + var sind = data.depthSortedFacets[f].ind; + data.depthSortedIndices[f * 3] = indices[sind]; + data.depthSortedIndices[f * 3 + 1] = indices[sind + 1]; + data.depthSortedIndices[f * 3 + 2] = indices[sind + 2]; + } + this.updateIndices(data.depthSortedIndices); + } + return this; + }; + /** + * Returns the facetLocalNormals array. + * The normals are expressed in the mesh local spac + * @returns an array of Vector3 + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getFacetLocalNormals = function () { + if (!this._facetData.facetNormals) { + this.updateFacetData(); + } + return this._facetData.facetNormals; + }; + /** + * Returns the facetLocalPositions array. + * The facet positions are expressed in the mesh local space + * @returns an array of Vector3 + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getFacetLocalPositions = function () { + if (!this._facetData.facetPositions) { + this.updateFacetData(); + } + return this._facetData.facetPositions; + }; + /** + * Returns the facetLocalPartioning array + * @returns an array of array of numbers + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getFacetLocalPartitioning = function () { + if (!this._facetData.facetPartitioning) { + this.updateFacetData(); + } + return this._facetData.facetPartitioning; + }; + /** + * Returns the i-th facet position in the world system. + * This method allocates a new Vector3 per call + * @param i defines the facet index + * @returns a new Vector3 + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getFacetPosition = function (i) { + var pos = BABYLON.Vector3.Zero(); + this.getFacetPositionToRef(i, pos); + return pos; + }; + /** + * Sets the reference Vector3 with the i-th facet position in the world system + * @param i defines the facet index + * @param ref defines the target vector + * @returns the current mesh + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getFacetPositionToRef = function (i, ref) { + var localPos = (this.getFacetLocalPositions())[i]; + var world = this.getWorldMatrix(); + BABYLON.Vector3.TransformCoordinatesToRef(localPos, world, ref); + return this; + }; + /** + * Returns the i-th facet normal in the world system. + * This method allocates a new Vector3 per call + * @param i defines the facet index + * @returns a new Vector3 + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getFacetNormal = function (i) { + var norm = BABYLON.Vector3.Zero(); + this.getFacetNormalToRef(i, norm); + return norm; + }; + /** + * Sets the reference Vector3 with the i-th facet normal in the world system + * @param i defines the facet index + * @param ref defines the target vector + * @returns the current mesh + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getFacetNormalToRef = function (i, ref) { + var localNorm = (this.getFacetLocalNormals())[i]; + BABYLON.Vector3.TransformNormalToRef(localNorm, this.getWorldMatrix(), ref); + return this; + }; + /** + * Returns the facets (in an array) in the same partitioning block than the one the passed coordinates are located (expressed in the mesh local system) + * @param x defines x coordinate + * @param y defines y coordinate + * @param z defines z coordinate + * @returns the array of facet indexes + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getFacetsAtLocalCoordinates = function (x, y, z) { + var bInfo = this.getBoundingInfo(); + var data = this._facetData; + var ox = Math.floor((x - bInfo.minimum.x * data.partitioningBBoxRatio) * data.subDiv.X * data.partitioningBBoxRatio / data.bbSize.x); + var oy = Math.floor((y - bInfo.minimum.y * data.partitioningBBoxRatio) * data.subDiv.Y * data.partitioningBBoxRatio / data.bbSize.y); + var oz = Math.floor((z - bInfo.minimum.z * data.partitioningBBoxRatio) * data.subDiv.Z * data.partitioningBBoxRatio / data.bbSize.z); + if (ox < 0 || ox > data.subDiv.max || oy < 0 || oy > data.subDiv.max || oz < 0 || oz > data.subDiv.max) { + return null; + } + return data.facetPartitioning[ox + data.subDiv.max * oy + data.subDiv.max * data.subDiv.max * oz]; + }; + /** + * Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found + * @param projected sets as the (x,y,z) world projection on the facet + * @param checkFace if true (default false), only the facet "facing" to (x,y,z) or only the ones "turning their backs", according to the parameter "facing" are returned + * @param facing if facing and checkFace are true, only the facet "facing" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet "turning their backs" to (x, y, z) are returned : negative dot (x, y, z) * facet position + * @param x defines x coordinate + * @param y defines y coordinate + * @param z defines z coordinate + * @returns the face index if found (or null instead) + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getClosestFacetAtCoordinates = function (x, y, z, projected, checkFace, facing) { + if (checkFace === void 0) { checkFace = false; } + if (facing === void 0) { facing = true; } + var world = this.getWorldMatrix(); + var invMat = BABYLON.Tmp.Matrix[5]; + world.invertToRef(invMat); + var invVect = BABYLON.Tmp.Vector3[8]; + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, invMat, invVect); // transform (x,y,z) to coordinates in the mesh local space + var closest = this.getClosestFacetAtLocalCoordinates(invVect.x, invVect.y, invVect.z, projected, checkFace, facing); + if (projected) { + // tranform the local computed projected vector to world coordinates + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(projected.x, projected.y, projected.z, world, projected); + } + return closest; + }; + /** + * Returns the closest mesh facet index at (x,y,z) local coordinates, null if not found + * @param projected sets as the (x,y,z) local projection on the facet + * @param checkFace if true (default false), only the facet "facing" to (x,y,z) or only the ones "turning their backs", according to the parameter "facing" are returned + * @param facing if facing and checkFace are true, only the facet "facing" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet "turning their backs" to (x, y, z) are returned : negative dot (x, y, z) * facet position + * @param x defines x coordinate + * @param y defines y coordinate + * @param z defines z coordinate + * @returns the face index if found (or null instead) + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getClosestFacetAtLocalCoordinates = function (x, y, z, projected, checkFace, facing) { + if (checkFace === void 0) { checkFace = false; } + if (facing === void 0) { facing = true; } + var closest = null; + var tmpx = 0.0; + var tmpy = 0.0; + var tmpz = 0.0; + var d = 0.0; // tmp dot facet normal * facet position + var t0 = 0.0; + var projx = 0.0; + var projy = 0.0; + var projz = 0.0; + // Get all the facets in the same partitioning block than (x, y, z) + var facetPositions = this.getFacetLocalPositions(); + var facetNormals = this.getFacetLocalNormals(); + var facetsInBlock = this.getFacetsAtLocalCoordinates(x, y, z); + if (!facetsInBlock) { + return null; + } + // Get the closest facet to (x, y, z) + var shortest = Number.MAX_VALUE; // init distance vars + var tmpDistance = shortest; + var fib; // current facet in the block + var norm; // current facet normal + var p0; // current facet barycenter position + // loop on all the facets in the current partitioning block + for (var idx = 0; idx < facetsInBlock.length; idx++) { + fib = facetsInBlock[idx]; + norm = facetNormals[fib]; + p0 = facetPositions[fib]; + d = (x - p0.x) * norm.x + (y - p0.y) * norm.y + (z - p0.z) * norm.z; + if (!checkFace || (checkFace && facing && d >= 0.0) || (checkFace && !facing && d <= 0.0)) { + // compute (x,y,z) projection on the facet = (projx, projy, projz) + d = norm.x * p0.x + norm.y * p0.y + norm.z * p0.z; + t0 = -(norm.x * x + norm.y * y + norm.z * z - d) / (norm.x * norm.x + norm.y * norm.y + norm.z * norm.z); + projx = x + norm.x * t0; + projy = y + norm.y * t0; + projz = z + norm.z * t0; + tmpx = projx - x; + tmpy = projy - y; + tmpz = projz - z; + tmpDistance = tmpx * tmpx + tmpy * tmpy + tmpz * tmpz; // compute length between (x, y, z) and its projection on the facet + if (tmpDistance < shortest) { // just keep the closest facet to (x, y, z) + shortest = tmpDistance; + closest = fib; + if (projected) { + projected.x = projx; + projected.y = projy; + projected.z = projz; + } + } + } + } + return closest; + }; + /** + * Returns the object "parameter" set with all the expected parameters for facetData computation by ComputeNormals() + * @returns the parameters + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.getFacetDataParameters = function () { + return this._facetData.facetParameters; + }; + /** + * Disables the feature FacetData and frees the related memory + * @returns the current mesh + * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata + */ + AbstractMesh.prototype.disableFacetData = function () { + if (this._facetData.facetDataEnabled) { + this._facetData.facetDataEnabled = false; + this._facetData.facetPositions = new Array(); + this._facetData.facetNormals = new Array(); + this._facetData.facetPartitioning = new Array(); + this._facetData.facetParameters = null; + this._facetData.depthSortedIndices = new Uint32Array(0); + } + return this; + }; + /** + * Updates the AbstractMesh indices array + * @param indices defines the data source + * @returns the current mesh + */ + AbstractMesh.prototype.updateIndices = function (indices) { + return this; + }; + /** + * Creates new normals data for the mesh + * @param updatable defines if the normal vertex buffer must be flagged as updatable + * @returns the current mesh + */ + AbstractMesh.prototype.createNormals = function (updatable) { + var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var indices = this.getIndices(); + var normals; + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + } + else { + normals = []; + } + BABYLON.VertexData.ComputeNormals(positions, indices, normals, { useRightHandedSystem: this.getScene().useRightHandedSystem }); + this.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, updatable); + return this; + }; + /** + * Align the mesh with a normal + * @param normal defines the normal to use + * @param upDirection can be used to redefined the up vector to use (will use the (0, 1, 0) by default) + * @returns the current mesh + */ + AbstractMesh.prototype.alignWithNormal = function (normal, upDirection) { + if (!upDirection) { + upDirection = BABYLON.Axis.Y; + } + var axisX = BABYLON.Tmp.Vector3[0]; + var axisZ = BABYLON.Tmp.Vector3[1]; + BABYLON.Vector3.CrossToRef(upDirection, normal, axisZ); + BABYLON.Vector3.CrossToRef(normal, axisZ, axisX); + if (this.rotationQuaternion) { + BABYLON.Quaternion.RotationQuaternionFromAxisToRef(axisX, normal, axisZ, this.rotationQuaternion); + } + else { + BABYLON.Vector3.RotationFromAxisToRef(axisX, normal, axisZ, this.rotation); + } + return this; + }; + /** @hidden */ + AbstractMesh.prototype._checkOcclusionQuery = function () { + return false; + }; + /** No occlusion */ + AbstractMesh.OCCLUSION_TYPE_NONE = 0; + /** Occlusion set to optimisitic */ + AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC = 1; + /** Occlusion set to strict */ + AbstractMesh.OCCLUSION_TYPE_STRICT = 2; + /** Use an accurante occlusion algorithm */ + AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0; + /** Use a conservative occlusion algorithm */ + AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1; + /** Default culling strategy with bounding box and bounding sphere and then frustum culling */ + AbstractMesh.CULLINGSTRATEGY_STANDARD = 0; + /** Culling strategy with bounding sphere only and then frustum culling */ + AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1; + return AbstractMesh; + }(BABYLON.TransformNode)); + BABYLON.AbstractMesh = AbstractMesh; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.abstractMesh.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * Base class of all the lights in Babylon. It groups all the generic information about lights. + * Lights are used, as you would expect, to affect how meshes are seen, in terms of both illumination and colour. + * All meshes allow light to pass through them unless shadow generation is activated. The default number of lights allowed is four but this can be increased. + */ + var Light = /** @class */ (function (_super) { + __extends(Light, _super); + /** + * Creates a Light object in the scene. + * Documentation : http://doc.babylonjs.com/tutorials/lights + * @param name The firendly name of the light + * @param scene The scene the light belongs too + */ + function Light(name, scene) { + var _this = _super.call(this, name, scene) || this; + /** + * Diffuse gives the basic color to an object. + */ + _this.diffuse = new BABYLON.Color3(1.0, 1.0, 1.0); + /** + * Specular produces a highlight color on an object. + * Note: This is note affecting PBR materials. + */ + _this.specular = new BABYLON.Color3(1.0, 1.0, 1.0); + /** + * Defines the falloff type for this light. This lets overrriding how punctual light are + * falling off base on range or angle. + * This can be set to any values in Light.FALLOFF_x. + * + * Note: This is only usefull for PBR Materials at the moment. This could be extended if required to + * other types of materials. + */ + _this.falloffType = Light.FALLOFF_DEFAULT; + /** + * Strength of the light. + * Note: By default it is define in the framework own unit. + * Note: In PBR materials the intensityMode can be use to chose what unit the intensity is defined in. + */ + _this.intensity = 1.0; + _this._range = Number.MAX_VALUE; + _this._inverseSquaredRange = 0; + /** + * Cached photometric scale default to 1.0 as the automatic intensity mode defaults to 1.0 for every type + * of light. + */ + _this._photometricScale = 1.0; + _this._intensityMode = Light.INTENSITYMODE_AUTOMATIC; + _this._radius = 0.00001; + /** + * Defines the rendering priority of the lights. It can help in case of fallback or number of lights + * exceeding the number allowed of the materials. + */ + _this.renderPriority = 0; + _this._shadowEnabled = true; + _this._excludeWithLayerMask = 0; + _this._includeOnlyWithLayerMask = 0; + _this._lightmapMode = 0; + /** + * @hidden Internal use only. + */ + _this._excludedMeshesIds = new Array(); + /** + * @hidden Internal use only. + */ + _this._includedOnlyMeshesIds = new Array(); + _this.getScene().addLight(_this); + _this._uniformBuffer = new BABYLON.UniformBuffer(_this.getScene().getEngine()); + _this._buildUniformLayout(); + _this.includedOnlyMeshes = new Array(); + _this.excludedMeshes = new Array(); + _this._resyncMeshes(); + return _this; + } + Object.defineProperty(Light.prototype, "range", { + /** + * Defines how far from the source the light is impacting in scene units. + * Note: Unused in PBR material as the distance light falloff is defined following the inverse squared falloff. + */ + get: function () { + return this._range; + }, + /** + * Defines how far from the source the light is impacting in scene units. + * Note: Unused in PBR material as the distance light falloff is defined following the inverse squared falloff. + */ + set: function (value) { + this._range = value; + this._inverseSquaredRange = 1.0 / (this.range * this.range); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Light.prototype, "intensityMode", { + /** + * Gets the photometric scale used to interpret the intensity. + * This is only relevant with PBR Materials where the light intensity can be defined in a physical way. + */ + get: function () { + return this._intensityMode; + }, + /** + * Sets the photometric scale used to interpret the intensity. + * This is only relevant with PBR Materials where the light intensity can be defined in a physical way. + */ + set: function (value) { + this._intensityMode = value; + this._computePhotometricScale(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Light.prototype, "radius", { + /** + * Gets the light radius used by PBR Materials to simulate soft area lights. + */ + get: function () { + return this._radius; + }, + /** + * sets the light radius used by PBR Materials to simulate soft area lights. + */ + set: function (value) { + this._radius = value; + this._computePhotometricScale(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Light.prototype, "shadowEnabled", { + /** + * Gets wether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching + * the current shadow generator. + */ + get: function () { + return this._shadowEnabled; + }, + /** + * Sets wether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching + * the current shadow generator. + */ + set: function (value) { + if (this._shadowEnabled === value) { + return; + } + this._shadowEnabled = value; + this._markMeshesAsLightDirty(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Light.prototype, "includedOnlyMeshes", { + /** + * Gets the only meshes impacted by this light. + */ + get: function () { + return this._includedOnlyMeshes; + }, + /** + * Sets the only meshes impacted by this light. + */ + set: function (value) { + this._includedOnlyMeshes = value; + this._hookArrayForIncludedOnly(value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Light.prototype, "excludedMeshes", { + /** + * Gets the meshes not impacted by this light. + */ + get: function () { + return this._excludedMeshes; + }, + /** + * Sets the meshes not impacted by this light. + */ + set: function (value) { + this._excludedMeshes = value; + this._hookArrayForExcluded(value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Light.prototype, "excludeWithLayerMask", { + /** + * Gets the layer id use to find what meshes are not impacted by the light. + * Inactive if 0 + */ + get: function () { + return this._excludeWithLayerMask; + }, + /** + * Sets the layer id use to find what meshes are not impacted by the light. + * Inactive if 0 + */ + set: function (value) { + this._excludeWithLayerMask = value; + this._resyncMeshes(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Light.prototype, "includeOnlyWithLayerMask", { + /** + * Gets the layer id use to find what meshes are impacted by the light. + * Inactive if 0 + */ + get: function () { + return this._includeOnlyWithLayerMask; + }, + /** + * Sets the layer id use to find what meshes are impacted by the light. + * Inactive if 0 + */ + set: function (value) { + this._includeOnlyWithLayerMask = value; + this._resyncMeshes(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Light.prototype, "lightmapMode", { + /** + * Gets the lightmap mode of this light (should be one of the constants defined by Light.LIGHTMAP_x) + */ + get: function () { + return this._lightmapMode; + }, + /** + * Sets the lightmap mode of this light (should be one of the constants defined by Light.LIGHTMAP_x) + */ + set: function (value) { + if (this._lightmapMode === value) { + return; + } + this._lightmapMode = value; + this._markMeshesAsLightDirty(); + }, + enumerable: true, + configurable: true + }); + /** + * Returns the string "Light". + * @returns the class name + */ + Light.prototype.getClassName = function () { + return "Light"; + }; + /** + * Converts the light information to a readable string for debug purpose. + * @param fullDetails Supports for multiple levels of logging within scene loading + * @returns the human readable light info + */ + Light.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name; + ret += ", type: " + (["Point", "Directional", "Spot", "Hemispheric"])[this.getTypeID()]; + if (this.animations) { + for (var i = 0; i < this.animations.length; i++) { + ret += ", animation[0]: " + this.animations[i].toString(fullDetails); + } + } + if (fullDetails) { + } + return ret; + }; + /** @hidden */ + Light.prototype._syncParentEnabledState = function () { + _super.prototype._syncParentEnabledState.call(this); + this._resyncMeshes(); + }; + /** + * Set the enabled state of this node. + * @param value - the new enabled state + */ + Light.prototype.setEnabled = function (value) { + _super.prototype.setEnabled.call(this, value); + this._resyncMeshes(); + }; + /** + * Returns the Light associated shadow generator if any. + * @return the associated shadow generator. + */ + Light.prototype.getShadowGenerator = function () { + return this._shadowGenerator; + }; + /** + * Returns a Vector3, the absolute light position in the World. + * @returns the world space position of the light + */ + Light.prototype.getAbsolutePosition = function () { + return BABYLON.Vector3.Zero(); + }; + /** + * Specifies if the light will affect the passed mesh. + * @param mesh The mesh to test against the light + * @return true the mesh is affected otherwise, false. + */ + Light.prototype.canAffectMesh = function (mesh) { + if (!mesh) { + return true; + } + if (this.includedOnlyMeshes && this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(mesh) === -1) { + return false; + } + if (this.excludedMeshes && this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) { + return false; + } + if (this.includeOnlyWithLayerMask !== 0 && (this.includeOnlyWithLayerMask & mesh.layerMask) === 0) { + return false; + } + if (this.excludeWithLayerMask !== 0 && this.excludeWithLayerMask & mesh.layerMask) { + return false; + } + return true; + }; + /** + * Sort function to order lights for rendering. + * @param a First Light object to compare to second. + * @param b Second Light object to compare first. + * @return -1 to reduce's a's index relative to be, 0 for no change, 1 to increase a's index relative to b. + */ + Light.CompareLightsPriority = function (a, b) { + //shadow-casting lights have priority over non-shadow-casting lights + //the renderPrioirty is a secondary sort criterion + if (a.shadowEnabled !== b.shadowEnabled) { + return (b.shadowEnabled ? 1 : 0) - (a.shadowEnabled ? 1 : 0); + } + return b.renderPriority - a.renderPriority; + }; + /** + * Releases resources associated with this node. + * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default) + * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default) + */ + Light.prototype.dispose = function (doNotRecurse, disposeMaterialAndTextures) { + if (disposeMaterialAndTextures === void 0) { disposeMaterialAndTextures = false; } + if (this._shadowGenerator) { + this._shadowGenerator.dispose(); + this._shadowGenerator = null; + } + // Animations + this.getScene().stopAnimation(this); + // Remove from meshes + for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) { + var mesh = _a[_i]; + mesh._removeLightSource(this); + } + this._uniformBuffer.dispose(); + // Remove from scene + this.getScene().removeLight(this); + _super.prototype.dispose.call(this, doNotRecurse, disposeMaterialAndTextures); + }; + /** + * Returns the light type ID (integer). + * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x + */ + Light.prototype.getTypeID = function () { + return 0; + }; + /** + * Returns the intensity scaled by the Photometric Scale according to the light type and intensity mode. + * @returns the scaled intensity in intensity mode unit + */ + Light.prototype.getScaledIntensity = function () { + return this._photometricScale * this.intensity; + }; + /** + * Returns a new Light object, named "name", from the current one. + * @param name The name of the cloned light + * @returns the new created light + */ + Light.prototype.clone = function (name) { + var constructor = Light.GetConstructorFromName(this.getTypeID(), name, this.getScene()); + if (!constructor) { + return null; + } + return BABYLON.SerializationHelper.Clone(constructor, this); + }; + /** + * Serializes the current light into a Serialization object. + * @returns the serialized object. + */ + Light.prototype.serialize = function () { + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + // Type + serializationObject.type = this.getTypeID(); + // Parent + if (this.parent) { + serializationObject.parentId = this.parent.id; + } + // Inclusion / exclusions + if (this.excludedMeshes.length > 0) { + serializationObject.excludedMeshesIds = []; + this.excludedMeshes.forEach(function (mesh) { + serializationObject.excludedMeshesIds.push(mesh.id); + }); + } + if (this.includedOnlyMeshes.length > 0) { + serializationObject.includedOnlyMeshesIds = []; + this.includedOnlyMeshes.forEach(function (mesh) { + serializationObject.includedOnlyMeshesIds.push(mesh.id); + }); + } + // Animations + BABYLON.Animation.AppendSerializedAnimations(this, serializationObject); + serializationObject.ranges = this.serializeAnimationRanges(); + return serializationObject; + }; + /** + * Creates a new typed light from the passed type (integer) : point light = 0, directional light = 1, spot light = 2, hemispheric light = 3. + * This new light is named "name" and added to the passed scene. + * @param type Type according to the types available in Light.LIGHTTYPEID_x + * @param name The friendly name of the light + * @param scene The scene the new light will belong to + * @returns the constructor function + */ + Light.GetConstructorFromName = function (type, name, scene) { + var constructorFunc = BABYLON.Node.Construct("Light_Type_" + type, name, scene); + if (constructorFunc) { + return constructorFunc; + } + // Default to no light for none present once. + return null; + }; + /** + * Parses the passed "parsedLight" and returns a new instanced Light from this parsing. + * @param parsedLight The JSON representation of the light + * @param scene The scene to create the parsed light in + * @returns the created light after parsing + */ + Light.Parse = function (parsedLight, scene) { + var constructor = Light.GetConstructorFromName(parsedLight.type, parsedLight.name, scene); + if (!constructor) { + return null; + } + var light = BABYLON.SerializationHelper.Parse(constructor, parsedLight, scene); + // Inclusion / exclusions + if (parsedLight.excludedMeshesIds) { + light._excludedMeshesIds = parsedLight.excludedMeshesIds; + } + if (parsedLight.includedOnlyMeshesIds) { + light._includedOnlyMeshesIds = parsedLight.includedOnlyMeshesIds; + } + // Parent + if (parsedLight.parentId) { + light._waitingParentId = parsedLight.parentId; + } + // Animations + if (parsedLight.animations) { + for (var animationIndex = 0; animationIndex < parsedLight.animations.length; animationIndex++) { + var parsedAnimation = parsedLight.animations[animationIndex]; + light.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + BABYLON.Node.ParseAnimationRanges(light, parsedLight, scene); + } + if (parsedLight.autoAnimate) { + scene.beginAnimation(light, parsedLight.autoAnimateFrom, parsedLight.autoAnimateTo, parsedLight.autoAnimateLoop, parsedLight.autoAnimateSpeed || 1.0); + } + return light; + }; + Light.prototype._hookArrayForExcluded = function (array) { + var _this = this; + var oldPush = array.push; + array.push = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + var result = oldPush.apply(array, items); + for (var _a = 0, items_1 = items; _a < items_1.length; _a++) { + var item = items_1[_a]; + item._resyncLighSource(_this); + } + return result; + }; + var oldSplice = array.splice; + array.splice = function (index, deleteCount) { + var deleted = oldSplice.apply(array, [index, deleteCount]); + for (var _i = 0, deleted_1 = deleted; _i < deleted_1.length; _i++) { + var item = deleted_1[_i]; + item._resyncLighSource(_this); + } + return deleted; + }; + for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { + var item = array_1[_i]; + item._resyncLighSource(this); + } + }; + Light.prototype._hookArrayForIncludedOnly = function (array) { + var _this = this; + var oldPush = array.push; + array.push = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + var result = oldPush.apply(array, items); + _this._resyncMeshes(); + return result; + }; + var oldSplice = array.splice; + array.splice = function (index, deleteCount) { + var deleted = oldSplice.apply(array, [index, deleteCount]); + _this._resyncMeshes(); + return deleted; + }; + this._resyncMeshes(); + }; + Light.prototype._resyncMeshes = function () { + for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) { + var mesh = _a[_i]; + mesh._resyncLighSource(this); + } + }; + /** + * Forces the meshes to update their light related information in their rendering used effects + * @hidden Internal Use Only + */ + Light.prototype._markMeshesAsLightDirty = function () { + for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) { + var mesh = _a[_i]; + if (mesh._lightSources.indexOf(this) !== -1) { + mesh._markSubMeshesAsLightDirty(); + } + } + }; + /** + * Recomputes the cached photometric scale if needed. + */ + Light.prototype._computePhotometricScale = function () { + this._photometricScale = this._getPhotometricScale(); + this.getScene().resetCachedMaterial(); + }; + /** + * Returns the Photometric Scale according to the light type and intensity mode. + */ + Light.prototype._getPhotometricScale = function () { + var photometricScale = 0.0; + var lightTypeID = this.getTypeID(); + //get photometric mode + var photometricMode = this.intensityMode; + if (photometricMode === Light.INTENSITYMODE_AUTOMATIC) { + if (lightTypeID === Light.LIGHTTYPEID_DIRECTIONALLIGHT) { + photometricMode = Light.INTENSITYMODE_ILLUMINANCE; + } + else { + photometricMode = Light.INTENSITYMODE_LUMINOUSINTENSITY; + } + } + //compute photometric scale + switch (lightTypeID) { + case Light.LIGHTTYPEID_POINTLIGHT: + case Light.LIGHTTYPEID_SPOTLIGHT: + switch (photometricMode) { + case Light.INTENSITYMODE_LUMINOUSPOWER: + photometricScale = 1.0 / (4.0 * Math.PI); + break; + case Light.INTENSITYMODE_LUMINOUSINTENSITY: + photometricScale = 1.0; + break; + case Light.INTENSITYMODE_LUMINANCE: + photometricScale = this.radius * this.radius; + break; + } + break; + case Light.LIGHTTYPEID_DIRECTIONALLIGHT: + switch (photometricMode) { + case Light.INTENSITYMODE_ILLUMINANCE: + photometricScale = 1.0; + break; + case Light.INTENSITYMODE_LUMINANCE: + // When radius (and therefore solid angle) is non-zero a directional lights brightness can be specified via central (peak) luminance. + // For a directional light the 'radius' defines the angular radius (in radians) rather than world-space radius (e.g. in metres). + var apexAngleRadians = this.radius; + // Impose a minimum light angular size to avoid the light becoming an infinitely small angular light source (i.e. a dirac delta function). + apexAngleRadians = Math.max(apexAngleRadians, 0.001); + var solidAngle = 2.0 * Math.PI * (1.0 - Math.cos(apexAngleRadians)); + photometricScale = solidAngle; + break; + } + break; + case Light.LIGHTTYPEID_HEMISPHERICLIGHT: + // No fall off in hemisperic light. + photometricScale = 1.0; + break; + } + return photometricScale; + }; + /** + * Reorder the light in the scene according to their defined priority. + * @hidden Internal Use Only + */ + Light.prototype._reorderLightsInScene = function () { + var scene = this.getScene(); + if (this._renderPriority != 0) { + scene.requireLightSorting = true; + } + this.getScene().sortLightsByPriority(); + }; + /** + * Falloff Default: light is falling off following the material specification: + * standard material is using standard falloff whereas pbr material can request special falloff per materials. + */ + Light.FALLOFF_DEFAULT = 0; + /** + * Falloff Physical: light is falling off following the inverse squared distance law. + */ + Light.FALLOFF_PHYSICAL = 1; + /** + * Falloff gltf: light is falling off as described in the gltf moving to PBR document + * to enhance interoperability with other engines. + */ + Light.FALLOFF_GLTF = 2; + /** + * Falloff Standard: light is falling off like in the standard material + * to enhance interoperability with other materials. + */ + Light.FALLOFF_STANDARD = 3; + //lightmapMode Consts + /** + * If every light affecting the material is in this lightmapMode, + * material.lightmapTexture adds or multiplies + * (depends on material.useLightmapAsShadowmap) + * after every other light calculations. + */ + Light.LIGHTMAP_DEFAULT = 0; + /** + * material.lightmapTexture as only diffuse lighting from this light + * adds only specular lighting from this light + * adds dynamic shadows + */ + Light.LIGHTMAP_SPECULAR = 1; + /** + * material.lightmapTexture as only lighting + * no light calculation from this light + * only adds dynamic shadows from this light + */ + Light.LIGHTMAP_SHADOWSONLY = 2; + // Intensity Mode Consts + /** + * Each light type uses the default quantity according to its type: + * point/spot lights use luminous intensity + * directional lights use illuminance + */ + Light.INTENSITYMODE_AUTOMATIC = 0; + /** + * lumen (lm) + */ + Light.INTENSITYMODE_LUMINOUSPOWER = 1; + /** + * candela (lm/sr) + */ + Light.INTENSITYMODE_LUMINOUSINTENSITY = 2; + /** + * lux (lm/m^2) + */ + Light.INTENSITYMODE_ILLUMINANCE = 3; + /** + * nit (cd/m^2) + */ + Light.INTENSITYMODE_LUMINANCE = 4; + // Light types ids const. + /** + * Light type const id of the point light. + */ + Light.LIGHTTYPEID_POINTLIGHT = 0; + /** + * Light type const id of the directional light. + */ + Light.LIGHTTYPEID_DIRECTIONALLIGHT = 1; + /** + * Light type const id of the spot light. + */ + Light.LIGHTTYPEID_SPOTLIGHT = 2; + /** + * Light type const id of the hemispheric light. + */ + Light.LIGHTTYPEID_HEMISPHERICLIGHT = 3; + __decorate([ + BABYLON.serializeAsColor3() + ], Light.prototype, "diffuse", void 0); + __decorate([ + BABYLON.serializeAsColor3() + ], Light.prototype, "specular", void 0); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "falloffType", void 0); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "intensity", void 0); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "range", null); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "intensityMode", null); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "radius", null); + __decorate([ + BABYLON.serialize() + ], Light.prototype, "_renderPriority", void 0); + __decorate([ + BABYLON.expandToProperty("_reorderLightsInScene") + ], Light.prototype, "renderPriority", void 0); + __decorate([ + BABYLON.serialize("shadowEnabled") + ], Light.prototype, "_shadowEnabled", void 0); + __decorate([ + BABYLON.serialize("excludeWithLayerMask") + ], Light.prototype, "_excludeWithLayerMask", void 0); + __decorate([ + BABYLON.serialize("includeOnlyWithLayerMask") + ], Light.prototype, "_includeOnlyWithLayerMask", void 0); + __decorate([ + BABYLON.serialize("lightmapMode") + ], Light.prototype, "_lightmapMode", void 0); + return Light; + }(BABYLON.Node)); + BABYLON.Light = Light; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.light.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * This is the base class of all the camera used in the application. + * @see http://doc.babylonjs.com/features/cameras + */ + var Camera = /** @class */ (function (_super) { + __extends(Camera, _super); + /** + * Instantiates a new camera object. + * This should not be used directly but through the inherited cameras: ArcRotate, Free... + * @see http://doc.babylonjs.com/features/cameras + * @param name Defines the name of the camera in the scene + * @param position Defines the position of the camera + * @param scene Defines the scene the camera belongs too + * @param setActiveOnSceneIfNoneActive Defines if the camera should be set as active after creation if no other camera have been defined in the scene + */ + function Camera(name, position, scene, setActiveOnSceneIfNoneActive) { + if (setActiveOnSceneIfNoneActive === void 0) { setActiveOnSceneIfNoneActive = true; } + var _this = _super.call(this, name, scene) || this; + /** + * The vector the camera should consider as up. + * (default is Vector3(0, 1, 0) aka Vector3.Up()) + */ + _this.upVector = BABYLON.Vector3.Up(); + /** + * Define the current limit on the left side for an orthographic camera + * In scene unit + */ + _this.orthoLeft = null; + /** + * Define the current limit on the right side for an orthographic camera + * In scene unit + */ + _this.orthoRight = null; + /** + * Define the current limit on the bottom side for an orthographic camera + * In scene unit + */ + _this.orthoBottom = null; + /** + * Define the current limit on the top side for an orthographic camera + * In scene unit + */ + _this.orthoTop = null; + /** + * Field Of View is set in Radians. (default is 0.8) + */ + _this.fov = 0.8; + /** + * Define the minimum distance the camera can see from. + * This is important to note that the depth buffer are not infinite and the closer it starts + * the more your scene might encounter depth fighting issue. + */ + _this.minZ = 1; + /** + * Define the maximum distance the camera can see to. + * This is important to note that the depth buffer are not infinite and the further it end + * the more your scene might encounter depth fighting issue. + */ + _this.maxZ = 10000.0; + /** + * Define the default inertia of the camera. + * This helps giving a smooth feeling to the camera movement. + */ + _this.inertia = 0.9; + /** + * Define the mode of the camera (Camera.PERSPECTIVE_CAMERA or Camera.PERSPECTIVE_ORTHOGRAPHIC) + */ + _this.mode = Camera.PERSPECTIVE_CAMERA; + /** + * Define wether the camera is intermediate. + * This is usefull to not present the output directly to the screen in case of rig without post process for instance + */ + _this.isIntermediate = false; + /** + * Define the viewport of the camera. + * This correspond to the portion of the screen the camera will render to in normalized 0 to 1 unit. + */ + _this.viewport = new BABYLON.Viewport(0, 0, 1.0, 1.0); + /** + * Restricts the camera to viewing objects with the same layerMask. + * A camera with a layerMask of 1 will render mesh.layerMask & camera.layerMask!== 0 + */ + _this.layerMask = 0x0FFFFFFF; + /** + * fovMode sets the camera frustum bounds to the viewport bounds. (default is FOVMODE_VERTICAL_FIXED) + */ + _this.fovMode = Camera.FOVMODE_VERTICAL_FIXED; + /** + * Rig mode of the camera. + * This is usefull to create the camera with two "eyes" instead of one to create VR or stereoscopic scenes. + * This is normally controlled byt the camera themselves as internal use. + */ + _this.cameraRigMode = Camera.RIG_MODE_NONE; + /** + * Defines the list of custom render target the camera should render to. + * This is pretty helpfull if you wish to make a camera render to a texture you could reuse somewhere + * else in the scene. + */ + _this.customRenderTargets = new Array(); + /** + * Observable triggered when the camera view matrix has changed. + */ + _this.onViewMatrixChangedObservable = new BABYLON.Observable(); + /** + * Observable triggered when the camera Projection matrix has changed. + */ + _this.onProjectionMatrixChangedObservable = new BABYLON.Observable(); + /** + * Observable triggered when the inputs have been processed. + */ + _this.onAfterCheckInputsObservable = new BABYLON.Observable(); + /** + * Observable triggered when reset has been called and applied to the camera. + */ + _this.onRestoreStateObservable = new BABYLON.Observable(); + /** @hidden */ + _this._rigCameras = new Array(); + _this._webvrViewMatrix = BABYLON.Matrix.Identity(); + /** @hidden */ + _this._skipRendering = false; + /** @hidden */ + _this._projectionMatrix = new BABYLON.Matrix(); + /** @hidden */ + _this._postProcesses = new Array(); + /** @hidden */ + _this._activeMeshes = new BABYLON.SmartArray(256); + _this._globalPosition = BABYLON.Vector3.Zero(); + _this._computedViewMatrix = BABYLON.Matrix.Identity(); + _this._doNotComputeProjectionMatrix = false; + _this._transformMatrix = BABYLON.Matrix.Zero(); + _this._refreshFrustumPlanes = true; + _this.getScene().addCamera(_this); + if (setActiveOnSceneIfNoneActive && !_this.getScene().activeCamera) { + _this.getScene().activeCamera = _this; + } + _this.position = position; + return _this; + } + /** + * Store current camera state (fov, position, etc..) + * @returns the camera + */ + Camera.prototype.storeState = function () { + this._stateStored = true; + this._storedFov = this.fov; + return this; + }; + /** + * Restores the camera state values if it has been stored. You must call storeState() first + */ + Camera.prototype._restoreStateValues = function () { + if (!this._stateStored) { + return false; + } + this.fov = this._storedFov; + return true; + }; + /** + * Restored camera state. You must call storeState() first. + * @returns true if restored and false otherwise + */ + Camera.prototype.restoreState = function () { + if (this._restoreStateValues()) { + this.onRestoreStateObservable.notifyObservers(this); + return true; + } + return false; + }; + /** + * Gets the class name of the camera. + * @returns the class name + */ + Camera.prototype.getClassName = function () { + return "Camera"; + }; + /** + * Gets a string representation of the camera usefull for debug purpose. + * @param fullDetails Defines that a more verboe level of logging is required + * @returns the string representation + */ + Camera.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name; + ret += ", type: " + this.getClassName(); + if (this.animations) { + for (var i = 0; i < this.animations.length; i++) { + ret += ", animation[0]: " + this.animations[i].toString(fullDetails); + } + } + if (fullDetails) { + } + return ret; + }; + Object.defineProperty(Camera.prototype, "globalPosition", { + /** + * Gets the current world space position of the camera. + */ + get: function () { + return this._globalPosition; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the list of active meshes this frame (meshes no culled or excluded by lod s in the frame) + * @returns the active meshe list + */ + Camera.prototype.getActiveMeshes = function () { + return this._activeMeshes; + }; + /** + * Check wether a mesh is part of the current active mesh list of the camera + * @param mesh Defines the mesh to check + * @returns true if active, false otherwise + */ + Camera.prototype.isActiveMesh = function (mesh) { + return (this._activeMeshes.indexOf(mesh) !== -1); + }; + /** + * Is this camera ready to be used/rendered + * @param completeCheck defines if a complete check (including post processes) has to be done (false by default) + * @return true if the camera is ready + */ + Camera.prototype.isReady = function (completeCheck) { + if (completeCheck === void 0) { completeCheck = false; } + if (completeCheck) { + for (var _i = 0, _a = this._postProcesses; _i < _a.length; _i++) { + var pp = _a[_i]; + if (pp && !pp.isReady()) { + return false; + } + } + } + return _super.prototype.isReady.call(this, completeCheck); + }; + /** @hidden */ + Camera.prototype._initCache = function () { + _super.prototype._initCache.call(this); + this._cache.position = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + this._cache.upVector = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + this._cache.mode = undefined; + this._cache.minZ = undefined; + this._cache.maxZ = undefined; + this._cache.fov = undefined; + this._cache.fovMode = undefined; + this._cache.aspectRatio = undefined; + this._cache.orthoLeft = undefined; + this._cache.orthoRight = undefined; + this._cache.orthoBottom = undefined; + this._cache.orthoTop = undefined; + this._cache.renderWidth = undefined; + this._cache.renderHeight = undefined; + }; + /** @hidden */ + Camera.prototype._updateCache = function (ignoreParentClass) { + if (!ignoreParentClass) { + _super.prototype._updateCache.call(this); + } + this._cache.position.copyFrom(this.position); + this._cache.upVector.copyFrom(this.upVector); + }; + /** @hidden */ + Camera.prototype._isSynchronized = function () { + return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix(); + }; + /** @hidden */ + Camera.prototype._isSynchronizedViewMatrix = function () { + if (!_super.prototype._isSynchronized.call(this)) { + return false; + } + return this._cache.position.equals(this.position) + && this._cache.upVector.equals(this.upVector) + && this.isSynchronizedWithParent(); + }; + /** @hidden */ + Camera.prototype._isSynchronizedProjectionMatrix = function () { + var check = this._cache.mode === this.mode + && this._cache.minZ === this.minZ + && this._cache.maxZ === this.maxZ; + if (!check) { + return false; + } + var engine = this.getEngine(); + if (this.mode === Camera.PERSPECTIVE_CAMERA) { + check = this._cache.fov === this.fov + && this._cache.fovMode === this.fovMode + && this._cache.aspectRatio === engine.getAspectRatio(this); + } + else { + check = this._cache.orthoLeft === this.orthoLeft + && this._cache.orthoRight === this.orthoRight + && this._cache.orthoBottom === this.orthoBottom + && this._cache.orthoTop === this.orthoTop + && this._cache.renderWidth === engine.getRenderWidth() + && this._cache.renderHeight === engine.getRenderHeight(); + } + return check; + }; + /** + * Attach the input controls to a specific dom element to get the input from. + * @param element Defines the element the controls should be listened from + * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) + */ + Camera.prototype.attachControl = function (element, noPreventDefault) { + }; + /** + * Detach the current controls from the specified dom element. + * @param element Defines the element to stop listening the inputs from + */ + Camera.prototype.detachControl = function (element) { + }; + /** + * Update the camera state according to the different inputs gathered during the frame. + */ + Camera.prototype.update = function () { + this._checkInputs(); + if (this.cameraRigMode !== Camera.RIG_MODE_NONE) { + this._updateRigCameras(); + } + }; + /** @hidden */ + Camera.prototype._checkInputs = function () { + this.onAfterCheckInputsObservable.notifyObservers(this); + }; + Object.defineProperty(Camera.prototype, "rigCameras", { + /** @hidden */ + get: function () { + return this._rigCameras; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera.prototype, "rigPostProcess", { + /** + * Gets the post process used by the rig cameras + */ + get: function () { + return this._rigPostProcess; + }, + enumerable: true, + configurable: true + }); + /** + * Internal, gets the first post proces. + * @returns the first post process to be run on this camera. + */ + Camera.prototype._getFirstPostProcess = function () { + for (var ppIndex = 0; ppIndex < this._postProcesses.length; ppIndex++) { + if (this._postProcesses[ppIndex] !== null) { + return this._postProcesses[ppIndex]; + } + } + return null; + }; + Camera.prototype._cascadePostProcessesToRigCams = function () { + // invalidate framebuffer + var firstPostProcess = this._getFirstPostProcess(); + if (firstPostProcess) { + firstPostProcess.markTextureDirty(); + } + // glue the rigPostProcess to the end of the user postprocesses & assign to each sub-camera + for (var i = 0, len = this._rigCameras.length; i < len; i++) { + var cam = this._rigCameras[i]; + var rigPostProcess = cam._rigPostProcess; + // for VR rig, there does not have to be a post process + if (rigPostProcess) { + var isPass = rigPostProcess instanceof BABYLON.PassPostProcess; + if (isPass) { + // any rig which has a PassPostProcess for rig[0], cannot be isIntermediate when there are also user postProcesses + cam.isIntermediate = this._postProcesses.length === 0; + } + cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess); + rigPostProcess.markTextureDirty(); + } + else { + cam._postProcesses = this._postProcesses.slice(0); + } + } + }; + /** + * Attach a post process to the camera. + * @see http://doc.babylonjs.com/how_to/how_to_use_postprocesses#attach-postprocess + * @param postProcess The post process to attach to the camera + * @param insertAt The position of the post process in case several of them are in use in the scene + * @returns the position the post process has been inserted at + */ + Camera.prototype.attachPostProcess = function (postProcess, insertAt) { + if (insertAt === void 0) { insertAt = null; } + if (!postProcess.isReusable() && this._postProcesses.indexOf(postProcess) > -1) { + BABYLON.Tools.Error("You're trying to reuse a post process not defined as reusable."); + return 0; + } + if (insertAt == null || insertAt < 0) { + this._postProcesses.push(postProcess); + } + else if (this._postProcesses[insertAt] === null) { + this._postProcesses[insertAt] = postProcess; + } + else { + this._postProcesses.splice(insertAt, 0, postProcess); + } + this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated + return this._postProcesses.indexOf(postProcess); + }; + /** + * Detach a post process to the camera. + * @see http://doc.babylonjs.com/how_to/how_to_use_postprocesses#attach-postprocess + * @param postProcess The post process to detach from the camera + */ + Camera.prototype.detachPostProcess = function (postProcess) { + var idx = this._postProcesses.indexOf(postProcess); + if (idx !== -1) { + this._postProcesses[idx] = null; + } + this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated + }; + /** + * Gets the current world matrix of the camera + */ + Camera.prototype.getWorldMatrix = function () { + if (this._isSynchronizedViewMatrix()) { + return this._worldMatrix; + } + // Getting the the view matrix will also compute the world matrix. + this.getViewMatrix(); + return this._worldMatrix; + }; + /** @hidden */ + Camera.prototype._getViewMatrix = function () { + return BABYLON.Matrix.Identity(); + }; + /** + * Gets the current view matrix of the camera. + * @param force forces the camera to recompute the matrix without looking at the cached state + * @returns the view matrix + */ + Camera.prototype.getViewMatrix = function (force) { + if (!force && this._isSynchronizedViewMatrix()) { + return this._computedViewMatrix; + } + this.updateCache(); + this._computedViewMatrix = this._getViewMatrix(); + this._currentRenderId = this.getScene().getRenderId(); + this._childRenderId = this._currentRenderId; + this._refreshFrustumPlanes = true; + if (this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix) { + this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix); + } + this.onViewMatrixChangedObservable.notifyObservers(this); + this._computedViewMatrix.invertToRef(this._worldMatrix); + return this._computedViewMatrix; + }; + /** + * Freeze the projection matrix. + * It will prevent the cache check of the camera projection compute and can speed up perf + * if no parameter of the camera are meant to change + * @param projection Defines manually a projection if necessary + */ + Camera.prototype.freezeProjectionMatrix = function (projection) { + this._doNotComputeProjectionMatrix = true; + if (projection !== undefined) { + this._projectionMatrix = projection; + } + }; + /** + * Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix. + */ + Camera.prototype.unfreezeProjectionMatrix = function () { + this._doNotComputeProjectionMatrix = false; + }; + /** + * Gets the current projection matrix of the camera. + * @param force forces the camera to recompute the matrix without looking at the cached state + * @returns the projection matrix + */ + Camera.prototype.getProjectionMatrix = function (force) { + if (this._doNotComputeProjectionMatrix || (!force && this._isSynchronizedProjectionMatrix())) { + return this._projectionMatrix; + } + // Cache + this._cache.mode = this.mode; + this._cache.minZ = this.minZ; + this._cache.maxZ = this.maxZ; + // Matrix + this._refreshFrustumPlanes = true; + var engine = this.getEngine(); + var scene = this.getScene(); + if (this.mode === Camera.PERSPECTIVE_CAMERA) { + this._cache.fov = this.fov; + this._cache.fovMode = this.fovMode; + this._cache.aspectRatio = engine.getAspectRatio(this); + if (this.minZ <= 0) { + this.minZ = 0.1; + } + if (scene.useRightHandedSystem) { + BABYLON.Matrix.PerspectiveFovRHToRef(this.fov, engine.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode === Camera.FOVMODE_VERTICAL_FIXED); + } + else { + BABYLON.Matrix.PerspectiveFovLHToRef(this.fov, engine.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode === Camera.FOVMODE_VERTICAL_FIXED); + } + } + else { + var halfWidth = engine.getRenderWidth() / 2.0; + var halfHeight = engine.getRenderHeight() / 2.0; + if (scene.useRightHandedSystem) { + BABYLON.Matrix.OrthoOffCenterRHToRef(this.orthoLeft || -halfWidth, this.orthoRight || halfWidth, this.orthoBottom || -halfHeight, this.orthoTop || halfHeight, this.minZ, this.maxZ, this._projectionMatrix); + } + else { + BABYLON.Matrix.OrthoOffCenterLHToRef(this.orthoLeft || -halfWidth, this.orthoRight || halfWidth, this.orthoBottom || -halfHeight, this.orthoTop || halfHeight, this.minZ, this.maxZ, this._projectionMatrix); + } + this._cache.orthoLeft = this.orthoLeft; + this._cache.orthoRight = this.orthoRight; + this._cache.orthoBottom = this.orthoBottom; + this._cache.orthoTop = this.orthoTop; + this._cache.renderWidth = engine.getRenderWidth(); + this._cache.renderHeight = engine.getRenderHeight(); + } + this.onProjectionMatrixChangedObservable.notifyObservers(this); + return this._projectionMatrix; + }; + /** + * Gets the transformation matrix (ie. the multiplication of view by projection matrices) + * @returns a Matrix + */ + Camera.prototype.getTransformationMatrix = function () { + this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix); + return this._transformMatrix; + }; + Camera.prototype._updateFrustumPlanes = function () { + if (!this._refreshFrustumPlanes) { + return; + } + this.getTransformationMatrix(); + if (!this._frustumPlanes) { + this._frustumPlanes = BABYLON.Frustum.GetPlanes(this._transformMatrix); + } + else { + BABYLON.Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes); + } + this._refreshFrustumPlanes = false; + }; + /** + * Checks if a cullable object (mesh...) is in the camera frustum + * This checks the bounding box center. See isCompletelyInFrustum for a full bounding check + * @param target The object to check + * @returns true if the object is in frustum otherwise false + */ + Camera.prototype.isInFrustum = function (target) { + this._updateFrustumPlanes(); + return target.isInFrustum(this._frustumPlanes); + }; + /** + * Checks if a cullable object (mesh...) is in the camera frustum + * Unlike isInFrustum this cheks the full bounding box + * @param target The object to check + * @returns true if the object is in frustum otherwise false + */ + Camera.prototype.isCompletelyInFrustum = function (target) { + this._updateFrustumPlanes(); + return target.isCompletelyInFrustum(this._frustumPlanes); + }; + /** + * Gets a ray in the forward direction from the camera. + * @param length Defines the length of the ray to create + * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray + * @param origin Defines the start point of the ray which defaults to the camera position + * @returns the forward ray + */ + Camera.prototype.getForwardRay = function (length, transform, origin) { + if (length === void 0) { length = 100; } + if (!transform) { + transform = this.getWorldMatrix(); + } + if (!origin) { + origin = this.position; + } + var forward = this._scene.useRightHandedSystem ? new BABYLON.Vector3(0, 0, -1) : new BABYLON.Vector3(0, 0, 1); + var forwardWorld = BABYLON.Vector3.TransformNormal(forward, transform); + var direction = BABYLON.Vector3.Normalize(forwardWorld); + return new BABYLON.Ray(origin, direction, length); + }; + /** + * Releases resources associated with this node. + * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default) + * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default) + */ + Camera.prototype.dispose = function (doNotRecurse, disposeMaterialAndTextures) { + if (disposeMaterialAndTextures === void 0) { disposeMaterialAndTextures = false; } + // Observables + this.onViewMatrixChangedObservable.clear(); + this.onProjectionMatrixChangedObservable.clear(); + this.onAfterCheckInputsObservable.clear(); + this.onRestoreStateObservable.clear(); + // Inputs + if (this.inputs) { + this.inputs.clear(); + } + // Animations + this.getScene().stopAnimation(this); + // Remove from scene + this.getScene().removeCamera(this); + while (this._rigCameras.length > 0) { + var camera = this._rigCameras.pop(); + if (camera) { + camera.dispose(); + } + } + // Postprocesses + if (this._rigPostProcess) { + this._rigPostProcess.dispose(this); + this._rigPostProcess = null; + this._postProcesses = []; + } + else if (this.cameraRigMode !== Camera.RIG_MODE_NONE) { + this._rigPostProcess = null; + this._postProcesses = []; + } + else { + var i = this._postProcesses.length; + while (--i >= 0) { + var postProcess = this._postProcesses[i]; + if (postProcess) { + postProcess.dispose(this); + } + } + } + // Render targets + var i = this.customRenderTargets.length; + while (--i >= 0) { + this.customRenderTargets[i].dispose(); + } + this.customRenderTargets = []; + // Active Meshes + this._activeMeshes.dispose(); + _super.prototype.dispose.call(this, doNotRecurse, disposeMaterialAndTextures); + }; + Object.defineProperty(Camera.prototype, "leftCamera", { + /** + * Gets the left camera of a rig setup in case of Rigged Camera + */ + get: function () { + if (this._rigCameras.length < 1) { + return null; + } + return this._rigCameras[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Camera.prototype, "rightCamera", { + /** + * Gets the right camera of a rig setup in case of Rigged Camera + */ + get: function () { + if (this._rigCameras.length < 2) { + return null; + } + return this._rigCameras[1]; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the left camera target of a rig setup in case of Rigged Camera + * @returns the target position + */ + Camera.prototype.getLeftTarget = function () { + if (this._rigCameras.length < 1) { + return null; + } + return this._rigCameras[0].getTarget(); + }; + /** + * Gets the right camera target of a rig setup in case of Rigged Camera + * @returns the target position + */ + Camera.prototype.getRightTarget = function () { + if (this._rigCameras.length < 2) { + return null; + } + return this._rigCameras[1].getTarget(); + }; + /** + * @hidden + */ + Camera.prototype.setCameraRigMode = function (mode, rigParams) { + if (this.cameraRigMode === mode) { + return; + } + while (this._rigCameras.length > 0) { + var camera = this._rigCameras.pop(); + if (camera) { + camera.dispose(); + } + } + this.cameraRigMode = mode; + this._cameraRigParams = {}; + //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target, + //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced + this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637; + this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637); + // create the rig cameras, unless none + if (this.cameraRigMode !== Camera.RIG_MODE_NONE) { + var leftCamera = this.createRigCamera(this.name + "_L", 0); + var rightCamera = this.createRigCamera(this.name + "_R", 1); + if (leftCamera && rightCamera) { + this._rigCameras.push(leftCamera); + this._rigCameras.push(rightCamera); + } + } + switch (this.cameraRigMode) { + case Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH: + this._rigCameras[0]._rigPostProcess = new BABYLON.PassPostProcess(this.name + "_passthru", 1.0, this._rigCameras[0]); + this._rigCameras[1]._rigPostProcess = new BABYLON.AnaglyphPostProcess(this.name + "_anaglyph", 1.0, this._rigCameras); + break; + case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: + case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: + case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER: + var isStereoscopicHoriz = this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED; + this._rigCameras[0]._rigPostProcess = new BABYLON.PassPostProcess(this.name + "_passthru", 1.0, this._rigCameras[0]); + this._rigCameras[1]._rigPostProcess = new BABYLON.StereoscopicInterlacePostProcess(this.name + "_stereoInterlace", this._rigCameras, isStereoscopicHoriz); + break; + case Camera.RIG_MODE_VR: + var metrics = rigParams.vrCameraMetrics || BABYLON.VRCameraMetrics.GetDefault(); + this._rigCameras[0]._cameraRigParams.vrMetrics = metrics; + this._rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0); + this._rigCameras[0]._cameraRigParams.vrWorkMatrix = new BABYLON.Matrix(); + this._rigCameras[0]._cameraRigParams.vrHMatrix = metrics.leftHMatrix; + this._rigCameras[0]._cameraRigParams.vrPreViewMatrix = metrics.leftPreViewMatrix; + this._rigCameras[0].getProjectionMatrix = this._rigCameras[0]._getVRProjectionMatrix; + this._rigCameras[1]._cameraRigParams.vrMetrics = metrics; + this._rigCameras[1].viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0); + this._rigCameras[1]._cameraRigParams.vrWorkMatrix = new BABYLON.Matrix(); + this._rigCameras[1]._cameraRigParams.vrHMatrix = metrics.rightHMatrix; + this._rigCameras[1]._cameraRigParams.vrPreViewMatrix = metrics.rightPreViewMatrix; + this._rigCameras[1].getProjectionMatrix = this._rigCameras[1]._getVRProjectionMatrix; + if (metrics.compensateDistortion) { + this._rigCameras[0]._rigPostProcess = new BABYLON.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Left", this._rigCameras[0], false, metrics); + this._rigCameras[1]._rigPostProcess = new BABYLON.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right", this._rigCameras[1], true, metrics); + } + break; + case Camera.RIG_MODE_WEBVR: + if (rigParams.vrDisplay) { + var leftEye = rigParams.vrDisplay.getEyeParameters('left'); + var rightEye = rigParams.vrDisplay.getEyeParameters('right'); + //Left eye + this._rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0); + this._rigCameras[0].setCameraRigParameter("left", true); + //leaving this for future reference + this._rigCameras[0].setCameraRigParameter("specs", rigParams.specs); + this._rigCameras[0].setCameraRigParameter("eyeParameters", leftEye); + this._rigCameras[0].setCameraRigParameter("frameData", rigParams.frameData); + this._rigCameras[0].setCameraRigParameter("parentCamera", rigParams.parentCamera); + this._rigCameras[0]._cameraRigParams.vrWorkMatrix = new BABYLON.Matrix(); + this._rigCameras[0].getProjectionMatrix = this._getWebVRProjectionMatrix; + this._rigCameras[0].parent = this; + this._rigCameras[0]._getViewMatrix = this._getWebVRViewMatrix; + //Right eye + this._rigCameras[1].viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0); + this._rigCameras[1].setCameraRigParameter('eyeParameters', rightEye); + this._rigCameras[1].setCameraRigParameter("specs", rigParams.specs); + this._rigCameras[1].setCameraRigParameter("frameData", rigParams.frameData); + this._rigCameras[1].setCameraRigParameter("parentCamera", rigParams.parentCamera); + this._rigCameras[1]._cameraRigParams.vrWorkMatrix = new BABYLON.Matrix(); + this._rigCameras[1].getProjectionMatrix = this._getWebVRProjectionMatrix; + this._rigCameras[1].parent = this; + this._rigCameras[1]._getViewMatrix = this._getWebVRViewMatrix; + if (Camera.UseAlternateWebVRRendering) { + this._rigCameras[1]._skipRendering = true; + this._rigCameras[0]._alternateCamera = this._rigCameras[1]; + } + } + break; + } + this._cascadePostProcessesToRigCams(); + this.update(); + }; + Camera.prototype._getVRProjectionMatrix = function () { + BABYLON.Matrix.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix); + this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix); + return this._projectionMatrix; + }; + Camera.prototype._updateCameraRotationMatrix = function () { + //Here for WebVR + }; + Camera.prototype._updateWebVRCameraRotationMatrix = function () { + //Here for WebVR + }; + /** + * This function MUST be overwritten by the different WebVR cameras available. + * The context in which it is running is the RIG camera. So 'this' is the TargetCamera, left or right. + */ + Camera.prototype._getWebVRProjectionMatrix = function () { + return BABYLON.Matrix.Identity(); + }; + /** + * This function MUST be overwritten by the different WebVR cameras available. + * The context in which it is running is the RIG camera. So 'this' is the TargetCamera, left or right. + */ + Camera.prototype._getWebVRViewMatrix = function () { + return BABYLON.Matrix.Identity(); + }; + /** @hidden */ + Camera.prototype.setCameraRigParameter = function (name, value) { + if (!this._cameraRigParams) { + this._cameraRigParams = {}; + } + this._cameraRigParams[name] = value; + //provisionnally: + if (name === "interaxialDistance") { + this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(value / 0.0637); + } + }; + /** + * needs to be overridden by children so sub has required properties to be copied + * @hidden + */ + Camera.prototype.createRigCamera = function (name, cameraIndex) { + return null; + }; + /** + * May need to be overridden by children + * @hidden + */ + Camera.prototype._updateRigCameras = function () { + for (var i = 0; i < this._rigCameras.length; i++) { + this._rigCameras[i].minZ = this.minZ; + this._rigCameras[i].maxZ = this.maxZ; + this._rigCameras[i].fov = this.fov; + } + // only update viewport when ANAGLYPH + if (this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH) { + this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport; + } + }; + /** @hidden */ + Camera.prototype._setupInputs = function () { + }; + /** + * Serialiaze the camera setup to a json represention + * @returns the JSON representation + */ + Camera.prototype.serialize = function () { + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + // Type + serializationObject.type = this.getClassName(); + // Parent + if (this.parent) { + serializationObject.parentId = this.parent.id; + } + if (this.inputs) { + this.inputs.serialize(serializationObject); + } + // Animations + BABYLON.Animation.AppendSerializedAnimations(this, serializationObject); + serializationObject.ranges = this.serializeAnimationRanges(); + return serializationObject; + }; + /** + * Clones the current camera. + * @param name The cloned camera name + * @returns the cloned camera + */ + Camera.prototype.clone = function (name) { + return BABYLON.SerializationHelper.Clone(Camera.GetConstructorFromName(this.getClassName(), name, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this); + }; + /** + * Gets the direction of the camera relative to a given local axis. + * @param localAxis Defines the reference axis to provide a relative direction. + * @return the direction + */ + Camera.prototype.getDirection = function (localAxis) { + var result = BABYLON.Vector3.Zero(); + this.getDirectionToRef(localAxis, result); + return result; + }; + /** + * Gets the direction of the camera relative to a given local axis into a passed vector. + * @param localAxis Defines the reference axis to provide a relative direction. + * @param result Defines the vector to store the result in + */ + Camera.prototype.getDirectionToRef = function (localAxis, result) { + BABYLON.Vector3.TransformNormalToRef(localAxis, this.getWorldMatrix(), result); + }; + /** + * Gets a camera constructor for a given camera type + * @param type The type of the camera to construct (should be equal to one of the camera class name) + * @param name The name of the camera the result will be able to instantiate + * @param scene The scene the result will construct the camera in + * @param interaxial_distance In case of stereoscopic setup, the distance between both eyes + * @param isStereoscopicSideBySide In case of stereoscopic setup, should the sereo be side b side + * @returns a factory method to construc the camera + */ + Camera.GetConstructorFromName = function (type, name, scene, interaxial_distance, isStereoscopicSideBySide) { + if (interaxial_distance === void 0) { interaxial_distance = 0; } + if (isStereoscopicSideBySide === void 0) { isStereoscopicSideBySide = true; } + var constructorFunc = BABYLON.Node.Construct(type, name, scene, { + interaxial_distance: interaxial_distance, + isStereoscopicSideBySide: isStereoscopicSideBySide + }); + if (constructorFunc) { + return constructorFunc; + } + // Default to universal camera + return function () { return new BABYLON.UniversalCamera(name, BABYLON.Vector3.Zero(), scene); }; + }; + /** + * Compute the world matrix of the camera. + * @returns the camera workd matrix + */ + Camera.prototype.computeWorldMatrix = function () { + return this.getWorldMatrix(); + }; + /** + * Parse a JSON and creates the camera from the parsed information + * @param parsedCamera The JSON to parse + * @param scene The scene to instantiate the camera in + * @returns the newly constructed camera + */ + Camera.Parse = function (parsedCamera, scene) { + var type = parsedCamera.type; + var construct = Camera.GetConstructorFromName(type, parsedCamera.name, scene, parsedCamera.interaxial_distance, parsedCamera.isStereoscopicSideBySide); + var camera = BABYLON.SerializationHelper.Parse(construct, parsedCamera, scene); + // Parent + if (parsedCamera.parentId) { + camera._waitingParentId = parsedCamera.parentId; + } + //If camera has an input manager, let it parse inputs settings + if (camera.inputs) { + camera.inputs.parse(parsedCamera); + camera._setupInputs(); + } + if (camera.setPosition) { // need to force position + camera.position.copyFromFloats(0, 0, 0); + camera.setPosition(BABYLON.Vector3.FromArray(parsedCamera.position)); + } + // Target + if (parsedCamera.target) { + if (camera.setTarget) { + camera.setTarget(BABYLON.Vector3.FromArray(parsedCamera.target)); + } + } + // Apply 3d rig, when found + if (parsedCamera.cameraRigMode) { + var rigParams = (parsedCamera.interaxial_distance) ? { interaxialDistance: parsedCamera.interaxial_distance } : {}; + camera.setCameraRigMode(parsedCamera.cameraRigMode, rigParams); + } + // Animations + if (parsedCamera.animations) { + for (var animationIndex = 0; animationIndex < parsedCamera.animations.length; animationIndex++) { + var parsedAnimation = parsedCamera.animations[animationIndex]; + camera.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + BABYLON.Node.ParseAnimationRanges(camera, parsedCamera, scene); + } + if (parsedCamera.autoAnimate) { + scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, parsedCamera.autoAnimateSpeed || 1.0); + } + return camera; + }; + /** + * This is the default projection mode used by the cameras. + * It helps recreating a feeling of perspective and better appreciate depth. + * This is the best way to simulate real life cameras. + */ + Camera.PERSPECTIVE_CAMERA = 0; + /** + * This helps creating camera with an orthographic mode. + * Orthographic is commonly used in engineering as a means to produce object specifications that communicate dimensions unambiguously, each line of 1 unit length (cm, meter..whatever) will appear to have the same length everywhere on the drawing. This allows the drafter to dimension only a subset of lines and let the reader know that other lines of that length on the drawing are also that length in reality. Every parallel line in the drawing is also parallel in the object. + */ + Camera.ORTHOGRAPHIC_CAMERA = 1; + /** + * This is the default FOV mode for perspective cameras. + * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum. + */ + Camera.FOVMODE_VERTICAL_FIXED = 0; + /** + * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum. + */ + Camera.FOVMODE_HORIZONTAL_FIXED = 1; + /** + * This specifies ther is no need for a camera rig. + * Basically only one eye is rendered corresponding to the camera. + */ + Camera.RIG_MODE_NONE = 0; + /** + * Simulates a camera Rig with one blue eye and one red eye. + * This can be use with 3d blue and red glasses. + */ + Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10; + /** + * Defines that both eyes of the camera will be rendered side by side with a parallel target. + */ + Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11; + /** + * Defines that both eyes of the camera will be rendered side by side with a none parallel target. + */ + Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12; + /** + * Defines that both eyes of the camera will be rendered over under each other. + */ + Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13; + /** + * Defines that both eyes of the camera should be renderered in a VR mode (carbox). + */ + Camera.RIG_MODE_VR = 20; + /** + * Defines that both eyes of the camera should be renderered in a VR mode (webVR). + */ + Camera.RIG_MODE_WEBVR = 21; + /** + * Defines if by default attaching controls should prevent the default javascript event to continue. + */ + Camera.ForceAttachControlToAlwaysPreventDefault = false; + /** + * @hidden + * Might be removed once multiview will be a thing + */ + Camera.UseAlternateWebVRRendering = false; + __decorate([ + BABYLON.serializeAsVector3() + ], Camera.prototype, "position", void 0); + __decorate([ + BABYLON.serializeAsVector3() + ], Camera.prototype, "upVector", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "orthoLeft", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "orthoRight", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "orthoBottom", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "orthoTop", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "fov", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "minZ", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "maxZ", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "inertia", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "mode", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "layerMask", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "fovMode", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "cameraRigMode", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "interaxialDistance", void 0); + __decorate([ + BABYLON.serialize() + ], Camera.prototype, "isStereoscopicSideBySide", void 0); + return Camera; + }(BABYLON.Node)); + BABYLON.Camera = Camera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.camera.js.map + +var BABYLON; +(function (BABYLON) { + /** + * This is the manager responsible of all the rendering for meshes sprites and particles. + * It is enable to manage the different groups as well as the different necessary sort functions. + * This should not be used directly aside of the few static configurations + */ + var RenderingManager = /** @class */ (function () { + /** + * Instantiates a new rendering group for a particular scene + * @param scene Defines the scene the groups belongs to + */ + function RenderingManager(scene) { + /** + * @hidden + */ + this._useSceneAutoClearSetup = false; + this._renderingGroups = new Array(); + this._autoClearDepthStencil = {}; + this._customOpaqueSortCompareFn = {}; + this._customAlphaTestSortCompareFn = {}; + this._customTransparentSortCompareFn = {}; + this._renderingGroupInfo = new BABYLON.RenderingGroupInfo(); + this._scene = scene; + for (var i = RenderingManager.MIN_RENDERINGGROUPS; i < RenderingManager.MAX_RENDERINGGROUPS; i++) { + this._autoClearDepthStencil[i] = { autoClear: true, depth: true, stencil: true }; + } + } + RenderingManager.prototype._clearDepthStencilBuffer = function (depth, stencil) { + if (depth === void 0) { depth = true; } + if (stencil === void 0) { stencil = true; } + if (this._depthStencilBufferAlreadyCleaned) { + return; + } + this._scene.getEngine().clear(null, false, depth, stencil); + this._depthStencilBufferAlreadyCleaned = true; + }; + /** + * Renders the entire managed groups. This is used by the scene or the different rennder targets. + * @hidden + */ + RenderingManager.prototype.render = function (customRenderFunction, activeMeshes, renderParticles, renderSprites) { + // Update the observable context (not null as it only goes away on dispose) + var info = this._renderingGroupInfo; + info.scene = this._scene; + info.camera = this._scene.activeCamera; + // Dispatch sprites + if (this._scene.spriteManagers && renderSprites) { + for (var index = 0; index < this._scene.spriteManagers.length; index++) { + var manager = this._scene.spriteManagers[index]; + this.dispatchSprites(manager); + } + } + // Render + for (var index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) { + this._depthStencilBufferAlreadyCleaned = index === RenderingManager.MIN_RENDERINGGROUPS; + var renderingGroup = this._renderingGroups[index]; + if (!renderingGroup) { + continue; + } + var renderingGroupMask = Math.pow(2, index); + info.renderingGroupId = index; + // Before Observable + this._scene.onBeforeRenderingGroupObservable.notifyObservers(info, renderingGroupMask); + // Clear depth/stencil if needed + if (RenderingManager.AUTOCLEAR) { + var autoClear = this._useSceneAutoClearSetup ? + this._scene.getAutoClearDepthStencilSetup(index) : + this._autoClearDepthStencil[index]; + if (autoClear && autoClear.autoClear) { + this._clearDepthStencilBuffer(autoClear.depth, autoClear.stencil); + } + } + // Render + for (var _i = 0, _a = this._scene._beforeRenderingGroupDrawStage; _i < _a.length; _i++) { + var step = _a[_i]; + step.action(index); + } + renderingGroup.render(customRenderFunction, renderSprites, renderParticles, activeMeshes); + for (var _b = 0, _c = this._scene._afterRenderingGroupDrawStage; _b < _c.length; _b++) { + var step = _c[_b]; + step.action(index); + } + // After Observable + this._scene.onAfterRenderingGroupObservable.notifyObservers(info, renderingGroupMask); + } + }; + /** + * Resets the different information of the group to prepare a new frame + * @hidden + */ + RenderingManager.prototype.reset = function () { + for (var index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) { + var renderingGroup = this._renderingGroups[index]; + if (renderingGroup) { + renderingGroup.prepare(); + } + } + }; + /** + * Dispose and release the group and its associated resources. + * @hidden + */ + RenderingManager.prototype.dispose = function () { + this.freeRenderingGroups(); + this._renderingGroups.length = 0; + this._renderingGroupInfo = null; + }; + /** + * Clear the info related to rendering groups preventing retention points during dispose. + */ + RenderingManager.prototype.freeRenderingGroups = function () { + for (var index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) { + var renderingGroup = this._renderingGroups[index]; + if (renderingGroup) { + renderingGroup.dispose(); + } + } + }; + RenderingManager.prototype._prepareRenderingGroup = function (renderingGroupId) { + if (this._renderingGroups[renderingGroupId] === undefined) { + this._renderingGroups[renderingGroupId] = new BABYLON.RenderingGroup(renderingGroupId, this._scene, this._customOpaqueSortCompareFn[renderingGroupId], this._customAlphaTestSortCompareFn[renderingGroupId], this._customTransparentSortCompareFn[renderingGroupId]); + } + }; + /** + * Add a sprite manager to the rendering manager in order to render it this frame. + * @param spriteManager Define the sprite manager to render + */ + RenderingManager.prototype.dispatchSprites = function (spriteManager) { + var renderingGroupId = spriteManager.renderingGroupId || 0; + this._prepareRenderingGroup(renderingGroupId); + this._renderingGroups[renderingGroupId].dispatchSprites(spriteManager); + }; + /** + * Add a particle system to the rendering manager in order to render it this frame. + * @param particleSystem Define the particle system to render + */ + RenderingManager.prototype.dispatchParticles = function (particleSystem) { + var renderingGroupId = particleSystem.renderingGroupId || 0; + this._prepareRenderingGroup(renderingGroupId); + this._renderingGroups[renderingGroupId].dispatchParticles(particleSystem); + }; + /** + * Add a submesh to the manager in order to render it this frame + * @param subMesh The submesh to dispatch + * @param mesh Optional reference to the submeshes's mesh. Provide if you have an exiting reference to improve performance. + * @param material Optional reference to the submeshes's material. Provide if you have an exiting reference to improve performance. + */ + RenderingManager.prototype.dispatch = function (subMesh, mesh, material) { + if (mesh === undefined) { + mesh = subMesh.getMesh(); + } + var renderingGroupId = mesh.renderingGroupId || 0; + this._prepareRenderingGroup(renderingGroupId); + this._renderingGroups[renderingGroupId].dispatch(subMesh, mesh, material); + }; + /** + * Overrides the default sort function applied in the renderging group to prepare the meshes. + * This allowed control for front to back rendering or reversly depending of the special needs. + * + * @param renderingGroupId The rendering group id corresponding to its index + * @param opaqueSortCompareFn The opaque queue comparison function use to sort. + * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort. + * @param transparentSortCompareFn The transparent queue comparison function use to sort. + */ + RenderingManager.prototype.setRenderingOrder = function (renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) { + if (opaqueSortCompareFn === void 0) { opaqueSortCompareFn = null; } + if (alphaTestSortCompareFn === void 0) { alphaTestSortCompareFn = null; } + if (transparentSortCompareFn === void 0) { transparentSortCompareFn = null; } + this._customOpaqueSortCompareFn[renderingGroupId] = opaqueSortCompareFn; + this._customAlphaTestSortCompareFn[renderingGroupId] = alphaTestSortCompareFn; + this._customTransparentSortCompareFn[renderingGroupId] = transparentSortCompareFn; + if (this._renderingGroups[renderingGroupId]) { + var group = this._renderingGroups[renderingGroupId]; + group.opaqueSortCompareFn = this._customOpaqueSortCompareFn[renderingGroupId]; + group.alphaTestSortCompareFn = this._customAlphaTestSortCompareFn[renderingGroupId]; + group.transparentSortCompareFn = this._customTransparentSortCompareFn[renderingGroupId]; + } + }; + /** + * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups. + * + * @param renderingGroupId The rendering group id corresponding to its index + * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true. + * @param depth Automatically clears depth between groups if true and autoClear is true. + * @param stencil Automatically clears stencil between groups if true and autoClear is true. + */ + RenderingManager.prototype.setRenderingAutoClearDepthStencil = function (renderingGroupId, autoClearDepthStencil, depth, stencil) { + if (depth === void 0) { depth = true; } + if (stencil === void 0) { stencil = true; } + this._autoClearDepthStencil[renderingGroupId] = { + autoClear: autoClearDepthStencil, + depth: depth, + stencil: stencil + }; + }; + /** + * Gets the current auto clear configuration for one rendering group of the rendering + * manager. + * @param index the rendering group index to get the information for + * @returns The auto clear setup for the requested rendering group + */ + RenderingManager.prototype.getAutoClearDepthStencilSetup = function (index) { + return this._autoClearDepthStencil[index]; + }; + /** + * The max id used for rendering groups (not included) + */ + RenderingManager.MAX_RENDERINGGROUPS = 4; + /** + * The min id used for rendering groups (included) + */ + RenderingManager.MIN_RENDERINGGROUPS = 0; + /** + * Used to globally prevent autoclearing scenes. + */ + RenderingManager.AUTOCLEAR = true; + return RenderingManager; + }()); + BABYLON.RenderingManager = RenderingManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.renderingManager.js.map + +var BABYLON; +(function (BABYLON) { + /** + * This represents the object necessary to create a rendering group. + * This is exclusively used and created by the rendering manager. + * To modify the behavior, you use the available helpers in your scene or meshes. + * @hidden + */ + var RenderingGroup = /** @class */ (function () { + /** + * Creates a new rendering group. + * @param index The rendering group index + * @param opaqueSortCompareFn The opaque sort comparison function. If null no order is applied + * @param alphaTestSortCompareFn The alpha test sort comparison function. If null no order is applied + * @param transparentSortCompareFn The transparent sort comparison function. If null back to front + alpha index sort is applied + */ + function RenderingGroup(index, scene, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) { + if (opaqueSortCompareFn === void 0) { opaqueSortCompareFn = null; } + if (alphaTestSortCompareFn === void 0) { alphaTestSortCompareFn = null; } + if (transparentSortCompareFn === void 0) { transparentSortCompareFn = null; } + this.index = index; + this._opaqueSubMeshes = new BABYLON.SmartArray(256); + this._transparentSubMeshes = new BABYLON.SmartArray(256); + this._alphaTestSubMeshes = new BABYLON.SmartArray(256); + this._depthOnlySubMeshes = new BABYLON.SmartArray(256); + this._particleSystems = new BABYLON.SmartArray(256); + this._spriteManagers = new BABYLON.SmartArray(256); + this._edgesRenderers = new BABYLON.SmartArray(16); + this._scene = scene; + this.opaqueSortCompareFn = opaqueSortCompareFn; + this.alphaTestSortCompareFn = alphaTestSortCompareFn; + this.transparentSortCompareFn = transparentSortCompareFn; + } + Object.defineProperty(RenderingGroup.prototype, "opaqueSortCompareFn", { + /** + * Set the opaque sort comparison function. + * If null the sub meshes will be render in the order they were created + */ + set: function (value) { + this._opaqueSortCompareFn = value; + if (value) { + this._renderOpaque = this.renderOpaqueSorted; + } + else { + this._renderOpaque = RenderingGroup.renderUnsorted; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RenderingGroup.prototype, "alphaTestSortCompareFn", { + /** + * Set the alpha test sort comparison function. + * If null the sub meshes will be render in the order they were created + */ + set: function (value) { + this._alphaTestSortCompareFn = value; + if (value) { + this._renderAlphaTest = this.renderAlphaTestSorted; + } + else { + this._renderAlphaTest = RenderingGroup.renderUnsorted; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RenderingGroup.prototype, "transparentSortCompareFn", { + /** + * Set the transparent sort comparison function. + * If null the sub meshes will be render in the order they were created + */ + set: function (value) { + if (value) { + this._transparentSortCompareFn = value; + } + else { + this._transparentSortCompareFn = RenderingGroup.defaultTransparentSortCompare; + } + this._renderTransparent = this.renderTransparentSorted; + }, + enumerable: true, + configurable: true + }); + /** + * Render all the sub meshes contained in the group. + * @param customRenderFunction Used to override the default render behaviour of the group. + * @returns true if rendered some submeshes. + */ + RenderingGroup.prototype.render = function (customRenderFunction, renderSprites, renderParticles, activeMeshes) { + if (customRenderFunction) { + customRenderFunction(this._opaqueSubMeshes, this._alphaTestSubMeshes, this._transparentSubMeshes, this._depthOnlySubMeshes); + return; + } + var engine = this._scene.getEngine(); + // Depth only + if (this._depthOnlySubMeshes.length !== 0) { + engine.setColorWrite(false); + this._renderAlphaTest(this._depthOnlySubMeshes); + engine.setColorWrite(true); + } + // Opaque + if (this._opaqueSubMeshes.length !== 0) { + this._renderOpaque(this._opaqueSubMeshes); + } + // Alpha test + if (this._alphaTestSubMeshes.length !== 0) { + this._renderAlphaTest(this._alphaTestSubMeshes); + } + var stencilState = engine.getStencilBuffer(); + engine.setStencilBuffer(false); + // Sprites + if (renderSprites) { + this._renderSprites(); + } + // Particles + if (renderParticles) { + this._renderParticles(activeMeshes); + } + if (this.onBeforeTransparentRendering) { + this.onBeforeTransparentRendering(); + } + // Transparent + if (this._transparentSubMeshes.length !== 0) { + this._renderTransparent(this._transparentSubMeshes); + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + } + // Set back stencil to false in case it changes before the edge renderer. + engine.setStencilBuffer(false); + // Edges + if (this._edgesRenderers.length) { + for (var edgesRendererIndex = 0; edgesRendererIndex < this._edgesRenderers.length; edgesRendererIndex++) { + this._edgesRenderers.data[edgesRendererIndex].render(); + } + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + } + // Restore Stencil state. + engine.setStencilBuffer(stencilState); + }; + /** + * Renders the opaque submeshes in the order from the opaqueSortCompareFn. + * @param subMeshes The submeshes to render + */ + RenderingGroup.prototype.renderOpaqueSorted = function (subMeshes) { + return RenderingGroup.renderSorted(subMeshes, this._opaqueSortCompareFn, this._scene.activeCamera, false); + }; + /** + * Renders the opaque submeshes in the order from the alphatestSortCompareFn. + * @param subMeshes The submeshes to render + */ + RenderingGroup.prototype.renderAlphaTestSorted = function (subMeshes) { + return RenderingGroup.renderSorted(subMeshes, this._alphaTestSortCompareFn, this._scene.activeCamera, false); + }; + /** + * Renders the opaque submeshes in the order from the transparentSortCompareFn. + * @param subMeshes The submeshes to render + */ + RenderingGroup.prototype.renderTransparentSorted = function (subMeshes) { + return RenderingGroup.renderSorted(subMeshes, this._transparentSortCompareFn, this._scene.activeCamera, true); + }; + /** + * Renders the submeshes in a specified order. + * @param subMeshes The submeshes to sort before render + * @param sortCompareFn The comparison function use to sort + * @param cameraPosition The camera position use to preprocess the submeshes to help sorting + * @param transparent Specifies to activate blending if true + */ + RenderingGroup.renderSorted = function (subMeshes, sortCompareFn, camera, transparent) { + var subIndex = 0; + var subMesh; + var cameraPosition = camera ? camera.globalPosition : BABYLON.Vector3.Zero(); + for (; subIndex < subMeshes.length; subIndex++) { + subMesh = subMeshes.data[subIndex]; + subMesh._alphaIndex = subMesh.getMesh().alphaIndex; + subMesh._distanceToCamera = subMesh.getBoundingInfo().boundingSphere.centerWorld.subtract(cameraPosition).length(); + } + var sortedArray = subMeshes.data.slice(0, subMeshes.length); + if (sortCompareFn) { + sortedArray.sort(sortCompareFn); + } + for (subIndex = 0; subIndex < sortedArray.length; subIndex++) { + subMesh = sortedArray[subIndex]; + if (transparent) { + var material = subMesh.getMaterial(); + if (material && material.needDepthPrePass) { + var engine = material.getScene().getEngine(); + engine.setColorWrite(false); + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + subMesh.render(false); + engine.setColorWrite(true); + } + } + subMesh.render(transparent); + } + }; + /** + * Renders the submeshes in the order they were dispatched (no sort applied). + * @param subMeshes The submeshes to render + */ + RenderingGroup.renderUnsorted = function (subMeshes) { + for (var subIndex = 0; subIndex < subMeshes.length; subIndex++) { + var submesh = subMeshes.data[subIndex]; + submesh.render(false); + } + }; + /** + * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent) + * are rendered back to front if in the same alpha index. + * + * @param a The first submesh + * @param b The second submesh + * @returns The result of the comparison + */ + RenderingGroup.defaultTransparentSortCompare = function (a, b) { + // Alpha index first + if (a._alphaIndex > b._alphaIndex) { + return 1; + } + if (a._alphaIndex < b._alphaIndex) { + return -1; + } + // Then distance to camera + return RenderingGroup.backToFrontSortCompare(a, b); + }; + /** + * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent) + * are rendered back to front. + * + * @param a The first submesh + * @param b The second submesh + * @returns The result of the comparison + */ + RenderingGroup.backToFrontSortCompare = function (a, b) { + // Then distance to camera + if (a._distanceToCamera < b._distanceToCamera) { + return 1; + } + if (a._distanceToCamera > b._distanceToCamera) { + return -1; + } + return 0; + }; + /** + * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent) + * are rendered front to back (prevent overdraw). + * + * @param a The first submesh + * @param b The second submesh + * @returns The result of the comparison + */ + RenderingGroup.frontToBackSortCompare = function (a, b) { + // Then distance to camera + if (a._distanceToCamera < b._distanceToCamera) { + return -1; + } + if (a._distanceToCamera > b._distanceToCamera) { + return 1; + } + return 0; + }; + /** + * Resets the different lists of submeshes to prepare a new frame. + */ + RenderingGroup.prototype.prepare = function () { + this._opaqueSubMeshes.reset(); + this._transparentSubMeshes.reset(); + this._alphaTestSubMeshes.reset(); + this._depthOnlySubMeshes.reset(); + this._particleSystems.reset(); + this._spriteManagers.reset(); + this._edgesRenderers.reset(); + }; + RenderingGroup.prototype.dispose = function () { + this._opaqueSubMeshes.dispose(); + this._transparentSubMeshes.dispose(); + this._alphaTestSubMeshes.dispose(); + this._depthOnlySubMeshes.dispose(); + this._particleSystems.dispose(); + this._spriteManagers.dispose(); + this._edgesRenderers.dispose(); + }; + /** + * Inserts the submesh in its correct queue depending on its material. + * @param subMesh The submesh to dispatch + * @param [mesh] Optional reference to the submeshes's mesh. Provide if you have an exiting reference to improve performance. + * @param [material] Optional reference to the submeshes's material. Provide if you have an exiting reference to improve performance. + */ + RenderingGroup.prototype.dispatch = function (subMesh, mesh, material) { + // Get mesh and materials if not provided + if (mesh === undefined) { + mesh = subMesh.getMesh(); + } + if (material === undefined) { + material = subMesh.getMaterial(); + } + if (material === null || material === undefined) { + return; + } + if (material.needAlphaBlendingForMesh(mesh)) { // Transparent + this._transparentSubMeshes.push(subMesh); + } + else if (material.needAlphaTesting()) { // Alpha test + if (material.needDepthPrePass) { + this._depthOnlySubMeshes.push(subMesh); + } + this._alphaTestSubMeshes.push(subMesh); + } + else { + if (material.needDepthPrePass) { + this._depthOnlySubMeshes.push(subMesh); + } + this._opaqueSubMeshes.push(subMesh); // Opaque + } + if (mesh._edgesRenderer && mesh._edgesRenderer.isEnabled) { + this._edgesRenderers.push(mesh._edgesRenderer); + } + }; + RenderingGroup.prototype.dispatchSprites = function (spriteManager) { + this._spriteManagers.push(spriteManager); + }; + RenderingGroup.prototype.dispatchParticles = function (particleSystem) { + this._particleSystems.push(particleSystem); + }; + RenderingGroup.prototype._renderParticles = function (activeMeshes) { + if (this._particleSystems.length === 0) { + return; + } + // Particles + var activeCamera = this._scene.activeCamera; + this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene); + for (var particleIndex = 0; particleIndex < this._particleSystems.length; particleIndex++) { + var particleSystem = this._particleSystems.data[particleIndex]; + if ((activeCamera && activeCamera.layerMask & particleSystem.layerMask) === 0) { + continue; + } + var emitter = particleSystem.emitter; + if (!emitter.position || !activeMeshes || activeMeshes.indexOf(emitter) !== -1) { + this._scene._activeParticles.addCount(particleSystem.render(), false); + } + } + this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene); + }; + RenderingGroup.prototype._renderSprites = function () { + if (!this._scene.spritesEnabled || this._spriteManagers.length === 0) { + return; + } + // Sprites + var activeCamera = this._scene.activeCamera; + this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene); + for (var id = 0; id < this._spriteManagers.length; id++) { + var spriteManager = this._spriteManagers.data[id]; + if (((activeCamera && activeCamera.layerMask & spriteManager.layerMask) !== 0)) { + spriteManager.render(); + } + } + this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene); + }; + return RenderingGroup; + }()); + BABYLON.RenderingGroup = RenderingGroup; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.renderingGroup.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Groups all the scene component constants in one place to ease maintenance. + * @hidden + */ + var SceneComponentConstants = /** @class */ (function () { + function SceneComponentConstants() { + } + SceneComponentConstants.NAME_EFFECTLAYER = "EffectLayer"; + SceneComponentConstants.NAME_LAYER = "Layer"; + SceneComponentConstants.NAME_LENSFLARESYSTEM = "LensFlareSystem"; + SceneComponentConstants.NAME_BOUNDINGBOXRENDERER = "BoundingBoxRenderer"; + SceneComponentConstants.NAME_PARTICLESYSTEM = "ParticleSystem"; + SceneComponentConstants.NAME_GAMEPAD = "Gamepad"; + SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE = "SimplificationQueue"; + SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER = "GeometryBufferRenderer"; + SceneComponentConstants.NAME_DEPTHRENDERER = "DepthRenderer"; + SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER = "PostProcessRenderPipelineManager"; + SceneComponentConstants.NAME_SPRITE = "Sprite"; + SceneComponentConstants.NAME_OUTLINERENDERER = "Outline"; + SceneComponentConstants.NAME_PROCEDURALTEXTURE = "ProceduralTexture"; + SceneComponentConstants.NAME_SHADOWGENERATOR = "ShadowGenerator"; + SceneComponentConstants.NAME_OCTREE = "Octree"; + SceneComponentConstants.NAME_PHYSICSENGINE = "PhysicsEngine"; + SceneComponentConstants.NAME_AUDIO = "Audio"; + SceneComponentConstants.STEP_ISREADYFORMESH_EFFECTLAYER = 0; + SceneComponentConstants.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0; + SceneComponentConstants.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0; + SceneComponentConstants.STEP_ACTIVEMESH_BOUNDINGBOXRENDERER = 0; + SceneComponentConstants.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1; + SceneComponentConstants.STEP_BEFORECAMERADRAW_EFFECTLAYER = 0; + SceneComponentConstants.STEP_BEFORECAMERADRAW_LAYER = 1; + SceneComponentConstants.STEP_BEFORERENDERINGMESH_OUTLINE = 0; + SceneComponentConstants.STEP_AFTERRENDERINGMESH_OUTLINE = 0; + SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0; + SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1; + SceneComponentConstants.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0; + SceneComponentConstants.STEP_BEFORECAMERAUPDATE_GAMEPAD = 1; + SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0; + SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER = 0; + SceneComponentConstants.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 1; + SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 2; + SceneComponentConstants.STEP_AFTERCAMERADRAW_LAYER = 3; + SceneComponentConstants.STEP_AFTERRENDER_AUDIO = 0; + SceneComponentConstants.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 0; + SceneComponentConstants.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1; + SceneComponentConstants.STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 2; + SceneComponentConstants.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3; + SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0; + SceneComponentConstants.STEP_POINTERMOVE_SPRITE = 0; + SceneComponentConstants.STEP_POINTERDOWN_SPRITE = 0; + SceneComponentConstants.STEP_POINTERUP_SPRITE = 0; + return SceneComponentConstants; + }()); + BABYLON.SceneComponentConstants = SceneComponentConstants; + /** + * Repressentation of a stage in the scene (Basically a list of ordered steps) + * @hidden + */ + var Stage = /** @class */ (function (_super) { + __extends(Stage, _super); + /** + * Hide ctor from the rest of the world. + * @param items The items to add. + */ + function Stage(items) { + return _super.apply(this, items) || this; + } + /** + * Creates a new Stage. + * @returns A new instance of a Stage + */ + Stage.Create = function () { + return Object.create(Stage.prototype); + }; + /** + * Registers a step in an ordered way in the targeted stage. + * @param index Defines the position to register the step in + * @param component Defines the component attached to the step + * @param action Defines the action to launch during the step + */ + Stage.prototype.registerStep = function (index, component, action) { + var i = 0; + var maxIndex = Number.MAX_VALUE; + for (; i < this.length; i++) { + var step = this[i]; + maxIndex = step.index; + if (index < maxIndex) { + break; + } + } + this.splice(i, 0, { index: index, component: component, action: action.bind(component) }); + }; + /** + * Clears all the steps from the stage. + */ + Stage.prototype.clear = function () { + this.length = 0; + }; + return Stage; + }(Array)); + BABYLON.Stage = Stage; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.sceneComponent.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Base class of the scene acting as a container for the different elements composing a scene. + * This class is dynamically extended by the different components of the scene increasing + * flexibility and reducing coupling + */ + var AbstractScene = /** @class */ (function () { + function AbstractScene() { + /** + * Gets the list of root nodes (ie. nodes with no parent) + */ + this.rootNodes = new Array(); + /** All of the cameras added to this scene + * @see http://doc.babylonjs.com/babylon101/cameras + */ + this.cameras = new Array(); + /** + * All of the lights added to this scene + * @see http://doc.babylonjs.com/babylon101/lights + */ + this.lights = new Array(); + /** + * All of the (abstract) meshes added to this scene + */ + this.meshes = new Array(); + /** + * The list of skeletons added to the scene + * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons + */ + this.skeletons = new Array(); + /** + * All of the particle systems added to this scene + * @see http://doc.babylonjs.com/babylon101/particles + */ + this.particleSystems = new Array(); + /** + * Gets a list of Animations associated with the scene + */ + this.animations = []; + /** + * All of the animation groups added to this scene + * @see http://doc.babylonjs.com/how_to/group + */ + this.animationGroups = new Array(); + /** + * All of the multi-materials added to this scene + * @see http://doc.babylonjs.com/how_to/multi_materials + */ + this.multiMaterials = new Array(); + /** + * All of the materials added to this scene + * @see http://doc.babylonjs.com/babylon101/materials + */ + this.materials = new Array(); + /** + * The list of morph target managers added to the scene + * @see http://doc.babylonjs.com/how_to/how_to_dynamically_morph_a_mesh + */ + this.morphTargetManagers = new Array(); + /** + * The list of geometries used in the scene. + */ + this.geometries = new Array(); + /** + * All of the tranform nodes added to this scene + * @see http://doc.babylonjs.com/how_to/transformnode + */ + this.transformNodes = new Array(); + /** + * ActionManagers available on the scene. + */ + this.actionManagers = new Array(); + /** + * Textures to keep. + */ + this.textures = new Array(); + } + /** + * Adds a parser in the list of available ones + * @param name Defines the name of the parser + * @param parser Defines the parser to add + */ + AbstractScene.AddParser = function (name, parser) { + this._BabylonFileParsers[name] = parser; + }; + /** + * Gets a general parser from the list of avaialble ones + * @param name Defines the name of the parser + * @returns the requested parser or null + */ + AbstractScene.GetParser = function (name) { + if (this._BabylonFileParsers[name]) { + return this._BabylonFileParsers[name]; + } + return null; + }; + /** + * Adds n individual parser in the list of available ones + * @param name Defines the name of the parser + * @param parser Defines the parser to add + */ + AbstractScene.AddIndividualParser = function (name, parser) { + this._IndividualBabylonFileParsers[name] = parser; + }; + /** + * Gets an individual parser from the list of avaialble ones + * @param name Defines the name of the parser + * @returns the requested parser or null + */ + AbstractScene.GetIndividualParser = function (name) { + if (this._IndividualBabylonFileParsers[name]) { + return this._IndividualBabylonFileParsers[name]; + } + return null; + }; + /** + * Parser json data and populate both a scene and its associated container object + * @param jsonData Defines the data to parse + * @param scene Defines the scene to parse the data for + * @param container Defines the container attached to the parsing sequence + * @param rootUrl Defines the root url of the data + */ + AbstractScene.Parse = function (jsonData, scene, container, rootUrl) { + for (var parserName in this._BabylonFileParsers) { + if (this._BabylonFileParsers.hasOwnProperty(parserName)) { + this._BabylonFileParsers[parserName](jsonData, scene, container, rootUrl); + } + } + }; + /** + * Stores the list of available parsers in the application. + */ + AbstractScene._BabylonFileParsers = {}; + /** + * Stores the list of available individual parsers in the application. + */ + AbstractScene._IndividualBabylonFileParsers = {}; + return AbstractScene; + }()); + BABYLON.AbstractScene = AbstractScene; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.abstractScene.js.map + + +var BABYLON; +(function (BABYLON) { + /** @hidden */ + var ClickInfo = /** @class */ (function () { + function ClickInfo() { + this._singleClick = false; + this._doubleClick = false; + this._hasSwiped = false; + this._ignore = false; + } + Object.defineProperty(ClickInfo.prototype, "singleClick", { + get: function () { + return this._singleClick; + }, + set: function (b) { + this._singleClick = b; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClickInfo.prototype, "doubleClick", { + get: function () { + return this._doubleClick; + }, + set: function (b) { + this._doubleClick = b; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClickInfo.prototype, "hasSwiped", { + get: function () { + return this._hasSwiped; + }, + set: function (b) { + this._hasSwiped = b; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClickInfo.prototype, "ignore", { + get: function () { + return this._ignore; + }, + set: function (b) { + this._ignore = b; + }, + enumerable: true, + configurable: true + }); + return ClickInfo; + }()); + /** + * This class is used by the onRenderingGroupObservable + */ + var RenderingGroupInfo = /** @class */ (function () { + function RenderingGroupInfo() { + } + return RenderingGroupInfo; + }()); + BABYLON.RenderingGroupInfo = RenderingGroupInfo; + /** + * Represents a scene to be rendered by the engine. + * @see http://doc.babylonjs.com/features/scene + */ + var Scene = /** @class */ (function (_super) { + __extends(Scene, _super); + /** + * Creates a new Scene + * @param engine defines the engine to use to render this scene + */ + function Scene(engine) { + var _this = _super.call(this) || this; + // Members + /** + * Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame + */ + _this.autoClear = true; + /** + * Gets or sets a boolean that indicates if the scene must clear the depth and stencil buffers before rendering a frame + */ + _this.autoClearDepthAndStencil = true; + /** + * Defines the color used to clear the render buffer (Default is (0.2, 0.2, 0.3, 1.0)) + */ + _this.clearColor = new BABYLON.Color4(0.2, 0.2, 0.3, 1.0); + /** + * Defines the color used to simulate the ambient color (Default is (0, 0, 0)) + */ + _this.ambientColor = new BABYLON.Color3(0, 0, 0); + _this._forceWireframe = false; + _this._forcePointsCloud = false; + /** + * Gets or sets a boolean indicating if animations are enabled + */ + _this.animationsEnabled = true; + _this._animationPropertiesOverride = null; + /** + * Gets or sets a boolean indicating if a constant deltatime has to be used + * This is mostly useful for testing purposes when you do not want the animations to scale with the framerate + */ + _this.useConstantAnimationDeltaTime = false; + /** + * Gets or sets a boolean indicating if the scene must keep the meshUnderPointer property updated + * Please note that it requires to run a ray cast through the scene on every frame + */ + _this.constantlyUpdateMeshUnderPointer = false; + /** + * Defines the HTML cursor to use when hovering over interactive elements + */ + _this.hoverCursor = "pointer"; + /** + * Defines the HTML default cursor to use (empty by default) + */ + _this.defaultCursor = ""; + /** + * This is used to call preventDefault() on pointer down + * in order to block unwanted artifacts like system double clicks + */ + _this.preventDefaultOnPointerDown = true; + // Metadata + /** + * Gets or sets user defined metadata + */ + _this.metadata = null; + /** + * Use this array to add regular expressions used to disable offline support for specific urls + */ + _this.disableOfflineSupportExceptionRules = new Array(); + /** + * An event triggered when the scene is disposed. + */ + _this.onDisposeObservable = new BABYLON.Observable(); + _this._onDisposeObserver = null; + /** + * An event triggered before rendering the scene (right after animations and physics) + */ + _this.onBeforeRenderObservable = new BABYLON.Observable(); + _this._onBeforeRenderObserver = null; + /** + * An event triggered after rendering the scene + */ + _this.onAfterRenderObservable = new BABYLON.Observable(); + _this._onAfterRenderObserver = null; + /** + * An event triggered before animating the scene + */ + _this.onBeforeAnimationsObservable = new BABYLON.Observable(); + /** + * An event triggered after animations processing + */ + _this.onAfterAnimationsObservable = new BABYLON.Observable(); + /** + * An event triggered before draw calls are ready to be sent + */ + _this.onBeforeDrawPhaseObservable = new BABYLON.Observable(); + /** + * An event triggered after draw calls have been sent + */ + _this.onAfterDrawPhaseObservable = new BABYLON.Observable(); + /** + * An event triggered when the scene is ready + */ + _this.onReadyObservable = new BABYLON.Observable(); + /** + * An event triggered before rendering a camera + */ + _this.onBeforeCameraRenderObservable = new BABYLON.Observable(); + _this._onBeforeCameraRenderObserver = null; + /** + * An event triggered after rendering a camera + */ + _this.onAfterCameraRenderObservable = new BABYLON.Observable(); + _this._onAfterCameraRenderObserver = null; + /** + * An event triggered when active meshes evaluation is about to start + */ + _this.onBeforeActiveMeshesEvaluationObservable = new BABYLON.Observable(); + /** + * An event triggered when active meshes evaluation is done + */ + _this.onAfterActiveMeshesEvaluationObservable = new BABYLON.Observable(); + /** + * An event triggered when particles rendering is about to start + * Note: This event can be trigger more than once per frame (because particles can be rendered by render target textures as well) + */ + _this.onBeforeParticlesRenderingObservable = new BABYLON.Observable(); + /** + * An event triggered when particles rendering is done + * Note: This event can be trigger more than once per frame (because particles can be rendered by render target textures as well) + */ + _this.onAfterParticlesRenderingObservable = new BABYLON.Observable(); + /** + * An event triggered when SceneLoader.Append or SceneLoader.Load or SceneLoader.ImportMesh were successfully executed + */ + _this.onDataLoadedObservable = new BABYLON.Observable(); + /** + * An event triggered when a camera is created + */ + _this.onNewCameraAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a camera is removed + */ + _this.onCameraRemovedObservable = new BABYLON.Observable(); + /** + * An event triggered when a light is created + */ + _this.onNewLightAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a light is removed + */ + _this.onLightRemovedObservable = new BABYLON.Observable(); + /** + * An event triggered when a geometry is created + */ + _this.onNewGeometryAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a geometry is removed + */ + _this.onGeometryRemovedObservable = new BABYLON.Observable(); + /** + * An event triggered when a transform node is created + */ + _this.onNewTransformNodeAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a transform node is removed + */ + _this.onTransformNodeRemovedObservable = new BABYLON.Observable(); + /** + * An event triggered when a mesh is created + */ + _this.onNewMeshAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a mesh is removed + */ + _this.onMeshRemovedObservable = new BABYLON.Observable(); + /** + * An event triggered when a material is created + */ + _this.onNewMaterialAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a material is removed + */ + _this.onMaterialRemovedObservable = new BABYLON.Observable(); + /** + * An event triggered when a texture is created + */ + _this.onNewTextureAddedObservable = new BABYLON.Observable(); + /** + * An event triggered when a texture is removed + */ + _this.onTextureRemovedObservable = new BABYLON.Observable(); + /** + * An event triggered when render targets are about to be rendered + * Can happen multiple times per frame. + */ + _this.onBeforeRenderTargetsRenderObservable = new BABYLON.Observable(); + /** + * An event triggered when render targets were rendered. + * Can happen multiple times per frame. + */ + _this.onAfterRenderTargetsRenderObservable = new BABYLON.Observable(); + /** + * An event triggered before calculating deterministic simulation step + */ + _this.onBeforeStepObservable = new BABYLON.Observable(); + /** + * An event triggered after calculating deterministic simulation step + */ + _this.onAfterStepObservable = new BABYLON.Observable(); + /** + * This Observable will be triggered before rendering each renderingGroup of each rendered camera. + * The RenderinGroupInfo class contains all the information about the context in which the observable is called + * If you wish to register an Observer only for a given set of renderingGroup, use the mask with a combination of the renderingGroup index elevated to the power of two (1 for renderingGroup 0, 2 for renderingrOup1, 4 for 2 and 8 for 3) + */ + _this.onBeforeRenderingGroupObservable = new BABYLON.Observable(); + /** + * This Observable will be triggered after rendering each renderingGroup of each rendered camera. + * The RenderinGroupInfo class contains all the information about the context in which the observable is called + * If you wish to register an Observer only for a given set of renderingGroup, use the mask with a combination of the renderingGroup index elevated to the power of two (1 for renderingGroup 0, 2 for renderingrOup1, 4 for 2 and 8 for 3) + */ + _this.onAfterRenderingGroupObservable = new BABYLON.Observable(); + /** + * This Observable will when a mesh has been imported into the scene. + */ + _this.onMeshImportedObservable = new BABYLON.Observable(); + // Animations + _this._registeredForLateAnimationBindings = new BABYLON.SmartArrayNoDuplicate(256); + /** + * This observable event is triggered when any ponter event is triggered. It is registered during Scene.attachControl() and it is called BEFORE the 3D engine process anything (mesh/sprite picking for instance). + * You have the possibility to skip the process and the call to onPointerObservable by setting PointerInfoPre.skipOnPointerObservable to true + */ + _this.onPrePointerObservable = new BABYLON.Observable(); + /** + * Observable event triggered each time an input event is received from the rendering canvas + */ + _this.onPointerObservable = new BABYLON.Observable(); + _this._meshPickProceed = false; + _this._currentPickResult = null; + _this._previousPickResult = null; + _this._totalPointersPressed = 0; + _this._doubleClickOccured = false; + /** Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position */ + _this.cameraToUseForPointers = null; + _this._pointerX = 0; + _this._pointerY = 0; + _this._startingPointerPosition = new BABYLON.Vector2(0, 0); + _this._previousStartingPointerPosition = new BABYLON.Vector2(0, 0); + _this._startingPointerTime = 0; + _this._previousStartingPointerTime = 0; + _this._pointerCaptures = {}; + // Deterministic lockstep + _this._timeAccumulator = 0; + _this._currentStepId = 0; + _this._currentInternalStep = 0; + // Keyboard + /** + * This observable event is triggered when any keyboard event si raised and registered during Scene.attachControl() + * You have the possibility to skip the process and the call to onKeyboardObservable by setting KeyboardInfoPre.skipOnPointerObservable to true + */ + _this.onPreKeyboardObservable = new BABYLON.Observable(); + /** + * Observable event triggered each time an keyboard event is received from the hosting window + */ + _this.onKeyboardObservable = new BABYLON.Observable(); + // Coordinates system + _this._useRightHandedSystem = false; + // Fog + _this._fogEnabled = true; + _this._fogMode = Scene.FOGMODE_NONE; + /** + * Gets or sets the fog color to use + * @see http://doc.babylonjs.com/babylon101/environment#fog + * (Default is Color3(0.2, 0.2, 0.3)) + */ + _this.fogColor = new BABYLON.Color3(0.2, 0.2, 0.3); + /** + * Gets or sets the fog density to use + * @see http://doc.babylonjs.com/babylon101/environment#fog + * (Default is 0.1) + */ + _this.fogDensity = 0.1; + /** + * Gets or sets the fog start distance to use + * @see http://doc.babylonjs.com/babylon101/environment#fog + * (Default is 0) + */ + _this.fogStart = 0; + /** + * Gets or sets the fog end distance to use + * @see http://doc.babylonjs.com/babylon101/environment#fog + * (Default is 1000) + */ + _this.fogEnd = 1000.0; + // Lights + _this._shadowsEnabled = true; + _this._lightsEnabled = true; + /** All of the active cameras added to this scene. */ + _this.activeCameras = new Array(); + // Textures + _this._texturesEnabled = true; + // Particles + /** + * Gets or sets a boolean indicating if particles are enabled on this scene + */ + _this.particlesEnabled = true; + // Sprites + /** + * Gets or sets a boolean indicating if sprites are enabled on this scene + */ + _this.spritesEnabled = true; + // Skeletons + _this._skeletonsEnabled = true; + // Lens flares + /** + * Gets or sets a boolean indicating if lens flares are enabled on this scene + */ + _this.lensFlaresEnabled = true; + // Collisions + /** + * Gets or sets a boolean indicating if collisions are enabled on this scene + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity + */ + _this.collisionsEnabled = true; + /** + * Defines the gravity applied to this scene (used only for collisions) + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity + */ + _this.gravity = new BABYLON.Vector3(0, -9.807, 0); + // Postprocesses + /** + * Gets or sets a boolean indicating if postprocesses are enabled on this scene + */ + _this.postProcessesEnabled = true; + /** + * The list of postprocesses added to the scene + */ + _this.postProcesses = new Array(); + // Customs render targets + /** + * Gets or sets a boolean indicating if render targets are enabled on this scene + */ + _this.renderTargetsEnabled = true; + /** + * Gets or sets a boolean indicating if next render targets must be dumped as image for debugging purposes + * We recommend not using it and instead rely on Spector.js: http://spector.babylonjs.com + */ + _this.dumpNextRenderTargets = false; + /** + * The list of user defined render targets added to the scene + */ + _this.customRenderTargets = new Array(); + /** + * Gets the list of meshes imported to the scene through SceneLoader + */ + _this.importedMeshesFiles = new Array(); + // Probes + /** + * Gets or sets a boolean indicating if probes are enabled on this scene + */ + _this.probesEnabled = true; + _this._meshesForIntersections = new BABYLON.SmartArrayNoDuplicate(256); + // Procedural textures + /** + * Gets or sets a boolean indicating if procedural textures are enabled on this scene + */ + _this.proceduralTexturesEnabled = true; + // Performance counters + _this._totalVertices = new BABYLON.PerfCounter(); + /** @hidden */ + _this._activeIndices = new BABYLON.PerfCounter(); + /** @hidden */ + _this._activeParticles = new BABYLON.PerfCounter(); + /** @hidden */ + _this._activeBones = new BABYLON.PerfCounter(); + _this._animationTime = 0; + /** + * Gets or sets a general scale for animation speed + * @see https://www.babylonjs-playground.com/#IBU2W7#3 + */ + _this.animationTimeScale = 1; + _this._renderId = 0; + _this._frameId = 0; + _this._executeWhenReadyTimeoutId = -1; + _this._intermediateRendering = false; + _this._viewUpdateFlag = -1; + _this._projectionUpdateFlag = -1; + _this._alternateViewUpdateFlag = -1; + _this._alternateProjectionUpdateFlag = -1; + /** @hidden */ + _this._toBeDisposed = new Array(256); + _this._activeRequests = new Array(); + _this._pendingData = new Array(); + _this._isDisposed = false; + /** + * Gets or sets a boolean indicating that all submeshes of active meshes must be rendered + * Use this boolean to avoid computing frustum clipping on submeshes (This could help when you are CPU bound) + */ + _this.dispatchAllSubMeshesOfActiveMeshes = false; + _this._activeMeshes = new BABYLON.SmartArray(256); + _this._processedMaterials = new BABYLON.SmartArray(256); + _this._renderTargets = new BABYLON.SmartArrayNoDuplicate(256); + /** @hidden */ + _this._activeParticleSystems = new BABYLON.SmartArray(256); + _this._activeSkeletons = new BABYLON.SmartArrayNoDuplicate(32); + _this._softwareSkinnedMeshes = new BABYLON.SmartArrayNoDuplicate(32); + /** @hidden */ + _this._activeAnimatables = new Array(); + _this._transformMatrix = BABYLON.Matrix.Zero(); + _this._useAlternateCameraConfiguration = false; + _this._alternateRendering = false; + /** + * Gets or sets a boolean indicating if lights must be sorted by priority (off by default) + * This is useful if there are more lights that the maximum simulteanous authorized + */ + _this.requireLightSorting = false; + /** + * @hidden + * Backing store of defined scene components. + */ + _this._components = []; + /** + * @hidden + * Backing store of defined scene components. + */ + _this._serializableComponents = []; + /** + * List of components to register on the next registration step. + */ + _this._transientComponents = []; + /** + * @hidden + * Defines the actions happening before camera updates. + */ + _this._beforeCameraUpdateStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening before clear the canvas. + */ + _this._beforeClearStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions when collecting render targets for the frame. + */ + _this._gatherRenderTargetsStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening for one camera in the frame. + */ + _this._gatherActiveCameraRenderTargetsStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening during the per mesh ready checks. + */ + _this._isReadyForMeshStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening before evaluate active mesh checks. + */ + _this._beforeEvaluateActiveMeshStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening during the evaluate sub mesh checks. + */ + _this._evaluateSubMeshStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening during the active mesh stage. + */ + _this._activeMeshStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening during the per camera render target step. + */ + _this._cameraDrawRenderTargetStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening just before the active camera is drawing. + */ + _this._beforeCameraDrawStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening just before a rendering group is drawing. + */ + _this._beforeRenderingGroupDrawStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening just before a mesh is drawing. + */ + _this._beforeRenderingMeshStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening just after a mesh has been drawn. + */ + _this._afterRenderingMeshStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening just after a rendering group has been drawn. + */ + _this._afterRenderingGroupDrawStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening just after the active camera has been drawn. + */ + _this._afterCameraDrawStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening just after rendering all cameras and computing intersections. + */ + _this._afterRenderStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening when a pointer move event happens. + */ + _this._pointerMoveStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening when a pointer down event happens. + */ + _this._pointerDownStage = BABYLON.Stage.Create(); + /** + * @hidden + * Defines the actions happening when a pointer up event happens. + */ + _this._pointerUpStage = BABYLON.Stage.Create(); + _this._defaultMeshCandidates = { + data: [], + length: 0 + }; + _this._defaultSubMeshCandidates = { + data: [], + length: 0 + }; + _this._activeMeshesFrozen = false; + /** @hidden */ + _this._allowPostProcessClearColor = true; + /** + * User updatable function that will return a deterministic frame time when engine is in deterministic lock step mode + */ + _this.getDeterministicFrameTime = function () { + return 1000.0 / 60.0; // frame time in ms + }; + _this._tempPickingRay = BABYLON.Ray ? BABYLON.Ray.Zero() : null; + _this._blockMaterialDirtyMechanism = false; + _this._engine = engine || BABYLON.Engine.LastCreatedEngine; + _this._engine.scenes.push(_this); + _this._uid = null; + _this._renderingManager = new BABYLON.RenderingManager(_this); + if (BABYLON.PostProcessManager) { + _this.postProcessManager = new BABYLON.PostProcessManager(_this); + } + if (BABYLON.Tools.IsWindowObjectExist()) { + _this.attachControl(); + } + //collision coordinator initialization. For now legacy per default. + _this.workerCollisions = false; //(!!Worker && (!!BABYLON.CollisionWorker || BABYLON.WorkerIncluded)); + // Uniform Buffer + _this._createUbo(); + // Default Image processing definition + if (BABYLON.ImageProcessingConfiguration) { + _this._imageProcessingConfiguration = new BABYLON.ImageProcessingConfiguration(); + } + _this.setDefaultCandidateProviders(); + return _this; + } + Object.defineProperty(Scene.prototype, "environmentTexture", { + /** + * Texture used in all pbr material as the reflection texture. + * As in the majority of the scene they are the same (exception for multi room and so on), + * this is easier to reference from here than from all the materials. + */ + get: function () { + return this._environmentTexture; + }, + /** + * Texture used in all pbr material as the reflection texture. + * As in the majority of the scene they are the same (exception for multi room and so on), + * this is easier to set here than in all the materials. + */ + set: function (value) { + if (this._environmentTexture === value) { + return; + } + this._environmentTexture = value; + this.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "imageProcessingConfiguration", { + /** + * Default image processing configuration used either in the rendering + * Forward main pass or through the imageProcessingPostProcess if present. + * As in the majority of the scene they are the same (exception for multi camera), + * this is easier to reference from here than from all the materials and post process. + * + * No setter as we it is a shared configuration, you can set the values instead. + */ + get: function () { + return this._imageProcessingConfiguration; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "forceWireframe", { + get: function () { + return this._forceWireframe; + }, + /** + * Gets or sets a boolean indicating if all rendering must be done in wireframe + */ + set: function (value) { + if (this._forceWireframe === value) { + return; + } + this._forceWireframe = value; + this.markAllMaterialsAsDirty(BABYLON.Material.MiscDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "forcePointsCloud", { + get: function () { + return this._forcePointsCloud; + }, + /** + * Gets or sets a boolean indicating if all rendering must be done in point cloud + */ + set: function (value) { + if (this._forcePointsCloud === value) { + return; + } + this._forcePointsCloud = value; + this.markAllMaterialsAsDirty(BABYLON.Material.MiscDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "animationPropertiesOverride", { + /** + * Gets or sets the animation properties override + */ + get: function () { + return this._animationPropertiesOverride; + }, + set: function (value) { + this._animationPropertiesOverride = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "onDispose", { + /** Sets a function to be executed when this scene is disposed. */ + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "beforeRender", { + /** Sets a function to be executed before rendering this scene */ + set: function (callback) { + if (this._onBeforeRenderObserver) { + this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver); + } + if (callback) { + this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "afterRender", { + /** Sets a function to be executed after rendering this scene */ + set: function (callback) { + if (this._onAfterRenderObserver) { + this.onAfterRenderObservable.remove(this._onAfterRenderObserver); + } + if (callback) { + this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "beforeCameraRender", { + /** Sets a function to be executed before rendering a camera*/ + set: function (callback) { + if (this._onBeforeCameraRenderObserver) { + this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver); + } + this._onBeforeCameraRenderObserver = this.onBeforeCameraRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "afterCameraRender", { + /** Sets a function to be executed after rendering a camera*/ + set: function (callback) { + if (this._onAfterCameraRenderObserver) { + this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver); + } + this._onAfterCameraRenderObserver = this.onAfterCameraRenderObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "unTranslatedPointer", { + /** + * Gets the pointer coordinates without any translation (ie. straight out of the pointer event) + */ + get: function () { + return new BABYLON.Vector2(this._unTranslatedPointerX, this._unTranslatedPointerY); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "useRightHandedSystem", { + get: function () { + return this._useRightHandedSystem; + }, + /** + * Gets or sets a boolean indicating if the scene must use right-handed coordinates system + */ + set: function (value) { + if (this._useRightHandedSystem === value) { + return; + } + this._useRightHandedSystem = value; + this.markAllMaterialsAsDirty(BABYLON.Material.MiscDirtyFlag); + }, + enumerable: true, + configurable: true + }); + /** + * Sets the step Id used by deterministic lock step + * @see http://doc.babylonjs.com/babylon101/animations#deterministic-lockstep + * @param newStepId defines the step Id + */ + Scene.prototype.setStepId = function (newStepId) { + this._currentStepId = newStepId; + }; + /** + * Gets the step Id used by deterministic lock step + * @see http://doc.babylonjs.com/babylon101/animations#deterministic-lockstep + * @returns the step Id + */ + Scene.prototype.getStepId = function () { + return this._currentStepId; + }; + /** + * Gets the internal step used by deterministic lock step + * @see http://doc.babylonjs.com/babylon101/animations#deterministic-lockstep + * @returns the internal step + */ + Scene.prototype.getInternalStep = function () { + return this._currentInternalStep; + }; + Object.defineProperty(Scene.prototype, "fogEnabled", { + get: function () { + return this._fogEnabled; + }, + /** + * Gets or sets a boolean indicating if fog is enabled on this scene + * @see http://doc.babylonjs.com/babylon101/environment#fog + * (Default is true) + */ + set: function (value) { + if (this._fogEnabled === value) { + return; + } + this._fogEnabled = value; + this.markAllMaterialsAsDirty(BABYLON.Material.MiscDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "fogMode", { + get: function () { + return this._fogMode; + }, + /** + * Gets or sets the fog mode to use + * @see http://doc.babylonjs.com/babylon101/environment#fog + * | mode | value | + * | --- | --- | + * | FOGMODE_NONE | 0 | + * | FOGMODE_EXP | 1 | + * | FOGMODE_EXP2 | 2 | + * | FOGMODE_LINEAR | 3 | + */ + set: function (value) { + if (this._fogMode === value) { + return; + } + this._fogMode = value; + this.markAllMaterialsAsDirty(BABYLON.Material.MiscDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "shadowsEnabled", { + get: function () { + return this._shadowsEnabled; + }, + /** + * Gets or sets a boolean indicating if shadows are enabled on this scene + */ + set: function (value) { + if (this._shadowsEnabled === value) { + return; + } + this._shadowsEnabled = value; + this.markAllMaterialsAsDirty(BABYLON.Material.LightDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "lightsEnabled", { + get: function () { + return this._lightsEnabled; + }, + /** + * Gets or sets a boolean indicating if lights are enabled on this scene + */ + set: function (value) { + if (this._lightsEnabled === value) { + return; + } + this._lightsEnabled = value; + this.markAllMaterialsAsDirty(BABYLON.Material.LightDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "defaultMaterial", { + /** The default material used on meshes when no material is affected */ + get: function () { + if (!this._defaultMaterial) { + this._defaultMaterial = new BABYLON.StandardMaterial("default material", this); + } + return this._defaultMaterial; + }, + /** The default material used on meshes when no material is affected */ + set: function (value) { + this._defaultMaterial = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "texturesEnabled", { + get: function () { + return this._texturesEnabled; + }, + /** + * Gets or sets a boolean indicating if textures are enabled on this scene + */ + set: function (value) { + if (this._texturesEnabled === value) { + return; + } + this._texturesEnabled = value; + this.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "skeletonsEnabled", { + get: function () { + return this._skeletonsEnabled; + }, + /** + * Gets or sets a boolean indicating if skeletons are enabled on this scene + */ + set: function (value) { + if (this._skeletonsEnabled === value) { + return; + } + this._skeletonsEnabled = value; + this.markAllMaterialsAsDirty(BABYLON.Material.AttributesDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "_isAlternateRenderingEnabled", { + /** @hidden */ + get: function () { + return this._alternateRendering; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "frustumPlanes", { + /** + * Gets the list of frustum planes (built from the active camera) + */ + get: function () { + return this._frustumPlanes; + }, + enumerable: true, + configurable: true + }); + /** + * Registers the transient components if needed. + */ + Scene.prototype._registerTransientComponents = function () { + // Register components that have been associated lately to the scene. + if (this._transientComponents.length > 0) { + for (var _i = 0, _a = this._transientComponents; _i < _a.length; _i++) { + var component = _a[_i]; + component.register(); + } + this._transientComponents = []; + } + }; + /** + * @hidden + * Add a component to the scene. + * Note that the ccomponent could be registered on th next frame if this is called after + * the register component stage. + * @param component Defines the component to add to the scene + */ + Scene.prototype._addComponent = function (component) { + this._components.push(component); + this._transientComponents.push(component); + var serializableComponent = component; + if (serializableComponent.addFromContainer) { + this._serializableComponents.push(serializableComponent); + } + }; + /** + * @hidden + * Gets a component from the scene. + * @param name defines the name of the component to retrieve + * @returns the component or null if not present + */ + Scene.prototype._getComponent = function (name) { + for (var _i = 0, _a = this._components; _i < _a.length; _i++) { + var component = _a[_i]; + if (component.name === name) { + return component; + } + } + return null; + }; + /** + * @hidden + */ + Scene.prototype._getDefaultMeshCandidates = function () { + this._defaultMeshCandidates.data = this.meshes; + this._defaultMeshCandidates.length = this.meshes.length; + return this._defaultMeshCandidates; + }; + /** + * @hidden + */ + Scene.prototype._getDefaultSubMeshCandidates = function (mesh) { + this._defaultSubMeshCandidates.data = mesh.subMeshes; + this._defaultSubMeshCandidates.length = mesh.subMeshes.length; + return this._defaultSubMeshCandidates; + }; + /** + * Sets the default candidate providers for the scene. + * This sets the getActiveMeshCandidates, getActiveSubMeshCandidates, getIntersectingSubMeshCandidates + * and getCollidingSubMeshCandidates to their default function + */ + Scene.prototype.setDefaultCandidateProviders = function () { + this.getActiveMeshCandidates = this._getDefaultMeshCandidates.bind(this); + this.getActiveSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this); + this.getIntersectingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this); + this.getCollidingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this); + }; + Object.defineProperty(Scene.prototype, "workerCollisions", { + /** + * Gets a boolean indicating if collisions are processed on a web worker + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#web-worker-based-collision-system-since-21 + */ + get: function () { + return this._workerCollisions; + }, + set: function (enabled) { + if (!BABYLON.CollisionCoordinatorLegacy) { + return; + } + enabled = (enabled && !!Worker && !!BABYLON.CollisionWorker); + this._workerCollisions = enabled; + if (this.collisionCoordinator) { + this.collisionCoordinator.destroy(); + } + this.collisionCoordinator = enabled ? new BABYLON.CollisionCoordinatorWorker() : new BABYLON.CollisionCoordinatorLegacy(); + this.collisionCoordinator.init(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "meshUnderPointer", { + /** + * Gets the mesh that is currently under the pointer + */ + get: function () { + return this._pointerOverMesh; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "pointerX", { + /** + * Gets the current on-screen X position of the pointer + */ + get: function () { + return this._pointerX; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "pointerY", { + /** + * Gets the current on-screen Y position of the pointer + */ + get: function () { + return this._pointerY; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the cached material (ie. the latest rendered one) + * @returns the cached material + */ + Scene.prototype.getCachedMaterial = function () { + return this._cachedMaterial; + }; + /** + * Gets the cached effect (ie. the latest rendered one) + * @returns the cached effect + */ + Scene.prototype.getCachedEffect = function () { + return this._cachedEffect; + }; + /** + * Gets the cached visibility state (ie. the latest rendered one) + * @returns the cached visibility state + */ + Scene.prototype.getCachedVisibility = function () { + return this._cachedVisibility; + }; + /** + * Gets a boolean indicating if the current material / effect / visibility must be bind again + * @param material defines the current material + * @param effect defines the current effect + * @param visibility defines the current visibility state + * @returns true if one parameter is not cached + */ + Scene.prototype.isCachedMaterialInvalid = function (material, effect, visibility) { + if (visibility === void 0) { visibility = 1; } + return this._cachedEffect !== effect || this._cachedMaterial !== material || this._cachedVisibility !== visibility; + }; + /** + * Gets the engine associated with the scene + * @returns an Engine + */ + Scene.prototype.getEngine = function () { + return this._engine; + }; + /** + * Gets the total number of vertices rendered per frame + * @returns the total number of vertices rendered per frame + */ + Scene.prototype.getTotalVertices = function () { + return this._totalVertices.current; + }; + Object.defineProperty(Scene.prototype, "totalVerticesPerfCounter", { + /** + * Gets the performance counter for total vertices + * @see http://doc.babylonjs.com/how_to/optimizing_your_scene#instrumentation + */ + get: function () { + return this._totalVertices; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the total number of active indices rendered per frame (You can deduce the number of rendered triangles by dividing this number by 3) + * @returns the total number of active indices rendered per frame + */ + Scene.prototype.getActiveIndices = function () { + return this._activeIndices.current; + }; + Object.defineProperty(Scene.prototype, "totalActiveIndicesPerfCounter", { + /** + * Gets the performance counter for active indices + * @see http://doc.babylonjs.com/how_to/optimizing_your_scene#instrumentation + */ + get: function () { + return this._activeIndices; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the total number of active particles rendered per frame + * @returns the total number of active particles rendered per frame + */ + Scene.prototype.getActiveParticles = function () { + return this._activeParticles.current; + }; + Object.defineProperty(Scene.prototype, "activeParticlesPerfCounter", { + /** + * Gets the performance counter for active particles + * @see http://doc.babylonjs.com/how_to/optimizing_your_scene#instrumentation + */ + get: function () { + return this._activeParticles; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the total number of active bones rendered per frame + * @returns the total number of active bones rendered per frame + */ + Scene.prototype.getActiveBones = function () { + return this._activeBones.current; + }; + Object.defineProperty(Scene.prototype, "activeBonesPerfCounter", { + /** + * Gets the performance counter for active bones + * @see http://doc.babylonjs.com/how_to/optimizing_your_scene#instrumentation + */ + get: function () { + return this._activeBones; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + Scene.prototype.getInterFramePerfCounter = function () { + BABYLON.Tools.Warn("getInterFramePerfCounter is deprecated. Please use SceneInstrumentation class"); + return 0; + }; + Object.defineProperty(Scene.prototype, "interFramePerfCounter", { + /** @hidden */ + get: function () { + BABYLON.Tools.Warn("interFramePerfCounter is deprecated. Please use SceneInstrumentation class"); + return null; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + Scene.prototype.getLastFrameDuration = function () { + BABYLON.Tools.Warn("getLastFrameDuration is deprecated. Please use SceneInstrumentation class"); + return 0; + }; + Object.defineProperty(Scene.prototype, "lastFramePerfCounter", { + /** @hidden */ + get: function () { + BABYLON.Tools.Warn("lastFramePerfCounter is deprecated. Please use SceneInstrumentation class"); + return null; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + Scene.prototype.getEvaluateActiveMeshesDuration = function () { + BABYLON.Tools.Warn("getEvaluateActiveMeshesDuration is deprecated. Please use SceneInstrumentation class"); + return 0; + }; + Object.defineProperty(Scene.prototype, "evaluateActiveMeshesDurationPerfCounter", { + /** @hidden */ + get: function () { + BABYLON.Tools.Warn("evaluateActiveMeshesDurationPerfCounter is deprecated. Please use SceneInstrumentation class"); + return null; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the array of active meshes + * @returns an array of AbstractMesh + */ + Scene.prototype.getActiveMeshes = function () { + return this._activeMeshes; + }; + /** @hidden */ + Scene.prototype.getRenderTargetsDuration = function () { + BABYLON.Tools.Warn("getRenderTargetsDuration is deprecated. Please use SceneInstrumentation class"); + return 0; + }; + /** @hidden */ + Scene.prototype.getRenderDuration = function () { + BABYLON.Tools.Warn("getRenderDuration is deprecated. Please use SceneInstrumentation class"); + return 0; + }; + Object.defineProperty(Scene.prototype, "renderDurationPerfCounter", { + /** @hidden */ + get: function () { + BABYLON.Tools.Warn("renderDurationPerfCounter is deprecated. Please use SceneInstrumentation class"); + return null; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + Scene.prototype.getParticlesDuration = function () { + BABYLON.Tools.Warn("getParticlesDuration is deprecated. Please use SceneInstrumentation class"); + return 0; + }; + Object.defineProperty(Scene.prototype, "particlesDurationPerfCounter", { + /** @hidden */ + get: function () { + BABYLON.Tools.Warn("particlesDurationPerfCounter is deprecated. Please use SceneInstrumentation class"); + return null; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + Scene.prototype.getSpritesDuration = function () { + BABYLON.Tools.Warn("getSpritesDuration is deprecated. Please use SceneInstrumentation class"); + return 0; + }; + Object.defineProperty(Scene.prototype, "spriteDuractionPerfCounter", { + /** @hidden */ + get: function () { + BABYLON.Tools.Warn("spriteDuractionPerfCounter is deprecated. Please use SceneInstrumentation class"); + return null; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the animation ratio (which is 1.0 is the scene renders at 60fps and 2 if the scene renders at 30fps, etc.) + * @returns a number + */ + Scene.prototype.getAnimationRatio = function () { + return this._animationRatio !== undefined ? this._animationRatio : 1; + }; + /** + * Gets an unique Id for the current render phase + * @returns a number + */ + Scene.prototype.getRenderId = function () { + return this._renderId; + }; + /** + * Gets an unique Id for the current frame + * @returns a number + */ + Scene.prototype.getFrameId = function () { + return this._frameId; + }; + /** Call this function if you want to manually increment the render Id*/ + Scene.prototype.incrementRenderId = function () { + this._renderId++; + }; + Scene.prototype._updatePointerPosition = function (evt) { + var canvasRect = this._engine.getRenderingCanvasClientRect(); + if (!canvasRect) { + return; + } + this._pointerX = evt.clientX - canvasRect.left; + this._pointerY = evt.clientY - canvasRect.top; + this._unTranslatedPointerX = this._pointerX; + this._unTranslatedPointerY = this._pointerY; + }; + Scene.prototype._createUbo = function () { + this._sceneUbo = new BABYLON.UniformBuffer(this._engine, undefined, true); + this._sceneUbo.addUniform("viewProjection", 16); + this._sceneUbo.addUniform("view", 16); + }; + Scene.prototype._createAlternateUbo = function () { + this._alternateSceneUbo = new BABYLON.UniformBuffer(this._engine, undefined, true); + this._alternateSceneUbo.addUniform("viewProjection", 16); + this._alternateSceneUbo.addUniform("view", 16); + }; + // Pointers handling + Scene.prototype._setRayOnPointerInfo = function (pointerInfo) { + if (pointerInfo.pickInfo) { + if (!pointerInfo.pickInfo.ray) { + pointerInfo.pickInfo.ray = this.createPickingRay(pointerInfo.event.offsetX, pointerInfo.event.offsetY, BABYLON.Matrix.Identity(), this.activeCamera); + } + } + }; + /** + * Use this method to simulate a pointer move on a mesh + * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay + * @param pickResult pickingInfo of the object wished to simulate pointer event on + * @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch) + * @returns the current scene + */ + Scene.prototype.simulatePointerMove = function (pickResult, pointerEventInit) { + var evt = new PointerEvent("pointermove", pointerEventInit); + if (this._checkPrePointerObservable(pickResult, evt, BABYLON.PointerEventTypes.POINTERMOVE)) { + return this; + } + return this._processPointerMove(pickResult, evt); + }; + Scene.prototype._processPointerMove = function (pickResult, evt) { + var canvas = this._engine.getRenderingCanvas(); + if (!canvas) { + return this; + } + // Restore pointer + canvas.style.cursor = this.defaultCursor; + var isMeshPicked = (pickResult && pickResult.hit && pickResult.pickedMesh) ? true : false; + if (isMeshPicked) { + this.setPointerOverMesh(pickResult.pickedMesh); + if (this._pointerOverMesh && this._pointerOverMesh.actionManager && this._pointerOverMesh.actionManager.hasPointerTriggers) { + if (this._pointerOverMesh.actionManager.hoverCursor) { + canvas.style.cursor = this._pointerOverMesh.actionManager.hoverCursor; + } + else { + canvas.style.cursor = this.hoverCursor; + } + } + } + else { + this.setPointerOverMesh(null); + } + for (var _i = 0, _a = this._pointerMoveStage; _i < _a.length; _i++) { + var step = _a[_i]; + pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, isMeshPicked, canvas); + } + if (pickResult) { + var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE; + if (this.onPointerMove) { + this.onPointerMove(evt, pickResult, type); + } + if (this.onPointerObservable.hasObservers()) { + var pi = new BABYLON.PointerInfo(type, evt, pickResult); + this._setRayOnPointerInfo(pi); + this.onPointerObservable.notifyObservers(pi, type); + } + } + return this; + }; + Scene.prototype._checkPrePointerObservable = function (pickResult, evt, type) { + var pi = new BABYLON.PointerInfoPre(type, evt, this._unTranslatedPointerX, this._unTranslatedPointerY); + if (pickResult) { + pi.ray = pickResult.ray; + } + this.onPrePointerObservable.notifyObservers(pi, type); + if (pi.skipOnPointerObservable) { + return true; + } + else { + return false; + } + }; + /** + * Use this method to simulate a pointer down on a mesh + * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay + * @param pickResult pickingInfo of the object wished to simulate pointer event on + * @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch) + * @returns the current scene + */ + Scene.prototype.simulatePointerDown = function (pickResult, pointerEventInit) { + var evt = new PointerEvent("pointerdown", pointerEventInit); + if (this._checkPrePointerObservable(pickResult, evt, BABYLON.PointerEventTypes.POINTERDOWN)) { + return this; + } + return this._processPointerDown(pickResult, evt); + }; + Scene.prototype._processPointerDown = function (pickResult, evt) { + var _this = this; + if (pickResult && pickResult.hit && pickResult.pickedMesh) { + this._pickedDownMesh = pickResult.pickedMesh; + var actionManager = pickResult.pickedMesh.actionManager; + if (actionManager) { + if (actionManager.hasPickTriggers) { + actionManager.processTrigger(BABYLON.ActionManager.OnPickDownTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + switch (evt.button) { + case 0: + actionManager.processTrigger(BABYLON.ActionManager.OnLeftPickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + break; + case 1: + actionManager.processTrigger(BABYLON.ActionManager.OnCenterPickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + break; + case 2: + actionManager.processTrigger(BABYLON.ActionManager.OnRightPickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + break; + } + } + if (actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnLongPressTrigger)) { + window.setTimeout(function () { + var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, function (mesh) { return (mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.actionManager && mesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnLongPressTrigger) && mesh == _this._pickedDownMesh); }, false, _this.cameraToUseForPointers); + if (pickResult && pickResult.hit && pickResult.pickedMesh && actionManager) { + if (_this._totalPointersPressed !== 0 && + ((Date.now() - _this._startingPointerTime) > Scene.LongPressDelay) && + !_this._isPointerSwiping()) { + _this._startingPointerTime = 0; + actionManager.processTrigger(BABYLON.ActionManager.OnLongPressTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + } + } + }, Scene.LongPressDelay); + } + } + } + else { + for (var _i = 0, _a = this._pointerDownStage; _i < _a.length; _i++) { + var step = _a[_i]; + pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, evt); + } + } + if (pickResult) { + var type = BABYLON.PointerEventTypes.POINTERDOWN; + if (this.onPointerDown) { + this.onPointerDown(evt, pickResult, type); + } + if (this.onPointerObservable.hasObservers()) { + var pi = new BABYLON.PointerInfo(type, evt, pickResult); + this._setRayOnPointerInfo(pi); + this.onPointerObservable.notifyObservers(pi, type); + } + } + return this; + }; + /** + * Use this method to simulate a pointer up on a mesh + * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay + * @param pickResult pickingInfo of the object wished to simulate pointer event on + * @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch) + * @returns the current scene + */ + Scene.prototype.simulatePointerUp = function (pickResult, pointerEventInit) { + var evt = new PointerEvent("pointerup", pointerEventInit); + var clickInfo = new ClickInfo(); + clickInfo.singleClick = true; + clickInfo.ignore = true; + if (this._checkPrePointerObservable(pickResult, evt, BABYLON.PointerEventTypes.POINTERUP)) { + return this; + } + return this._processPointerUp(pickResult, evt, clickInfo); + }; + Scene.prototype._processPointerUp = function (pickResult, evt, clickInfo) { + if (pickResult && pickResult && pickResult.pickedMesh) { + this._pickedUpMesh = pickResult.pickedMesh; + if (this._pickedDownMesh === this._pickedUpMesh) { + if (this.onPointerPick) { + this.onPointerPick(evt, pickResult); + } + if (clickInfo.singleClick && !clickInfo.ignore && this.onPointerObservable.hasObservers()) { + var type_1 = BABYLON.PointerEventTypes.POINTERPICK; + var pi = new BABYLON.PointerInfo(type_1, evt, pickResult); + this._setRayOnPointerInfo(pi); + this.onPointerObservable.notifyObservers(pi, type_1); + } + } + if (pickResult.pickedMesh.actionManager) { + if (clickInfo.ignore) { + pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickUpTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + } + if (!clickInfo.hasSwiped && !clickInfo.ignore && clickInfo.singleClick) { + pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + } + if (clickInfo.doubleClick && !clickInfo.ignore && pickResult.pickedMesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnDoublePickTrigger)) { + pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnDoublePickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt)); + } + } + } + else { + if (!clickInfo.ignore) { + for (var _i = 0, _a = this._pointerUpStage; _i < _a.length; _i++) { + var step = _a[_i]; + pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, evt); + } + } + } + if (this._pickedDownMesh && + this._pickedDownMesh.actionManager && + this._pickedDownMesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnPickOutTrigger) && + this._pickedDownMesh !== this._pickedUpMesh) { + this._pickedDownMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNew(this._pickedDownMesh, evt)); + } + var type = BABYLON.PointerEventTypes.POINTERUP; + if (this.onPointerObservable.hasObservers()) { + if (!clickInfo.ignore) { + if (!clickInfo.hasSwiped) { + if (clickInfo.singleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) { + var type_2 = BABYLON.PointerEventTypes.POINTERTAP; + var pi = new BABYLON.PointerInfo(type_2, evt, pickResult); + this._setRayOnPointerInfo(pi); + this.onPointerObservable.notifyObservers(pi, type_2); + } + if (clickInfo.doubleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP)) { + var type_3 = BABYLON.PointerEventTypes.POINTERDOUBLETAP; + var pi = new BABYLON.PointerInfo(type_3, evt, pickResult); + this._setRayOnPointerInfo(pi); + this.onPointerObservable.notifyObservers(pi, type_3); + } + } + } + else { + var pi = new BABYLON.PointerInfo(type, evt, pickResult); + this._setRayOnPointerInfo(pi); + this.onPointerObservable.notifyObservers(pi, type); + } + } + if (this.onPointerUp) { + this.onPointerUp(evt, pickResult, type); + } + return this; + }; + /** + * Gets a boolean indicating if the current pointer event is captured (meaning that the scene has already handled the pointer down) + * @param pointerId defines the pointer id to use in a multi-touch scenario (0 by default) + * @returns true if the pointer was captured + */ + Scene.prototype.isPointerCaptured = function (pointerId) { + if (pointerId === void 0) { pointerId = 0; } + return this._pointerCaptures[pointerId]; + }; + /** @hidden */ + Scene.prototype._isPointerSwiping = function () { + return Math.abs(this._startingPointerPosition.x - this._pointerX) > Scene.DragMovementThreshold || + Math.abs(this._startingPointerPosition.y - this._pointerY) > Scene.DragMovementThreshold; + }; + /** + * Attach events to the canvas (To handle actionManagers triggers and raise onPointerMove, onPointerDown and onPointerUp + * @param attachUp defines if you want to attach events to pointerup + * @param attachDown defines if you want to attach events to pointerdown + * @param attachMove defines if you want to attach events to pointermove + */ + Scene.prototype.attachControl = function (attachUp, attachDown, attachMove) { + var _this = this; + if (attachUp === void 0) { attachUp = true; } + if (attachDown === void 0) { attachDown = true; } + if (attachMove === void 0) { attachMove = true; } + this._initActionManager = function (act, clickInfo) { + if (!_this._meshPickProceed) { + var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this.pointerDownPredicate, false, _this.cameraToUseForPointers); + _this._currentPickResult = pickResult; + if (pickResult) { + act = (pickResult.hit && pickResult.pickedMesh) ? pickResult.pickedMesh.actionManager : null; + } + _this._meshPickProceed = true; + } + return act; + }; + this._delayedSimpleClick = function (btn, clickInfo, cb) { + // double click delay is over and that no double click has been raised since, or the 2 consecutive keys pressed are different + if ((Date.now() - _this._previousStartingPointerTime > Scene.DoubleClickDelay && !_this._doubleClickOccured) || + btn !== _this._previousButtonPressed) { + _this._doubleClickOccured = false; + clickInfo.singleClick = true; + clickInfo.ignore = false; + cb(clickInfo, _this._currentPickResult); + } + }; + this._initClickEvent = function (obs1, obs2, evt, cb) { + var clickInfo = new ClickInfo(); + _this._currentPickResult = null; + var act = null; + var checkPicking = obs1.hasSpecificMask(BABYLON.PointerEventTypes.POINTERPICK) || obs2.hasSpecificMask(BABYLON.PointerEventTypes.POINTERPICK) + || obs1.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP) || obs2.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP) + || obs1.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP) || obs2.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP); + if (!checkPicking && BABYLON.ActionManager && BABYLON.ActionManager.HasPickTriggers) { + act = _this._initActionManager(act, clickInfo); + if (act) { + checkPicking = act.hasPickTriggers; + } + } + if (checkPicking) { + var btn = evt.button; + clickInfo.hasSwiped = _this._isPointerSwiping(); + if (!clickInfo.hasSwiped) { + var checkSingleClickImmediately = !Scene.ExclusiveDoubleClickMode; + if (!checkSingleClickImmediately) { + checkSingleClickImmediately = !obs1.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP) && + !obs2.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP); + if (checkSingleClickImmediately && !BABYLON.ActionManager.HasSpecificTrigger(BABYLON.ActionManager.OnDoublePickTrigger)) { + act = _this._initActionManager(act, clickInfo); + if (act) { + checkSingleClickImmediately = !act.hasSpecificTrigger(BABYLON.ActionManager.OnDoublePickTrigger); + } + } + } + if (checkSingleClickImmediately) { + // single click detected if double click delay is over or two different successive keys pressed without exclusive double click or no double click required + if (Date.now() - _this._previousStartingPointerTime > Scene.DoubleClickDelay || + btn !== _this._previousButtonPressed) { + clickInfo.singleClick = true; + cb(clickInfo, _this._currentPickResult); + } + } + // at least one double click is required to be check and exclusive double click is enabled + else { + // wait that no double click has been raised during the double click delay + _this._previousDelayedSimpleClickTimeout = _this._delayedSimpleClickTimeout; + _this._delayedSimpleClickTimeout = window.setTimeout(_this._delayedSimpleClick.bind(_this, btn, clickInfo, cb), Scene.DoubleClickDelay); + } + var checkDoubleClick = obs1.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP) || + obs2.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP); + if (!checkDoubleClick && BABYLON.ActionManager.HasSpecificTrigger(BABYLON.ActionManager.OnDoublePickTrigger)) { + act = _this._initActionManager(act, clickInfo); + if (act) { + checkDoubleClick = act.hasSpecificTrigger(BABYLON.ActionManager.OnDoublePickTrigger); + } + } + if (checkDoubleClick) { + // two successive keys pressed are equal, double click delay is not over and double click has not just occurred + if (btn === _this._previousButtonPressed && + Date.now() - _this._previousStartingPointerTime < Scene.DoubleClickDelay && + !_this._doubleClickOccured) { + // pointer has not moved for 2 clicks, it's a double click + if (!clickInfo.hasSwiped && + !_this._isPointerSwiping()) { + _this._previousStartingPointerTime = 0; + _this._doubleClickOccured = true; + clickInfo.doubleClick = true; + clickInfo.ignore = false; + if (Scene.ExclusiveDoubleClickMode && _this._previousDelayedSimpleClickTimeout) { + clearTimeout(_this._previousDelayedSimpleClickTimeout); + } + _this._previousDelayedSimpleClickTimeout = _this._delayedSimpleClickTimeout; + cb(clickInfo, _this._currentPickResult); + } + // if the two successive clicks are too far, it's just two simple clicks + else { + _this._doubleClickOccured = false; + _this._previousStartingPointerTime = _this._startingPointerTime; + _this._previousStartingPointerPosition.x = _this._startingPointerPosition.x; + _this._previousStartingPointerPosition.y = _this._startingPointerPosition.y; + _this._previousButtonPressed = btn; + if (Scene.ExclusiveDoubleClickMode) { + if (_this._previousDelayedSimpleClickTimeout) { + clearTimeout(_this._previousDelayedSimpleClickTimeout); + } + _this._previousDelayedSimpleClickTimeout = _this._delayedSimpleClickTimeout; + cb(clickInfo, _this._previousPickResult); + } + else { + cb(clickInfo, _this._currentPickResult); + } + } + } + // just the first click of the double has been raised + else { + _this._doubleClickOccured = false; + _this._previousStartingPointerTime = _this._startingPointerTime; + _this._previousStartingPointerPosition.x = _this._startingPointerPosition.x; + _this._previousStartingPointerPosition.y = _this._startingPointerPosition.y; + _this._previousButtonPressed = btn; + } + } + } + } + clickInfo.ignore = true; + cb(clickInfo, _this._currentPickResult); + }; + this._onPointerMove = function (evt) { + _this._updatePointerPosition(evt); + // PreObservable support + if (_this._checkPrePointerObservable(null, evt, evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE)) { + return; + } + if (!_this.cameraToUseForPointers && !_this.activeCamera) { + return; + } + if (!_this.pointerMovePredicate) { + _this.pointerMovePredicate = function (mesh) { return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (mesh.enablePointerMoveEvents || _this.constantlyUpdateMeshUnderPointer || (mesh.actionManager !== null && mesh.actionManager !== undefined)); }; + } + // Meshes + var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this.pointerMovePredicate, false, _this.cameraToUseForPointers); + _this._processPointerMove(pickResult, evt); + }; + this._onPointerDown = function (evt) { + _this._totalPointersPressed++; + _this._pickedDownMesh = null; + _this._meshPickProceed = false; + _this._updatePointerPosition(evt); + if (_this.preventDefaultOnPointerDown && canvas) { + evt.preventDefault(); + canvas.focus(); + } + // PreObservable support + if (_this._checkPrePointerObservable(null, evt, BABYLON.PointerEventTypes.POINTERDOWN)) { + return; + } + if (!_this.cameraToUseForPointers && !_this.activeCamera) { + return; + } + _this._pointerCaptures[evt.pointerId] = true; + _this._startingPointerPosition.x = _this._pointerX; + _this._startingPointerPosition.y = _this._pointerY; + _this._startingPointerTime = Date.now(); + if (!_this.pointerDownPredicate) { + _this.pointerDownPredicate = function (mesh) { + return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled(); + }; + } + // Meshes + _this._pickedDownMesh = null; + var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this.pointerDownPredicate, false, _this.cameraToUseForPointers); + _this._processPointerDown(pickResult, evt); + }; + this._onPointerUp = function (evt) { + if (_this._totalPointersPressed === 0) { // We are attaching the pointer up to windows because of a bug in FF + return; // So we need to test it the pointer down was pressed before. + } + _this._totalPointersPressed--; + _this._pickedUpMesh = null; + _this._meshPickProceed = false; + _this._updatePointerPosition(evt); + _this._initClickEvent(_this.onPrePointerObservable, _this.onPointerObservable, evt, function (clickInfo, pickResult) { + // PreObservable support + if (_this.onPrePointerObservable.hasObservers()) { + if (!clickInfo.ignore) { + if (!clickInfo.hasSwiped) { + if (clickInfo.singleClick && _this.onPrePointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) { + if (_this._checkPrePointerObservable(null, evt, BABYLON.PointerEventTypes.POINTERTAP)) { + return; + } + } + if (clickInfo.doubleClick && _this.onPrePointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP)) { + if (_this._checkPrePointerObservable(null, evt, BABYLON.PointerEventTypes.POINTERDOUBLETAP)) { + return; + } + } + } + } + else { + if (_this._checkPrePointerObservable(null, evt, BABYLON.PointerEventTypes.POINTERUP)) { + return; + } + } + } + if (!_this.cameraToUseForPointers && !_this.activeCamera) { + return; + } + _this._pointerCaptures[evt.pointerId] = false; + if (!_this.pointerUpPredicate) { + _this.pointerUpPredicate = function (mesh) { + return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled(); + }; + } + // Meshes + if (!_this._meshPickProceed && (BABYLON.ActionManager && BABYLON.ActionManager.HasTriggers || _this.onPointerObservable.hasObservers())) { + _this._initActionManager(null, clickInfo); + } + if (!pickResult) { + pickResult = _this._currentPickResult; + } + _this._processPointerUp(pickResult, evt, clickInfo); + _this._previousPickResult = _this._currentPickResult; + }); + }; + this._onKeyDown = function (evt) { + var type = BABYLON.KeyboardEventTypes.KEYDOWN; + if (_this.onPreKeyboardObservable.hasObservers()) { + var pi = new BABYLON.KeyboardInfoPre(type, evt); + _this.onPreKeyboardObservable.notifyObservers(pi, type); + if (pi.skipOnPointerObservable) { + return; + } + } + if (_this.onKeyboardObservable.hasObservers()) { + var pi = new BABYLON.KeyboardInfo(type, evt); + _this.onKeyboardObservable.notifyObservers(pi, type); + } + if (_this.actionManager) { + _this.actionManager.processTrigger(BABYLON.ActionManager.OnKeyDownTrigger, BABYLON.ActionEvent.CreateNewFromScene(_this, evt)); + } + }; + this._onKeyUp = function (evt) { + var type = BABYLON.KeyboardEventTypes.KEYUP; + if (_this.onPreKeyboardObservable.hasObservers()) { + var pi = new BABYLON.KeyboardInfoPre(type, evt); + _this.onPreKeyboardObservable.notifyObservers(pi, type); + if (pi.skipOnPointerObservable) { + return; + } + } + if (_this.onKeyboardObservable.hasObservers()) { + var pi = new BABYLON.KeyboardInfo(type, evt); + _this.onKeyboardObservable.notifyObservers(pi, type); + } + if (_this.actionManager) { + _this.actionManager.processTrigger(BABYLON.ActionManager.OnKeyUpTrigger, BABYLON.ActionEvent.CreateNewFromScene(_this, evt)); + } + }; + var engine = this.getEngine(); + this._onCanvasFocusObserver = engine.onCanvasFocusObservable.add(function () { + if (!canvas) { + return; + } + canvas.addEventListener("keydown", _this._onKeyDown, false); + canvas.addEventListener("keyup", _this._onKeyUp, false); + }); + this._onCanvasBlurObserver = engine.onCanvasBlurObservable.add(function () { + if (!canvas) { + return; + } + canvas.removeEventListener("keydown", _this._onKeyDown); + canvas.removeEventListener("keyup", _this._onKeyUp); + }); + var eventPrefix = BABYLON.Tools.GetPointerPrefix(); + var canvas = this._engine.getRenderingCanvas(); + if (!canvas) { + return; + } + if (attachMove) { + canvas.addEventListener(eventPrefix + "move", this._onPointerMove, false); + // Wheel + canvas.addEventListener('mousewheel', this._onPointerMove, false); + canvas.addEventListener('DOMMouseScroll', this._onPointerMove, false); + } + if (attachDown) { + canvas.addEventListener(eventPrefix + "down", this._onPointerDown, false); + } + if (attachUp) { + window.addEventListener(eventPrefix + "up", this._onPointerUp, false); + } + canvas.tabIndex = 1; + }; + /** Detaches all event handlers*/ + Scene.prototype.detachControl = function () { + var engine = this.getEngine(); + var eventPrefix = BABYLON.Tools.GetPointerPrefix(); + var canvas = engine.getRenderingCanvas(); + if (!canvas) { + return; + } + canvas.removeEventListener(eventPrefix + "move", this._onPointerMove); + canvas.removeEventListener(eventPrefix + "down", this._onPointerDown); + window.removeEventListener(eventPrefix + "up", this._onPointerUp); + if (this._onCanvasBlurObserver) { + engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver); + } + if (this._onCanvasFocusObserver) { + engine.onCanvasFocusObservable.remove(this._onCanvasFocusObserver); + } + // Wheel + canvas.removeEventListener('mousewheel', this._onPointerMove); + canvas.removeEventListener('DOMMouseScroll', this._onPointerMove); + // Keyboard + canvas.removeEventListener("keydown", this._onKeyDown); + canvas.removeEventListener("keyup", this._onKeyUp); + // Observables + this.onKeyboardObservable.clear(); + this.onPreKeyboardObservable.clear(); + this.onPointerObservable.clear(); + this.onPrePointerObservable.clear(); + }; + /** + * This function will check if the scene can be rendered (textures are loaded, shaders are compiled) + * Delay loaded resources are not taking in account + * @return true if all required resources are ready + */ + Scene.prototype.isReady = function () { + if (this._isDisposed) { + return false; + } + if (this._pendingData.length > 0) { + return false; + } + var index; + var engine = this.getEngine(); + // Geometries + for (index = 0; index < this.geometries.length; index++) { + var geometry = this.geometries[index]; + if (geometry.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADING) { + return false; + } + } + // Meshes + for (index = 0; index < this.meshes.length; index++) { + var mesh = this.meshes[index]; + if (!mesh.isEnabled()) { + continue; + } + if (!mesh.subMeshes || mesh.subMeshes.length === 0) { + continue; + } + if (!mesh.isReady(true)) { + return false; + } + var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh" || engine.getCaps().instancedArrays && mesh.instances.length > 0; + // Is Ready For Mesh + for (var _i = 0, _a = this._isReadyForMeshStage; _i < _a.length; _i++) { + var step = _a[_i]; + if (!step.action(mesh, hardwareInstancedRendering)) { + return false; + } + } + } + // Post-processes + if (this.activeCameras && this.activeCameras.length > 0) { + for (var _b = 0, _c = this.activeCameras; _b < _c.length; _b++) { + var camera = _c[_b]; + if (!camera.isReady(true)) { + return false; + } + } + } + else if (this.activeCamera) { + if (!this.activeCamera.isReady(true)) { + return false; + } + } + // Particles + for (var _d = 0, _e = this.particleSystems; _d < _e.length; _d++) { + var particleSystem = _e[_d]; + if (!particleSystem.isReady()) { + return false; + } + } + return true; + }; + /** Resets all cached information relative to material (including effect and visibility) */ + Scene.prototype.resetCachedMaterial = function () { + this._cachedMaterial = null; + this._cachedEffect = null; + this._cachedVisibility = null; + }; + /** + * Registers a function to be called before every frame render + * @param func defines the function to register + */ + Scene.prototype.registerBeforeRender = function (func) { + this.onBeforeRenderObservable.add(func); + }; + /** + * Unregisters a function called before every frame render + * @param func defines the function to unregister + */ + Scene.prototype.unregisterBeforeRender = function (func) { + this.onBeforeRenderObservable.removeCallback(func); + }; + /** + * Registers a function to be called after every frame render + * @param func defines the function to register + */ + Scene.prototype.registerAfterRender = function (func) { + this.onAfterRenderObservable.add(func); + }; + /** + * Unregisters a function called after every frame render + * @param func defines the function to unregister + */ + Scene.prototype.unregisterAfterRender = function (func) { + this.onAfterRenderObservable.removeCallback(func); + }; + Scene.prototype._executeOnceBeforeRender = function (func) { + var _this = this; + var execFunc = function () { + func(); + setTimeout(function () { + _this.unregisterBeforeRender(execFunc); + }); + }; + this.registerBeforeRender(execFunc); + }; + /** + * The provided function will run before render once and will be disposed afterwards. + * A timeout delay can be provided so that the function will be executed in N ms. + * The timeout is using the browser's native setTimeout so time percision cannot be guaranteed. + * @param func The function to be executed. + * @param timeout optional delay in ms + */ + Scene.prototype.executeOnceBeforeRender = function (func, timeout) { + var _this = this; + if (timeout !== undefined) { + setTimeout(function () { + _this._executeOnceBeforeRender(func); + }, timeout); + } + else { + this._executeOnceBeforeRender(func); + } + }; + /** @hidden */ + Scene.prototype._addPendingData = function (data) { + this._pendingData.push(data); + }; + /** @hidden */ + Scene.prototype._removePendingData = function (data) { + var wasLoading = this.isLoading; + var index = this._pendingData.indexOf(data); + if (index !== -1) { + this._pendingData.splice(index, 1); + } + if (wasLoading && !this.isLoading) { + this.onDataLoadedObservable.notifyObservers(this); + } + }; + /** + * Returns the number of items waiting to be loaded + * @returns the number of items waiting to be loaded + */ + Scene.prototype.getWaitingItemsCount = function () { + return this._pendingData.length; + }; + Object.defineProperty(Scene.prototype, "isLoading", { + /** + * Returns a boolean indicating if the scene is still loading data + */ + get: function () { + return this._pendingData.length > 0; + }, + enumerable: true, + configurable: true + }); + /** + * Registers a function to be executed when the scene is ready + * @param {Function} func - the function to be executed + */ + Scene.prototype.executeWhenReady = function (func) { + var _this = this; + this.onReadyObservable.add(func); + if (this._executeWhenReadyTimeoutId !== -1) { + return; + } + this._executeWhenReadyTimeoutId = setTimeout(function () { + _this._checkIsReady(); + }, 150); + }; + /** + * Returns a promise that resolves when the scene is ready + * @returns A promise that resolves when the scene is ready + */ + Scene.prototype.whenReadyAsync = function () { + var _this = this; + return new Promise(function (resolve) { + _this.executeWhenReady(function () { + resolve(); + }); + }); + }; + /** @hidden */ + Scene.prototype._checkIsReady = function () { + var _this = this; + this._registerTransientComponents(); + if (this.isReady()) { + this.onReadyObservable.notifyObservers(this); + this.onReadyObservable.clear(); + this._executeWhenReadyTimeoutId = -1; + return; + } + this._executeWhenReadyTimeoutId = setTimeout(function () { + _this._checkIsReady(); + }, 150); + }; + // Animations + /** + * Will start the animation sequence of a given target + * @param target defines the target + * @param from defines from which frame should animation start + * @param to defines until which frame should animation run. + * @param weight defines the weight to apply to the animation (1.0 by default) + * @param loop defines if the animation loops + * @param speedRatio defines the speed in which to run the animation (1.0 by default) + * @param onAnimationEnd defines the function to be executed when the animation ends + * @param animatable defines an animatable object. If not provided a new one will be created from the given params + * @param targetMask defines if the target should be animated if animations are present (this is called recursively on descendant animatables regardless of return value) + * @returns the animatable object created for this animation + */ + Scene.prototype.beginWeightedAnimation = function (target, from, to, weight, loop, speedRatio, onAnimationEnd, animatable, targetMask) { + if (weight === void 0) { weight = 1.0; } + if (speedRatio === void 0) { speedRatio = 1.0; } + var returnedAnimatable = this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, false, targetMask); + returnedAnimatable.weight = weight; + return returnedAnimatable; + }; + /** + * Will start the animation sequence of a given target + * @param target defines the target + * @param from defines from which frame should animation start + * @param to defines until which frame should animation run. + * @param loop defines if the animation loops + * @param speedRatio defines the speed in which to run the animation (1.0 by default) + * @param onAnimationEnd defines the function to be executed when the animation ends + * @param animatable defines an animatable object. If not provided a new one will be created from the given params + * @param stopCurrent defines if the current animations must be stopped first (true by default) + * @param targetMask defines if the target should be animated if animations are present (this is called recursively on descendant animatables regardless of return value) + * @returns the animatable object created for this animation + */ + Scene.prototype.beginAnimation = function (target, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask) { + if (speedRatio === void 0) { speedRatio = 1.0; } + if (stopCurrent === void 0) { stopCurrent = true; } + if (from > to && speedRatio > 0) { + speedRatio *= -1; + } + if (stopCurrent) { + this.stopAnimation(target, undefined, targetMask); + } + if (!animatable) { + animatable = new BABYLON.Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd); + } + var shouldRunTargetAnimations = targetMask ? targetMask(target) : true; + // Local animations + if (target.animations && shouldRunTargetAnimations) { + animatable.appendAnimations(target, target.animations); + } + // Children animations + if (target.getAnimatables) { + var animatables = target.getAnimatables(); + for (var index = 0; index < animatables.length; index++) { + this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask); + } + } + animatable.reset(); + return animatable; + }; + /** + * Begin a new animation on a given node + * @param target defines the target where the animation will take place + * @param animations defines the list of animations to start + * @param from defines the initial value + * @param to defines the final value + * @param loop defines if you want animation to loop (off by default) + * @param speedRatio defines the speed ratio to apply to all animations + * @param onAnimationEnd defines the callback to call when an animation ends (will be called once per node) + * @returns the list of created animatables + */ + Scene.prototype.beginDirectAnimation = function (target, animations, from, to, loop, speedRatio, onAnimationEnd) { + if (speedRatio === undefined) { + speedRatio = 1.0; + } + var animatable = new BABYLON.Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, animations); + return animatable; + }; + /** + * Begin a new animation on a given node and its hierarchy + * @param target defines the root node where the animation will take place + * @param directDescendantsOnly if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used. + * @param animations defines the list of animations to start + * @param from defines the initial value + * @param to defines the final value + * @param loop defines if you want animation to loop (off by default) + * @param speedRatio defines the speed ratio to apply to all animations + * @param onAnimationEnd defines the callback to call when an animation ends (will be called once per node) + * @returns the list of animatables created for all nodes + */ + Scene.prototype.beginDirectHierarchyAnimation = function (target, directDescendantsOnly, animations, from, to, loop, speedRatio, onAnimationEnd) { + var children = target.getDescendants(directDescendantsOnly); + var result = []; + result.push(this.beginDirectAnimation(target, animations, from, to, loop, speedRatio, onAnimationEnd)); + for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { + var child = children_1[_i]; + result.push(this.beginDirectAnimation(child, animations, from, to, loop, speedRatio, onAnimationEnd)); + } + return result; + }; + /** + * Gets the animatable associated with a specific target + * @param target defines the target of the animatable + * @returns the required animatable if found + */ + Scene.prototype.getAnimatableByTarget = function (target) { + for (var index = 0; index < this._activeAnimatables.length; index++) { + if (this._activeAnimatables[index].target === target) { + return this._activeAnimatables[index]; + } + } + return null; + }; + /** + * Gets all animatables associated with a given target + * @param target defines the target to look animatables for + * @returns an array of Animatables + */ + Scene.prototype.getAllAnimatablesByTarget = function (target) { + var result = []; + for (var index = 0; index < this._activeAnimatables.length; index++) { + if (this._activeAnimatables[index].target === target) { + result.push(this._activeAnimatables[index]); + } + } + return result; + }; + Object.defineProperty(Scene.prototype, "animatables", { + /** + * Gets all animatable attached to the scene + */ + get: function () { + return this._activeAnimatables; + }, + enumerable: true, + configurable: true + }); + /** + * Will stop the animation of the given target + * @param target - the target + * @param animationName - the name of the animation to stop (all animations will be stopped if both this and targetMask are empty) + * @param targetMask - a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty) + */ + Scene.prototype.stopAnimation = function (target, animationName, targetMask) { + var animatables = this.getAllAnimatablesByTarget(target); + for (var _i = 0, animatables_1 = animatables; _i < animatables_1.length; _i++) { + var animatable = animatables_1[_i]; + animatable.stop(animationName, targetMask); + } + }; + /** + * Stops and removes all animations that have been applied to the scene + */ + Scene.prototype.stopAllAnimations = function () { + if (this._activeAnimatables) { + for (var i = 0; i < this._activeAnimatables.length; i++) { + this._activeAnimatables[i].stop(); + } + this._activeAnimatables = []; + } + for (var _i = 0, _a = this.animationGroups; _i < _a.length; _i++) { + var group = _a[_i]; + group.stop(); + } + }; + Scene.prototype._animate = function () { + if (!this.animationsEnabled || this._activeAnimatables.length === 0) { + return; + } + // Getting time + var now = BABYLON.Tools.Now; + if (!this._animationTimeLast) { + if (this._pendingData.length > 0) { + return; + } + this._animationTimeLast = now; + } + var deltaTime = this.useConstantAnimationDeltaTime ? 16.0 : (now - this._animationTimeLast) * this.animationTimeScale; + this._animationTime += deltaTime; + this._animationTimeLast = now; + for (var index = 0; index < this._activeAnimatables.length; index++) { + this._activeAnimatables[index]._animate(this._animationTime); + } + // Late animation bindings + this._processLateAnimationBindings(); + }; + /** @hidden */ + Scene.prototype._registerTargetForLateAnimationBinding = function (runtimeAnimation, originalValue) { + var target = runtimeAnimation.target; + this._registeredForLateAnimationBindings.pushNoDuplicate(target); + if (!target._lateAnimationHolders) { + target._lateAnimationHolders = {}; + } + if (!target._lateAnimationHolders[runtimeAnimation.targetPath]) { + target._lateAnimationHolders[runtimeAnimation.targetPath] = { + totalWeight: 0, + animations: [], + originalValue: originalValue + }; + } + target._lateAnimationHolders[runtimeAnimation.targetPath].animations.push(runtimeAnimation); + target._lateAnimationHolders[runtimeAnimation.targetPath].totalWeight += runtimeAnimation.weight; + }; + Scene.prototype._processLateAnimationBindingsForMatrices = function (holder) { + var normalizer = 1.0; + var finalPosition = BABYLON.Tmp.Vector3[0]; + var finalScaling = BABYLON.Tmp.Vector3[1]; + var finalQuaternion = BABYLON.Tmp.Quaternion[0]; + var startIndex = 0; + var originalAnimation = holder.animations[0]; + var originalValue = holder.originalValue; + var scale = 1; + if (holder.totalWeight < 1.0) { + // We need to mix the original value in + originalValue.decompose(finalScaling, finalQuaternion, finalPosition); + scale = 1.0 - holder.totalWeight; + } + else { + startIndex = 1; + // We need to normalize the weights + normalizer = holder.totalWeight; + originalAnimation.currentValue.decompose(finalScaling, finalQuaternion, finalPosition); + scale = originalAnimation.weight / normalizer; + if (scale == 1) { + return originalAnimation.currentValue; + } + } + finalScaling.scaleInPlace(scale); + finalPosition.scaleInPlace(scale); + finalQuaternion.scaleInPlace(scale); + for (var animIndex = startIndex; animIndex < holder.animations.length; animIndex++) { + var runtimeAnimation = holder.animations[animIndex]; + var scale = runtimeAnimation.weight / normalizer; + var currentPosition = BABYLON.Tmp.Vector3[2]; + var currentScaling = BABYLON.Tmp.Vector3[3]; + var currentQuaternion = BABYLON.Tmp.Quaternion[1]; + runtimeAnimation.currentValue.decompose(currentScaling, currentQuaternion, currentPosition); + currentScaling.scaleAndAddToRef(scale, finalScaling); + currentQuaternion.scaleAndAddToRef(scale, finalQuaternion); + currentPosition.scaleAndAddToRef(scale, finalPosition); + } + BABYLON.Matrix.ComposeToRef(finalScaling, finalQuaternion, finalPosition, originalAnimation._workValue); + return originalAnimation._workValue; + }; + Scene.prototype._processLateAnimationBindingsForQuaternions = function (holder, refQuaternion) { + var originalAnimation = holder.animations[0]; + var originalValue = holder.originalValue; + if (holder.animations.length === 1) { + BABYLON.Quaternion.SlerpToRef(originalValue, originalAnimation.currentValue, Math.min(1.0, holder.totalWeight), refQuaternion); + return refQuaternion; + } + var normalizer = 1.0; + var quaternions; + var weights; + if (holder.totalWeight < 1.0) { + var scale = 1.0 - holder.totalWeight; + quaternions = []; + weights = []; + quaternions.push(originalValue); + weights.push(scale); + } + else { + if (holder.animations.length === 2) { // Slerp as soon as we can + BABYLON.Quaternion.SlerpToRef(holder.animations[0].currentValue, holder.animations[1].currentValue, holder.animations[1].weight / holder.totalWeight, refQuaternion); + return refQuaternion; + } + quaternions = []; + weights = []; + normalizer = holder.totalWeight; + } + for (var animIndex = 0; animIndex < holder.animations.length; animIndex++) { + var runtimeAnimation = holder.animations[animIndex]; + quaternions.push(runtimeAnimation.currentValue); + weights.push(runtimeAnimation.weight / normalizer); + } + // https://gamedev.stackexchange.com/questions/62354/method-for-interpolation-between-3-quaternions + var cumulativeAmount = 0; + var cumulativeQuaternion = null; + for (var index = 0; index < quaternions.length;) { + if (!cumulativeQuaternion) { + BABYLON.Quaternion.SlerpToRef(quaternions[index], quaternions[index + 1], weights[index + 1] / (weights[index] + weights[index + 1]), refQuaternion); + cumulativeQuaternion = refQuaternion; + cumulativeAmount = weights[index] + weights[index + 1]; + index += 2; + continue; + } + cumulativeAmount += weights[index]; + BABYLON.Quaternion.SlerpToRef(cumulativeQuaternion, quaternions[index], weights[index] / cumulativeAmount, cumulativeQuaternion); + index++; + } + return cumulativeQuaternion; + }; + Scene.prototype._processLateAnimationBindings = function () { + if (!this._registeredForLateAnimationBindings.length) { + return; + } + for (var index = 0; index < this._registeredForLateAnimationBindings.length; index++) { + var target = this._registeredForLateAnimationBindings.data[index]; + for (var path in target._lateAnimationHolders) { + var holder = target._lateAnimationHolders[path]; + var originalAnimation = holder.animations[0]; + var originalValue = holder.originalValue; + var matrixDecomposeMode = BABYLON.Animation.AllowMatrixDecomposeForInterpolation && originalValue.m; // ie. data is matrix + var finalValue = target[path]; + if (matrixDecomposeMode) { + finalValue = this._processLateAnimationBindingsForMatrices(holder); + } + else { + var quaternionMode = originalValue.w !== undefined; + if (quaternionMode) { + finalValue = this._processLateAnimationBindingsForQuaternions(holder, finalValue || BABYLON.Quaternion.Identity()); + } + else { + var startIndex = 0; + var normalizer = 1.0; + if (holder.totalWeight < 1.0) { + // We need to mix the original value in + if (originalValue.scale) { + finalValue = originalValue.scale(1.0 - holder.totalWeight); + } + else { + finalValue = originalValue * (1.0 - holder.totalWeight); + } + } + else { + // We need to normalize the weights + normalizer = holder.totalWeight; + var scale_1 = originalAnimation.weight / normalizer; + if (scale_1 !== 1) { + if (originalAnimation.currentValue.scale) { + finalValue = originalAnimation.currentValue.scale(scale_1); + } + else { + finalValue = originalAnimation.currentValue * scale_1; + } + } + else { + finalValue = originalAnimation.currentValue; + } + startIndex = 1; + } + for (var animIndex = startIndex; animIndex < holder.animations.length; animIndex++) { + var runtimeAnimation = holder.animations[animIndex]; + var scale = runtimeAnimation.weight / normalizer; + if (runtimeAnimation.currentValue.scaleAndAddToRef) { + runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue); + } + else { + finalValue += runtimeAnimation.currentValue * scale; + } + } + } + } + target[path] = finalValue; + } + target._lateAnimationHolders = {}; + } + this._registeredForLateAnimationBindings.reset(); + }; + // Matrix + /** @hidden */ + Scene.prototype._switchToAlternateCameraConfiguration = function (active) { + this._useAlternateCameraConfiguration = active; + }; + /** + * Gets the current view matrix + * @returns a Matrix + */ + Scene.prototype.getViewMatrix = function () { + return this._useAlternateCameraConfiguration ? this._alternateViewMatrix : this._viewMatrix; + }; + /** + * Gets the current projection matrix + * @returns a Matrix + */ + Scene.prototype.getProjectionMatrix = function () { + return this._useAlternateCameraConfiguration ? this._alternateProjectionMatrix : this._projectionMatrix; + }; + /** + * Gets the current transform matrix + * @returns a Matrix made of View * Projection + */ + Scene.prototype.getTransformMatrix = function () { + return this._useAlternateCameraConfiguration ? this._alternateTransformMatrix : this._transformMatrix; + }; + /** + * Sets the current transform matrix + * @param view defines the View matrix to use + * @param projection defines the Projection matrix to use + */ + Scene.prototype.setTransformMatrix = function (view, projection) { + if (this._viewUpdateFlag === view.updateFlag && this._projectionUpdateFlag === projection.updateFlag) { + return; + } + this._viewUpdateFlag = view.updateFlag; + this._projectionUpdateFlag = projection.updateFlag; + this._viewMatrix = view; + this._projectionMatrix = projection; + this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix); + // Update frustum + if (!this._frustumPlanes) { + this._frustumPlanes = BABYLON.Frustum.GetPlanes(this._transformMatrix); + } + else { + BABYLON.Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes); + } + if (this.activeCamera && this.activeCamera._alternateCamera) { + var otherCamera = this.activeCamera._alternateCamera; + otherCamera.getViewMatrix().multiplyToRef(otherCamera.getProjectionMatrix(), BABYLON.Tmp.Matrix[0]); + BABYLON.Frustum.GetRightPlaneToRef(BABYLON.Tmp.Matrix[0], this._frustumPlanes[3]); // Replace right plane by second camera right plane + } + if (this._sceneUbo.useUbo) { + this._sceneUbo.updateMatrix("viewProjection", this._transformMatrix); + this._sceneUbo.updateMatrix("view", this._viewMatrix); + this._sceneUbo.update(); + } + }; + /** @hidden */ + Scene.prototype._setAlternateTransformMatrix = function (view, projection) { + if (this._alternateViewUpdateFlag === view.updateFlag && this._alternateProjectionUpdateFlag === projection.updateFlag) { + return; + } + this._alternateViewUpdateFlag = view.updateFlag; + this._alternateProjectionUpdateFlag = projection.updateFlag; + this._alternateViewMatrix = view; + this._alternateProjectionMatrix = projection; + if (!this._alternateTransformMatrix) { + this._alternateTransformMatrix = BABYLON.Matrix.Zero(); + } + this._alternateViewMatrix.multiplyToRef(this._alternateProjectionMatrix, this._alternateTransformMatrix); + if (!this._alternateSceneUbo) { + this._createAlternateUbo(); + } + if (this._alternateSceneUbo.useUbo) { + this._alternateSceneUbo.updateMatrix("viewProjection", this._alternateTransformMatrix); + this._alternateSceneUbo.updateMatrix("view", this._alternateViewMatrix); + this._alternateSceneUbo.update(); + } + }; + /** + * Gets the uniform buffer used to store scene data + * @returns a UniformBuffer + */ + Scene.prototype.getSceneUniformBuffer = function () { + return this._useAlternateCameraConfiguration ? this._alternateSceneUbo : this._sceneUbo; + }; + /** + * Gets an unique (relatively to the current scene) Id + * @returns an unique number for the scene + */ + Scene.prototype.getUniqueId = function () { + var result = Scene._uniqueIdCounter; + Scene._uniqueIdCounter++; + return result; + }; + /** + * Add a mesh to the list of scene's meshes + * @param newMesh defines the mesh to add + * @param recursive if all child meshes should also be added to the scene + */ + Scene.prototype.addMesh = function (newMesh, recursive) { + var _this = this; + if (recursive === void 0) { recursive = false; } + this.meshes.push(newMesh); + //notify the collision coordinator + if (this.collisionCoordinator) { + this.collisionCoordinator.onMeshAdded(newMesh); + } + newMesh._resyncLightSources(); + this.onNewMeshAddedObservable.notifyObservers(newMesh); + if (recursive) { + newMesh.getChildMeshes().forEach(function (m) { + _this.addMesh(m); + }); + } + }; + /** + * Remove a mesh for the list of scene's meshes + * @param toRemove defines the mesh to remove + * @param recursive if all child meshes should also be removed from the scene + * @returns the index where the mesh was in the mesh list + */ + Scene.prototype.removeMesh = function (toRemove, recursive) { + var _this = this; + if (recursive === void 0) { recursive = false; } + var index = this.meshes.indexOf(toRemove); + if (index !== -1) { + // Remove from the scene if mesh found + this.meshes.splice(index, 1); + } + this.onMeshRemovedObservable.notifyObservers(toRemove); + if (recursive) { + toRemove.getChildMeshes().forEach(function (m) { + _this.removeMesh(m); + }); + } + return index; + }; + /** + * Add a transform node to the list of scene's transform nodes + * @param newTransformNode defines the transform node to add + */ + Scene.prototype.addTransformNode = function (newTransformNode) { + this.transformNodes.push(newTransformNode); + this.onNewTransformNodeAddedObservable.notifyObservers(newTransformNode); + }; + /** + * Remove a transform node for the list of scene's transform nodes + * @param toRemove defines the transform node to remove + * @returns the index where the transform node was in the transform node list + */ + Scene.prototype.removeTransformNode = function (toRemove) { + var index = this.transformNodes.indexOf(toRemove); + if (index !== -1) { + // Remove from the scene if found + this.transformNodes.splice(index, 1); + } + this.onTransformNodeRemovedObservable.notifyObservers(toRemove); + return index; + }; + /** + * Remove a skeleton for the list of scene's skeletons + * @param toRemove defines the skeleton to remove + * @returns the index where the skeleton was in the skeleton list + */ + Scene.prototype.removeSkeleton = function (toRemove) { + var index = this.skeletons.indexOf(toRemove); + if (index !== -1) { + // Remove from the scene if found + this.skeletons.splice(index, 1); + } + return index; + }; + /** + * Remove a morph target for the list of scene's morph targets + * @param toRemove defines the morph target to remove + * @returns the index where the morph target was in the morph target list + */ + Scene.prototype.removeMorphTargetManager = function (toRemove) { + var index = this.morphTargetManagers.indexOf(toRemove); + if (index !== -1) { + // Remove from the scene if found + this.morphTargetManagers.splice(index, 1); + } + return index; + }; + /** + * Remove a light for the list of scene's lights + * @param toRemove defines the light to remove + * @returns the index where the light was in the light list + */ + Scene.prototype.removeLight = function (toRemove) { + var index = this.lights.indexOf(toRemove); + if (index !== -1) { + // Remove from meshes + for (var _i = 0, _a = this.meshes; _i < _a.length; _i++) { + var mesh = _a[_i]; + mesh._removeLightSource(toRemove); + } + // Remove from the scene if mesh found + this.lights.splice(index, 1); + this.sortLightsByPriority(); + } + this.onLightRemovedObservable.notifyObservers(toRemove); + return index; + }; + /** + * Remove a camera for the list of scene's cameras + * @param toRemove defines the camera to remove + * @returns the index where the camera was in the camera list + */ + Scene.prototype.removeCamera = function (toRemove) { + var index = this.cameras.indexOf(toRemove); + if (index !== -1) { + // Remove from the scene if mesh found + this.cameras.splice(index, 1); + } + // Remove from activeCameras + var index2 = this.activeCameras.indexOf(toRemove); + if (index2 !== -1) { + // Remove from the scene if mesh found + this.activeCameras.splice(index2, 1); + } + // Reset the activeCamera + if (this.activeCamera === toRemove) { + if (this.cameras.length > 0) { + this.activeCamera = this.cameras[0]; + } + else { + this.activeCamera = null; + } + } + this.onCameraRemovedObservable.notifyObservers(toRemove); + return index; + }; + /** + * Remove a particle system for the list of scene's particle systems + * @param toRemove defines the particle system to remove + * @returns the index where the particle system was in the particle system list + */ + Scene.prototype.removeParticleSystem = function (toRemove) { + var index = this.particleSystems.indexOf(toRemove); + if (index !== -1) { + this.particleSystems.splice(index, 1); + } + return index; + }; + /** + * Remove a animation for the list of scene's animations + * @param toRemove defines the animation to remove + * @returns the index where the animation was in the animation list + */ + Scene.prototype.removeAnimation = function (toRemove) { + var index = this.animations.indexOf(toRemove); + if (index !== -1) { + this.animations.splice(index, 1); + } + return index; + }; + /** + * Removes the given animation group from this scene. + * @param toRemove The animation group to remove + * @returns The index of the removed animation group + */ + Scene.prototype.removeAnimationGroup = function (toRemove) { + var index = this.animationGroups.indexOf(toRemove); + if (index !== -1) { + this.animationGroups.splice(index, 1); + } + return index; + }; + /** + * Removes the given multi-material from this scene. + * @param toRemove The multi-material to remove + * @returns The index of the removed multi-material + */ + Scene.prototype.removeMultiMaterial = function (toRemove) { + var index = this.multiMaterials.indexOf(toRemove); + if (index !== -1) { + this.multiMaterials.splice(index, 1); + } + return index; + }; + /** + * Removes the given material from this scene. + * @param toRemove The material to remove + * @returns The index of the removed material + */ + Scene.prototype.removeMaterial = function (toRemove) { + var index = this.materials.indexOf(toRemove); + if (index !== -1) { + this.materials.splice(index, 1); + } + this.onMaterialRemovedObservable.notifyObservers(toRemove); + return index; + }; + /** + * Removes the given action manager from this scene. + * @param toRemove The action manager to remove + * @returns The index of the removed action manager + */ + Scene.prototype.removeActionManager = function (toRemove) { + var index = this.actionManagers.indexOf(toRemove); + if (index !== -1) { + this.actionManagers.splice(index, 1); + } + return index; + }; + /** + * Removes the given texture from this scene. + * @param toRemove The texture to remove + * @returns The index of the removed texture + */ + Scene.prototype.removeTexture = function (toRemove) { + var index = this.textures.indexOf(toRemove); + if (index !== -1) { + this.textures.splice(index, 1); + } + this.onTextureRemovedObservable.notifyObservers(toRemove); + return index; + }; + /** + * Adds the given light to this scene + * @param newLight The light to add + */ + Scene.prototype.addLight = function (newLight) { + this.lights.push(newLight); + this.sortLightsByPriority(); + // Add light to all meshes (To support if the light is removed and then readded) + for (var _i = 0, _a = this.meshes; _i < _a.length; _i++) { + var mesh = _a[_i]; + if (mesh._lightSources.indexOf(newLight) === -1) { + mesh._lightSources.push(newLight); + mesh._resyncLightSources(); + } + } + this.onNewLightAddedObservable.notifyObservers(newLight); + }; + /** + * Sorts the list list based on light priorities + */ + Scene.prototype.sortLightsByPriority = function () { + if (this.requireLightSorting) { + this.lights.sort(BABYLON.Light.CompareLightsPriority); + } + }; + /** + * Adds the given camera to this scene + * @param newCamera The camera to add + */ + Scene.prototype.addCamera = function (newCamera) { + this.cameras.push(newCamera); + this.onNewCameraAddedObservable.notifyObservers(newCamera); + }; + /** + * Adds the given skeleton to this scene + * @param newSkeleton The skeleton to add + */ + Scene.prototype.addSkeleton = function (newSkeleton) { + this.skeletons.push(newSkeleton); + }; + /** + * Adds the given particle system to this scene + * @param newParticleSystem The particle system to add + */ + Scene.prototype.addParticleSystem = function (newParticleSystem) { + this.particleSystems.push(newParticleSystem); + }; + /** + * Adds the given animation to this scene + * @param newAnimation The animation to add + */ + Scene.prototype.addAnimation = function (newAnimation) { + this.animations.push(newAnimation); + }; + /** + * Adds the given animation group to this scene. + * @param newAnimationGroup The animation group to add + */ + Scene.prototype.addAnimationGroup = function (newAnimationGroup) { + this.animationGroups.push(newAnimationGroup); + }; + /** + * Adds the given multi-material to this scene + * @param newMultiMaterial The multi-material to add + */ + Scene.prototype.addMultiMaterial = function (newMultiMaterial) { + this.multiMaterials.push(newMultiMaterial); + }; + /** + * Adds the given material to this scene + * @param newMaterial The material to add + */ + Scene.prototype.addMaterial = function (newMaterial) { + this.materials.push(newMaterial); + this.onNewMaterialAddedObservable.notifyObservers(newMaterial); + }; + /** + * Adds the given morph target to this scene + * @param newMorphTargetManager The morph target to add + */ + Scene.prototype.addMorphTargetManager = function (newMorphTargetManager) { + this.morphTargetManagers.push(newMorphTargetManager); + }; + /** + * Adds the given geometry to this scene + * @param newGeometry The geometry to add + */ + Scene.prototype.addGeometry = function (newGeometry) { + this.geometries.push(newGeometry); + }; + /** + * Adds the given action manager to this scene + * @param newActionManager The action manager to add + */ + Scene.prototype.addActionManager = function (newActionManager) { + this.actionManagers.push(newActionManager); + }; + /** + * Adds the given texture to this scene. + * @param newTexture The texture to add + */ + Scene.prototype.addTexture = function (newTexture) { + this.textures.push(newTexture); + this.onNewTextureAddedObservable.notifyObservers(newTexture); + }; + /** + * Switch active camera + * @param newCamera defines the new active camera + * @param attachControl defines if attachControl must be called for the new active camera (default: true) + */ + Scene.prototype.switchActiveCamera = function (newCamera, attachControl) { + if (attachControl === void 0) { attachControl = true; } + var canvas = this._engine.getRenderingCanvas(); + if (!canvas) { + return; + } + if (this.activeCamera) { + this.activeCamera.detachControl(canvas); + } + this.activeCamera = newCamera; + if (attachControl) { + newCamera.attachControl(canvas); + } + }; + /** + * sets the active camera of the scene using its ID + * @param id defines the camera's ID + * @return the new active camera or null if none found. + */ + Scene.prototype.setActiveCameraByID = function (id) { + var camera = this.getCameraByID(id); + if (camera) { + this.activeCamera = camera; + return camera; + } + return null; + }; + /** + * sets the active camera of the scene using its name + * @param name defines the camera's name + * @returns the new active camera or null if none found. + */ + Scene.prototype.setActiveCameraByName = function (name) { + var camera = this.getCameraByName(name); + if (camera) { + this.activeCamera = camera; + return camera; + } + return null; + }; + /** + * get an animation group using its name + * @param name defines the material's name + * @return the animation group or null if none found. + */ + Scene.prototype.getAnimationGroupByName = function (name) { + for (var index = 0; index < this.animationGroups.length; index++) { + if (this.animationGroups[index].name === name) { + return this.animationGroups[index]; + } + } + return null; + }; + /** + * get a material using its id + * @param id defines the material's ID + * @return the material or null if none found. + */ + Scene.prototype.getMaterialByID = function (id) { + for (var index = 0; index < this.materials.length; index++) { + if (this.materials[index].id === id) { + return this.materials[index]; + } + } + return null; + }; + /** + * Gets a material using its name + * @param name defines the material's name + * @return the material or null if none found. + */ + Scene.prototype.getMaterialByName = function (name) { + for (var index = 0; index < this.materials.length; index++) { + if (this.materials[index].name === name) { + return this.materials[index]; + } + } + return null; + }; + /** + * Gets a camera using its id + * @param id defines the id to look for + * @returns the camera or null if not found + */ + Scene.prototype.getCameraByID = function (id) { + for (var index = 0; index < this.cameras.length; index++) { + if (this.cameras[index].id === id) { + return this.cameras[index]; + } + } + return null; + }; + /** + * Gets a camera using its unique id + * @param uniqueId defines the unique id to look for + * @returns the camera or null if not found + */ + Scene.prototype.getCameraByUniqueID = function (uniqueId) { + for (var index = 0; index < this.cameras.length; index++) { + if (this.cameras[index].uniqueId === uniqueId) { + return this.cameras[index]; + } + } + return null; + }; + /** + * Gets a camera using its name + * @param name defines the camera's name + * @return the camera or null if none found. + */ + Scene.prototype.getCameraByName = function (name) { + for (var index = 0; index < this.cameras.length; index++) { + if (this.cameras[index].name === name) { + return this.cameras[index]; + } + } + return null; + }; + /** + * Gets a bone using its id + * @param id defines the bone's id + * @return the bone or null if not found + */ + Scene.prototype.getBoneByID = function (id) { + for (var skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) { + var skeleton = this.skeletons[skeletonIndex]; + for (var boneIndex = 0; boneIndex < skeleton.bones.length; boneIndex++) { + if (skeleton.bones[boneIndex].id === id) { + return skeleton.bones[boneIndex]; + } + } + } + return null; + }; + /** + * Gets a bone using its id + * @param name defines the bone's name + * @return the bone or null if not found + */ + Scene.prototype.getBoneByName = function (name) { + for (var skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) { + var skeleton = this.skeletons[skeletonIndex]; + for (var boneIndex = 0; boneIndex < skeleton.bones.length; boneIndex++) { + if (skeleton.bones[boneIndex].name === name) { + return skeleton.bones[boneIndex]; + } + } + } + return null; + }; + /** + * Gets a light node using its name + * @param name defines the the light's name + * @return the light or null if none found. + */ + Scene.prototype.getLightByName = function (name) { + for (var index = 0; index < this.lights.length; index++) { + if (this.lights[index].name === name) { + return this.lights[index]; + } + } + return null; + }; + /** + * Gets a light node using its id + * @param id defines the light's id + * @return the light or null if none found. + */ + Scene.prototype.getLightByID = function (id) { + for (var index = 0; index < this.lights.length; index++) { + if (this.lights[index].id === id) { + return this.lights[index]; + } + } + return null; + }; + /** + * Gets a light node using its scene-generated unique ID + * @param uniqueId defines the light's unique id + * @return the light or null if none found. + */ + Scene.prototype.getLightByUniqueID = function (uniqueId) { + for (var index = 0; index < this.lights.length; index++) { + if (this.lights[index].uniqueId === uniqueId) { + return this.lights[index]; + } + } + return null; + }; + /** + * Gets a particle system by id + * @param id defines the particle system id + * @return the corresponding system or null if none found + */ + Scene.prototype.getParticleSystemByID = function (id) { + for (var index = 0; index < this.particleSystems.length; index++) { + if (this.particleSystems[index].id === id) { + return this.particleSystems[index]; + } + } + return null; + }; + /** + * Gets a geometry using its ID + * @param id defines the geometry's id + * @return the geometry or null if none found. + */ + Scene.prototype.getGeometryByID = function (id) { + for (var index = 0; index < this.geometries.length; index++) { + if (this.geometries[index].id === id) { + return this.geometries[index]; + } + } + return null; + }; + /** + * Add a new geometry to this scene + * @param geometry defines the geometry to be added to the scene. + * @param force defines if the geometry must be pushed even if a geometry with this id already exists + * @return a boolean defining if the geometry was added or not + */ + Scene.prototype.pushGeometry = function (geometry, force) { + if (!force && this.getGeometryByID(geometry.id)) { + return false; + } + this.geometries.push(geometry); + //notify the collision coordinator + if (this.collisionCoordinator) { + this.collisionCoordinator.onGeometryAdded(geometry); + } + this.onNewGeometryAddedObservable.notifyObservers(geometry); + return true; + }; + /** + * Removes an existing geometry + * @param geometry defines the geometry to be removed from the scene + * @return a boolean defining if the geometry was removed or not + */ + Scene.prototype.removeGeometry = function (geometry) { + var index = this.geometries.indexOf(geometry); + if (index > -1) { + this.geometries.splice(index, 1); + //notify the collision coordinator + if (this.collisionCoordinator) { + this.collisionCoordinator.onGeometryDeleted(geometry); + } + this.onGeometryRemovedObservable.notifyObservers(geometry); + return true; + } + return false; + }; + /** + * Gets the list of geometries attached to the scene + * @returns an array of Geometry + */ + Scene.prototype.getGeometries = function () { + return this.geometries; + }; + /** + * Gets the first added mesh found of a given ID + * @param id defines the id to search for + * @return the mesh found or null if not found at all + */ + Scene.prototype.getMeshByID = function (id) { + for (var index = 0; index < this.meshes.length; index++) { + if (this.meshes[index].id === id) { + return this.meshes[index]; + } + } + return null; + }; + /** + * Gets a list of meshes using their id + * @param id defines the id to search for + * @returns a list of meshes + */ + Scene.prototype.getMeshesByID = function (id) { + return this.meshes.filter(function (m) { + return m.id === id; + }); + }; + /** + * Gets the first added transform node found of a given ID + * @param id defines the id to search for + * @return the found transform node or null if not found at all. + */ + Scene.prototype.getTransformNodeByID = function (id) { + for (var index = 0; index < this.transformNodes.length; index++) { + if (this.transformNodes[index].id === id) { + return this.transformNodes[index]; + } + } + return null; + }; + /** + * Gets a list of transform nodes using their id + * @param id defines the id to search for + * @returns a list of transform nodes + */ + Scene.prototype.getTransformNodesByID = function (id) { + return this.transformNodes.filter(function (m) { + return m.id === id; + }); + }; + /** + * Gets a mesh with its auto-generated unique id + * @param uniqueId defines the unique id to search for + * @return the found mesh or null if not found at all. + */ + Scene.prototype.getMeshByUniqueID = function (uniqueId) { + for (var index = 0; index < this.meshes.length; index++) { + if (this.meshes[index].uniqueId === uniqueId) { + return this.meshes[index]; + } + } + return null; + }; + /** + * Gets a the last added mesh using a given id + * @param id defines the id to search for + * @return the found mesh or null if not found at all. + */ + Scene.prototype.getLastMeshByID = function (id) { + for (var index = this.meshes.length - 1; index >= 0; index--) { + if (this.meshes[index].id === id) { + return this.meshes[index]; + } + } + return null; + }; + /** + * Gets a the last added node (Mesh, Camera, Light) using a given id + * @param id defines the id to search for + * @return the found node or null if not found at all + */ + Scene.prototype.getLastEntryByID = function (id) { + var index; + for (index = this.meshes.length - 1; index >= 0; index--) { + if (this.meshes[index].id === id) { + return this.meshes[index]; + } + } + for (index = this.transformNodes.length - 1; index >= 0; index--) { + if (this.transformNodes[index].id === id) { + return this.transformNodes[index]; + } + } + for (index = this.cameras.length - 1; index >= 0; index--) { + if (this.cameras[index].id === id) { + return this.cameras[index]; + } + } + for (index = this.lights.length - 1; index >= 0; index--) { + if (this.lights[index].id === id) { + return this.lights[index]; + } + } + return null; + }; + /** + * Gets a node (Mesh, Camera, Light) using a given id + * @param id defines the id to search for + * @return the found node or null if not found at all + */ + Scene.prototype.getNodeByID = function (id) { + var mesh = this.getMeshByID(id); + if (mesh) { + return mesh; + } + var light = this.getLightByID(id); + if (light) { + return light; + } + var camera = this.getCameraByID(id); + if (camera) { + return camera; + } + var bone = this.getBoneByID(id); + return bone; + }; + /** + * Gets a node (Mesh, Camera, Light) using a given name + * @param name defines the name to search for + * @return the found node or null if not found at all. + */ + Scene.prototype.getNodeByName = function (name) { + var mesh = this.getMeshByName(name); + if (mesh) { + return mesh; + } + var light = this.getLightByName(name); + if (light) { + return light; + } + var camera = this.getCameraByName(name); + if (camera) { + return camera; + } + var bone = this.getBoneByName(name); + return bone; + }; + /** + * Gets a mesh using a given name + * @param name defines the name to search for + * @return the found mesh or null if not found at all. + */ + Scene.prototype.getMeshByName = function (name) { + for (var index = 0; index < this.meshes.length; index++) { + if (this.meshes[index].name === name) { + return this.meshes[index]; + } + } + return null; + }; + /** + * Gets a transform node using a given name + * @param name defines the name to search for + * @return the found transform node or null if not found at all. + */ + Scene.prototype.getTransformNodeByName = function (name) { + for (var index = 0; index < this.transformNodes.length; index++) { + if (this.transformNodes[index].name === name) { + return this.transformNodes[index]; + } + } + return null; + }; + /** + * Gets a skeleton using a given id (if many are found, this function will pick the last one) + * @param id defines the id to search for + * @return the found skeleton or null if not found at all. + */ + Scene.prototype.getLastSkeletonByID = function (id) { + for (var index = this.skeletons.length - 1; index >= 0; index--) { + if (this.skeletons[index].id === id) { + return this.skeletons[index]; + } + } + return null; + }; + /** + * Gets a skeleton using a given id (if many are found, this function will pick the first one) + * @param id defines the id to search for + * @return the found skeleton or null if not found at all. + */ + Scene.prototype.getSkeletonById = function (id) { + for (var index = 0; index < this.skeletons.length; index++) { + if (this.skeletons[index].id === id) { + return this.skeletons[index]; + } + } + return null; + }; + /** + * Gets a skeleton using a given name + * @param name defines the name to search for + * @return the found skeleton or null if not found at all. + */ + Scene.prototype.getSkeletonByName = function (name) { + for (var index = 0; index < this.skeletons.length; index++) { + if (this.skeletons[index].name === name) { + return this.skeletons[index]; + } + } + return null; + }; + /** + * Gets a morph target manager using a given id (if many are found, this function will pick the last one) + * @param id defines the id to search for + * @return the found morph target manager or null if not found at all. + */ + Scene.prototype.getMorphTargetManagerById = function (id) { + for (var index = 0; index < this.morphTargetManagers.length; index++) { + if (this.morphTargetManagers[index].uniqueId === id) { + return this.morphTargetManagers[index]; + } + } + return null; + }; + /** + * Gets a boolean indicating if the given mesh is active + * @param mesh defines the mesh to look for + * @returns true if the mesh is in the active list + */ + Scene.prototype.isActiveMesh = function (mesh) { + return (this._activeMeshes.indexOf(mesh) !== -1); + }; + Object.defineProperty(Scene.prototype, "uid", { + /** + * Return a unique id as a string which can serve as an identifier for the scene + */ + get: function () { + if (!this._uid) { + this._uid = BABYLON.Tools.RandomId(); + } + return this._uid; + }, + enumerable: true, + configurable: true + }); + /** + * Add an externaly attached data from its key. + * This method call will fail and return false, if such key already exists. + * If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method. + * @param key the unique key that identifies the data + * @param data the data object to associate to the key for this Engine instance + * @return true if no such key were already present and the data was added successfully, false otherwise + */ + Scene.prototype.addExternalData = function (key, data) { + if (!this._externalData) { + this._externalData = new BABYLON.StringDictionary(); + } + return this._externalData.add(key, data); + }; + /** + * Get an externaly attached data from its key + * @param key the unique key that identifies the data + * @return the associated data, if present (can be null), or undefined if not present + */ + Scene.prototype.getExternalData = function (key) { + if (!this._externalData) { + return null; + } + return this._externalData.get(key); + }; + /** + * Get an externaly attached data from its key, create it using a factory if it's not already present + * @param key the unique key that identifies the data + * @param factory the factory that will be called to create the instance if and only if it doesn't exists + * @return the associated data, can be null if the factory returned null. + */ + Scene.prototype.getOrAddExternalDataWithFactory = function (key, factory) { + if (!this._externalData) { + this._externalData = new BABYLON.StringDictionary(); + } + return this._externalData.getOrAddWithFactory(key, factory); + }; + /** + * Remove an externaly attached data from the Engine instance + * @param key the unique key that identifies the data + * @return true if the data was successfully removed, false if it doesn't exist + */ + Scene.prototype.removeExternalData = function (key) { + return this._externalData.remove(key); + }; + Scene.prototype._evaluateSubMesh = function (subMesh, mesh) { + if (this.dispatchAllSubMeshesOfActiveMeshes || mesh.alwaysSelectAsActiveMesh || mesh.subMeshes.length === 1 || subMesh.isInFrustum(this._frustumPlanes)) { + for (var _i = 0, _a = this._evaluateSubMeshStage; _i < _a.length; _i++) { + var step = _a[_i]; + step.action(mesh, subMesh); + } + var material = subMesh.getMaterial(); + if (material !== null && material !== undefined) { + // Render targets + if (material.hasRenderTargetTextures && material.getRenderTargetTextures !== undefined) { + if (this._processedMaterials.indexOf(material) === -1) { + this._processedMaterials.push(material); + this._renderTargets.concatWithNoDuplicate(material.getRenderTargetTextures()); + } + } + // Dispatch + this._activeIndices.addCount(subMesh.indexCount, false); + this._renderingManager.dispatch(subMesh, mesh, material); + } + } + }; + /** + * Clear the processed materials smart array preventing retention point in material dispose. + */ + Scene.prototype.freeProcessedMaterials = function () { + this._processedMaterials.dispose(); + }; + /** + * Clear the active meshes smart array preventing retention point in mesh dispose. + */ + Scene.prototype.freeActiveMeshes = function () { + this._activeMeshes.dispose(); + if (this.activeCamera && this.activeCamera._activeMeshes) { + this.activeCamera._activeMeshes.dispose(); + } + if (this.activeCameras) { + for (var i = 0; i < this.activeCameras.length; i++) { + var activeCamera = this.activeCameras[i]; + if (activeCamera && activeCamera._activeMeshes) { + activeCamera._activeMeshes.dispose(); + } + } + } + }; + /** + * Clear the info related to rendering groups preventing retention points during dispose. + */ + Scene.prototype.freeRenderingGroups = function () { + if (this._renderingManager) { + this._renderingManager.freeRenderingGroups(); + } + if (this.textures) { + for (var i = 0; i < this.textures.length; i++) { + var texture = this.textures[i]; + if (texture && texture.renderList) { + texture.freeRenderingGroups(); + } + } + } + }; + /** @hidden */ + Scene.prototype._isInIntermediateRendering = function () { + return this._intermediateRendering; + }; + /** + * Use this function to stop evaluating active meshes. The current list will be keep alive between frames + * @returns the current scene + */ + Scene.prototype.freezeActiveMeshes = function () { + if (!this.activeCamera) { + return this; + } + if (!this._frustumPlanes) { + this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix()); + } + this._evaluateActiveMeshes(); + this._activeMeshesFrozen = true; + return this; + }; + /** + * Use this function to restart evaluating active meshes on every frame + * @returns the current scene + */ + Scene.prototype.unfreezeActiveMeshes = function () { + this._activeMeshesFrozen = false; + return this; + }; + Scene.prototype._evaluateActiveMeshes = function () { + if (this._activeMeshesFrozen && this._activeMeshes.length) { + return; + } + if (!this.activeCamera) { + return; + } + this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this); + this.activeCamera._activeMeshes.reset(); + this._activeMeshes.reset(); + this._renderingManager.reset(); + this._processedMaterials.reset(); + this._activeParticleSystems.reset(); + this._activeSkeletons.reset(); + this._softwareSkinnedMeshes.reset(); + for (var _i = 0, _a = this._beforeEvaluateActiveMeshStage; _i < _a.length; _i++) { + var step = _a[_i]; + step.action(); + } + // Determine mesh candidates + var meshes = this.getActiveMeshCandidates(); + // Check each mesh + var len = meshes.length; + for (var i = 0; i < len; i++) { + var mesh = meshes.data[i]; + if (mesh.isBlocked) { + continue; + } + this._totalVertices.addCount(mesh.getTotalVertices(), false); + if (!mesh.isReady() || !mesh.isEnabled()) { + continue; + } + mesh.computeWorldMatrix(); + // Intersections + if (mesh.actionManager && mesh.actionManager.hasSpecificTriggers2(BABYLON.ActionManager.OnIntersectionEnterTrigger, BABYLON.ActionManager.OnIntersectionExitTrigger)) { + this._meshesForIntersections.pushNoDuplicate(mesh); + } + // Switch to current LOD + var meshLOD = mesh.getLOD(this.activeCamera); + if (meshLOD === undefined || meshLOD === null) { + continue; + } + mesh._preActivate(); + if (mesh.isVisible && mesh.visibility > 0 && (mesh.alwaysSelectAsActiveMesh || ((mesh.layerMask & this.activeCamera.layerMask) !== 0 && mesh.isInFrustum(this._frustumPlanes)))) { + this._activeMeshes.push(mesh); + this.activeCamera._activeMeshes.push(mesh); + mesh._activate(this._renderId); + if (meshLOD !== mesh) { + meshLOD._activate(this._renderId); + } + this._activeMesh(mesh, meshLOD); + } + } + this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this); + // Particle systems + if (this.particlesEnabled) { + this.onBeforeParticlesRenderingObservable.notifyObservers(this); + for (var particleIndex = 0; particleIndex < this.particleSystems.length; particleIndex++) { + var particleSystem = this.particleSystems[particleIndex]; + if (!particleSystem.isStarted() || !particleSystem.emitter) { + continue; + } + var emitter = particleSystem.emitter; + if (!emitter.position || emitter.isEnabled()) { + this._activeParticleSystems.push(particleSystem); + particleSystem.animate(); + this._renderingManager.dispatchParticles(particleSystem); + } + } + this.onAfterParticlesRenderingObservable.notifyObservers(this); + } + }; + Scene.prototype._activeMesh = function (sourceMesh, mesh) { + if (this._skeletonsEnabled && mesh.skeleton !== null && mesh.skeleton !== undefined) { + if (this._activeSkeletons.pushNoDuplicate(mesh.skeleton)) { + mesh.skeleton.prepare(); + } + if (!mesh.computeBonesUsingShaders) { + this._softwareSkinnedMeshes.pushNoDuplicate(mesh); + } + } + for (var _i = 0, _a = this._activeMeshStage; _i < _a.length; _i++) { + var step = _a[_i]; + step.action(sourceMesh, mesh); + } + if (mesh !== undefined && mesh !== null + && mesh.subMeshes !== undefined && mesh.subMeshes !== null && mesh.subMeshes.length > 0) { + var subMeshes = this.getActiveSubMeshCandidates(mesh); + var len = subMeshes.length; + for (var i = 0; i < len; i++) { + var subMesh = subMeshes.data[i]; + this._evaluateSubMesh(subMesh, mesh); + } + } + }; + /** + * Update the transform matrix to update from the current active camera + * @param force defines a boolean used to force the update even if cache is up to date + */ + Scene.prototype.updateTransformMatrix = function (force) { + if (!this.activeCamera) { + return; + } + this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(force)); + }; + /** + * Defines an alternate camera (used mostly in VR-like scenario where two cameras can render the same scene from a slightly different point of view) + * @param alternateCamera defines the camera to use + */ + Scene.prototype.updateAlternateTransformMatrix = function (alternateCamera) { + this._setAlternateTransformMatrix(alternateCamera.getViewMatrix(), alternateCamera.getProjectionMatrix()); + }; + Scene.prototype._renderForCamera = function (camera, rigParent) { + if (camera && camera._skipRendering) { + return; + } + var engine = this._engine; + this.activeCamera = camera; + if (!this.activeCamera) { + throw new Error("Active camera not set"); + } + // Viewport + engine.setViewport(this.activeCamera.viewport); + // Camera + this.resetCachedMaterial(); + this._renderId++; + this.updateTransformMatrix(); + if (camera._alternateCamera) { + this.updateAlternateTransformMatrix(camera._alternateCamera); + this._alternateRendering = true; + } + this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera); + // Meshes + this._evaluateActiveMeshes(); + // Software skinning + for (var softwareSkinnedMeshIndex = 0; softwareSkinnedMeshIndex < this._softwareSkinnedMeshes.length; softwareSkinnedMeshIndex++) { + var mesh = this._softwareSkinnedMeshes.data[softwareSkinnedMeshIndex]; + mesh.applySkeleton(mesh.skeleton); + } + // Render targets + this.onBeforeRenderTargetsRenderObservable.notifyObservers(this); + if (camera.customRenderTargets && camera.customRenderTargets.length > 0) { + this._renderTargets.concatWithNoDuplicate(camera.customRenderTargets); + } + if (rigParent && rigParent.customRenderTargets && rigParent.customRenderTargets.length > 0) { + this._renderTargets.concatWithNoDuplicate(rigParent.customRenderTargets); + } + // Collects render targets from external components. + for (var _i = 0, _a = this._gatherActiveCameraRenderTargetsStage; _i < _a.length; _i++) { + var step = _a[_i]; + step.action(this._renderTargets); + } + if (this.renderTargetsEnabled) { + this._intermediateRendering = true; + if (this._renderTargets.length > 0) { + BABYLON.Tools.StartPerformanceCounter("Render targets", this._renderTargets.length > 0); + for (var renderIndex = 0; renderIndex < this._renderTargets.length; renderIndex++) { + var renderTarget = this._renderTargets.data[renderIndex]; + if (renderTarget._shouldRender()) { + this._renderId++; + var hasSpecialRenderTargetCamera = renderTarget.activeCamera && renderTarget.activeCamera !== this.activeCamera; + renderTarget.render(hasSpecialRenderTargetCamera, this.dumpNextRenderTargets); + } + } + BABYLON.Tools.EndPerformanceCounter("Render targets", this._renderTargets.length > 0); + this._renderId++; + } + for (var _b = 0, _c = this._cameraDrawRenderTargetStage; _b < _c.length; _b++) { + var step = _c[_b]; + step.action(this.activeCamera); + } + this._intermediateRendering = false; + engine.restoreDefaultFramebuffer(); // Restore back buffer if needed + } + this.onAfterRenderTargetsRenderObservable.notifyObservers(this); + // Prepare Frame + if (this.postProcessManager) { + this.postProcessManager._prepareFrame(); + } + // Before Camera Draw + for (var _d = 0, _e = this._beforeCameraDrawStage; _d < _e.length; _d++) { + var step = _e[_d]; + step.action(this.activeCamera); + } + // Render + this.onBeforeDrawPhaseObservable.notifyObservers(this); + this._renderingManager.render(null, null, true, true); + this.onAfterDrawPhaseObservable.notifyObservers(this); + // After Camera Draw + for (var _f = 0, _g = this._afterCameraDrawStage; _f < _g.length; _f++) { + var step = _g[_f]; + step.action(this.activeCamera); + } + // Finalize frame + if (this.postProcessManager) { + this.postProcessManager._finalizeFrame(camera.isIntermediate); + } + // Reset some special arrays + this._renderTargets.reset(); + this._alternateRendering = false; + this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera); + }; + Scene.prototype._processSubCameras = function (camera) { + if (camera.cameraRigMode === BABYLON.Camera.RIG_MODE_NONE) { + this._renderForCamera(camera); + return; + } + // rig cameras + for (var index = 0; index < camera._rigCameras.length; index++) { + this._renderForCamera(camera._rigCameras[index], camera); + } + this.activeCamera = camera; + this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix()); + }; + Scene.prototype._checkIntersections = function () { + for (var index = 0; index < this._meshesForIntersections.length; index++) { + var sourceMesh = this._meshesForIntersections.data[index]; + if (!sourceMesh.actionManager) { + continue; + } + for (var actionIndex = 0; actionIndex < sourceMesh.actionManager.actions.length; actionIndex++) { + var action = sourceMesh.actionManager.actions[actionIndex]; + if (action.trigger === BABYLON.ActionManager.OnIntersectionEnterTrigger || action.trigger === BABYLON.ActionManager.OnIntersectionExitTrigger) { + var parameters = action.getTriggerParameter(); + var otherMesh = parameters instanceof BABYLON.AbstractMesh ? parameters : parameters.mesh; + var areIntersecting = otherMesh.intersectsMesh(sourceMesh, parameters.usePreciseIntersection); + var currentIntersectionInProgress = sourceMesh._intersectionsInProgress.indexOf(otherMesh); + if (areIntersecting && currentIntersectionInProgress === -1) { + if (action.trigger === BABYLON.ActionManager.OnIntersectionEnterTrigger) { + action._executeCurrent(BABYLON.ActionEvent.CreateNew(sourceMesh, undefined, otherMesh)); + sourceMesh._intersectionsInProgress.push(otherMesh); + } + else if (action.trigger === BABYLON.ActionManager.OnIntersectionExitTrigger) { + sourceMesh._intersectionsInProgress.push(otherMesh); + } + } + else if (!areIntersecting && currentIntersectionInProgress > -1) { + //They intersected, and now they don't. + //is this trigger an exit trigger? execute an event. + if (action.trigger === BABYLON.ActionManager.OnIntersectionExitTrigger) { + action._executeCurrent(BABYLON.ActionEvent.CreateNew(sourceMesh, undefined, otherMesh)); + } + //if this is an exit trigger, or no exit trigger exists, remove the id from the intersection in progress array. + if (!sourceMesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnIntersectionExitTrigger, function (parameter) { + var parameterMesh = parameter instanceof BABYLON.AbstractMesh ? parameter : parameter.mesh; + return otherMesh === parameterMesh; + }) || action.trigger === BABYLON.ActionManager.OnIntersectionExitTrigger) { + sourceMesh._intersectionsInProgress.splice(currentIntersectionInProgress, 1); + } + } + } + } + } + }; + /** @hidden */ + Scene.prototype._advancePhysicsEngineStep = function (step) { + // Do nothing. Code will be replaced if physics engine component is referenced + }; + /** + * Render the scene + * @param updateCameras defines a boolean indicating if cameras must update according to their inputs (true by default) + */ + Scene.prototype.render = function (updateCameras) { + if (updateCameras === void 0) { updateCameras = true; } + if (this.isDisposed) { + return; + } + this._frameId++; + // Register components that have been associated lately to the scene. + this._registerTransientComponents(); + this._activeParticles.fetchNewFrame(); + this._totalVertices.fetchNewFrame(); + this._activeIndices.fetchNewFrame(); + this._activeBones.fetchNewFrame(); + this._meshesForIntersections.reset(); + this.resetCachedMaterial(); + this.onBeforeAnimationsObservable.notifyObservers(this); + // Actions + if (this.actionManager) { + this.actionManager.processTrigger(BABYLON.ActionManager.OnEveryFrameTrigger); + } + if (this._engine.isDeterministicLockStep()) { + var deltaTime = Math.max(Scene.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Scene.MaxDeltaTime)) + this._timeAccumulator; + var defaultFPS = (60.0 / 1000.0); + var defaultFrameTime = this.getDeterministicFrameTime(); + var stepsTaken = 0; + var maxSubSteps = this._engine.getLockstepMaxSteps(); + var internalSteps = Math.floor(deltaTime / (1000 * defaultFPS)); + internalSteps = Math.min(internalSteps, maxSubSteps); + do { + this.onBeforeStepObservable.notifyObservers(this); + // Animations + this._animationRatio = defaultFrameTime * defaultFPS; + this._animate(); + this.onAfterAnimationsObservable.notifyObservers(this); + // Physics + this._advancePhysicsEngineStep(defaultFrameTime); + this.onAfterStepObservable.notifyObservers(this); + this._currentStepId++; + stepsTaken++; + deltaTime -= defaultFrameTime; + } while (deltaTime > 0 && stepsTaken < internalSteps); + this._timeAccumulator = deltaTime < 0 ? 0 : deltaTime; + } + else { + // Animations + var deltaTime = this.useConstantAnimationDeltaTime ? 16 : Math.max(Scene.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Scene.MaxDeltaTime)); + this._animationRatio = deltaTime * (60.0 / 1000.0); + this._animate(); + this.onAfterAnimationsObservable.notifyObservers(this); + // Physics + this._advancePhysicsEngineStep(deltaTime); + } + // Before camera update steps + for (var _i = 0, _a = this._beforeCameraUpdateStage; _i < _a.length; _i++) { + var step = _a[_i]; + step.action(); + } + // Update Cameras + if (updateCameras) { + if (this.activeCameras.length > 0) { + for (var cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) { + var camera = this.activeCameras[cameraIndex]; + camera.update(); + if (camera.cameraRigMode !== BABYLON.Camera.RIG_MODE_NONE) { + // rig cameras + for (var index = 0; index < camera._rigCameras.length; index++) { + camera._rigCameras[index].update(); + } + } + } + } + else if (this.activeCamera) { + this.activeCamera.update(); + if (this.activeCamera.cameraRigMode !== BABYLON.Camera.RIG_MODE_NONE) { + // rig cameras + for (var index = 0; index < this.activeCamera._rigCameras.length; index++) { + this.activeCamera._rigCameras[index].update(); + } + } + } + } + // Before render + this.onBeforeRenderObservable.notifyObservers(this); + // Customs render targets + this.onBeforeRenderTargetsRenderObservable.notifyObservers(this); + var engine = this.getEngine(); + var currentActiveCamera = this.activeCamera; + if (this.renderTargetsEnabled) { + BABYLON.Tools.StartPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0); + this._intermediateRendering = true; + for (var customIndex = 0; customIndex < this.customRenderTargets.length; customIndex++) { + var renderTarget = this.customRenderTargets[customIndex]; + if (renderTarget._shouldRender()) { + this._renderId++; + this.activeCamera = renderTarget.activeCamera || this.activeCamera; + if (!this.activeCamera) { + throw new Error("Active camera not set"); + } + // Viewport + engine.setViewport(this.activeCamera.viewport); + // Camera + this.updateTransformMatrix(); + renderTarget.render(currentActiveCamera !== this.activeCamera, this.dumpNextRenderTargets); + } + } + BABYLON.Tools.EndPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0); + this._intermediateRendering = false; + this._renderId++; + } + // Restore back buffer + if (this.customRenderTargets.length > 0) { + engine.restoreDefaultFramebuffer(); + } + this.onAfterRenderTargetsRenderObservable.notifyObservers(this); + this.activeCamera = currentActiveCamera; + for (var _b = 0, _c = this._beforeClearStage; _b < _c.length; _b++) { + var step = _c[_b]; + step.action(); + } + // Clear + if (this.autoClearDepthAndStencil || this.autoClear) { + this._engine.clear(this.clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil); + } + // Collects render targets from external components. + for (var _d = 0, _e = this._gatherRenderTargetsStage; _d < _e.length; _d++) { + var step = _e[_d]; + step.action(this._renderTargets); + } + // Multi-cameras? + if (this.activeCameras.length > 0) { + for (var cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) { + if (cameraIndex > 0) { + this._engine.clear(null, false, true, true); + } + this._processSubCameras(this.activeCameras[cameraIndex]); + } + } + else { + if (!this.activeCamera) { + throw new Error("No camera defined"); + } + this._processSubCameras(this.activeCamera); + } + // Intersection checks + this._checkIntersections(); + // Executes the after render stage actions. + for (var _f = 0, _g = this._afterRenderStage; _f < _g.length; _f++) { + var step = _g[_f]; + step.action(); + } + // After render + if (this.afterRender) { + this.afterRender(); + } + this.onAfterRenderObservable.notifyObservers(this); + // Cleaning + if (this._toBeDisposed.length) { + for (var index = 0; index < this._toBeDisposed.length; index++) { + var data = this._toBeDisposed[index]; + if (data) { + data.dispose(); + } + } + this._toBeDisposed = []; + } + if (this.dumpNextRenderTargets) { + this.dumpNextRenderTargets = false; + } + this._activeBones.addCount(0, true); + this._activeIndices.addCount(0, true); + this._activeParticles.addCount(0, true); + }; + /** + * Freeze all materials + * A frozen material will not be updatable but should be faster to render + */ + Scene.prototype.freezeMaterials = function () { + for (var i = 0; i < this.materials.length; i++) { + this.materials[i].freeze(); + } + }; + /** + * Unfreeze all materials + * A frozen material will not be updatable but should be faster to render + */ + Scene.prototype.unfreezeMaterials = function () { + for (var i = 0; i < this.materials.length; i++) { + this.materials[i].unfreeze(); + } + }; + /** + * Releases all held ressources + */ + Scene.prototype.dispose = function () { + this.beforeRender = null; + this.afterRender = null; + this.skeletons = []; + this.morphTargetManagers = []; + this._transientComponents = []; + this._isReadyForMeshStage.clear(); + this._beforeEvaluateActiveMeshStage.clear(); + this._evaluateSubMeshStage.clear(); + this._activeMeshStage.clear(); + this._cameraDrawRenderTargetStage.clear(); + this._beforeCameraDrawStage.clear(); + this._beforeRenderingGroupDrawStage.clear(); + this._beforeRenderingMeshStage.clear(); + this._afterRenderingMeshStage.clear(); + this._afterRenderingGroupDrawStage.clear(); + this._afterCameraDrawStage.clear(); + this._afterRenderStage.clear(); + this._beforeCameraUpdateStage.clear(); + this._beforeClearStage.clear(); + this._gatherRenderTargetsStage.clear(); + this._gatherActiveCameraRenderTargetsStage.clear(); + this._pointerMoveStage.clear(); + this._pointerDownStage.clear(); + this._pointerUpStage.clear(); + for (var _i = 0, _a = this._components; _i < _a.length; _i++) { + var component = _a[_i]; + component.dispose(); + } + this.importedMeshesFiles = new Array(); + this.stopAllAnimations(); + this.resetCachedMaterial(); + // Smart arrays + if (this.activeCamera) { + this.activeCamera._activeMeshes.dispose(); + this.activeCamera = null; + } + this._activeMeshes.dispose(); + this._renderingManager.dispose(); + this._processedMaterials.dispose(); + this._activeParticleSystems.dispose(); + this._activeSkeletons.dispose(); + this._softwareSkinnedMeshes.dispose(); + this._renderTargets.dispose(); + this._registeredForLateAnimationBindings.dispose(); + this._meshesForIntersections.dispose(); + this._toBeDisposed = []; + // Abort active requests + for (var _b = 0, _c = this._activeRequests; _b < _c.length; _b++) { + var request = _c[_b]; + request.abort(); + } + // Events + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + this.onBeforeRenderObservable.clear(); + this.onAfterRenderObservable.clear(); + this.onBeforeRenderTargetsRenderObservable.clear(); + this.onAfterRenderTargetsRenderObservable.clear(); + this.onAfterStepObservable.clear(); + this.onBeforeStepObservable.clear(); + this.onBeforeActiveMeshesEvaluationObservable.clear(); + this.onAfterActiveMeshesEvaluationObservable.clear(); + this.onBeforeParticlesRenderingObservable.clear(); + this.onAfterParticlesRenderingObservable.clear(); + this.onBeforeDrawPhaseObservable.clear(); + this.onAfterDrawPhaseObservable.clear(); + this.onBeforeAnimationsObservable.clear(); + this.onAfterAnimationsObservable.clear(); + this.onDataLoadedObservable.clear(); + this.onBeforeRenderingGroupObservable.clear(); + this.onAfterRenderingGroupObservable.clear(); + this.onMeshImportedObservable.clear(); + this.onBeforeCameraRenderObservable.clear(); + this.onAfterCameraRenderObservable.clear(); + this.onReadyObservable.clear(); + this.onNewCameraAddedObservable.clear(); + this.onCameraRemovedObservable.clear(); + this.onNewLightAddedObservable.clear(); + this.onLightRemovedObservable.clear(); + this.onNewGeometryAddedObservable.clear(); + this.onGeometryRemovedObservable.clear(); + this.onNewTransformNodeAddedObservable.clear(); + this.onTransformNodeRemovedObservable.clear(); + this.onNewMeshAddedObservable.clear(); + this.onMeshRemovedObservable.clear(); + this.onNewMaterialAddedObservable.clear(); + this.onMaterialRemovedObservable.clear(); + this.onNewTextureAddedObservable.clear(); + this.onTextureRemovedObservable.clear(); + this.onPrePointerObservable.clear(); + this.onPointerObservable.clear(); + this.onPreKeyboardObservable.clear(); + this.onKeyboardObservable.clear(); + this.detachControl(); + // Detach cameras + var canvas = this._engine.getRenderingCanvas(); + if (canvas) { + var index; + for (index = 0; index < this.cameras.length; index++) { + this.cameras[index].detachControl(canvas); + } + } + // Release animation groups + while (this.animationGroups.length) { + this.animationGroups[0].dispose(); + } + // Release lights + while (this.lights.length) { + this.lights[0].dispose(); + } + // Release meshes + while (this.meshes.length) { + this.meshes[0].dispose(true); + } + while (this.transformNodes.length) { + this.removeTransformNode(this.transformNodes[0]); + } + // Release cameras + while (this.cameras.length) { + this.cameras[0].dispose(); + } + // Release materials + if (this.defaultMaterial) { + this.defaultMaterial.dispose(); + } + while (this.multiMaterials.length) { + this.multiMaterials[0].dispose(); + } + while (this.materials.length) { + this.materials[0].dispose(); + } + // Release particles + while (this.particleSystems.length) { + this.particleSystems[0].dispose(); + } + // Release postProcesses + while (this.postProcesses.length) { + this.postProcesses[0].dispose(); + } + // Release textures + while (this.textures.length) { + this.textures[0].dispose(); + } + // Release UBO + this._sceneUbo.dispose(); + if (this._alternateSceneUbo) { + this._alternateSceneUbo.dispose(); + } + // Post-processes + this.postProcessManager.dispose(); + // Remove from engine + index = this._engine.scenes.indexOf(this); + if (index > -1) { + this._engine.scenes.splice(index, 1); + } + this._engine.wipeCaches(true); + this._isDisposed = true; + }; + Object.defineProperty(Scene.prototype, "isDisposed", { + /** + * Gets if the scene is already disposed + */ + get: function () { + return this._isDisposed; + }, + enumerable: true, + configurable: true + }); + /** + * Call this function to reduce memory footprint of the scene. + * Vertex buffers will not store CPU data anymore (this will prevent picking, collisions or physics to work correctly) + */ + Scene.prototype.clearCachedVertexData = function () { + for (var meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) { + var mesh = this.meshes[meshIndex]; + var geometry = mesh.geometry; + if (geometry) { + geometry._indices = []; + for (var vbName in geometry._vertexBuffers) { + if (!geometry._vertexBuffers.hasOwnProperty(vbName)) { + continue; + } + geometry._vertexBuffers[vbName]._buffer._data = null; + } + } + } + }; + /** + * This function will remove the local cached buffer data from texture. + * It will save memory but will prevent the texture from being rebuilt + */ + Scene.prototype.cleanCachedTextureBuffer = function () { + for (var _i = 0, _a = this.textures; _i < _a.length; _i++) { + var baseTexture = _a[_i]; + var buffer = baseTexture._buffer; + if (buffer) { + baseTexture._buffer = null; + } + } + }; + /** + * Get the world extend vectors with an optional filter + * + * @param filterPredicate the predicate - which meshes should be included when calculating the world size + * @returns {{ min: Vector3; max: Vector3 }} min and max vectors + */ + Scene.prototype.getWorldExtends = function (filterPredicate) { + var min = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + var max = new BABYLON.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); + filterPredicate = filterPredicate || (function () { return true; }); + this.meshes.filter(filterPredicate).forEach(function (mesh) { + mesh.computeWorldMatrix(true); + if (!mesh.subMeshes || mesh.subMeshes.length === 0 || mesh.infiniteDistance) { + return; + } + var boundingInfo = mesh.getBoundingInfo(); + var minBox = boundingInfo.boundingBox.minimumWorld; + var maxBox = boundingInfo.boundingBox.maximumWorld; + BABYLON.Tools.CheckExtends(minBox, min, max); + BABYLON.Tools.CheckExtends(maxBox, min, max); + }); + return { + min: min, + max: max + }; + }; + // Picking + /** + * Creates a ray that can be used to pick in the scene + * @param x defines the x coordinate of the origin (on-screen) + * @param y defines the y coordinate of the origin (on-screen) + * @param world defines the world matrix to use if you want to pick in object space (instead of world space) + * @param camera defines the camera to use for the picking + * @param cameraViewSpace defines if picking will be done in view space (false by default) + * @returns a Ray + */ + Scene.prototype.createPickingRay = function (x, y, world, camera, cameraViewSpace) { + if (cameraViewSpace === void 0) { cameraViewSpace = false; } + var result = BABYLON.Ray.Zero(); + this.createPickingRayToRef(x, y, world, result, camera, cameraViewSpace); + return result; + }; + /** + * Creates a ray that can be used to pick in the scene + * @param x defines the x coordinate of the origin (on-screen) + * @param y defines the y coordinate of the origin (on-screen) + * @param world defines the world matrix to use if you want to pick in object space (instead of world space) + * @param result defines the ray where to store the picking ray + * @param camera defines the camera to use for the picking + * @param cameraViewSpace defines if picking will be done in view space (false by default) + * @returns the current scene + */ + Scene.prototype.createPickingRayToRef = function (x, y, world, result, camera, cameraViewSpace) { + if (cameraViewSpace === void 0) { cameraViewSpace = false; } + var engine = this._engine; + if (!camera) { + if (!this.activeCamera) { + throw new Error("Active camera not set"); + } + camera = this.activeCamera; + } + var cameraViewport = camera.viewport; + var viewport = cameraViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight()); + // Moving coordinates to local viewport world + x = x / this._engine.getHardwareScalingLevel() - viewport.x; + y = y / this._engine.getHardwareScalingLevel() - (this._engine.getRenderHeight() - viewport.y - viewport.height); + result.update(x, y, viewport.width, viewport.height, world ? world : BABYLON.Matrix.Identity(), cameraViewSpace ? BABYLON.Matrix.Identity() : camera.getViewMatrix(), camera.getProjectionMatrix()); + return this; + }; + /** + * Creates a ray that can be used to pick in the scene + * @param x defines the x coordinate of the origin (on-screen) + * @param y defines the y coordinate of the origin (on-screen) + * @param camera defines the camera to use for the picking + * @returns a Ray + */ + Scene.prototype.createPickingRayInCameraSpace = function (x, y, camera) { + var result = BABYLON.Ray.Zero(); + this.createPickingRayInCameraSpaceToRef(x, y, result, camera); + return result; + }; + /** + * Creates a ray that can be used to pick in the scene + * @param x defines the x coordinate of the origin (on-screen) + * @param y defines the y coordinate of the origin (on-screen) + * @param result defines the ray where to store the picking ray + * @param camera defines the camera to use for the picking + * @returns the current scene + */ + Scene.prototype.createPickingRayInCameraSpaceToRef = function (x, y, result, camera) { + if (!BABYLON.PickingInfo) { + return this; + } + var engine = this._engine; + if (!camera) { + if (!this.activeCamera) { + throw new Error("Active camera not set"); + } + camera = this.activeCamera; + } + var cameraViewport = camera.viewport; + var viewport = cameraViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight()); + var identity = BABYLON.Matrix.Identity(); + // Moving coordinates to local viewport world + x = x / this._engine.getHardwareScalingLevel() - viewport.x; + y = y / this._engine.getHardwareScalingLevel() - (this._engine.getRenderHeight() - viewport.y - viewport.height); + result.update(x, y, viewport.width, viewport.height, identity, identity, camera.getProjectionMatrix()); + return this; + }; + Scene.prototype._internalPick = function (rayFunction, predicate, fastCheck) { + if (!BABYLON.PickingInfo) { + return null; + } + var pickingInfo = null; + for (var meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) { + var mesh = this.meshes[meshIndex]; + if (predicate) { + if (!predicate(mesh)) { + continue; + } + } + else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) { + continue; + } + var world = mesh.getWorldMatrix(); + var ray = rayFunction(world); + var result = mesh.intersects(ray, fastCheck); + if (!result || !result.hit) { + continue; + } + if (!fastCheck && pickingInfo != null && result.distance >= pickingInfo.distance) { + continue; + } + pickingInfo = result; + if (fastCheck) { + break; + } + } + return pickingInfo || new BABYLON.PickingInfo(); + }; + Scene.prototype._internalMultiPick = function (rayFunction, predicate) { + if (!BABYLON.PickingInfo) { + return null; + } + var pickingInfos = new Array(); + for (var meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) { + var mesh = this.meshes[meshIndex]; + if (predicate) { + if (!predicate(mesh)) { + continue; + } + } + else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) { + continue; + } + var world = mesh.getWorldMatrix(); + var ray = rayFunction(world); + var result = mesh.intersects(ray, false); + if (!result || !result.hit) { + continue; + } + pickingInfos.push(result); + } + return pickingInfos; + }; + /** Launch a ray to try to pick a mesh in the scene + * @param x position on screen + * @param y position on screen + * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true + * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null. + * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used + * @returns a PickingInfo + */ + Scene.prototype.pick = function (x, y, predicate, fastCheck, camera) { + var _this = this; + if (!BABYLON.PickingInfo) { + return null; + } + var result = this._internalPick(function (world) { + _this.createPickingRayToRef(x, y, world, _this._tempPickingRay, camera || null); + return _this._tempPickingRay; + }, predicate, fastCheck); + if (result) { + result.ray = this.createPickingRay(x, y, BABYLON.Matrix.Identity(), camera || null); + } + return result; + }; + /** Use the given ray to pick a mesh in the scene + * @param ray The ray to use to pick meshes + * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must have isPickable set to true + * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null + * @returns a PickingInfo + */ + Scene.prototype.pickWithRay = function (ray, predicate, fastCheck) { + var _this = this; + var result = this._internalPick(function (world) { + if (!_this._pickWithRayInverseMatrix) { + _this._pickWithRayInverseMatrix = BABYLON.Matrix.Identity(); + } + world.invertToRef(_this._pickWithRayInverseMatrix); + if (!_this._cachedRayForTransform) { + _this._cachedRayForTransform = BABYLON.Ray.Zero(); + } + BABYLON.Ray.TransformToRef(ray, _this._pickWithRayInverseMatrix, _this._cachedRayForTransform); + return _this._cachedRayForTransform; + }, predicate, fastCheck); + if (result) { + result.ray = ray; + } + return result; + }; + /** + * Launch a ray to try to pick a mesh in the scene + * @param x X position on screen + * @param y Y position on screen + * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true + * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used + * @returns an array of PickingInfo + */ + Scene.prototype.multiPick = function (x, y, predicate, camera) { + var _this = this; + return this._internalMultiPick(function (world) { return _this.createPickingRay(x, y, world, camera || null); }, predicate); + }; + /** + * Launch a ray to try to pick a mesh in the scene + * @param ray Ray to use + * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true + * @returns an array of PickingInfo + */ + Scene.prototype.multiPickWithRay = function (ray, predicate) { + var _this = this; + return this._internalMultiPick(function (world) { + if (!_this._pickWithRayInverseMatrix) { + _this._pickWithRayInverseMatrix = BABYLON.Matrix.Identity(); + } + world.invertToRef(_this._pickWithRayInverseMatrix); + if (!_this._cachedRayForTransform) { + _this._cachedRayForTransform = BABYLON.Ray.Zero(); + } + BABYLON.Ray.TransformToRef(ray, _this._pickWithRayInverseMatrix, _this._cachedRayForTransform); + return _this._cachedRayForTransform; + }, predicate); + }; + /** + * Force the value of meshUnderPointer + * @param mesh defines the mesh to use + */ + Scene.prototype.setPointerOverMesh = function (mesh) { + if (this._pointerOverMesh === mesh) { + return; + } + if (this._pointerOverMesh && this._pointerOverMesh.actionManager) { + this._pointerOverMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPointerOutTrigger, BABYLON.ActionEvent.CreateNew(this._pointerOverMesh)); + } + this._pointerOverMesh = mesh; + if (this._pointerOverMesh && this._pointerOverMesh.actionManager) { + this._pointerOverMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPointerOverTrigger, BABYLON.ActionEvent.CreateNew(this._pointerOverMesh)); + } + }; + /** + * Gets the mesh under the pointer + * @returns a Mesh or null if no mesh is under the pointer + */ + Scene.prototype.getPointerOverMesh = function () { + return this._pointerOverMesh; + }; + // Misc. + /** @hidden */ + Scene.prototype._rebuildGeometries = function () { + for (var _i = 0, _a = this.geometries; _i < _a.length; _i++) { + var geometry = _a[_i]; + geometry._rebuild(); + } + for (var _b = 0, _c = this.meshes; _b < _c.length; _b++) { + var mesh = _c[_b]; + mesh._rebuild(); + } + if (this.postProcessManager) { + this.postProcessManager._rebuild(); + } + for (var _d = 0, _e = this._components; _d < _e.length; _d++) { + var component = _e[_d]; + component.rebuild(); + } + for (var _f = 0, _g = this.particleSystems; _f < _g.length; _f++) { + var system = _g[_f]; + system.rebuild(); + } + }; + /** @hidden */ + Scene.prototype._rebuildTextures = function () { + for (var _i = 0, _a = this.textures; _i < _a.length; _i++) { + var texture = _a[_i]; + texture._rebuild(); + } + this.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }; + // Tags + Scene.prototype._getByTags = function (list, tagsQuery, forEach) { + if (tagsQuery === undefined) { + // returns the complete list (could be done with BABYLON.Tags.MatchesQuery but no need to have a for-loop here) + return list; + } + var listByTags = []; + forEach = forEach || (function (item) { return; }); + for (var i in list) { + var item = list[i]; + if (BABYLON.Tags && BABYLON.Tags.MatchesQuery(item, tagsQuery)) { + listByTags.push(item); + forEach(item); + } + } + return listByTags; + }; + /** + * Get a list of meshes by tags + * @param tagsQuery defines the tags query to use + * @param forEach defines a predicate used to filter results + * @returns an array of Mesh + */ + Scene.prototype.getMeshesByTags = function (tagsQuery, forEach) { + return this._getByTags(this.meshes, tagsQuery, forEach); + }; + /** + * Get a list of cameras by tags + * @param tagsQuery defines the tags query to use + * @param forEach defines a predicate used to filter results + * @returns an array of Camera + */ + Scene.prototype.getCamerasByTags = function (tagsQuery, forEach) { + return this._getByTags(this.cameras, tagsQuery, forEach); + }; + /** + * Get a list of lights by tags + * @param tagsQuery defines the tags query to use + * @param forEach defines a predicate used to filter results + * @returns an array of Light + */ + Scene.prototype.getLightsByTags = function (tagsQuery, forEach) { + return this._getByTags(this.lights, tagsQuery, forEach); + }; + /** + * Get a list of materials by tags + * @param tagsQuery defines the tags query to use + * @param forEach defines a predicate used to filter results + * @returns an array of Material + */ + Scene.prototype.getMaterialByTags = function (tagsQuery, forEach) { + return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach)); + }; + /** + * Overrides the default sort function applied in the renderging group to prepare the meshes. + * This allowed control for front to back rendering or reversly depending of the special needs. + * + * @param renderingGroupId The rendering group id corresponding to its index + * @param opaqueSortCompareFn The opaque queue comparison function use to sort. + * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort. + * @param transparentSortCompareFn The transparent queue comparison function use to sort. + */ + Scene.prototype.setRenderingOrder = function (renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) { + if (opaqueSortCompareFn === void 0) { opaqueSortCompareFn = null; } + if (alphaTestSortCompareFn === void 0) { alphaTestSortCompareFn = null; } + if (transparentSortCompareFn === void 0) { transparentSortCompareFn = null; } + this._renderingManager.setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn); + }; + /** + * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups. + * + * @param renderingGroupId The rendering group id corresponding to its index + * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true. + * @param depth Automatically clears depth between groups if true and autoClear is true. + * @param stencil Automatically clears stencil between groups if true and autoClear is true. + */ + Scene.prototype.setRenderingAutoClearDepthStencil = function (renderingGroupId, autoClearDepthStencil, depth, stencil) { + if (depth === void 0) { depth = true; } + if (stencil === void 0) { stencil = true; } + this._renderingManager.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil, depth, stencil); + }; + /** + * Gets the current auto clear configuration for one rendering group of the rendering + * manager. + * @param index the rendering group index to get the information for + * @returns The auto clear setup for the requested rendering group + */ + Scene.prototype.getAutoClearDepthStencilSetup = function (index) { + return this._renderingManager.getAutoClearDepthStencilSetup(index); + }; + Object.defineProperty(Scene.prototype, "blockMaterialDirtyMechanism", { + /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */ + get: function () { + return this._blockMaterialDirtyMechanism; + }, + set: function (value) { + if (this._blockMaterialDirtyMechanism === value) { + return; + } + this._blockMaterialDirtyMechanism = value; + if (!value) { // Do a complete update + this.markAllMaterialsAsDirty(BABYLON.Material.AllDirtyFlag); + } + }, + enumerable: true, + configurable: true + }); + /** + * Will flag all materials as dirty to trigger new shader compilation + * @param flag defines the flag used to specify which material part must be marked as dirty + * @param predicate If not null, it will be used to specifiy if a material has to be marked as dirty + */ + Scene.prototype.markAllMaterialsAsDirty = function (flag, predicate) { + if (this._blockMaterialDirtyMechanism) { + return; + } + for (var _i = 0, _a = this.materials; _i < _a.length; _i++) { + var material = _a[_i]; + if (predicate && !predicate(material)) { + continue; + } + material.markAsDirty(flag); + } + }; + /** @hidden */ + Scene.prototype._loadFile = function (url, onSuccess, onProgress, useDatabase, useArrayBuffer, onError) { + var _this = this; + var request = BABYLON.Tools.LoadFile(url, onSuccess, onProgress, useDatabase ? this.database : undefined, useArrayBuffer, onError); + this._activeRequests.push(request); + request.onCompleteObservable.add(function (request) { + _this._activeRequests.splice(_this._activeRequests.indexOf(request), 1); + }); + return request; + }; + /** @hidden */ + Scene.prototype._loadFileAsync = function (url, useDatabase, useArrayBuffer) { + var _this = this; + return new Promise(function (resolve, reject) { + _this._loadFile(url, function (data) { + resolve(data); + }, undefined, useDatabase, useArrayBuffer, function (request, exception) { + reject(exception); + }); + }); + }; + // Statics + Scene._uniqueIdCounter = 0; + /** The fog is deactivated */ + Scene.FOGMODE_NONE = 0; + /** The fog density is following an exponential function */ + Scene.FOGMODE_EXP = 1; + /** The fog density is following an exponential function faster than FOGMODE_EXP */ + Scene.FOGMODE_EXP2 = 2; + /** The fog density is following a linear function. */ + Scene.FOGMODE_LINEAR = 3; + /** + * Gets or sets the minimum deltatime when deterministic lock step is enabled + * @see http://doc.babylonjs.com/babylon101/animations#deterministic-lockstep + */ + Scene.MinDeltaTime = 1.0; + /** + * Gets or sets the maximum deltatime when deterministic lock step is enabled + * @see http://doc.babylonjs.com/babylon101/animations#deterministic-lockstep + */ + Scene.MaxDeltaTime = 1000.0; + /** The distance in pixel that you have to move to prevent some events */ + Scene.DragMovementThreshold = 10; // in pixels + /** Time in milliseconds to wait to raise long press events if button is still pressed */ + Scene.LongPressDelay = 500; // in milliseconds + /** Time in milliseconds with two consecutive clicks will be considered as a double click */ + Scene.DoubleClickDelay = 300; // in milliseconds + /** If you need to check double click without raising a single click at first click, enable this flag */ + Scene.ExclusiveDoubleClickMode = false; + return Scene; + }(BABYLON.AbstractScene)); + BABYLON.Scene = Scene; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.scene.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Set of assets to keep when moving a scene into an asset container. + */ + var KeepAssets = /** @class */ (function (_super) { + __extends(KeepAssets, _super); + function KeepAssets() { + return _super !== null && _super.apply(this, arguments) || this; + } + return KeepAssets; + }(BABYLON.AbstractScene)); + BABYLON.KeepAssets = KeepAssets; + /** + * Container with a set of assets that can be added or removed from a scene. + */ + var AssetContainer = /** @class */ (function (_super) { + __extends(AssetContainer, _super); + /** + * Instantiates an AssetContainer. + * @param scene The scene the AssetContainer belongs to. + */ + function AssetContainer(scene) { + var _this = _super.call(this) || this; + _this.scene = scene; + return _this; + } + /** + * Adds all the assets from the container to the scene. + */ + AssetContainer.prototype.addAllToScene = function () { + var _this = this; + this.cameras.forEach(function (o) { + _this.scene.addCamera(o); + }); + this.lights.forEach(function (o) { + _this.scene.addLight(o); + }); + this.meshes.forEach(function (o) { + _this.scene.addMesh(o); + }); + this.skeletons.forEach(function (o) { + _this.scene.addSkeleton(o); + }); + this.animations.forEach(function (o) { + _this.scene.addAnimation(o); + }); + this.animationGroups.forEach(function (o) { + _this.scene.addAnimationGroup(o); + }); + this.multiMaterials.forEach(function (o) { + _this.scene.addMultiMaterial(o); + }); + this.materials.forEach(function (o) { + _this.scene.addMaterial(o); + }); + this.morphTargetManagers.forEach(function (o) { + _this.scene.addMorphTargetManager(o); + }); + this.geometries.forEach(function (o) { + _this.scene.addGeometry(o); + }); + this.transformNodes.forEach(function (o) { + _this.scene.addTransformNode(o); + }); + this.actionManagers.forEach(function (o) { + _this.scene.addActionManager(o); + }); + this.textures.forEach(function (o) { + _this.scene.addTexture(o); + }); + for (var _i = 0, _a = this.scene._serializableComponents; _i < _a.length; _i++) { + var component = _a[_i]; + component.addFromContainer(this.scene); + } + }; + /** + * Removes all the assets in the container from the scene + */ + AssetContainer.prototype.removeAllFromScene = function () { + var _this = this; + this.cameras.forEach(function (o) { + _this.scene.removeCamera(o); + }); + this.lights.forEach(function (o) { + _this.scene.removeLight(o); + }); + this.meshes.forEach(function (o) { + _this.scene.removeMesh(o); + }); + this.skeletons.forEach(function (o) { + _this.scene.removeSkeleton(o); + }); + this.animations.forEach(function (o) { + _this.scene.removeAnimation(o); + }); + this.animationGroups.forEach(function (o) { + _this.scene.removeAnimationGroup(o); + }); + this.multiMaterials.forEach(function (o) { + _this.scene.removeMultiMaterial(o); + }); + this.materials.forEach(function (o) { + _this.scene.removeMaterial(o); + }); + this.morphTargetManagers.forEach(function (o) { + _this.scene.removeMorphTargetManager(o); + }); + this.geometries.forEach(function (o) { + _this.scene.removeGeometry(o); + }); + this.transformNodes.forEach(function (o) { + _this.scene.removeTransformNode(o); + }); + this.actionManagers.forEach(function (o) { + _this.scene.removeActionManager(o); + }); + this.textures.forEach(function (o) { + _this.scene.removeTexture(o); + }); + for (var _i = 0, _a = this.scene._serializableComponents; _i < _a.length; _i++) { + var component = _a[_i]; + component.removeFromContainer(this.scene); + } + }; + AssetContainer.prototype._moveAssets = function (sourceAssets, targetAssets, keepAssets) { + if (!sourceAssets) { + return; + } + for (var _i = 0, sourceAssets_1 = sourceAssets; _i < sourceAssets_1.length; _i++) { + var asset = sourceAssets_1[_i]; + var move = true; + if (keepAssets) { + for (var _a = 0, keepAssets_1 = keepAssets; _a < keepAssets_1.length; _a++) { + var keepAsset = keepAssets_1[_a]; + if (asset === keepAsset) { + move = false; + break; + } + } + } + if (move) { + targetAssets.push(asset); + } + } + }; + /** + * Removes all the assets contained in the scene and adds them to the container. + * @param keepAssets Set of assets to keep in the scene. (default: empty) + */ + AssetContainer.prototype.moveAllFromScene = function (keepAssets) { + if (keepAssets === undefined) { + keepAssets = new KeepAssets(); + } + for (var key in this) { + if (this.hasOwnProperty(key)) { + this[key] = this[key] || []; + this._moveAssets(this.scene[key], this[key], keepAssets[key]); + } + } + this.removeAllFromScene(); + }; + /** + * Adds all meshes in the asset container to a root mesh that can be used to position all the contained meshes. The root mesh is then added to the front of the meshes in the assetContainer. + * @returns the root mesh + */ + AssetContainer.prototype.createRootMesh = function () { + var rootMesh = new BABYLON.Mesh("assetContainerRootMesh", this.scene); + this.meshes.forEach(function (m) { + if (!m.parent) { + rootMesh.addChild(m); + } + }); + this.meshes.unshift(rootMesh); + return rootMesh; + }; + return AssetContainer; + }(BABYLON.AbstractScene)); + BABYLON.AssetContainer = AssetContainer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.assetContainer.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Class used to store data that will be store in GPU memory + */ + var Buffer = /** @class */ (function () { + /** + * Constructor + * @param engine the engine + * @param data the data to use for this buffer + * @param updatable whether the data is updatable + * @param stride the stride (optional) + * @param postponeInternalCreation whether to postpone creating the internal WebGL buffer (optional) + * @param instanced whether the buffer is instanced (optional) + * @param useBytes set to true if the stride in in bytes (optional) + */ + function Buffer(engine, data, updatable, stride, postponeInternalCreation, instanced, useBytes) { + if (stride === void 0) { stride = 0; } + if (postponeInternalCreation === void 0) { postponeInternalCreation = false; } + if (instanced === void 0) { instanced = false; } + if (useBytes === void 0) { useBytes = false; } + if (engine instanceof BABYLON.Mesh) { // old versions of BABYLON.VertexBuffer accepted 'mesh' instead of 'engine' + this._engine = engine.getScene().getEngine(); + } + else { + this._engine = engine; + } + this._updatable = updatable; + this._instanced = instanced; + this._data = data; + this.byteStride = useBytes ? stride : stride * Float32Array.BYTES_PER_ELEMENT; + if (!postponeInternalCreation) { // by default + this.create(); + } + } + /** + * Create a new VertexBuffer based on the current buffer + * @param kind defines the vertex buffer kind (position, normal, etc.) + * @param offset defines offset in the buffer (0 by default) + * @param size defines the size in floats of attributes (position is 3 for instance) + * @param stride defines the stride size in floats in the buffer (the offset to apply to reach next value when data is interleaved) + * @param instanced defines if the vertex buffer contains indexed data + * @param useBytes defines if the offset and stride are in bytes + * @returns the new vertex buffer + */ + Buffer.prototype.createVertexBuffer = function (kind, offset, size, stride, instanced, useBytes) { + if (useBytes === void 0) { useBytes = false; } + var byteOffset = useBytes ? offset : offset * Float32Array.BYTES_PER_ELEMENT; + var byteStride = stride ? (useBytes ? stride : stride * Float32Array.BYTES_PER_ELEMENT) : this.byteStride; + // a lot of these parameters are ignored as they are overriden by the buffer + return new BABYLON.VertexBuffer(this._engine, this, kind, this._updatable, true, byteStride, instanced === undefined ? this._instanced : instanced, byteOffset, size, undefined, undefined, true); + }; + // Properties + /** + * Gets a boolean indicating if the Buffer is updatable? + * @returns true if the buffer is updatable + */ + Buffer.prototype.isUpdatable = function () { + return this._updatable; + }; + /** + * Gets current buffer's data + * @returns a DataArray or null + */ + Buffer.prototype.getData = function () { + return this._data; + }; + /** + * Gets underlying native buffer + * @returns underlying native buffer + */ + Buffer.prototype.getBuffer = function () { + return this._buffer; + }; + /** + * Gets the stride in float32 units (i.e. byte stride / 4). + * May not be an integer if the byte stride is not divisible by 4. + * DEPRECATED. Use byteStride instead. + * @returns the stride in float32 units + */ + Buffer.prototype.getStrideSize = function () { + return this.byteStride / Float32Array.BYTES_PER_ELEMENT; + }; + // Methods + /** + * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property + * @param data defines the data to store + */ + Buffer.prototype.create = function (data) { + if (data === void 0) { data = null; } + if (!data && this._buffer) { + return; // nothing to do + } + data = data || this._data; + if (!data) { + return; + } + if (!this._buffer) { // create buffer + if (this._updatable) { + this._buffer = this._engine.createDynamicVertexBuffer(data); + this._data = data; + } + else { + this._buffer = this._engine.createVertexBuffer(data); + } + } + else if (this._updatable) { // update buffer + this._engine.updateDynamicVertexBuffer(this._buffer, data); + this._data = data; + } + }; + /** @hidden */ + Buffer.prototype._rebuild = function () { + this._buffer = null; + this.create(this._data); + }; + /** + * Update current buffer data + * @param data defines the data to store + */ + Buffer.prototype.update = function (data) { + this.create(data); + }; + /** + * Updates the data directly. + * @param data the new data + * @param offset the new offset + * @param vertexCount the vertex count (optional) + * @param useBytes set to true if the offset is in bytes + */ + Buffer.prototype.updateDirectly = function (data, offset, vertexCount, useBytes) { + if (useBytes === void 0) { useBytes = false; } + if (!this._buffer) { + return; + } + if (this._updatable) { // update buffer + this._engine.updateDynamicVertexBuffer(this._buffer, data, useBytes ? offset : offset * Float32Array.BYTES_PER_ELEMENT, (vertexCount ? vertexCount * this.byteStride : undefined)); + this._data = null; + } + }; + /** + * Release all resources + */ + Buffer.prototype.dispose = function () { + if (!this._buffer) { + return; + } + if (this._engine._releaseBuffer(this._buffer)) { + this._buffer = null; + } + }; + return Buffer; + }()); + BABYLON.Buffer = Buffer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.buffer.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Specialized buffer used to store vertex data + */ + var VertexBuffer = /** @class */ (function () { + /** + * Constructor + * @param engine the engine + * @param data the data to use for this vertex buffer + * @param kind the vertex buffer kind + * @param updatable whether the data is updatable + * @param postponeInternalCreation whether to postpone creating the internal WebGL buffer (optional) + * @param stride the stride (optional) + * @param instanced whether the buffer is instanced (optional) + * @param offset the offset of the data (optional) + * @param size the number of components (optional) + * @param type the type of the component (optional) + * @param normalized whether the data contains normalized data (optional) + * @param useBytes set to true if stride and offset are in bytes (optional) + */ + function VertexBuffer(engine, data, kind, updatable, postponeInternalCreation, stride, instanced, offset, size, type, normalized, useBytes) { + if (normalized === void 0) { normalized = false; } + if (useBytes === void 0) { useBytes = false; } + if (data instanceof BABYLON.Buffer) { + this._buffer = data; + this._ownsBuffer = false; + } + else { + this._buffer = new BABYLON.Buffer(engine, data, updatable, stride, postponeInternalCreation, instanced, useBytes); + this._ownsBuffer = true; + } + this._kind = kind; + if (type == undefined) { + var data_1 = this.getData(); + this.type = VertexBuffer.FLOAT; + if (data_1 instanceof Int8Array) { + this.type = VertexBuffer.BYTE; + } + else if (data_1 instanceof Uint8Array) { + this.type = VertexBuffer.UNSIGNED_BYTE; + } + else if (data_1 instanceof Int16Array) { + this.type = VertexBuffer.SHORT; + } + else if (data_1 instanceof Uint16Array) { + this.type = VertexBuffer.UNSIGNED_SHORT; + } + else if (data_1 instanceof Int32Array) { + this.type = VertexBuffer.INT; + } + else if (data_1 instanceof Uint32Array) { + this.type = VertexBuffer.UNSIGNED_INT; + } + } + else { + this.type = type; + } + var typeByteLength = VertexBuffer.GetTypeByteLength(this.type); + if (useBytes) { + this._size = size || (stride ? (stride / typeByteLength) : VertexBuffer.DeduceStride(kind)); + this.byteStride = stride || this._buffer.byteStride || (this._size * typeByteLength); + this.byteOffset = offset || 0; + } + else { + this._size = size || stride || VertexBuffer.DeduceStride(kind); + this.byteStride = stride ? (stride * typeByteLength) : (this._buffer.byteStride || (this._size * typeByteLength)); + this.byteOffset = (offset || 0) * typeByteLength; + } + this.normalized = normalized; + this._instanced = instanced !== undefined ? instanced : false; + this._instanceDivisor = instanced ? 1 : 0; + } + Object.defineProperty(VertexBuffer.prototype, "instanceDivisor", { + /** + * Gets or sets the instance divisor when in instanced mode + */ + get: function () { + return this._instanceDivisor; + }, + set: function (value) { + this._instanceDivisor = value; + if (value == 0) { + this._instanced = false; + } + else { + this._instanced = true; + } + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + VertexBuffer.prototype._rebuild = function () { + if (!this._buffer) { + return; + } + this._buffer._rebuild(); + }; + /** + * Returns the kind of the VertexBuffer (string) + * @returns a string + */ + VertexBuffer.prototype.getKind = function () { + return this._kind; + }; + // Properties + /** + * Gets a boolean indicating if the VertexBuffer is updatable? + * @returns true if the buffer is updatable + */ + VertexBuffer.prototype.isUpdatable = function () { + return this._buffer.isUpdatable(); + }; + /** + * Gets current buffer's data + * @returns a DataArray or null + */ + VertexBuffer.prototype.getData = function () { + return this._buffer.getData(); + }; + /** + * Gets underlying native buffer + * @returns underlying native buffer + */ + VertexBuffer.prototype.getBuffer = function () { + return this._buffer.getBuffer(); + }; + /** + * Gets the stride in float32 units (i.e. byte stride / 4). + * May not be an integer if the byte stride is not divisible by 4. + * DEPRECATED. Use byteStride instead. + * @returns the stride in float32 units + */ + VertexBuffer.prototype.getStrideSize = function () { + return this.byteStride / VertexBuffer.GetTypeByteLength(this.type); + }; + /** + * Returns the offset as a multiple of the type byte length. + * DEPRECATED. Use byteOffset instead. + * @returns the offset in bytes + */ + VertexBuffer.prototype.getOffset = function () { + return this.byteOffset / VertexBuffer.GetTypeByteLength(this.type); + }; + /** + * Returns the number of components per vertex attribute (integer) + * @returns the size in float + */ + VertexBuffer.prototype.getSize = function () { + return this._size; + }; + /** + * Gets a boolean indicating is the internal buffer of the VertexBuffer is instanced + * @returns true if this buffer is instanced + */ + VertexBuffer.prototype.getIsInstanced = function () { + return this._instanced; + }; + /** + * Returns the instancing divisor, zero for non-instanced (integer). + * @returns a number + */ + VertexBuffer.prototype.getInstanceDivisor = function () { + return this._instanceDivisor; + }; + // Methods + /** + * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property + * @param data defines the data to store + */ + VertexBuffer.prototype.create = function (data) { + this._buffer.create(data); + }; + /** + * Updates the underlying buffer according to the passed numeric array or Float32Array. + * This function will create a new buffer if the current one is not updatable + * @param data defines the data to store + */ + VertexBuffer.prototype.update = function (data) { + this._buffer.update(data); + }; + /** + * Updates directly the underlying WebGLBuffer according to the passed numeric array or Float32Array. + * Returns the directly updated WebGLBuffer. + * @param data the new data + * @param offset the new offset + * @param useBytes set to true if the offset is in bytes + */ + VertexBuffer.prototype.updateDirectly = function (data, offset, useBytes) { + if (useBytes === void 0) { useBytes = false; } + this._buffer.updateDirectly(data, offset, undefined, useBytes); + }; + /** + * Disposes the VertexBuffer and the underlying WebGLBuffer. + */ + VertexBuffer.prototype.dispose = function () { + if (this._ownsBuffer) { + this._buffer.dispose(); + } + }; + /** + * Enumerates each value of this vertex buffer as numbers. + * @param count the number of values to enumerate + * @param callback the callback function called for each value + */ + VertexBuffer.prototype.forEach = function (count, callback) { + VertexBuffer.ForEach(this._buffer.getData(), this.byteOffset, this.byteStride, this._size, this.type, count, this.normalized, callback); + }; + /** + * Deduces the stride given a kind. + * @param kind The kind string to deduce + * @returns The deduced stride + */ + VertexBuffer.DeduceStride = function (kind) { + switch (kind) { + case VertexBuffer.UVKind: + case VertexBuffer.UV2Kind: + case VertexBuffer.UV3Kind: + case VertexBuffer.UV4Kind: + case VertexBuffer.UV5Kind: + case VertexBuffer.UV6Kind: + return 2; + case VertexBuffer.NormalKind: + case VertexBuffer.PositionKind: + return 3; + case VertexBuffer.ColorKind: + case VertexBuffer.MatricesIndicesKind: + case VertexBuffer.MatricesIndicesExtraKind: + case VertexBuffer.MatricesWeightsKind: + case VertexBuffer.MatricesWeightsExtraKind: + case VertexBuffer.TangentKind: + return 4; + default: + throw new Error("Invalid kind '" + kind + "'"); + } + }; + /** + * Gets the byte length of the given type. + * @param type the type + * @returns the number of bytes + */ + VertexBuffer.GetTypeByteLength = function (type) { + switch (type) { + case VertexBuffer.BYTE: + case VertexBuffer.UNSIGNED_BYTE: + return 1; + case VertexBuffer.SHORT: + case VertexBuffer.UNSIGNED_SHORT: + return 2; + case VertexBuffer.INT: + case VertexBuffer.FLOAT: + return 4; + default: + throw new Error("Invalid type '" + type + "'"); + } + }; + /** + * Enumerates each value of the given parameters as numbers. + * @param data the data to enumerate + * @param byteOffset the byte offset of the data + * @param byteStride the byte stride of the data + * @param componentCount the number of components per element + * @param componentType the type of the component + * @param count the total number of components + * @param normalized whether the data is normalized + * @param callback the callback function called for each value + */ + VertexBuffer.ForEach = function (data, byteOffset, byteStride, componentCount, componentType, count, normalized, callback) { + if (data instanceof Array) { + var offset = byteOffset / 4; + var stride = byteStride / 4; + for (var index = 0; index < count; index += componentCount) { + for (var componentIndex = 0; componentIndex < componentCount; componentIndex++) { + callback(data[offset + componentIndex], index + componentIndex); + } + offset += stride; + } + } + else { + var dataView = data instanceof ArrayBuffer ? new DataView(data) : new DataView(data.buffer, data.byteOffset, data.byteLength); + var componentByteLength = VertexBuffer.GetTypeByteLength(componentType); + for (var index = 0; index < count; index += componentCount) { + var componentByteOffset = byteOffset; + for (var componentIndex = 0; componentIndex < componentCount; componentIndex++) { + var value = VertexBuffer._GetFloatValue(dataView, componentType, componentByteOffset, normalized); + callback(value, index + componentIndex); + componentByteOffset += componentByteLength; + } + byteOffset += byteStride; + } + } + }; + VertexBuffer._GetFloatValue = function (dataView, type, byteOffset, normalized) { + switch (type) { + case VertexBuffer.BYTE: { + var value = dataView.getInt8(byteOffset); + if (normalized) { + value = Math.max(value / 127, -1); + } + return value; + } + case VertexBuffer.UNSIGNED_BYTE: { + var value = dataView.getUint8(byteOffset); + if (normalized) { + value = value / 255; + } + return value; + } + case VertexBuffer.SHORT: { + var value = dataView.getInt16(byteOffset, true); + if (normalized) { + value = Math.max(value / 16383, -1); + } + return value; + } + case VertexBuffer.UNSIGNED_SHORT: { + var value = dataView.getUint16(byteOffset, true); + if (normalized) { + value = value / 65535; + } + return value; + } + case VertexBuffer.FLOAT: { + return dataView.getFloat32(byteOffset, true); + } + default: { + throw new Error("Invalid component type " + type); + } + } + }; + /** + * The byte type. + */ + VertexBuffer.BYTE = 5120; + /** + * The unsigned byte type. + */ + VertexBuffer.UNSIGNED_BYTE = 5121; + /** + * The short type. + */ + VertexBuffer.SHORT = 5122; + /** + * The unsigned short type. + */ + VertexBuffer.UNSIGNED_SHORT = 5123; + /** + * The integer type. + */ + VertexBuffer.INT = 5124; + /** + * The unsigned integer type. + */ + VertexBuffer.UNSIGNED_INT = 5125; + /** + * The float type. + */ + VertexBuffer.FLOAT = 5126; + // Enums + /** + * Positions + */ + VertexBuffer.PositionKind = "position"; + /** + * Normals + */ + VertexBuffer.NormalKind = "normal"; + /** + * Tangents + */ + VertexBuffer.TangentKind = "tangent"; + /** + * Texture coordinates + */ + VertexBuffer.UVKind = "uv"; + /** + * Texture coordinates 2 + */ + VertexBuffer.UV2Kind = "uv2"; + /** + * Texture coordinates 3 + */ + VertexBuffer.UV3Kind = "uv3"; + /** + * Texture coordinates 4 + */ + VertexBuffer.UV4Kind = "uv4"; + /** + * Texture coordinates 5 + */ + VertexBuffer.UV5Kind = "uv5"; + /** + * Texture coordinates 6 + */ + VertexBuffer.UV6Kind = "uv6"; + /** + * Colors + */ + VertexBuffer.ColorKind = "color"; + /** + * Matrix indices (for bones) + */ + VertexBuffer.MatricesIndicesKind = "matricesIndices"; + /** + * Matrix weights (for bones) + */ + VertexBuffer.MatricesWeightsKind = "matricesWeights"; + /** + * Additional matrix indices (for bones) + */ + VertexBuffer.MatricesIndicesExtraKind = "matricesIndicesExtra"; + /** + * Additional matrix weights (for bones) + */ + VertexBuffer.MatricesWeightsExtraKind = "matricesWeightsExtra"; + return VertexBuffer; + }()); + BABYLON.VertexBuffer = VertexBuffer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.vertexBuffer.js.map + + + +//# sourceMappingURL=babylon.internalTextureLoader.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Internal class used by the engine to get list of InternalTexture already bound to the GL context + */ + var DummyInternalTextureTracker = /** @class */ (function () { + function DummyInternalTextureTracker() { + /** + * Gets or set the previous tracker in the list + */ + this.previous = null; + /** + * Gets or set the next tracker in the list + */ + this.next = null; + } + return DummyInternalTextureTracker; + }()); + BABYLON.DummyInternalTextureTracker = DummyInternalTextureTracker; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.internalTextureTracker.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Class used to store data associated with WebGL texture data for the engine + * This class should not be used directly + */ + var InternalTexture = /** @class */ (function () { + /** + * Creates a new InternalTexture + * @param engine defines the engine to use + * @param dataSource defines the type of data that will be used + */ + function InternalTexture(engine, dataSource) { + /** + * Observable called when the texture is loaded + */ + this.onLoadedObservable = new BABYLON.Observable(); + /** + * Gets or set the previous tracker in the list + */ + this.previous = null; + /** + * Gets or set the next tracker in the list + */ + this.next = null; + // Private + /** @hidden */ + this._initialSlot = -1; + /** @hidden */ + this._designatedSlot = -1; + /** @hidden */ + this._dataSource = InternalTexture.DATASOURCE_UNKNOWN; + /** @hidden */ + this._comparisonFunction = 0; + /** @hidden */ + this._sphericalPolynomial = null; + /** @hidden */ + this._lodGenerationScale = 0; + /** @hidden */ + this._lodGenerationOffset = 0; + /** @hidden */ + this._isRGBD = false; + /** @hidden */ + this._references = 1; + this._engine = engine; + this._dataSource = dataSource; + this._webGLTexture = engine._createTexture(); + } + /** + * Gets the Engine the texture belongs to. + * @returns The babylon engine + */ + InternalTexture.prototype.getEngine = function () { + return this._engine; + }; + Object.defineProperty(InternalTexture.prototype, "dataSource", { + /** + * Gets the data source type of the texture (can be one of the BABYLON.InternalTexture.DATASOURCE_XXXX) + */ + get: function () { + return this._dataSource; + }, + enumerable: true, + configurable: true + }); + /** + * Increments the number of references (ie. the number of Texture that point to it) + */ + InternalTexture.prototype.incrementReferences = function () { + this._references++; + }; + /** + * Change the size of the texture (not the size of the content) + * @param width defines the new width + * @param height defines the new height + * @param depth defines the new depth (1 by default) + */ + InternalTexture.prototype.updateSize = function (width, height, depth) { + if (depth === void 0) { depth = 1; } + this.width = width; + this.height = height; + this.depth = depth; + this.baseWidth = width; + this.baseHeight = height; + this.baseDepth = depth; + this._size = width * height * depth; + }; + /** @hidden */ + InternalTexture.prototype._rebuild = function () { + var _this = this; + var proxy; + this.isReady = false; + this._cachedCoordinatesMode = null; + this._cachedWrapU = null; + this._cachedWrapV = null; + this._cachedAnisotropicFilteringLevel = null; + switch (this._dataSource) { + case InternalTexture.DATASOURCE_TEMP: + return; + case InternalTexture.DATASOURCE_URL: + proxy = this._engine.createTexture(this.url, !this.generateMipMaps, this.invertY, null, this.samplingMode, function () { + _this.isReady = true; + }, null, this._buffer, undefined, this.format); + proxy._swapAndDie(this); + return; + case InternalTexture.DATASOURCE_RAW: + proxy = this._engine.createRawTexture(this._bufferView, this.baseWidth, this.baseHeight, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression); + proxy._swapAndDie(this); + this.isReady = true; + return; + case InternalTexture.DATASOURCE_RAW3D: + proxy = this._engine.createRawTexture3D(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression); + proxy._swapAndDie(this); + this.isReady = true; + return; + case InternalTexture.DATASOURCE_DYNAMIC: + proxy = this._engine.createDynamicTexture(this.baseWidth, this.baseHeight, this.generateMipMaps, this.samplingMode); + proxy._swapAndDie(this); + // The engine will make sure to update content so no need to flag it as isReady = true + return; + case InternalTexture.DATASOURCE_RENDERTARGET: + var options = new BABYLON.RenderTargetCreationOptions(); + options.generateDepthBuffer = this._generateDepthBuffer; + options.generateMipMaps = this.generateMipMaps; + options.generateStencilBuffer = this._generateStencilBuffer; + options.samplingMode = this.samplingMode; + options.type = this.type; + if (this.isCube) { + proxy = this._engine.createRenderTargetCubeTexture(this.width, options); + } + else { + var size = { + width: this.width, + height: this.height + }; + proxy = this._engine.createRenderTargetTexture(size, options); + } + proxy._swapAndDie(this); + this.isReady = true; + return; + case InternalTexture.DATASOURCE_DEPTHTEXTURE: + var depthTextureOptions = { + bilinearFiltering: this.samplingMode !== BABYLON.Texture.BILINEAR_SAMPLINGMODE, + comparisonFunction: this._comparisonFunction, + generateStencil: this._generateStencilBuffer, + isCube: this.isCube + }; + proxy = this._engine.createDepthStencilTexture({ width: this.width, height: this.height }, depthTextureOptions); + proxy._swapAndDie(this); + this.isReady = true; + return; + case InternalTexture.DATASOURCE_CUBE: + proxy = this._engine.createCubeTexture(this.url, null, this._files, !this.generateMipMaps, function () { + _this.isReady = true; + }, null, this.format, this._extension); + proxy._swapAndDie(this); + return; + case InternalTexture.DATASOURCE_CUBERAW: + proxy = this._engine.createRawCubeTexture(this._bufferViewArray, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression); + proxy._swapAndDie(this); + this.isReady = true; + return; + case InternalTexture.DATASOURCE_CUBERAW_RGBD: + proxy = this._engine.createRawCubeTexture(null, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression); + BABYLON.RawCubeTexture._UpdateRGBDAsync(proxy, this._bufferViewArrayArray, this._sphericalPolynomial, this._lodGenerationScale, this._lodGenerationOffset).then(function () { + _this.isReady = true; + }); + proxy._swapAndDie(this); + return; + case InternalTexture.DATASOURCE_CUBEPREFILTERED: + proxy = this._engine.createPrefilteredCubeTexture(this.url, null, this._lodGenerationScale, this._lodGenerationOffset, function (proxy) { + if (proxy) { + proxy._swapAndDie(_this); + } + _this.isReady = true; + }, null, this.format, this._extension); + proxy._sphericalPolynomial = this._sphericalPolynomial; + return; + } + }; + /** @hidden */ + InternalTexture.prototype._swapAndDie = function (target) { + target._webGLTexture = this._webGLTexture; + if (this._framebuffer) { + target._framebuffer = this._framebuffer; + } + if (this._depthStencilBuffer) { + target._depthStencilBuffer = this._depthStencilBuffer; + } + if (this._lodTextureHigh) { + if (target._lodTextureHigh) { + target._lodTextureHigh.dispose(); + } + target._lodTextureHigh = this._lodTextureHigh; + } + if (this._lodTextureMid) { + if (target._lodTextureMid) { + target._lodTextureMid.dispose(); + } + target._lodTextureMid = this._lodTextureMid; + } + if (this._lodTextureLow) { + if (target._lodTextureLow) { + target._lodTextureLow.dispose(); + } + target._lodTextureLow = this._lodTextureLow; + } + var cache = this._engine.getLoadedTexturesCache(); + var index = cache.indexOf(this); + if (index !== -1) { + cache.splice(index, 1); + } + }; + /** + * Dispose the current allocated resources + */ + InternalTexture.prototype.dispose = function () { + if (!this._webGLTexture) { + return; + } + this._references--; + if (this._references === 0) { + this._engine._releaseTexture(this); + this._webGLTexture = null; + this.previous = null; + this.next = null; + } + }; + /** + * The source of the texture data is unknown + */ + InternalTexture.DATASOURCE_UNKNOWN = 0; + /** + * Texture data comes from an URL + */ + InternalTexture.DATASOURCE_URL = 1; + /** + * Texture data is only used for temporary storage + */ + InternalTexture.DATASOURCE_TEMP = 2; + /** + * Texture data comes from raw data (ArrayBuffer) + */ + InternalTexture.DATASOURCE_RAW = 3; + /** + * Texture content is dynamic (video or dynamic texture) + */ + InternalTexture.DATASOURCE_DYNAMIC = 4; + /** + * Texture content is generated by rendering to it + */ + InternalTexture.DATASOURCE_RENDERTARGET = 5; + /** + * Texture content is part of a multi render target process + */ + InternalTexture.DATASOURCE_MULTIRENDERTARGET = 6; + /** + * Texture data comes from a cube data file + */ + InternalTexture.DATASOURCE_CUBE = 7; + /** + * Texture data comes from a raw cube data + */ + InternalTexture.DATASOURCE_CUBERAW = 8; + /** + * Texture data come from a prefiltered cube data file + */ + InternalTexture.DATASOURCE_CUBEPREFILTERED = 9; + /** + * Texture content is raw 3D data + */ + InternalTexture.DATASOURCE_RAW3D = 10; + /** + * Texture content is a depth texture + */ + InternalTexture.DATASOURCE_DEPTHTEXTURE = 11; + /** + * Texture data comes from a raw cube data encoded with RGBD + */ + InternalTexture.DATASOURCE_CUBERAW_RGBD = 12; + return InternalTexture; + }()); + BABYLON.InternalTexture = InternalTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.internalTexture.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Base class of all the textures in babylon. + * It groups all the common properties the materials, post process, lights... might need + * in order to make a correct use of the texture. + */ + var BaseTexture = /** @class */ (function () { + /** + * Instantiates a new BaseTexture. + * Base class of all the textures in babylon. + * It groups all the common properties the materials, post process, lights... might need + * in order to make a correct use of the texture. + * @param scene Define the scene the texture blongs to + */ + function BaseTexture(scene) { + this._hasAlpha = false; + /** + * Defines if the alpha value should be determined via the rgb values. + * If true the luminance of the pixel might be used to find the corresponding alpha value. + */ + this.getAlphaFromRGB = false; + /** + * Intensity or strength of the texture. + * It is commonly used by materials to fine tune the intensity of the texture + */ + this.level = 1; + /** + * Define the UV chanel to use starting from 0 and defaulting to 0. + * This is part of the texture as textures usually maps to one uv set. + */ + this.coordinatesIndex = 0; + this._coordinatesMode = BABYLON.Texture.EXPLICIT_MODE; + /** + * | Value | Type | Description | + * | ----- | ------------------ | ----------- | + * | 0 | CLAMP_ADDRESSMODE | | + * | 1 | WRAP_ADDRESSMODE | | + * | 2 | MIRROR_ADDRESSMODE | | + */ + this.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE; + /** + * | Value | Type | Description | + * | ----- | ------------------ | ----------- | + * | 0 | CLAMP_ADDRESSMODE | | + * | 1 | WRAP_ADDRESSMODE | | + * | 2 | MIRROR_ADDRESSMODE | | + */ + this.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE; + /** + * | Value | Type | Description | + * | ----- | ------------------ | ----------- | + * | 0 | CLAMP_ADDRESSMODE | | + * | 1 | WRAP_ADDRESSMODE | | + * | 2 | MIRROR_ADDRESSMODE | | + */ + this.wrapR = BABYLON.Texture.WRAP_ADDRESSMODE; + /** + * With compliant hardware and browser (supporting anisotropic filtering) + * this defines the level of anisotropic filtering in the texture. + * The higher the better but the slower. This defaults to 4 as it seems to be the best tradeoff. + */ + this.anisotropicFilteringLevel = BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL; + /** + * Define if the texture is a cube texture or if false a 2d texture. + */ + this.isCube = false; + /** + * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture. + */ + this.is3D = false; + /** + * Define if the texture contains data in gamma space (most of the png/jpg aside bump). + * HDR texture are usually stored in linear space. + * This only impacts the PBR and Background materials + */ + this.gammaSpace = true; + /** + * Is Z inverted in the texture (useful in a cube texture). + */ + this.invertZ = false; + /** + * @hidden + */ + this.lodLevelInAlpha = false; + /** + * Define if the texture is a render target. + */ + this.isRenderTarget = false; + /** + * Define the list of animation attached to the texture. + */ + this.animations = new Array(); + /** + * An event triggered when the texture is disposed. + */ + this.onDisposeObservable = new BABYLON.Observable(); + /** + * Define the current state of the loading sequence when in delayed load mode. + */ + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NONE; + this._cachedSize = BABYLON.Size.Zero(); + this._scene = scene || BABYLON.Engine.LastCreatedScene; + if (this._scene) { + this._scene.textures.push(this); + this._scene.onNewTextureAddedObservable.notifyObservers(this); + } + this._uid = null; + } + Object.defineProperty(BaseTexture.prototype, "hasAlpha", { + get: function () { + return this._hasAlpha; + }, + /** + * Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance). + */ + set: function (value) { + if (this._hasAlpha === value) { + return; + } + this._hasAlpha = value; + if (this._scene) { + this._scene.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag | BABYLON.Material.MiscDirtyFlag); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseTexture.prototype, "coordinatesMode", { + get: function () { + return this._coordinatesMode; + }, + /** + * How a texture is mapped. + * + * | Value | Type | Description | + * | ----- | ----------------------------------- | ----------- | + * | 0 | EXPLICIT_MODE | | + * | 1 | SPHERICAL_MODE | | + * | 2 | PLANAR_MODE | | + * | 3 | CUBIC_MODE | | + * | 4 | PROJECTION_MODE | | + * | 5 | SKYBOX_MODE | | + * | 6 | INVCUBIC_MODE | | + * | 7 | EQUIRECTANGULAR_MODE | | + * | 8 | FIXED_EQUIRECTANGULAR_MODE | | + * | 9 | FIXED_EQUIRECTANGULAR_MIRRORED_MODE | | + */ + set: function (value) { + if (this._coordinatesMode === value) { + return; + } + this._coordinatesMode = value; + if (this._scene) { + this._scene.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseTexture.prototype, "isRGBD", { + /** + * Gets whether or not the texture contains RGBD data. + */ + get: function () { + return this._texture != null && this._texture._isRGBD; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseTexture.prototype, "lodGenerationOffset", { + /** + * With prefiltered texture, defined the offset used during the prefiltering steps. + */ + get: function () { + if (this._texture) { + return this._texture._lodGenerationOffset; + } + return 0.0; + }, + set: function (value) { + if (this._texture) { + this._texture._lodGenerationOffset = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseTexture.prototype, "lodGenerationScale", { + /** + * With prefiltered texture, defined the scale used during the prefiltering steps. + */ + get: function () { + if (this._texture) { + return this._texture._lodGenerationScale; + } + return 0.0; + }, + set: function (value) { + if (this._texture) { + this._texture._lodGenerationScale = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseTexture.prototype, "uid", { + /** + * Define the unique id of the texture in the scene. + */ + get: function () { + if (!this._uid) { + this._uid = BABYLON.Tools.RandomId(); + } + return this._uid; + }, + enumerable: true, + configurable: true + }); + /** + * Return a string representation of the texture. + * @returns the texture as a string + */ + BaseTexture.prototype.toString = function () { + return this.name; + }; + /** + * Get the class name of the texture. + * @returns "BaseTexture" + */ + BaseTexture.prototype.getClassName = function () { + return "BaseTexture"; + }; + Object.defineProperty(BaseTexture.prototype, "onDispose", { + /** + * Callback triggered when the texture has been disposed. + * Kept for back compatibility, you can use the onDisposeObservable instead. + */ + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseTexture.prototype, "isBlocking", { + /** + * Define if the texture is preventinga material to render or not. + * If not and the texture is not ready, the engine will use a default black texture instead. + */ + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + /** + * Get the scene the texture belongs to. + * @returns the scene or null if undefined + */ + BaseTexture.prototype.getScene = function () { + return this._scene; + }; + /** + * Get the texture transform matrix used to offset tile the texture for istance. + * @returns the transformation matrix + */ + BaseTexture.prototype.getTextureMatrix = function () { + return BABYLON.Matrix.IdentityReadOnly; + }; + /** + * Get the texture reflection matrix used to rotate/transform the reflection. + * @returns the reflection matrix + */ + BaseTexture.prototype.getReflectionTextureMatrix = function () { + return BABYLON.Matrix.IdentityReadOnly; + }; + /** + * Get the underlying lower level texture from Babylon. + * @returns the insternal texture + */ + BaseTexture.prototype.getInternalTexture = function () { + return this._texture; + }; + /** + * Get if the texture is ready to be consumed (either it is ready or it is not blocking) + * @returns true if ready or not blocking + */ + BaseTexture.prototype.isReadyOrNotBlocking = function () { + return !this.isBlocking || this.isReady(); + }; + /** + * Get if the texture is ready to be used (downloaded, converted, mip mapped...). + * @returns true if fully ready + */ + BaseTexture.prototype.isReady = function () { + if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) { + this.delayLoad(); + return false; + } + if (this._texture) { + return this._texture.isReady; + } + return false; + }; + /** + * Get the size of the texture. + * @returns the texture size. + */ + BaseTexture.prototype.getSize = function () { + if (this._texture) { + if (this._texture.width) { + this._cachedSize.width = this._texture.width; + this._cachedSize.height = this._texture.height; + return this._cachedSize; + } + if (this._texture._size) { + this._cachedSize.width = this._texture._size; + this._cachedSize.height = this._texture._size; + return this._cachedSize; + } + } + return this._cachedSize; + }; + /** + * Get the base size of the texture. + * It can be different from the size if the texture has been resized for POT for instance + * @returns the base size + */ + BaseTexture.prototype.getBaseSize = function () { + if (!this.isReady() || !this._texture) { + return BABYLON.Size.Zero(); + } + if (this._texture._size) { + return new BABYLON.Size(this._texture._size, this._texture._size); + } + return new BABYLON.Size(this._texture.baseWidth, this._texture.baseHeight); + }; + /** + * Scales the texture if is `canRescale()` + * @param ratio the resize factor we want to use to rescale + */ + BaseTexture.prototype.scale = function (ratio) { + }; + Object.defineProperty(BaseTexture.prototype, "canRescale", { + /** + * Get if the texture can rescale. + */ + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + BaseTexture.prototype._getFromCache = function (url, noMipmap, sampling) { + if (!this._scene) { + return null; + } + var texturesCache = this._scene.getEngine().getLoadedTexturesCache(); + for (var index = 0; index < texturesCache.length; index++) { + var texturesCacheEntry = texturesCache[index]; + if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) { + if (!sampling || sampling === texturesCacheEntry.samplingMode) { + texturesCacheEntry.incrementReferences(); + return texturesCacheEntry; + } + } + } + return null; + }; + /** @hidden */ + BaseTexture.prototype._rebuild = function () { + }; + /** + * Triggers the load sequence in delayed load mode. + */ + BaseTexture.prototype.delayLoad = function () { + }; + /** + * Clones the texture. + * @returns the cloned texture + */ + BaseTexture.prototype.clone = function () { + return null; + }; + Object.defineProperty(BaseTexture.prototype, "textureType", { + /** + * Get the texture underlying type (INT, FLOAT...) + */ + get: function () { + if (!this._texture) { + return BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; + } + return (this._texture.type !== undefined) ? this._texture.type : BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseTexture.prototype, "textureFormat", { + /** + * Get the texture underlying format (RGB, RGBA...) + */ + get: function () { + if (!this._texture) { + return BABYLON.Engine.TEXTUREFORMAT_RGBA; + } + return (this._texture.format !== undefined) ? this._texture.format : BABYLON.Engine.TEXTUREFORMAT_RGBA; + }, + enumerable: true, + configurable: true + }); + /** + * Reads the pixels stored in the webgl texture and returns them as an ArrayBuffer. + * This will returns an RGBA array buffer containing either in values (0-255) or + * float values (0-1) depending of the underlying buffer type. + * @param faceIndex defines the face of the texture to read (in case of cube texture) + * @param level defines the LOD level of the texture to read (in case of Mip Maps) + * @param buffer defines a user defined buffer to fill with data (can be null) + * @returns The Array buffer containing the pixels data. + */ + BaseTexture.prototype.readPixels = function (faceIndex, level, buffer) { + if (faceIndex === void 0) { faceIndex = 0; } + if (level === void 0) { level = 0; } + if (buffer === void 0) { buffer = null; } + if (!this._texture) { + return null; + } + var size = this.getSize(); + var width = size.width; + var height = size.height; + var scene = this.getScene(); + if (!scene) { + return null; + } + var engine = scene.getEngine(); + if (level != 0) { + width = width / Math.pow(2, level); + height = height / Math.pow(2, level); + width = Math.round(width); + height = Math.round(height); + } + if (this._texture.isCube) { + return engine._readTexturePixels(this._texture, width, height, faceIndex, level, buffer); + } + return engine._readTexturePixels(this._texture, width, height, -1, level, buffer); + }; + /** + * Release and destroy the underlying lower level texture aka internalTexture. + */ + BaseTexture.prototype.releaseInternalTexture = function () { + if (this._texture) { + this._texture.dispose(); + this._texture = null; + } + }; + Object.defineProperty(BaseTexture.prototype, "sphericalPolynomial", { + /** + * Get the polynomial representation of the texture data. + * This is mainly use as a fast way to recover IBL Diffuse irradiance data. + * @see https://learnopengl.com/PBR/IBL/Diffuse-irradiance + */ + get: function () { + if (!this._texture || !BABYLON.CubeMapToSphericalPolynomialTools || !this.isReady()) { + return null; + } + if (!this._texture._sphericalPolynomial) { + this._texture._sphericalPolynomial = + BABYLON.CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial(this); + } + return this._texture._sphericalPolynomial; + }, + set: function (value) { + if (this._texture) { + this._texture._sphericalPolynomial = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseTexture.prototype, "_lodTextureHigh", { + /** @hidden */ + get: function () { + if (this._texture) { + return this._texture._lodTextureHigh; + } + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseTexture.prototype, "_lodTextureMid", { + /** @hidden */ + get: function () { + if (this._texture) { + return this._texture._lodTextureMid; + } + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseTexture.prototype, "_lodTextureLow", { + /** @hidden */ + get: function () { + if (this._texture) { + return this._texture._lodTextureLow; + } + return null; + }, + enumerable: true, + configurable: true + }); + /** + * Dispose the texture and release its associated resources. + */ + BaseTexture.prototype.dispose = function () { + if (!this._scene) { + return; + } + // Animations + this._scene.stopAnimation(this); + // Remove from scene + this._scene._removePendingData(this); + var index = this._scene.textures.indexOf(this); + if (index >= 0) { + this._scene.textures.splice(index, 1); + } + this._scene.onTextureRemovedObservable.notifyObservers(this); + if (this._texture === undefined) { + return; + } + // Release + this.releaseInternalTexture(); + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + }; + /** + * Serialize the texture into a JSON representation that can be parsed later on. + * @returns the JSON representation of the texture + */ + BaseTexture.prototype.serialize = function () { + if (!this.name) { + return null; + } + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + // Animations + BABYLON.Animation.AppendSerializedAnimations(this, serializationObject); + return serializationObject; + }; + /** + * Helper function to be called back once a list of texture contains only ready textures. + * @param textures Define the list of textures to wait for + * @param callback Define the callback triggered once the entire list will be ready + */ + BaseTexture.WhenAllReady = function (textures, callback) { + var numRemaining = textures.length; + if (numRemaining === 0) { + callback(); + return; + } + var _loop_1 = function () { + texture = textures[i]; + if (texture.isReady()) { + if (--numRemaining === 0) { + callback(); + } + } + else { + onLoadObservable = texture.onLoadObservable; + var onLoadCallback_1 = function () { + onLoadObservable.removeCallback(onLoadCallback_1); + if (--numRemaining === 0) { + callback(); + } + }; + onLoadObservable.add(onLoadCallback_1); + } + }; + var texture, onLoadObservable; + for (var i = 0; i < textures.length; i++) { + _loop_1(); + } + }; + /** + * Default anisotropic filtering level for the application. + * It is set to 4 as a good tradeoff between perf and quality. + */ + BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4; + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "name", void 0); + __decorate([ + BABYLON.serialize("hasAlpha") + ], BaseTexture.prototype, "_hasAlpha", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "getAlphaFromRGB", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "level", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "coordinatesIndex", void 0); + __decorate([ + BABYLON.serialize("coordinatesMode") + ], BaseTexture.prototype, "_coordinatesMode", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "wrapU", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "wrapV", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "wrapR", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "anisotropicFilteringLevel", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "isCube", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "is3D", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "gammaSpace", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "invertZ", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "lodLevelInAlpha", void 0); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "lodGenerationOffset", null); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "lodGenerationScale", null); + __decorate([ + BABYLON.serialize() + ], BaseTexture.prototype, "isRenderTarget", void 0); + return BaseTexture; + }()); + BABYLON.BaseTexture = BaseTexture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.baseTexture.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input. + * @see http://doc.babylonjs.com/babylon101/materials#texture + */ + var Texture = /** @class */ (function (_super) { + __extends(Texture, _super); + /** + * Instantiates a new texture. + * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input. + * @see http://doc.babylonjs.com/babylon101/materials#texture + * @param url define the url of the picture to load as a texture + * @param scene define the scene the texture will belong to + * @param noMipmap define if the texture will require mip maps or not + * @param invertY define if the texture needs to be inverted on the y axis during loading + * @param samplingMode define the sampling mode we want for the texture while fectching from it (Texture.NEAREST_SAMPLINGMODE...) + * @param onLoad define a callback triggered when the texture has been loaded + * @param onError define a callback triggered when an error occurred during the loading session + * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation + * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load + * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...) + */ + function Texture(url, scene, noMipmap, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format) { + if (noMipmap === void 0) { noMipmap = false; } + if (invertY === void 0) { invertY = true; } + if (samplingMode === void 0) { samplingMode = Texture.TRILINEAR_SAMPLINGMODE; } + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + if (buffer === void 0) { buffer = null; } + if (deleteBuffer === void 0) { deleteBuffer = false; } + var _this = _super.call(this, scene) || this; + /** + * Define an offset on the texture to offset the u coordinates of the UVs + * @see http://doc.babylonjs.com/how_to/more_materials#offsetting + */ + _this.uOffset = 0; + /** + * Define an offset on the texture to offset the v coordinates of the UVs + * @see http://doc.babylonjs.com/how_to/more_materials#offsetting + */ + _this.vOffset = 0; + /** + * Define an offset on the texture to scale the u coordinates of the UVs + * @see http://doc.babylonjs.com/how_to/more_materials#tiling + */ + _this.uScale = 1.0; + /** + * Define an offset on the texture to scale the v coordinates of the UVs + * @see http://doc.babylonjs.com/how_to/more_materials#tiling + */ + _this.vScale = 1.0; + /** + * Define an offset on the texture to rotate around the u coordinates of the UVs + * @see http://doc.babylonjs.com/how_to/more_materials + */ + _this.uAng = 0; + /** + * Define an offset on the texture to rotate around the v coordinates of the UVs + * @see http://doc.babylonjs.com/how_to/more_materials + */ + _this.vAng = 0; + /** + * Define an offset on the texture to rotate around the w coordinates of the UVs (in case of 3d texture) + * @see http://doc.babylonjs.com/how_to/more_materials + */ + _this.wAng = 0; + /** + * Defines the center of rotation (U) + */ + _this.uRotationCenter = 0.5; + /** + * Defines the center of rotation (V) + */ + _this.vRotationCenter = 0.5; + /** + * Defines the center of rotation (W) + */ + _this.wRotationCenter = 0.5; + /** + * Observable triggered once the texture has been loaded. + */ + _this.onLoadObservable = new BABYLON.Observable(); + _this._isBlocking = true; + _this.name = url || ""; + _this.url = url; + _this._noMipmap = noMipmap; + _this._invertY = invertY; + _this._samplingMode = samplingMode; + _this._buffer = buffer; + _this._deleteBuffer = deleteBuffer; + if (format) { + _this._format = format; + } + scene = _this.getScene(); + if (!scene) { + return _this; + } + scene.getEngine().onBeforeTextureInitObservable.notifyObservers(_this); + var load = function () { + if (_this.onLoadObservable.hasObservers()) { + _this.onLoadObservable.notifyObservers(_this); + } + if (onLoad) { + onLoad(); + } + if (!_this.isBlocking && scene) { + scene.resetCachedMaterial(); + } + }; + if (!_this.url) { + _this._delayedOnLoad = load; + _this._delayedOnError = onError; + return _this; + } + _this._texture = _this._getFromCache(_this.url, noMipmap, samplingMode); + if (!_this._texture) { + if (!scene.useDelayedTextureLoading) { + _this._texture = scene.getEngine().createTexture(_this.url, noMipmap, invertY, scene, _this._samplingMode, load, onError, _this._buffer, undefined, _this._format); + if (deleteBuffer) { + delete _this._buffer; + } + } + else { + _this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED; + _this._delayedOnLoad = load; + _this._delayedOnError = onError; + } + } + else { + if (_this._texture.isReady) { + BABYLON.Tools.SetImmediate(function () { return load(); }); + } + else { + _this._texture.onLoadedObservable.add(load); + } + } + return _this; + } + Object.defineProperty(Texture.prototype, "noMipmap", { + /** + * Are mip maps generated for this texture or not. + */ + get: function () { + return this._noMipmap; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Texture.prototype, "isBlocking", { + get: function () { + return this._isBlocking; + }, + /** + * Is the texture preventing material to render while loading. + * If false, a default texture will be used instead of the loading one during the preparation step. + */ + set: function (value) { + this._isBlocking = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Texture.prototype, "samplingMode", { + /** + * Get the current sampling mode associated with the texture. + */ + get: function () { + return this._samplingMode; + }, + enumerable: true, + configurable: true + }); + /** + * Update the url (and optional buffer) of this texture if url was null during construction. + * @param url the url of the texture + * @param buffer the buffer of the texture (defaults to null) + */ + Texture.prototype.updateURL = function (url, buffer) { + if (buffer === void 0) { buffer = null; } + if (this.url) { + throw new Error("URL is already set"); + } + this.url = url; + this._buffer = buffer; + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED; + this.delayLoad(); + }; + /** + * Finish the loading sequence of a texture flagged as delayed load. + * @hidden + */ + Texture.prototype.delayLoad = function () { + if (this.delayLoadState !== BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) { + return; + } + var scene = this.getScene(); + if (!scene) { + return; + } + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED; + this._texture = this._getFromCache(this.url, this._noMipmap, this._samplingMode); + if (!this._texture) { + this._texture = scene.getEngine().createTexture(this.url, this._noMipmap, this._invertY, scene, this._samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format); + if (this._deleteBuffer) { + delete this._buffer; + } + } + else { + if (this._delayedOnLoad) { + if (this._texture.isReady) { + BABYLON.Tools.SetImmediate(this._delayedOnLoad); + } + else { + this._texture.onLoadedObservable.add(this._delayedOnLoad); + } + } + } + this._delayedOnLoad = null; + this._delayedOnError = null; + }; + /** + * Update the sampling mode of the texture. + * Default is Trilinear mode. + * + * | Value | Type | Description | + * | ----- | ------------------ | ----------- | + * | 1 | NEAREST_SAMPLINGMODE or NEAREST_NEAREST_MIPLINEAR | Nearest is: mag = nearest, min = nearest, mip = linear | + * | 2 | BILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPNEAREST | Bilinear is: mag = linear, min = linear, mip = nearest | + * | 3 | TRILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPLINEAR | Trilinear is: mag = linear, min = linear, mip = linear | + * | 4 | NEAREST_NEAREST_MIPNEAREST | | + * | 5 | NEAREST_LINEAR_MIPNEAREST | | + * | 6 | NEAREST_LINEAR_MIPLINEAR | | + * | 7 | NEAREST_LINEAR | | + * | 8 | NEAREST_NEAREST | | + * | 9 | LINEAR_NEAREST_MIPNEAREST | | + * | 10 | LINEAR_NEAREST_MIPLINEAR | | + * | 11 | LINEAR_LINEAR | | + * | 12 | LINEAR_NEAREST | | + * + * > _mag_: magnification filter (close to the viewer) + * > _min_: minification filter (far from the viewer) + * > _mip_: filter used between mip map levels + *@param samplingMode Define the new sampling mode of the texture + */ + Texture.prototype.updateSamplingMode = function (samplingMode) { + if (!this._texture) { + return; + } + var scene = this.getScene(); + if (!scene) { + return; + } + this._samplingMode = samplingMode; + scene.getEngine().updateTextureSamplingMode(samplingMode, this._texture); + }; + Texture.prototype._prepareRowForTextureGeneration = function (x, y, z, t) { + x *= this.uScale; + y *= this.vScale; + x -= this.uRotationCenter * this.uScale; + y -= this.vRotationCenter * this.vScale; + z -= this.wRotationCenter; + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t); + t.x += this.uRotationCenter * this.uScale + this.uOffset; + t.y += this.vRotationCenter * this.vScale + this.vOffset; + t.z += this.wRotationCenter; + }; + /** + * Get the current texture matrix which includes the requested offsetting, tiling and rotation components. + * @returns the transform matrix of the texture. + */ + Texture.prototype.getTextureMatrix = function () { + var _this = this; + if (this.uOffset === this._cachedUOffset && + this.vOffset === this._cachedVOffset && + this.uScale === this._cachedUScale && + this.vScale === this._cachedVScale && + this.uAng === this._cachedUAng && + this.vAng === this._cachedVAng && + this.wAng === this._cachedWAng) { + return this._cachedTextureMatrix; + } + this._cachedUOffset = this.uOffset; + this._cachedVOffset = this.vOffset; + this._cachedUScale = this.uScale; + this._cachedVScale = this.vScale; + this._cachedUAng = this.uAng; + this._cachedVAng = this.vAng; + this._cachedWAng = this.wAng; + if (!this._cachedTextureMatrix) { + this._cachedTextureMatrix = BABYLON.Matrix.Zero(); + this._rowGenerationMatrix = new BABYLON.Matrix(); + this._t0 = BABYLON.Vector3.Zero(); + this._t1 = BABYLON.Vector3.Zero(); + this._t2 = BABYLON.Vector3.Zero(); + } + BABYLON.Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix); + this._prepareRowForTextureGeneration(0, 0, 0, this._t0); + this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1); + this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2); + this._t1.subtractInPlace(this._t0); + this._t2.subtractInPlace(this._t0); + BABYLON.Matrix.IdentityToRef(this._cachedTextureMatrix); + this._cachedTextureMatrix.m[0] = this._t1.x; + this._cachedTextureMatrix.m[1] = this._t1.y; + this._cachedTextureMatrix.m[2] = this._t1.z; + this._cachedTextureMatrix.m[4] = this._t2.x; + this._cachedTextureMatrix.m[5] = this._t2.y; + this._cachedTextureMatrix.m[6] = this._t2.z; + this._cachedTextureMatrix.m[8] = this._t0.x; + this._cachedTextureMatrix.m[9] = this._t0.y; + this._cachedTextureMatrix.m[10] = this._t0.z; + var scene = this.getScene(); + if (!scene) { + return this._cachedTextureMatrix; + } + scene.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag, function (mat) { + return mat.hasTexture(_this); + }); + return this._cachedTextureMatrix; + }; + /** + * Get the current matrix used to apply reflection. This is useful to rotate an environment texture for instance. + * @returns The reflection texture transform + */ + Texture.prototype.getReflectionTextureMatrix = function () { + var _this = this; + var scene = this.getScene(); + if (!scene) { + return this._cachedTextureMatrix; + } + if (this.uOffset === this._cachedUOffset && + this.vOffset === this._cachedVOffset && + this.uScale === this._cachedUScale && + this.vScale === this._cachedVScale && + this.coordinatesMode === this._cachedCoordinatesMode) { + if (this.coordinatesMode === Texture.PROJECTION_MODE) { + if (this._cachedProjectionMatrixId === scene.getProjectionMatrix().updateFlag) { + return this._cachedTextureMatrix; + } + } + else { + return this._cachedTextureMatrix; + } + } + if (!this._cachedTextureMatrix) { + this._cachedTextureMatrix = BABYLON.Matrix.Zero(); + } + if (!this._projectionModeMatrix) { + this._projectionModeMatrix = BABYLON.Matrix.Zero(); + } + this._cachedUOffset = this.uOffset; + this._cachedVOffset = this.vOffset; + this._cachedUScale = this.uScale; + this._cachedVScale = this.vScale; + this._cachedCoordinatesMode = this.coordinatesMode; + switch (this.coordinatesMode) { + case Texture.PLANAR_MODE: + BABYLON.Matrix.IdentityToRef(this._cachedTextureMatrix); + this._cachedTextureMatrix[0] = this.uScale; + this._cachedTextureMatrix[5] = this.vScale; + this._cachedTextureMatrix[12] = this.uOffset; + this._cachedTextureMatrix[13] = this.vOffset; + break; + case Texture.PROJECTION_MODE: + BABYLON.Matrix.IdentityToRef(this._projectionModeMatrix); + this._projectionModeMatrix.m[0] = 0.5; + this._projectionModeMatrix.m[5] = -0.5; + this._projectionModeMatrix.m[10] = 0.0; + this._projectionModeMatrix.m[12] = 0.5; + this._projectionModeMatrix.m[13] = 0.5; + this._projectionModeMatrix.m[14] = 1.0; + this._projectionModeMatrix.m[15] = 1.0; + var projectionMatrix = scene.getProjectionMatrix(); + this._cachedProjectionMatrixId = projectionMatrix.updateFlag; + projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedTextureMatrix); + break; + default: + BABYLON.Matrix.IdentityToRef(this._cachedTextureMatrix); + break; + } + scene.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag, function (mat) { + return (mat.getActiveTextures().indexOf(_this) !== -1); + }); + return this._cachedTextureMatrix; + }; + /** + * Clones the texture. + * @returns the cloned texture + */ + Texture.prototype.clone = function () { + var _this = this; + return BABYLON.SerializationHelper.Clone(function () { + return new Texture(_this._texture ? _this._texture.url : null, _this.getScene(), _this._noMipmap, _this._invertY, _this._samplingMode); + }, this); + }; + /** + * Serialize the texture to a JSON representation we can easily use in the resepective Parse function. + * @returns The JSON representation of the texture + */ + Texture.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + if (typeof this._buffer === "string" && this._buffer.substr(0, 5) === "data:") { + serializationObject.base64String = this._buffer; + serializationObject.name = serializationObject.name.replace("data:", ""); + } + serializationObject.invertY = this._invertY; + serializationObject.samplingMode = this.samplingMode; + return serializationObject; + }; + /** + * Get the current class name of the texture usefull for serialization or dynamic coding. + * @returns "Texture" + */ + Texture.prototype.getClassName = function () { + return "Texture"; + }; + /** + * Dispose the texture and release its associated resources. + */ + Texture.prototype.dispose = function () { + _super.prototype.dispose.call(this); + this.onLoadObservable.clear(); + this._delayedOnLoad = null; + this._delayedOnError = null; + }; + /** + * Parse the JSON representation of a texture in order to recreate the texture in the given scene. + * @param parsedTexture Define the JSON representation of the texture + * @param scene Define the scene the parsed texture should be instantiated in + * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies + * @returns The parsed texture if successful + */ + Texture.Parse = function (parsedTexture, scene, rootUrl) { + if (parsedTexture.customType) { + var customTexture = BABYLON.Tools.Instantiate(parsedTexture.customType); + // Update Sampling Mode + var parsedCustomTexture = customTexture.Parse(parsedTexture, scene, rootUrl); + if (parsedTexture.samplingMode && parsedCustomTexture.updateSamplingMode && parsedCustomTexture._samplingMode) { + if (parsedCustomTexture._samplingMode !== parsedTexture.samplingMode) { + parsedCustomTexture.updateSamplingMode(parsedTexture.samplingMode); + } + } + return parsedCustomTexture; + } + if (parsedTexture.isCube) { + return BABYLON.CubeTexture.Parse(parsedTexture, scene, rootUrl); + } + if (!parsedTexture.name && !parsedTexture.isRenderTarget) { + return null; + } + var texture = BABYLON.SerializationHelper.Parse(function () { + var generateMipMaps = true; + if (parsedTexture.noMipmap) { + generateMipMaps = false; + } + if (parsedTexture.mirrorPlane) { + var mirrorTexture = new BABYLON.MirrorTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps); + mirrorTexture._waitingRenderList = parsedTexture.renderList; + mirrorTexture.mirrorPlane = BABYLON.Plane.FromArray(parsedTexture.mirrorPlane); + return mirrorTexture; + } + else if (parsedTexture.isRenderTarget) { + var renderTargetTexture = new BABYLON.RenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps); + renderTargetTexture._waitingRenderList = parsedTexture.renderList; + return renderTargetTexture; + } + else { + var texture; + if (parsedTexture.base64String) { + texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.name, scene, !generateMipMaps); + } + else { + var url = rootUrl + parsedTexture.name; + if (Texture.UseSerializedUrlIfAny && parsedTexture.url) { + url = parsedTexture.url; + } + texture = new Texture(url, scene, !generateMipMaps, parsedTexture.invertY); + } + return texture; + } + }, parsedTexture, scene); + // Update Sampling Mode + if (parsedTexture.samplingMode) { + var sampling = parsedTexture.samplingMode; + if (texture._samplingMode !== sampling) { + texture.updateSamplingMode(sampling); + } + } + // Animations + if (parsedTexture.animations) { + for (var animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) { + var parsedAnimation = parsedTexture.animations[animationIndex]; + texture.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + } + return texture; + }; + /** + * Creates a texture from its base 64 representation. + * @param data Define the base64 payload without the data: prefix + * @param name Define the name of the texture in the scene useful fo caching purpose for instance + * @param scene Define the scene the texture should belong to + * @param noMipmap Forces the texture to not create mip map information if true + * @param invertY define if the texture needs to be inverted on the y axis during loading + * @param samplingMode define the sampling mode we want for the texture while fectching from it (Texture.NEAREST_SAMPLINGMODE...) + * @param onLoad define a callback triggered when the texture has been loaded + * @param onError define a callback triggered when an error occurred during the loading session + * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...) + * @returns the created texture + */ + Texture.CreateFromBase64String = function (data, name, scene, noMipmap, invertY, samplingMode, onLoad, onError, format) { + if (samplingMode === void 0) { samplingMode = Texture.TRILINEAR_SAMPLINGMODE; } + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + if (format === void 0) { format = BABYLON.Engine.TEXTUREFORMAT_RGBA; } + return new Texture("data:" + name, scene, noMipmap, invertY, samplingMode, onLoad, onError, data, false, format); + }; + /** + * Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in) + * @param data Define the base64 payload without the data: prefix + * @param name Define the name of the texture in the scene useful fo caching purpose for instance + * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation + * @param scene Define the scene the texture should belong to + * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load + * @param noMipmap Forces the texture to not create mip map information if true + * @param invertY define if the texture needs to be inverted on the y axis during loading + * @param samplingMode define the sampling mode we want for the texture while fectching from it (Texture.NEAREST_SAMPLINGMODE...) + * @param onLoad define a callback triggered when the texture has been loaded + * @param onError define a callback triggered when an error occurred during the loading session + * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...) + * @returns the created texture + */ + Texture.LoadFromDataString = function (name, buffer, scene, deleteBuffer, noMipmap, invertY, samplingMode, onLoad, onError, format) { + if (deleteBuffer === void 0) { deleteBuffer = false; } + if (noMipmap === void 0) { noMipmap = false; } + if (invertY === void 0) { invertY = true; } + if (samplingMode === void 0) { samplingMode = Texture.TRILINEAR_SAMPLINGMODE; } + if (onLoad === void 0) { onLoad = null; } + if (onError === void 0) { onError = null; } + if (format === void 0) { format = BABYLON.Engine.TEXTUREFORMAT_RGBA; } + if (name.substr(0, 5) !== "data:") { + name = "data:" + name; + } + return new Texture(name, scene, noMipmap, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format); + }; + /** nearest is mag = nearest and min = nearest and mip = linear */ + Texture.NEAREST_SAMPLINGMODE = BABYLON.Engine.TEXTURE_NEAREST_SAMPLINGMODE; + /** nearest is mag = nearest and min = nearest and mip = linear */ + Texture.NEAREST_NEAREST_MIPLINEAR = BABYLON.Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR; // nearest is mag = nearest and min = nearest and mip = linear + /** Bilinear is mag = linear and min = linear and mip = nearest */ + Texture.BILINEAR_SAMPLINGMODE = BABYLON.Engine.TEXTURE_BILINEAR_SAMPLINGMODE; + /** Bilinear is mag = linear and min = linear and mip = nearest */ + Texture.LINEAR_LINEAR_MIPNEAREST = BABYLON.Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST; // Bilinear is mag = linear and min = linear and mip = nearest + /** Trilinear is mag = linear and min = linear and mip = linear */ + Texture.TRILINEAR_SAMPLINGMODE = BABYLON.Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; + /** Trilinear is mag = linear and min = linear and mip = linear */ + Texture.LINEAR_LINEAR_MIPLINEAR = BABYLON.Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR; // Trilinear is mag = linear and min = linear and mip = linear + /** mag = nearest and min = nearest and mip = nearest */ + Texture.NEAREST_NEAREST_MIPNEAREST = BABYLON.Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST; + /** mag = nearest and min = linear and mip = nearest */ + Texture.NEAREST_LINEAR_MIPNEAREST = BABYLON.Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST; + /** mag = nearest and min = linear and mip = linear */ + Texture.NEAREST_LINEAR_MIPLINEAR = BABYLON.Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR; + /** mag = nearest and min = linear and mip = none */ + Texture.NEAREST_LINEAR = BABYLON.Engine.TEXTURE_NEAREST_LINEAR; + /** mag = nearest and min = nearest and mip = none */ + Texture.NEAREST_NEAREST = BABYLON.Engine.TEXTURE_NEAREST_NEAREST; + /** mag = linear and min = nearest and mip = nearest */ + Texture.LINEAR_NEAREST_MIPNEAREST = BABYLON.Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST; + /** mag = linear and min = nearest and mip = linear */ + Texture.LINEAR_NEAREST_MIPLINEAR = BABYLON.Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR; + /** mag = linear and min = linear and mip = none */ + Texture.LINEAR_LINEAR = BABYLON.Engine.TEXTURE_LINEAR_LINEAR; + /** mag = linear and min = nearest and mip = none */ + Texture.LINEAR_NEAREST = BABYLON.Engine.TEXTURE_LINEAR_NEAREST; + /** Explicit coordinates mode */ + Texture.EXPLICIT_MODE = BABYLON.Engine.TEXTURE_EXPLICIT_MODE; + /** Spherical coordinates mode */ + Texture.SPHERICAL_MODE = BABYLON.Engine.TEXTURE_SPHERICAL_MODE; + /** Planar coordinates mode */ + Texture.PLANAR_MODE = BABYLON.Engine.TEXTURE_PLANAR_MODE; + /** Cubic coordinates mode */ + Texture.CUBIC_MODE = BABYLON.Engine.TEXTURE_CUBIC_MODE; + /** Projection coordinates mode */ + Texture.PROJECTION_MODE = BABYLON.Engine.TEXTURE_PROJECTION_MODE; + /** Inverse Cubic coordinates mode */ + Texture.SKYBOX_MODE = BABYLON.Engine.TEXTURE_SKYBOX_MODE; + /** Inverse Cubic coordinates mode */ + Texture.INVCUBIC_MODE = BABYLON.Engine.TEXTURE_INVCUBIC_MODE; + /** Equirectangular coordinates mode */ + Texture.EQUIRECTANGULAR_MODE = BABYLON.Engine.TEXTURE_EQUIRECTANGULAR_MODE; + /** Equirectangular Fixed coordinates mode */ + Texture.FIXED_EQUIRECTANGULAR_MODE = BABYLON.Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE; + /** Equirectangular Fixed Mirrored coordinates mode */ + Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = BABYLON.Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE; + /** Texture is not repeating outside of 0..1 UVs */ + Texture.CLAMP_ADDRESSMODE = BABYLON.Engine.TEXTURE_CLAMP_ADDRESSMODE; + /** Texture is repeating outside of 0..1 UVs */ + Texture.WRAP_ADDRESSMODE = BABYLON.Engine.TEXTURE_WRAP_ADDRESSMODE; + /** Texture is repeating and mirrored */ + Texture.MIRROR_ADDRESSMODE = BABYLON.Engine.TEXTURE_MIRROR_ADDRESSMODE; + /** + * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file + */ + Texture.UseSerializedUrlIfAny = false; + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "url", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "uOffset", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "vOffset", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "uScale", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "vScale", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "uAng", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "vAng", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "wAng", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "uRotationCenter", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "vRotationCenter", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "wRotationCenter", void 0); + __decorate([ + BABYLON.serialize() + ], Texture.prototype, "isBlocking", null); + return Texture; + }(BABYLON.BaseTexture)); + BABYLON.Texture = Texture; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.texture.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * @hidden + **/ + var _CreationDataStorage = /** @class */ (function () { + function _CreationDataStorage() { + } + return _CreationDataStorage; + }()); + BABYLON._CreationDataStorage = _CreationDataStorage; + /** + * @hidden + **/ + var _InstanceDataStorage = /** @class */ (function () { + function _InstanceDataStorage() { + this.visibleInstances = {}; + this.renderIdForInstances = new Array(); + this.batchCache = new _InstancesBatch(); + this.instancesBufferSize = 32 * 16 * 4; // let's start with a maximum of 32 instances + } + return _InstanceDataStorage; + }()); + /** + * @hidden + **/ + var _InstancesBatch = /** @class */ (function () { + function _InstancesBatch() { + this.mustReturn = false; + this.visibleInstances = new Array(); + this.renderSelf = new Array(); + } + return _InstancesBatch; + }()); + BABYLON._InstancesBatch = _InstancesBatch; + /** + * Class used to represent renderable models + */ + var Mesh = /** @class */ (function (_super) { + __extends(Mesh, _super); + /** + * @constructor + * @param name The value used by scene.getMeshByName() to do a lookup. + * @param scene The scene to add this mesh to. + * @param parent The parent of this mesh, if it has one + * @param source An optional Mesh from which geometry is shared, cloned. + * @param doNotCloneChildren When cloning, skip cloning child meshes of source, default False. + * When false, achieved by calling a clone(), also passing False. + * This will make creation of children, recursive. + * @param clonePhysicsImpostor When cloning, include cloning mesh physics impostor, default True. + */ + function Mesh(name, scene, parent, source, doNotCloneChildren, clonePhysicsImpostor) { + if (scene === void 0) { scene = null; } + if (parent === void 0) { parent = null; } + if (source === void 0) { source = null; } + if (clonePhysicsImpostor === void 0) { clonePhysicsImpostor = true; } + var _this = _super.call(this, name, scene) || this; + // Members + /** + * Gets the delay loading state of the mesh (when delay loading is turned on) + * @see http://doc.babylonjs.com/how_to/using_the_incremental_loading_system + */ + _this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NONE; + /** + * Gets the list of instances created from this mesh + * @see http://doc.babylonjs.com/how_to/how_to_use_instances + */ + _this.instances = new Array(); + _this._LODLevels = new Array(); + /** @hidden */ + _this._instanceDataStorage = new _InstanceDataStorage(); + // Use by builder only to know what orientation were the mesh build in. + /** @hidden */ + _this._originalBuilderSideOrientation = Mesh.DEFAULTSIDE; + /** + * Use this property to change the original side orientation defined at construction time + */ + _this.overrideMaterialSideOrientation = null; + _this._areNormalsFrozen = false; // Will be used by ribbons mainly + // Will be used to save a source mesh reference, If any + _this._source = null; + scene = _this.getScene(); + if (source) { + // Geometry + if (source._geometry) { + source._geometry.applyToMesh(_this); + } + // Deep copy + BABYLON.Tools.DeepCopy(source, _this, ["name", "material", "skeleton", "instances", "parent", "uniqueId", + "source", "metadata", "hasLODLevels", "geometry", "isBlocked", "areNormalsFrozen", + "onBeforeDrawObservable", "onBeforeRenderObservable", "onAfterRenderObservable", "onBeforeDraw" + ], ["_poseMatrix"]); + // Source mesh + _this._source = source; + // Construction Params + // Clone parameters allowing mesh to be updated in case of parametric shapes. + _this._originalBuilderSideOrientation = source._originalBuilderSideOrientation; + _this._creationDataStorage = source._creationDataStorage; + // Animation ranges + if (_this._source._ranges) { + var ranges = _this._source._ranges; + for (var name in ranges) { + if (!ranges.hasOwnProperty(name)) { + continue; + } + if (!ranges[name]) { + continue; + } + _this.createAnimationRange(name, ranges[name].from, ranges[name].to); + } + } + // Metadata + if (source.metadata && source.metadata.clone) { + _this.metadata = source.metadata.clone(); + } + else { + _this.metadata = source.metadata; + } + // Tags + if (BABYLON.Tags && BABYLON.Tags.HasTags(source)) { + BABYLON.Tags.AddTagsTo(_this, BABYLON.Tags.GetTags(source, true)); + } + // Parent + _this.parent = source.parent; + // Pivot + _this.setPivotMatrix(source.getPivotMatrix()); + _this.id = name + "." + source.id; + // Material + _this.material = source.material; + var index; + if (!doNotCloneChildren) { + // Children + var directDescendants = source.getDescendants(true); + for (var index_1 = 0; index_1 < directDescendants.length; index_1++) { + var child = directDescendants[index_1]; + if (child.clone) { + child.clone(name + "." + child.name, _this); + } + } + } + // Physics clone + var physicsEngine = _this.getScene().getPhysicsEngine(); + if (clonePhysicsImpostor && physicsEngine) { + var impostor = physicsEngine.getImpostorForPhysicsObject(source); + if (impostor) { + _this.physicsImpostor = impostor.clone(_this); + } + } + // Particles + for (index = 0; index < scene.particleSystems.length; index++) { + var system = scene.particleSystems[index]; + if (system.emitter === source) { + system.clone(system.name, _this); + } + } + _this.refreshBoundingInfo(); + _this.computeWorldMatrix(true); + } + // Parent + if (parent !== null) { + _this.parent = parent; + } + return _this; + } + Object.defineProperty(Mesh.prototype, "onBeforeRenderObservable", { + /** + * An event triggered before rendering the mesh + */ + get: function () { + if (!this._onBeforeRenderObservable) { + this._onBeforeRenderObservable = new BABYLON.Observable(); + } + return this._onBeforeRenderObservable; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh.prototype, "onAfterRenderObservable", { + /** + * An event triggered after rendering the mesh + */ + get: function () { + if (!this._onAfterRenderObservable) { + this._onAfterRenderObservable = new BABYLON.Observable(); + } + return this._onAfterRenderObservable; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh.prototype, "onBeforeDrawObservable", { + /** + * An event triggered before drawing the mesh + */ + get: function () { + if (!this._onBeforeDrawObservable) { + this._onBeforeDrawObservable = new BABYLON.Observable(); + } + return this._onBeforeDrawObservable; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh.prototype, "onBeforeDraw", { + /** + * Sets a callback to call before drawing the mesh. It is recommended to use onBeforeDrawObservable instead + */ + set: function (callback) { + if (this._onBeforeDrawObserver) { + this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver); + } + this._onBeforeDrawObserver = this.onBeforeDrawObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh.prototype, "morphTargetManager", { + /** + * Gets or sets the morph target manager + * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets + */ + get: function () { + return this._morphTargetManager; + }, + set: function (value) { + if (this._morphTargetManager === value) { + return; + } + this._morphTargetManager = value; + this._syncGeometryWithMorphTargetManager(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh.prototype, "source", { + /** + * Gets the source mesh (the one used to clone this one from) + */ + get: function () { + return this._source; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh.prototype, "isUnIndexed", { + /** + * Gets or sets a boolean indicating that this mesh does not use index buffer + */ + get: function () { + return this._unIndexed; + }, + set: function (value) { + if (this._unIndexed !== value) { + this._unIndexed = value; + this._markSubMeshesAsAttributesDirty(); + } + }, + enumerable: true, + configurable: true + }); + // Methods + /** + * Gets the class name + * @returns the string "Mesh". + */ + Mesh.prototype.getClassName = function () { + return "Mesh"; + }; + /** + * Returns a description of this mesh + * @param fullDetails define if full details about this mesh must be used + * @returns a descriptive string representing this mesh + */ + Mesh.prototype.toString = function (fullDetails) { + var ret = _super.prototype.toString.call(this, fullDetails); + ret += ", n vertices: " + this.getTotalVertices(); + ret += ", parent: " + (this._waitingParentId ? this._waitingParentId : (this.parent ? this.parent.name : "NONE")); + if (this.animations) { + for (var i = 0; i < this.animations.length; i++) { + ret += ", animation[0]: " + this.animations[i].toString(fullDetails); + } + } + if (fullDetails) { + if (this._geometry) { + var ib = this.getIndices(); + var vb = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (vb && ib) { + ret += ", flat shading: " + (vb.length / 3 === ib.length ? "YES" : "NO"); + } + } + else { + ret += ", flat shading: UNKNOWN"; + } + } + return ret; + }; + /** @hidden */ + Mesh.prototype._unBindEffect = function () { + _super.prototype._unBindEffect.call(this); + for (var _i = 0, _a = this.instances; _i < _a.length; _i++) { + var instance = _a[_i]; + instance._unBindEffect(); + } + }; + Object.defineProperty(Mesh.prototype, "hasLODLevels", { + /** + * Gets a boolean indicating if this mesh has LOD + */ + get: function () { + return this._LODLevels.length > 0; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the list of MeshLODLevel associated with the current mesh + * @returns an array of MeshLODLevel + */ + Mesh.prototype.getLODLevels = function () { + return this._LODLevels; + }; + Mesh.prototype._sortLODLevels = function () { + this._LODLevels.sort(function (a, b) { + if (a.distance < b.distance) { + return 1; + } + if (a.distance > b.distance) { + return -1; + } + return 0; + }); + }; + /** + * Add a mesh as LOD level triggered at the given distance. + * @see https://doc.babylonjs.com/how_to/how_to_use_lod + * @param distance The distance from the center of the object to show this level + * @param mesh The mesh to be added as LOD level (can be null) + * @return This mesh (for chaining) + */ + Mesh.prototype.addLODLevel = function (distance, mesh) { + if (mesh && mesh._masterMesh) { + BABYLON.Tools.Warn("You cannot use a mesh as LOD level twice"); + return this; + } + var level = new BABYLON.MeshLODLevel(distance, mesh); + this._LODLevels.push(level); + if (mesh) { + mesh._masterMesh = this; + } + this._sortLODLevels(); + return this; + }; + /** + * Returns the LOD level mesh at the passed distance or null if not found. + * @see https://doc.babylonjs.com/how_to/how_to_use_lod + * @param distance The distance from the center of the object to show this level + * @returns a Mesh or `null` + */ + Mesh.prototype.getLODLevelAtDistance = function (distance) { + for (var index = 0; index < this._LODLevels.length; index++) { + var level = this._LODLevels[index]; + if (level.distance === distance) { + return level.mesh; + } + } + return null; + }; + /** + * Remove a mesh from the LOD array + * @see https://doc.babylonjs.com/how_to/how_to_use_lod + * @param mesh defines the mesh to be removed + * @return This mesh (for chaining) + */ + Mesh.prototype.removeLODLevel = function (mesh) { + for (var index = 0; index < this._LODLevels.length; index++) { + if (this._LODLevels[index].mesh === mesh) { + this._LODLevels.splice(index, 1); + if (mesh) { + mesh._masterMesh = null; + } + } + } + this._sortLODLevels(); + return this; + }; + /** + * Returns the registered LOD mesh distant from the parameter `camera` position if any, else returns the current mesh. + * @see https://doc.babylonjs.com/how_to/how_to_use_lod + * @param camera defines the camera to use to compute distance + * @param boundingSphere defines a custom bounding sphere to use instead of the one from this mesh + * @return This mesh (for chaining) + */ + Mesh.prototype.getLOD = function (camera, boundingSphere) { + if (!this._LODLevels || this._LODLevels.length === 0) { + return this; + } + var bSphere; + if (boundingSphere) { + bSphere = boundingSphere; + } + else { + var boundingInfo = this.getBoundingInfo(); + bSphere = boundingInfo.boundingSphere; + } + var distanceToCamera = bSphere.centerWorld.subtract(camera.globalPosition).length(); + if (this._LODLevels[this._LODLevels.length - 1].distance > distanceToCamera) { + if (this.onLODLevelSelection) { + this.onLODLevelSelection(distanceToCamera, this, this._LODLevels[this._LODLevels.length - 1].mesh); + } + return this; + } + for (var index = 0; index < this._LODLevels.length; index++) { + var level = this._LODLevels[index]; + if (level.distance < distanceToCamera) { + if (level.mesh) { + level.mesh._preActivate(); + level.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache); + } + if (this.onLODLevelSelection) { + this.onLODLevelSelection(distanceToCamera, this, level.mesh); + } + return level.mesh; + } + } + if (this.onLODLevelSelection) { + this.onLODLevelSelection(distanceToCamera, this, this); + } + return this; + }; + Object.defineProperty(Mesh.prototype, "geometry", { + /** + * Gets the mesh internal Geometry object + */ + get: function () { + return this._geometry; + }, + enumerable: true, + configurable: true + }); + /** + * Returns the total number of vertices within the mesh geometry or zero if the mesh has no geometry. + * @returns the total number of vertices + */ + Mesh.prototype.getTotalVertices = function () { + if (this._geometry === null || this._geometry === undefined) { + return 0; + } + return this._geometry.getTotalVertices(); + }; + /** + * Returns the content of an associated vertex buffer + * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + * @param copyWhenShared defines a boolean indicating that if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one + * @param forceCopy defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is + * @returns a FloatArray or null if the mesh has no geometry or no vertex buffer for this kind. + */ + Mesh.prototype.getVerticesData = function (kind, copyWhenShared, forceCopy) { + if (!this._geometry) { + return null; + } + return this._geometry.getVerticesData(kind, copyWhenShared, forceCopy); + }; + /** + * Returns the mesh VertexBuffer object from the requested `kind` + * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + * @returns a FloatArray or null if the mesh has no vertex buffer for this kind. + */ + Mesh.prototype.getVertexBuffer = function (kind) { + if (!this._geometry) { + return null; + } + return this._geometry.getVertexBuffer(kind); + }; + /** + * Tests if a specific vertex buffer is associated with this mesh + * @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + * @returns a boolean + */ + Mesh.prototype.isVerticesDataPresent = function (kind) { + if (!this._geometry) { + if (this._delayInfo) { + return this._delayInfo.indexOf(kind) !== -1; + } + return false; + } + return this._geometry.isVerticesDataPresent(kind); + }; + /** + * Returns a boolean defining if the vertex data for the requested `kind` is updatable. + * @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + * @returns a boolean + */ + Mesh.prototype.isVertexBufferUpdatable = function (kind) { + if (!this._geometry) { + if (this._delayInfo) { + return this._delayInfo.indexOf(kind) !== -1; + } + return false; + } + return this._geometry.isVertexBufferUpdatable(kind); + }; + /** + * Returns a string which contains the list of existing `kinds` of Vertex Data associated with this mesh. + * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + * @returns an array of strings + */ + Mesh.prototype.getVerticesDataKinds = function () { + if (!this._geometry) { + var result = new Array(); + if (this._delayInfo) { + this._delayInfo.forEach(function (kind, index, array) { + result.push(kind); + }); + } + return result; + } + return this._geometry.getVerticesDataKinds(); + }; + /** + * Returns a positive integer : the total number of indices in this mesh geometry. + * @returns the numner of indices or zero if the mesh has no geometry. + */ + Mesh.prototype.getTotalIndices = function () { + if (!this._geometry) { + return 0; + } + return this._geometry.getTotalIndices(); + }; + /** + * Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices. + * @param copyWhenShared If true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one. + * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it + * @returns the indices array or an empty array if the mesh has no geometry + */ + Mesh.prototype.getIndices = function (copyWhenShared, forceCopy) { + if (!this._geometry) { + return []; + } + return this._geometry.getIndices(copyWhenShared, forceCopy); + }; + Object.defineProperty(Mesh.prototype, "isBlocked", { + get: function () { + return this._masterMesh !== null && this._masterMesh !== undefined; + }, + enumerable: true, + configurable: true + }); + /** + * Determine if the current mesh is ready to be rendered + * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default) + * @param forceInstanceSupport will check if the mesh will be ready when used with instances (false by default) + * @returns true if all associated assets are ready (material, textures, shaders) + */ + Mesh.prototype.isReady = function (completeCheck, forceInstanceSupport) { + if (completeCheck === void 0) { completeCheck = false; } + if (forceInstanceSupport === void 0) { forceInstanceSupport = false; } + if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADING) { + return false; + } + if (!_super.prototype.isReady.call(this, completeCheck)) { + return false; + } + if (!this.subMeshes || this.subMeshes.length === 0) { + return true; + } + if (!completeCheck) { + return true; + } + var engine = this.getEngine(); + var scene = this.getScene(); + var hardwareInstancedRendering = forceInstanceSupport || engine.getCaps().instancedArrays && this.instances.length > 0; + this.computeWorldMatrix(); + var mat = this.material || scene.defaultMaterial; + if (mat) { + if (mat.storeEffectOnSubMeshes) { + for (var _i = 0, _a = this.subMeshes; _i < _a.length; _i++) { + var subMesh = _a[_i]; + var effectiveMaterial = subMesh.getMaterial(); + if (effectiveMaterial) { + if (effectiveMaterial.storeEffectOnSubMeshes) { + if (!effectiveMaterial.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) { + return false; + } + } + else { + if (!effectiveMaterial.isReady(this, hardwareInstancedRendering)) { + return false; + } + } + } + } + } + else { + if (!mat.isReady(this, hardwareInstancedRendering)) { + return false; + } + } + } + // Shadows + for (var _b = 0, _c = this._lightSources; _b < _c.length; _b++) { + var light = _c[_b]; + var generator = light.getShadowGenerator(); + if (generator) { + for (var _d = 0, _e = this.subMeshes; _d < _e.length; _d++) { + var subMesh = _e[_d]; + if (!generator.isReady(subMesh, hardwareInstancedRendering)) { + return false; + } + } + } + } + // LOD + for (var _f = 0, _g = this._LODLevels; _f < _g.length; _f++) { + var lod = _g[_f]; + if (lod.mesh && !lod.mesh.isReady(hardwareInstancedRendering)) { + return false; + } + } + return true; + }; + Object.defineProperty(Mesh.prototype, "areNormalsFrozen", { + /** + * Gets a boolean indicating if the normals aren't to be recomputed on next mesh `positions` array update. This property is pertinent only for updatable parametric shapes. + */ + get: function () { + return this._areNormalsFrozen; + }, + enumerable: true, + configurable: true + }); + /** + * This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It prevents the mesh normals from being recomputed on next `positions` array update. + * @returns the current mesh + */ + Mesh.prototype.freezeNormals = function () { + this._areNormalsFrozen = true; + return this; + }; + /** + * This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It reactivates the mesh normals computation if it was previously frozen + * @returns the current mesh + */ + Mesh.prototype.unfreezeNormals = function () { + this._areNormalsFrozen = false; + return this; + }; + Object.defineProperty(Mesh.prototype, "overridenInstanceCount", { + /** + * Sets a value overriding the instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs + */ + set: function (count) { + this._instanceDataStorage.overridenInstanceCount = count; + }, + enumerable: true, + configurable: true + }); + // Methods + /** @hidden */ + Mesh.prototype._preActivate = function () { + var sceneRenderId = this.getScene().getRenderId(); + if (this._preActivateId === sceneRenderId) { + return this; + } + this._preActivateId = sceneRenderId; + this._instanceDataStorage.visibleInstances = null; + return this; + }; + /** @hidden */ + Mesh.prototype._preActivateForIntermediateRendering = function (renderId) { + if (this._instanceDataStorage.visibleInstances) { + this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId = renderId; + } + return this; + }; + /** @hidden */ + Mesh.prototype._registerInstanceForRenderId = function (instance, renderId) { + if (!this._instanceDataStorage.visibleInstances) { + this._instanceDataStorage.visibleInstances = {}; + this._instanceDataStorage.visibleInstances.defaultRenderId = renderId; + this._instanceDataStorage.visibleInstances.selfDefaultRenderId = this._renderId; + } + if (!this._instanceDataStorage.visibleInstances[renderId]) { + this._instanceDataStorage.visibleInstances[renderId] = new Array(); + } + this._instanceDataStorage.visibleInstances[renderId].push(instance); + return this; + }; + /** + * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked. + * This means the mesh underlying bounding box and sphere are recomputed. + * @returns the current mesh + */ + Mesh.prototype.refreshBoundingInfo = function () { + return this._refreshBoundingInfo(false); + }; + /** @hidden */ + Mesh.prototype._refreshBoundingInfo = function (applySkeleton) { + if (this._boundingInfo && this._boundingInfo.isLocked) { + return this; + } + var data = this._getPositionData(applySkeleton); + if (data) { + var bias = this.geometry ? this.geometry.boundingBias : null; + var extend = BABYLON.Tools.ExtractMinAndMax(data, 0, this.getTotalVertices(), bias); + this._boundingInfo = new BABYLON.BoundingInfo(extend.minimum, extend.maximum); + } + if (this.subMeshes) { + for (var index = 0; index < this.subMeshes.length; index++) { + this.subMeshes[index].refreshBoundingInfo(); + } + } + this._updateBoundingInfo(); + return this; + }; + Mesh.prototype._getPositionData = function (applySkeleton) { + var data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (data && applySkeleton && this.skeleton) { + data = BABYLON.Tools.Slice(data); + var matricesIndicesData = this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind); + var matricesWeightsData = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind); + if (matricesWeightsData && matricesIndicesData) { + var needExtras = this.numBoneInfluencers > 4; + var matricesIndicesExtraData = needExtras ? this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind) : null; + var matricesWeightsExtraData = needExtras ? this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind) : null; + var skeletonMatrices = this.skeleton.getTransformMatrices(this); + var tempVector = BABYLON.Tmp.Vector3[0]; + var finalMatrix = BABYLON.Tmp.Matrix[0]; + var tempMatrix = BABYLON.Tmp.Matrix[1]; + var matWeightIdx = 0; + for (var index = 0; index < data.length; index += 3, matWeightIdx += 4) { + finalMatrix.reset(); + var inf; + var weight; + for (inf = 0; inf < 4; inf++) { + weight = matricesWeightsData[matWeightIdx + inf]; + if (weight > 0) { + BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix); + finalMatrix.addToSelf(tempMatrix); + } + } + if (needExtras) { + for (inf = 0; inf < 4; inf++) { + weight = matricesWeightsExtraData[matWeightIdx + inf]; + if (weight > 0) { + BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix); + finalMatrix.addToSelf(tempMatrix); + } + } + } + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(data[index], data[index + 1], data[index + 2], finalMatrix, tempVector); + tempVector.toArray(data, index); + } + } + } + return data; + }; + /** @hidden */ + Mesh.prototype._createGlobalSubMesh = function (force) { + var totalVertices = this.getTotalVertices(); + if (!totalVertices || !this.getIndices()) { + return null; + } + // Check if we need to recreate the submeshes + if (this.subMeshes && this.subMeshes.length > 0) { + var ib = this.getIndices(); + if (!ib) { + return null; + } + var totalIndices = ib.length; + var needToRecreate = false; + if (force) { + needToRecreate = true; + } + else { + for (var _i = 0, _a = this.subMeshes; _i < _a.length; _i++) { + var submesh = _a[_i]; + if (submesh.indexStart + submesh.indexCount >= totalIndices) { + needToRecreate = true; + break; + } + if (submesh.verticesStart + submesh.verticesCount >= totalVertices) { + needToRecreate = true; + break; + } + } + } + if (!needToRecreate) { + return this.subMeshes[0]; + } + } + this.releaseSubMeshes(); + return new BABYLON.SubMesh(0, 0, totalVertices, 0, this.getTotalIndices(), this); + }; + /** + * This function will subdivide the mesh into multiple submeshes + * @param count defines the expected number of submeshes + */ + Mesh.prototype.subdivide = function (count) { + if (count < 1) { + return; + } + var totalIndices = this.getTotalIndices(); + var subdivisionSize = (totalIndices / count) | 0; + var offset = 0; + // Ensure that subdivisionSize is a multiple of 3 + while (subdivisionSize % 3 !== 0) { + subdivisionSize++; + } + this.releaseSubMeshes(); + for (var index = 0; index < count; index++) { + if (offset >= totalIndices) { + break; + } + BABYLON.SubMesh.CreateFromIndices(0, offset, Math.min(subdivisionSize, totalIndices - offset), this); + offset += subdivisionSize; + } + this.synchronizeInstances(); + }; + /** + * Copy a FloatArray into a specific associated vertex buffer + * @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + * @param data defines the data source + * @param updatable defines if the updated vertex buffer must be flagged as updatable + * @param stride defines the data stride size (can be null) + * @returns the current mesh + */ + Mesh.prototype.setVerticesData = function (kind, data, updatable, stride) { + if (updatable === void 0) { updatable = false; } + if (!this._geometry) { + var vertexData = new BABYLON.VertexData(); + vertexData.set(data, kind); + var scene = this.getScene(); + new BABYLON.Geometry(BABYLON.Geometry.RandomId(), scene, vertexData, updatable, this); + } + else { + this._geometry.setVerticesData(kind, data, updatable, stride); + } + return this; + }; + /** + * Flags an associated vertex buffer as updatable + * @param kind defines which buffer to use (positions, indices, normals, etc). Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + * @param updatable defines if the updated vertex buffer must be flagged as updatable + */ + Mesh.prototype.markVerticesDataAsUpdatable = function (kind, updatable) { + if (updatable === void 0) { updatable = true; } + var vb = this.getVertexBuffer(kind); + if (!vb || vb.isUpdatable() === updatable) { + return; + } + this.setVerticesData(kind, this.getVerticesData(kind), updatable); + }; + /** + * Sets the mesh global Vertex Buffer + * @param buffer defines the buffer to use + * @returns the current mesh + */ + Mesh.prototype.setVerticesBuffer = function (buffer) { + if (!this._geometry) { + this._geometry = BABYLON.Geometry.CreateGeometryForMesh(this); + } + this._geometry.setVerticesBuffer(buffer); + return this; + }; + /** + * Update a specific associated vertex buffer + * @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values : + * - BABYLON.VertexBuffer.PositionKind + * - BABYLON.VertexBuffer.UVKind + * - BABYLON.VertexBuffer.UV2Kind + * - BABYLON.VertexBuffer.UV3Kind + * - BABYLON.VertexBuffer.UV4Kind + * - BABYLON.VertexBuffer.UV5Kind + * - BABYLON.VertexBuffer.UV6Kind + * - BABYLON.VertexBuffer.ColorKind + * - BABYLON.VertexBuffer.MatricesIndicesKind + * - BABYLON.VertexBuffer.MatricesIndicesExtraKind + * - BABYLON.VertexBuffer.MatricesWeightsKind + * - BABYLON.VertexBuffer.MatricesWeightsExtraKind + * @param data defines the data source + * @param updateExtends defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind + * @param makeItUnique defines if the geometry associated with the mesh must be cloned to make the change only for this mesh (and not all meshes associated with the same geometry) + * @returns the current mesh + */ + Mesh.prototype.updateVerticesData = function (kind, data, updateExtends, makeItUnique) { + if (!this._geometry) { + return this; + } + if (!makeItUnique) { + this._geometry.updateVerticesData(kind, data, updateExtends); + } + else { + this.makeGeometryUnique(); + this.updateVerticesData(kind, data, updateExtends, false); + } + return this; + }; + /** + * This method updates the vertex positions of an updatable mesh according to the `positionFunction` returned values. + * @see http://doc.babylonjs.com/how_to/how_to_dynamically_morph_a_mesh#other-shapes-updatemeshpositions + * @param positionFunction is a simple JS function what is passed the mesh `positions` array. It doesn't need to return anything + * @param computeNormals is a boolean (default true) to enable/disable the mesh normal recomputation after the vertex position update + * @returns the current mesh + */ + Mesh.prototype.updateMeshPositions = function (positionFunction, computeNormals) { + if (computeNormals === void 0) { computeNormals = true; } + var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (!positions) { + return this; + } + positionFunction(positions); + this.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positions, false, false); + if (computeNormals) { + var indices = this.getIndices(); + var normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + if (!normals) { + return this; + } + BABYLON.VertexData.ComputeNormals(positions, indices, normals); + this.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normals, false, false); + } + return this; + }; + /** + * Creates a un-shared specific occurence of the geometry for the mesh. + * @returns the current mesh + */ + Mesh.prototype.makeGeometryUnique = function () { + if (!this._geometry) { + return this; + } + var oldGeometry = this._geometry; + var geometry = this._geometry.copy(BABYLON.Geometry.RandomId()); + oldGeometry.releaseForMesh(this, true); + geometry.applyToMesh(this); + return this; + }; + /** + * Set the index buffer of this mesh + * @param indices defines the source data + * @param totalVertices defines the total number of vertices referenced by this index data (can be null) + * @param updatable defines if the updated index buffer must be flagged as updatable (default is false) + * @returns the current mesh + */ + Mesh.prototype.setIndices = function (indices, totalVertices, updatable) { + if (totalVertices === void 0) { totalVertices = null; } + if (updatable === void 0) { updatable = false; } + if (!this._geometry) { + var vertexData = new BABYLON.VertexData(); + vertexData.indices = indices; + var scene = this.getScene(); + new BABYLON.Geometry(BABYLON.Geometry.RandomId(), scene, vertexData, updatable, this); + } + else { + this._geometry.setIndices(indices, totalVertices, updatable); + } + return this; + }; + /** + * Update the current index buffer + * @param indices defines the source data + * @param offset defines the offset in the index buffer where to store the new data (can be null) + * @returns the current mesh + */ + Mesh.prototype.updateIndices = function (indices, offset) { + if (!this._geometry) { + return this; + } + this._geometry.updateIndices(indices, offset); + return this; + }; + /** + * Invert the geometry to move from a right handed system to a left handed one. + * @returns the current mesh + */ + Mesh.prototype.toLeftHanded = function () { + if (!this._geometry) { + return this; + } + this._geometry.toLeftHanded(); + return this; + }; + /** @hidden */ + Mesh.prototype._bind = function (subMesh, effect, fillMode) { + if (!this._geometry) { + return this; + } + var engine = this.getScene().getEngine(); + // Wireframe + var indexToBind; + if (this._unIndexed) { + indexToBind = null; + } + else { + switch (fillMode) { + case BABYLON.Material.PointFillMode: + indexToBind = null; + break; + case BABYLON.Material.WireFrameFillMode: + indexToBind = subMesh._getLinesIndexBuffer(this.getIndices(), engine); + break; + default: + case BABYLON.Material.TriangleFillMode: + indexToBind = this._unIndexed ? null : this._geometry.getIndexBuffer(); + break; + } + } + // VBOs + this._geometry._bind(effect, indexToBind); + return this; + }; + /** @hidden */ + Mesh.prototype._draw = function (subMesh, fillMode, instancesCount, alternate) { + if (alternate === void 0) { alternate = false; } + if (!this._geometry || !this._geometry.getVertexBuffers() || (!this._unIndexed && !this._geometry.getIndexBuffer())) { + return this; + } + if (this._onBeforeDrawObservable) { + this._onBeforeDrawObservable.notifyObservers(this); + } + var scene = this.getScene(); + var engine = scene.getEngine(); + if (this._unIndexed || fillMode == BABYLON.Material.PointFillMode) { + // or triangles as points + engine.drawArraysType(fillMode, subMesh.verticesStart, subMesh.verticesCount, instancesCount); + } + else if (fillMode == BABYLON.Material.WireFrameFillMode) { + // Triangles as wireframe + engine.drawElementsType(fillMode, 0, subMesh._linesIndexCount, instancesCount); + } + else { + engine.drawElementsType(fillMode, subMesh.indexStart, subMesh.indexCount, instancesCount); + } + if (scene._isAlternateRenderingEnabled && !alternate) { + var effect = subMesh.effect || this._effectiveMaterial.getEffect(); + if (!effect || !scene.activeCamera) { + return this; + } + scene._switchToAlternateCameraConfiguration(true); + this._effectiveMaterial.bindView(effect); + this._effectiveMaterial.bindViewProjection(effect); + engine.setViewport(scene.activeCamera._alternateCamera.viewport); + this._draw(subMesh, fillMode, instancesCount, true); + engine.setViewport(scene.activeCamera.viewport); + scene._switchToAlternateCameraConfiguration(false); + this._effectiveMaterial.bindView(effect); + this._effectiveMaterial.bindViewProjection(effect); + } + return this; + }; + /** + * Registers for this mesh a javascript function called just before the rendering process + * @param func defines the function to call before rendering this mesh + * @returns the current mesh + */ + Mesh.prototype.registerBeforeRender = function (func) { + this.onBeforeRenderObservable.add(func); + return this; + }; + /** + * Disposes a previously registered javascript function called before the rendering + * @param func defines the function to remove + * @returns the current mesh + */ + Mesh.prototype.unregisterBeforeRender = function (func) { + this.onBeforeRenderObservable.removeCallback(func); + return this; + }; + /** + * Registers for this mesh a javascript function called just after the rendering is complete + * @param func defines the function to call after rendering this mesh + * @returns the current mesh + */ + Mesh.prototype.registerAfterRender = function (func) { + this.onAfterRenderObservable.add(func); + return this; + }; + /** + * Disposes a previously registered javascript function called after the rendering. + * @param func defines the function to remove + * @returns the current mesh + */ + Mesh.prototype.unregisterAfterRender = function (func) { + this.onAfterRenderObservable.removeCallback(func); + return this; + }; + /** @hidden */ + Mesh.prototype._getInstancesRenderList = function (subMeshId) { + var scene = this.getScene(); + var batchCache = this._instanceDataStorage.batchCache; + batchCache.mustReturn = false; + batchCache.renderSelf[subMeshId] = this.isEnabled() && this.isVisible; + batchCache.visibleInstances[subMeshId] = null; + if (this._instanceDataStorage.visibleInstances) { + var visibleInstances = this._instanceDataStorage.visibleInstances; + var currentRenderId = scene.getRenderId(); + var defaultRenderId = (scene._isInIntermediateRendering() ? visibleInstances.intermediateDefaultRenderId : visibleInstances.defaultRenderId); + batchCache.visibleInstances[subMeshId] = visibleInstances[currentRenderId]; + var selfRenderId = this._renderId; + if (!batchCache.visibleInstances[subMeshId] && defaultRenderId) { + batchCache.visibleInstances[subMeshId] = visibleInstances[defaultRenderId]; + currentRenderId = Math.max(defaultRenderId, currentRenderId); + selfRenderId = Math.max(visibleInstances.selfDefaultRenderId, currentRenderId); + } + var visibleInstancesForSubMesh = batchCache.visibleInstances[subMeshId]; + if (visibleInstancesForSubMesh && visibleInstancesForSubMesh.length) { + if (this._instanceDataStorage.renderIdForInstances[subMeshId] === currentRenderId) { + batchCache.mustReturn = true; + return batchCache; + } + if (currentRenderId !== selfRenderId) { + batchCache.renderSelf[subMeshId] = false; + } + } + this._instanceDataStorage.renderIdForInstances[subMeshId] = currentRenderId; + } + return batchCache; + }; + /** @hidden */ + Mesh.prototype._renderWithInstances = function (subMesh, fillMode, batch, effect, engine) { + var visibleInstances = batch.visibleInstances[subMesh._id]; + if (!visibleInstances) { + return this; + } + var matricesCount = visibleInstances.length + 1; + var bufferSize = matricesCount * 16 * 4; + var instanceStorage = this._instanceDataStorage; + var currentInstancesBufferSize = instanceStorage.instancesBufferSize; + var instancesBuffer = instanceStorage.instancesBuffer; + while (instanceStorage.instancesBufferSize < bufferSize) { + instanceStorage.instancesBufferSize *= 2; + } + if (!instanceStorage.instancesData || currentInstancesBufferSize != instanceStorage.instancesBufferSize) { + instanceStorage.instancesData = new Float32Array(instanceStorage.instancesBufferSize / 4); + } + var offset = 0; + var instancesCount = 0; + var world = this.getWorldMatrix(); + if (batch.renderSelf[subMesh._id]) { + world.copyToArray(instanceStorage.instancesData, offset); + offset += 16; + instancesCount++; + } + if (visibleInstances) { + for (var instanceIndex = 0; instanceIndex < visibleInstances.length; instanceIndex++) { + var instance = visibleInstances[instanceIndex]; + instance.getWorldMatrix().copyToArray(instanceStorage.instancesData, offset); + offset += 16; + instancesCount++; + } + } + if (!instancesBuffer || currentInstancesBufferSize != instanceStorage.instancesBufferSize) { + if (instancesBuffer) { + instancesBuffer.dispose(); + } + instancesBuffer = new BABYLON.Buffer(engine, instanceStorage.instancesData, true, 16, false, true); + instanceStorage.instancesBuffer = instancesBuffer; + this.setVerticesBuffer(instancesBuffer.createVertexBuffer("world0", 0, 4)); + this.setVerticesBuffer(instancesBuffer.createVertexBuffer("world1", 4, 4)); + this.setVerticesBuffer(instancesBuffer.createVertexBuffer("world2", 8, 4)); + this.setVerticesBuffer(instancesBuffer.createVertexBuffer("world3", 12, 4)); + } + else { + instancesBuffer.updateDirectly(instanceStorage.instancesData, 0, instancesCount); + } + this._bind(subMesh, effect, fillMode); + this._draw(subMesh, fillMode, instancesCount); + engine.unbindInstanceAttributes(); + return this; + }; + /** @hidden */ + Mesh.prototype._processRendering = function (subMesh, effect, fillMode, batch, hardwareInstancedRendering, onBeforeDraw, effectiveMaterial) { + var scene = this.getScene(); + var engine = scene.getEngine(); + if (hardwareInstancedRendering) { + this._renderWithInstances(subMesh, fillMode, batch, effect, engine); + } + else { + if (batch.renderSelf[subMesh._id]) { + // Draw + if (onBeforeDraw) { + onBeforeDraw(false, this.getWorldMatrix(), effectiveMaterial); + } + this._draw(subMesh, fillMode, this._instanceDataStorage.overridenInstanceCount); + } + var visibleInstancesForSubMesh = batch.visibleInstances[subMesh._id]; + if (visibleInstancesForSubMesh) { + for (var instanceIndex = 0; instanceIndex < visibleInstancesForSubMesh.length; instanceIndex++) { + var instance = visibleInstancesForSubMesh[instanceIndex]; + // World + var world = instance.getWorldMatrix(); + if (onBeforeDraw) { + onBeforeDraw(true, world, effectiveMaterial); + } + // Draw + this._draw(subMesh, fillMode); + } + } + } + return this; + }; + /** + * Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager + * @param subMesh defines the subMesh to render + * @param enableAlphaMode defines if alpha mode can be changed + * @returns the current mesh + */ + Mesh.prototype.render = function (subMesh, enableAlphaMode) { + if (this._checkOcclusionQuery()) { + return this; + } + var scene = this.getScene(); + // Managing instances + var batch = this._getInstancesRenderList(subMesh._id); + if (batch.mustReturn) { + return this; + } + // Checking geometry state + if (!this._geometry || !this._geometry.getVertexBuffers() || (!this._unIndexed && !this._geometry.getIndexBuffer())) { + return this; + } + if (this._onBeforeRenderObservable) { + this._onBeforeRenderObservable.notifyObservers(this); + } + var engine = scene.getEngine(); + var hardwareInstancedRendering = (engine.getCaps().instancedArrays) && (batch.visibleInstances[subMesh._id] !== null) && (batch.visibleInstances[subMesh._id] !== undefined); + // Material + var material = subMesh.getMaterial(); + if (!material) { + return this; + } + this._effectiveMaterial = material; + if (this._effectiveMaterial.storeEffectOnSubMeshes) { + if (!this._effectiveMaterial.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) { + return this; + } + } + else if (!this._effectiveMaterial.isReady(this, hardwareInstancedRendering)) { + return this; + } + // Alpha mode + if (enableAlphaMode) { + engine.setAlphaMode(this._effectiveMaterial.alphaMode); + } + for (var _i = 0, _a = scene._beforeRenderingMeshStage; _i < _a.length; _i++) { + var step = _a[_i]; + step.action(this, subMesh, batch); + } + var effect; + if (this._effectiveMaterial.storeEffectOnSubMeshes) { + effect = subMesh.effect; + } + else { + effect = this._effectiveMaterial.getEffect(); + } + if (!effect) { + return this; + } + var sideOrientation = this.overrideMaterialSideOrientation; + if (sideOrientation == null) { + sideOrientation = this._effectiveMaterial.sideOrientation; + if (this._getWorldMatrixDeterminant() < 0) { + sideOrientation = (sideOrientation === BABYLON.Material.ClockWiseSideOrientation ? BABYLON.Material.CounterClockWiseSideOrientation : BABYLON.Material.ClockWiseSideOrientation); + } + } + var reverse = this._effectiveMaterial._preBind(effect, sideOrientation); + if (this._effectiveMaterial.forceDepthWrite) { + engine.setDepthWrite(true); + } + // Bind + var fillMode = scene.forcePointsCloud ? BABYLON.Material.PointFillMode : (scene.forceWireframe ? BABYLON.Material.WireFrameFillMode : this._effectiveMaterial.fillMode); + if (!hardwareInstancedRendering) { // Binding will be done later because we need to add more info to the VB + this._bind(subMesh, effect, fillMode); + } + var world = this.getWorldMatrix(); + if (this._effectiveMaterial.storeEffectOnSubMeshes) { + this._effectiveMaterial.bindForSubMesh(world, this, subMesh); + } + else { + this._effectiveMaterial.bind(world, this); + } + if (!this._effectiveMaterial.backFaceCulling && this._effectiveMaterial.separateCullingPass) { + engine.setState(true, this._effectiveMaterial.zOffset, false, !reverse); + this._processRendering(subMesh, effect, fillMode, batch, hardwareInstancedRendering, this._onBeforeDraw, this._effectiveMaterial); + engine.setState(true, this._effectiveMaterial.zOffset, false, reverse); + } + // Draw + this._processRendering(subMesh, effect, fillMode, batch, hardwareInstancedRendering, this._onBeforeDraw, this._effectiveMaterial); + // Unbind + this._effectiveMaterial.unbind(); + for (var _b = 0, _c = scene._afterRenderingMeshStage; _b < _c.length; _b++) { + var step = _c[_b]; + step.action(this, subMesh, batch); + } + if (this._onAfterRenderObservable) { + this._onAfterRenderObservable.notifyObservers(this); + } + return this; + }; + Mesh.prototype._onBeforeDraw = function (isInstance, world, effectiveMaterial) { + if (isInstance && effectiveMaterial) { + effectiveMaterial.bindOnlyWorldMatrix(world); + } + }; + /** + * Renormalize the mesh and patch it up if there are no weights + * Similar to normalization by adding the weights compute the reciprocal and multiply all elements, this wil ensure that everything adds to 1. + * However in the case of zero weights then we set just a single influence to 1. + * We check in the function for extra's present and if so we use the normalizeSkinWeightsWithExtras rather than the FourWeights version. + */ + Mesh.prototype.cleanMatrixWeights = function () { + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) { + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsExtraKind)) { + this.normalizeSkinWeightsAndExtra(); + } + else { + this.normalizeSkinFourWeights(); + } + } + }; + // faster 4 weight version. + Mesh.prototype.normalizeSkinFourWeights = function () { + var matricesWeights = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind); + var numWeights = matricesWeights.length; + for (var a = 0; a < numWeights; a += 4) { + // accumulate weights + var t = matricesWeights[a] + matricesWeights[a + 1] + matricesWeights[a + 2] + matricesWeights[a + 3]; + // check for invalid weight and just set it to 1. + if (t === 0) { + matricesWeights[a] = 1; + } + else { + // renormalize so everything adds to 1 use reciprical + var recip = 1 / t; + matricesWeights[a] *= recip; + matricesWeights[a + 1] *= recip; + matricesWeights[a + 2] *= recip; + matricesWeights[a + 3] *= recip; + } + } + this.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, matricesWeights); + }; + // handle special case of extra verts. (in theory gltf can handle 12 influences) + Mesh.prototype.normalizeSkinWeightsAndExtra = function () { + var matricesWeightsExtra = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind); + var matricesWeights = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind); + var numWeights = matricesWeights.length; + for (var a = 0; a < numWeights; a += 4) { + // accumulate weights + var t = matricesWeights[a] + matricesWeights[a + 1] + matricesWeights[a + 2] + matricesWeights[a + 3]; + t += matricesWeightsExtra[a] + matricesWeightsExtra[a + 1] + matricesWeightsExtra[a + 2] + matricesWeightsExtra[a + 3]; + // check for invalid weight and just set it to 1. + if (t === 0) { + matricesWeights[a] = 1; + } + else { + // renormalize so everything adds to 1 use reciprical + var recip = 1 / t; + matricesWeights[a] *= recip; + matricesWeights[a + 1] *= recip; + matricesWeights[a + 2] *= recip; + matricesWeights[a + 3] *= recip; + // same goes for extras + matricesWeightsExtra[a] *= recip; + matricesWeightsExtra[a + 1] *= recip; + matricesWeightsExtra[a + 2] *= recip; + matricesWeightsExtra[a + 3] *= recip; + } + } + this.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, matricesWeights); + this.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, matricesWeightsExtra); + }; + /** + * ValidateSkinning is used to determine that a mesh has valid skinning data along with skin metrics, if missing weights, + * or not normalized it is returned as invalid mesh the string can be used for console logs, or on screen messages to let + * the user know there was an issue with importing the mesh + * @returns a validation object with skinned, valid and report string + */ + Mesh.prototype.validateSkinning = function () { + var matricesWeightsExtra = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind); + var matricesWeights = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind); + if (matricesWeights === null || this.skeleton == null) { + return { skinned: false, valid: true, report: "not skinned" }; + } + var numWeights = matricesWeights.length; + var numberNotSorted = 0; + var missingWeights = 0; + var maxUsedWeights = 0; + var numberNotNormalized = 0; + var numInfluences = matricesWeightsExtra === null ? 4 : 8; + var usedWeightCounts = new Array(); + for (var a = 0; a <= numInfluences; a++) { + usedWeightCounts[a] = 0; + } + var toleranceEpsilon = 0.001; + for (var a = 0; a < numWeights; a += 4) { + var lastWeight = matricesWeights[a]; + var t = lastWeight; + var usedWeights = t === 0 ? 0 : 1; + for (var b = 1; b < numInfluences; b++) { + var d = b < 4 ? matricesWeights[a + b] : matricesWeightsExtra[a + b - 4]; + if (d > lastWeight) { + numberNotSorted++; + } + if (d !== 0) { + usedWeights++; + } + t += d; + lastWeight = d; + } + // count the buffer weights usage + usedWeightCounts[usedWeights]++; + // max influences + if (usedWeights > maxUsedWeights) { + maxUsedWeights = usedWeights; + } + // check for invalid weight and just set it to 1. + if (t === 0) { + missingWeights++; + } + else { + // renormalize so everything adds to 1 use reciprical + var recip = 1 / t; + var tolerance = 0; + for (b = 0; b < numInfluences; b++) { + if (b < 4) { + tolerance += Math.abs(matricesWeights[a + b] - (matricesWeights[a + b] * recip)); + } + else { + tolerance += Math.abs(matricesWeightsExtra[a + b - 4] - (matricesWeightsExtra[a + b - 4] * recip)); + } + } + // arbitary epsilon value for dicdating not normalized + if (tolerance > toleranceEpsilon) { + numberNotNormalized++; + } + } + } + // validate bone indices are in range of the skeleton + var numBones = this.skeleton.bones.length; + var matricesIndices = this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind); + var matricesIndicesExtra = this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind); + var numBadBoneIndices = 0; + for (var a = 0; a < numWeights; a++) { + for (var b = 0; b < numInfluences; b++) { + var index = b < 4 ? matricesIndices[b] : matricesIndicesExtra[b - 4]; + if (index >= numBones || index < 0) { + numBadBoneIndices++; + } + } + } + // log mesh stats + var output = "Number of Weights = " + numWeights / 4 + "\nMaximum influences = " + maxUsedWeights + + "\nMissing Weights = " + missingWeights + "\nNot Sorted = " + numberNotSorted + + "\nNot Normalized = " + numberNotNormalized + "\nWeightCounts = [" + usedWeightCounts + "]" + + "\nNumber of bones = " + numBones + "\nBad Bone Indices = " + numBadBoneIndices; + return { skinned: true, valid: missingWeights === 0 && numberNotNormalized === 0 && numBadBoneIndices === 0, report: output }; + }; + /** @hidden */ + Mesh.prototype._checkDelayState = function () { + var scene = this.getScene(); + if (this._geometry) { + this._geometry.load(scene); + } + else if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) { + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADING; + this._queueLoad(scene); + } + return this; + }; + Mesh.prototype._queueLoad = function (scene) { + var _this = this; + scene._addPendingData(this); + var getBinaryData = (this.delayLoadingFile.indexOf(".babylonbinarymeshdata") !== -1); + BABYLON.Tools.LoadFile(this.delayLoadingFile, function (data) { + if (data instanceof ArrayBuffer) { + _this._delayLoadingFunction(data, _this); + } + else { + _this._delayLoadingFunction(JSON.parse(data), _this); + } + _this.instances.forEach(function (instance) { + instance._syncSubMeshes(); + }); + _this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED; + scene._removePendingData(_this); + }, function () { }, scene.database, getBinaryData); + return this; + }; + /** + * Returns `true` if the mesh is within the frustum defined by the passed array of planes. + * A mesh is in the frustum if its bounding box intersects the frustum + * @param frustumPlanes defines the frustum to test + * @returns true if the mesh is in the frustum planes + */ + Mesh.prototype.isInFrustum = function (frustumPlanes) { + if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADING) { + return false; + } + if (!_super.prototype.isInFrustum.call(this, frustumPlanes)) { + return false; + } + this._checkDelayState(); + return true; + }; + /** + * Sets the mesh material by the material or multiMaterial `id` property + * @param id is a string identifying the material or the multiMaterial + * @returns the current mesh + */ + Mesh.prototype.setMaterialByID = function (id) { + var materials = this.getScene().materials; + var index; + for (index = materials.length - 1; index > -1; index--) { + if (materials[index].id === id) { + this.material = materials[index]; + return this; + } + } + // Multi + var multiMaterials = this.getScene().multiMaterials; + for (index = multiMaterials.length - 1; index > -1; index--) { + if (multiMaterials[index].id === id) { + this.material = multiMaterials[index]; + return this; + } + } + return this; + }; + /** + * Returns as a new array populated with the mesh material and/or skeleton, if any. + * @returns an array of IAnimatable + */ + Mesh.prototype.getAnimatables = function () { + var results = new Array(); + if (this.material) { + results.push(this.material); + } + if (this.skeleton) { + results.push(this.skeleton); + } + return results; + }; + /** + * Modifies the mesh geometry according to the passed transformation matrix. + * This method returns nothing but it really modifies the mesh even if it's originally not set as updatable. + * The mesh normals are modified using the same transformation. + * Note that, under the hood, this method sets a new VertexBuffer each call. + * @param transform defines the transform matrix to use + * @see http://doc.babylonjs.com/resources/baking_transformations + * @returns the current mesh + */ + Mesh.prototype.bakeTransformIntoVertices = function (transform) { + // Position + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) { + return this; + } + var submeshes = this.subMeshes.splice(0); + this._resetPointsArrayCache(); + var data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var temp = new Array(); + var index; + for (index = 0; index < data.length; index += 3) { + BABYLON.Vector3.TransformCoordinates(BABYLON.Vector3.FromArray(data, index), transform).toArray(temp, index); + } + this.setVerticesData(BABYLON.VertexBuffer.PositionKind, temp, this.getVertexBuffer(BABYLON.VertexBuffer.PositionKind).isUpdatable()); + // Normals + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + data = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + temp = []; + for (index = 0; index < data.length; index += 3) { + BABYLON.Vector3.TransformNormal(BABYLON.Vector3.FromArray(data, index), transform).normalize().toArray(temp, index); + } + this.setVerticesData(BABYLON.VertexBuffer.NormalKind, temp, this.getVertexBuffer(BABYLON.VertexBuffer.NormalKind).isUpdatable()); + } + // flip faces? + if (transform.m[0] * transform.m[5] * transform.m[10] < 0) { + this.flipFaces(); + } + // Restore submeshes + this.releaseSubMeshes(); + this.subMeshes = submeshes; + return this; + }; + /** + * Modifies the mesh geometry according to its own current World Matrix. + * The mesh World Matrix is then reset. + * This method returns nothing but really modifies the mesh even if it's originally not set as updatable. + * Note that, under the hood, this method sets a new VertexBuffer each call. + * @see http://doc.babylonjs.com/resources/baking_transformations + * @returns the current mesh + */ + Mesh.prototype.bakeCurrentTransformIntoVertices = function () { + this.bakeTransformIntoVertices(this.computeWorldMatrix(true)); + this.scaling.copyFromFloats(1, 1, 1); + this.position.copyFromFloats(0, 0, 0); + this.rotation.copyFromFloats(0, 0, 0); + //only if quaternion is already set + if (this.rotationQuaternion) { + this.rotationQuaternion = BABYLON.Quaternion.Identity(); + } + this._worldMatrix = BABYLON.Matrix.Identity(); + return this; + }; + Object.defineProperty(Mesh.prototype, "_positions", { + // Cache + /** @hidden */ + get: function () { + if (this._geometry) { + return this._geometry._positions; + } + return null; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + Mesh.prototype._resetPointsArrayCache = function () { + if (this._geometry) { + this._geometry._resetPointsArrayCache(); + } + return this; + }; + /** @hidden */ + Mesh.prototype._generatePointsArray = function () { + if (this._geometry) { + return this._geometry._generatePointsArray(); + } + return false; + }; + /** + * Returns a new Mesh object generated from the current mesh properties. + * This method must not get confused with createInstance() + * @param name is a string, the name given to the new mesh + * @param newParent can be any Node object (default `null`) + * @param doNotCloneChildren allows/denies the recursive cloning of the original mesh children if any (default `false`) + * @param clonePhysicsImpostor allows/denies the cloning in the same time of the original mesh `body` used by the physics engine, if any (default `true`) + * @returns a new mesh + */ + Mesh.prototype.clone = function (name, newParent, doNotCloneChildren, clonePhysicsImpostor) { + if (name === void 0) { name = ""; } + if (clonePhysicsImpostor === void 0) { clonePhysicsImpostor = true; } + return new Mesh(name, this.getScene(), newParent, this, doNotCloneChildren, clonePhysicsImpostor); + }; + /** + * Releases resources associated with this mesh. + * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default) + * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default) + */ + Mesh.prototype.dispose = function (doNotRecurse, disposeMaterialAndTextures) { + var _this = this; + if (disposeMaterialAndTextures === void 0) { disposeMaterialAndTextures = false; } + this.morphTargetManager = null; + if (this._geometry) { + this._geometry.releaseForMesh(this, true); + } + if (this._onBeforeDrawObservable) { + this._onBeforeDrawObservable.clear(); + } + if (this._onBeforeRenderObservable) { + this._onBeforeRenderObservable.clear(); + } + if (this._onAfterRenderObservable) { + this._onAfterRenderObservable.clear(); + } + // Sources + var meshes = this.getScene().meshes; + meshes.forEach(function (abstractMesh) { + var mesh = abstractMesh; + if (mesh._source && mesh._source === _this) { + mesh._source = null; + } + }); + this._source = null; + // Instances + if (this._instanceDataStorage.instancesBuffer) { + this._instanceDataStorage.instancesBuffer.dispose(); + this._instanceDataStorage.instancesBuffer = null; + } + while (this.instances.length) { + this.instances[0].dispose(); + } + _super.prototype.dispose.call(this, doNotRecurse, disposeMaterialAndTextures); + }; + /** + * Modifies the mesh geometry according to a displacement map. + * A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex. + * The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated. + * @param url is a string, the URL from the image file is to be downloaded. + * @param minHeight is the lower limit of the displacement. + * @param maxHeight is the upper limit of the displacement. + * @param onSuccess is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing. + * @param uvOffset is an optional vector2 used to offset UV. + * @param uvScale is an optional vector2 used to scale UV. + * @param forceUpdate defines whether or not to force an update of the generated buffers. This is usefull to apply on a deserialized model for instance. + * @returns the Mesh. + */ + Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight, onSuccess, uvOffset, uvScale, forceUpdate) { + var _this = this; + if (forceUpdate === void 0) { forceUpdate = false; } + var scene = this.getScene(); + var onload = function (img) { + // Getting height map data + var canvas = document.createElement("canvas"); + var context = canvas.getContext("2d"); + var heightMapWidth = img.width; + var heightMapHeight = img.height; + canvas.width = heightMapWidth; + canvas.height = heightMapHeight; + context.drawImage(img, 0, 0); + // Create VertexData from map data + //Cast is due to wrong definition in lib.d.ts from ts 1.3 - https://github.com/Microsoft/TypeScript/issues/949 + var buffer = context.getImageData(0, 0, heightMapWidth, heightMapHeight).data; + _this.applyDisplacementMapFromBuffer(buffer, heightMapWidth, heightMapHeight, minHeight, maxHeight, uvOffset, uvScale, forceUpdate); + //execute success callback, if set + if (onSuccess) { + onSuccess(_this); + } + }; + BABYLON.Tools.LoadImage(url, onload, function () { }, scene.database); + return this; + }; + /** + * Modifies the mesh geometry according to a displacementMap buffer. + * A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex. + * The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated. + * @param buffer is a `Uint8Array` buffer containing series of `Uint8` lower than 255, the red, green, blue and alpha values of each successive pixel. + * @param heightMapWidth is the width of the buffer image. + * @param heightMapHeight is the height of the buffer image. + * @param minHeight is the lower limit of the displacement. + * @param maxHeight is the upper limit of the displacement. + * @param onSuccess is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing. + * @param uvOffset is an optional vector2 used to offset UV. + * @param uvScale is an optional vector2 used to scale UV. + * @param forceUpdate defines whether or not to force an update of the generated buffers. This is usefull to apply on a deserialized model for instance. + * @returns the Mesh. + */ + Mesh.prototype.applyDisplacementMapFromBuffer = function (buffer, heightMapWidth, heightMapHeight, minHeight, maxHeight, uvOffset, uvScale, forceUpdate) { + if (forceUpdate === void 0) { forceUpdate = false; } + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind) + || !this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind) + || !this.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + BABYLON.Tools.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"); + return this; + } + var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind, true, true); + var normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + var uvs = this.getVerticesData(BABYLON.VertexBuffer.UVKind); + var position = BABYLON.Vector3.Zero(); + var normal = BABYLON.Vector3.Zero(); + var uv = BABYLON.Vector2.Zero(); + uvOffset = uvOffset || BABYLON.Vector2.Zero(); + uvScale = uvScale || new BABYLON.Vector2(1, 1); + for (var index = 0; index < positions.length; index += 3) { + BABYLON.Vector3.FromArrayToRef(positions, index, position); + BABYLON.Vector3.FromArrayToRef(normals, index, normal); + BABYLON.Vector2.FromArrayToRef(uvs, (index / 3) * 2, uv); + // Compute height + var u = ((Math.abs(uv.x * uvScale.x + uvOffset.x) * heightMapWidth) % heightMapWidth) | 0; + var v = ((Math.abs(uv.y * uvScale.y + uvOffset.y) * heightMapHeight) % heightMapHeight) | 0; + var pos = (u + v * heightMapWidth) * 4; + var r = buffer[pos] / 255.0; + var g = buffer[pos + 1] / 255.0; + var b = buffer[pos + 2] / 255.0; + var gradient = r * 0.3 + g * 0.59 + b * 0.11; + normal.normalize(); + normal.scaleInPlace(minHeight + (maxHeight - minHeight) * gradient); + position = position.add(normal); + position.toArray(positions, index); + } + BABYLON.VertexData.ComputeNormals(positions, this.getIndices(), normals); + if (forceUpdate) { + this.setVerticesData(BABYLON.VertexBuffer.PositionKind, positions); + this.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals); + } + else { + this.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positions); + this.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normals); + } + return this; + }; + /** + * Modify the mesh to get a flat shading rendering. + * This means each mesh facet will then have its own normals. Usually new vertices are added in the mesh geometry to get this result. + * Warning : the mesh is really modified even if not set originally as updatable and, under the hood, a new VertexBuffer is allocated. + * @returns current mesh + */ + Mesh.prototype.convertToFlatShadedMesh = function () { + var kinds = this.getVerticesDataKinds(); + var vbs = {}; + var data = {}; + var newdata = {}; + var updatableNormals = false; + var kindIndex; + var kind; + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + var vertexBuffer = this.getVertexBuffer(kind); + if (kind === BABYLON.VertexBuffer.NormalKind) { + updatableNormals = vertexBuffer.isUpdatable(); + kinds.splice(kindIndex, 1); + kindIndex--; + continue; + } + vbs[kind] = vertexBuffer; + data[kind] = vbs[kind].getData(); + newdata[kind] = []; + } + // Save previous submeshes + var previousSubmeshes = this.subMeshes.slice(0); + var indices = this.getIndices(); + var totalIndices = this.getTotalIndices(); + // Generating unique vertices per face + var index; + for (index = 0; index < totalIndices; index++) { + var vertexIndex = indices[index]; + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + var stride = vbs[kind].getStrideSize(); + for (var offset = 0; offset < stride; offset++) { + newdata[kind].push(data[kind][vertexIndex * stride + offset]); + } + } + } + // Updating faces & normal + var normals = []; + var positions = newdata[BABYLON.VertexBuffer.PositionKind]; + for (index = 0; index < totalIndices; index += 3) { + indices[index] = index; + indices[index + 1] = index + 1; + indices[index + 2] = index + 2; + var p1 = BABYLON.Vector3.FromArray(positions, index * 3); + var p2 = BABYLON.Vector3.FromArray(positions, (index + 1) * 3); + var p3 = BABYLON.Vector3.FromArray(positions, (index + 2) * 3); + var p1p2 = p1.subtract(p2); + var p3p2 = p3.subtract(p2); + var normal = BABYLON.Vector3.Normalize(BABYLON.Vector3.Cross(p1p2, p3p2)); + // Store same normals for every vertex + for (var localIndex = 0; localIndex < 3; localIndex++) { + normals.push(normal.x); + normals.push(normal.y); + normals.push(normal.z); + } + } + this.setIndices(indices); + this.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, updatableNormals); + // Updating vertex buffers + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + this.setVerticesData(kind, newdata[kind], vbs[kind].isUpdatable()); + } + // Updating submeshes + this.releaseSubMeshes(); + for (var submeshIndex = 0; submeshIndex < previousSubmeshes.length; submeshIndex++) { + var previousOne = previousSubmeshes[submeshIndex]; + BABYLON.SubMesh.AddToMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this); + } + this.synchronizeInstances(); + return this; + }; + /** + * This method removes all the mesh indices and add new vertices (duplication) in order to unfold facets into buffers. + * In other words, more vertices, no more indices and a single bigger VBO. + * The mesh is really modified even if not set originally as updatable. Under the hood, a new VertexBuffer is allocated. + * @returns current mesh + */ + Mesh.prototype.convertToUnIndexedMesh = function () { + var kinds = this.getVerticesDataKinds(); + var vbs = {}; + var data = {}; + var newdata = {}; + var kindIndex; + var kind; + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + var vertexBuffer = this.getVertexBuffer(kind); + vbs[kind] = vertexBuffer; + data[kind] = vbs[kind].getData(); + newdata[kind] = []; + } + // Save previous submeshes + var previousSubmeshes = this.subMeshes.slice(0); + var indices = this.getIndices(); + var totalIndices = this.getTotalIndices(); + // Generating unique vertices per face + var index; + for (index = 0; index < totalIndices; index++) { + var vertexIndex = indices[index]; + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + var stride = vbs[kind].getStrideSize(); + for (var offset = 0; offset < stride; offset++) { + newdata[kind].push(data[kind][vertexIndex * stride + offset]); + } + } + } + // Updating indices + for (index = 0; index < totalIndices; index += 3) { + indices[index] = index; + indices[index + 1] = index + 1; + indices[index + 2] = index + 2; + } + this.setIndices(indices); + // Updating vertex buffers + for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) { + kind = kinds[kindIndex]; + this.setVerticesData(kind, newdata[kind], vbs[kind].isUpdatable()); + } + // Updating submeshes + this.releaseSubMeshes(); + for (var submeshIndex = 0; submeshIndex < previousSubmeshes.length; submeshIndex++) { + var previousOne = previousSubmeshes[submeshIndex]; + BABYLON.SubMesh.AddToMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this); + } + this._unIndexed = true; + this.synchronizeInstances(); + return this; + }; + /** + * Inverses facet orientations. + * Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call. + * @param flipNormals will also inverts the normals + * @returns current mesh + */ + Mesh.prototype.flipFaces = function (flipNormals) { + if (flipNormals === void 0) { flipNormals = false; } + var vertex_data = BABYLON.VertexData.ExtractFromMesh(this); + var i; + if (flipNormals && this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind) && vertex_data.normals) { + for (i = 0; i < vertex_data.normals.length; i++) { + vertex_data.normals[i] *= -1; + } + } + if (vertex_data.indices) { + var temp; + for (i = 0; i < vertex_data.indices.length; i += 3) { + // reassign indices + temp = vertex_data.indices[i + 1]; + vertex_data.indices[i + 1] = vertex_data.indices[i + 2]; + vertex_data.indices[i + 2] = temp; + } + } + vertex_data.applyToMesh(this); + return this; + }; + // Instances + /** + * Creates a new InstancedMesh object from the mesh model. + * Warning : this method is not supported for Line mesh and LineSystem + * @see http://doc.babylonjs.com/how_to/how_to_use_instances + * @param name defines the name of the new instance + * @returns a new InstancedMesh + */ + Mesh.prototype.createInstance = function (name) { + return new BABYLON.InstancedMesh(name, this); + }; + /** + * Synchronises all the mesh instance submeshes to the current mesh submeshes, if any. + * After this call, all the mesh instances have the same submeshes than the current mesh. + * @returns the current mesh + */ + Mesh.prototype.synchronizeInstances = function () { + for (var instanceIndex = 0; instanceIndex < this.instances.length; instanceIndex++) { + var instance = this.instances[instanceIndex]; + instance._syncSubMeshes(); + } + return this; + }; + /** + * Optimization of the mesh's indices, in case a mesh has duplicated vertices. + * The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes. + * This should be used together with the simplification to avoid disappearing triangles. + * @param successCallback an optional success callback to be called after the optimization finished. + * @returns the current mesh + */ + Mesh.prototype.optimizeIndices = function (successCallback) { + var _this = this; + var indices = this.getIndices(); + var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (!positions || !indices) { + return this; + } + var vectorPositions = new Array(); + for (var pos = 0; pos < positions.length; pos = pos + 3) { + vectorPositions.push(BABYLON.Vector3.FromArray(positions, pos)); + } + var dupes = new Array(); + BABYLON.AsyncLoop.SyncAsyncForLoop(vectorPositions.length, 40, function (iteration) { + var realPos = vectorPositions.length - 1 - iteration; + var testedPosition = vectorPositions[realPos]; + for (var j = 0; j < realPos; ++j) { + var againstPosition = vectorPositions[j]; + if (testedPosition.equals(againstPosition)) { + dupes[realPos] = j; + break; + } + } + }, function () { + for (var i = 0; i < indices.length; ++i) { + indices[i] = dupes[indices[i]] || indices[i]; + } + //indices are now reordered + var originalSubMeshes = _this.subMeshes.slice(0); + _this.setIndices(indices); + _this.subMeshes = originalSubMeshes; + if (successCallback) { + successCallback(_this); + } + }); + return this; + }; + /** + * Serialize current mesh + * @param serializationObject defines the object which will receive the serialization data + */ + Mesh.prototype.serialize = function (serializationObject) { + serializationObject.name = this.name; + serializationObject.id = this.id; + serializationObject.type = this.getClassName(); + if (BABYLON.Tags && BABYLON.Tags.HasTags(this)) { + serializationObject.tags = BABYLON.Tags.GetTags(this); + } + serializationObject.position = this.position.asArray(); + if (this.rotationQuaternion) { + serializationObject.rotationQuaternion = this.rotationQuaternion.asArray(); + } + else if (this.rotation) { + serializationObject.rotation = this.rotation.asArray(); + } + serializationObject.scaling = this.scaling.asArray(); + serializationObject.localMatrix = this.getPivotMatrix().asArray(); + serializationObject.isEnabled = this.isEnabled(false); + serializationObject.isVisible = this.isVisible; + serializationObject.infiniteDistance = this.infiniteDistance; + serializationObject.pickable = this.isPickable; + serializationObject.receiveShadows = this.receiveShadows; + serializationObject.billboardMode = this.billboardMode; + serializationObject.visibility = this.visibility; + serializationObject.checkCollisions = this.checkCollisions; + serializationObject.isBlocker = this.isBlocker; + // Parent + if (this.parent) { + serializationObject.parentId = this.parent.id; + } + // Geometry + serializationObject.isUnIndexed = this.isUnIndexed; + var geometry = this._geometry; + if (geometry) { + var geometryId = geometry.id; + serializationObject.geometryId = geometryId; + // SubMeshes + serializationObject.subMeshes = []; + for (var subIndex = 0; subIndex < this.subMeshes.length; subIndex++) { + var subMesh = this.subMeshes[subIndex]; + serializationObject.subMeshes.push({ + materialIndex: subMesh.materialIndex, + verticesStart: subMesh.verticesStart, + verticesCount: subMesh.verticesCount, + indexStart: subMesh.indexStart, + indexCount: subMesh.indexCount + }); + } + } + // Material + if (this.material) { + serializationObject.materialId = this.material.id; + } + else { + this.material = null; + } + // Morph targets + if (this.morphTargetManager) { + serializationObject.morphTargetManagerId = this.morphTargetManager.uniqueId; + } + // Skeleton + if (this.skeleton) { + serializationObject.skeletonId = this.skeleton.id; + } + // Physics + //TODO implement correct serialization for physics impostors. + var impostor = this.getPhysicsImpostor(); + if (impostor) { + serializationObject.physicsMass = impostor.getParam("mass"); + serializationObject.physicsFriction = impostor.getParam("friction"); + serializationObject.physicsRestitution = impostor.getParam("mass"); + serializationObject.physicsImpostor = impostor.type; + } + // Metadata + if (this.metadata) { + serializationObject.metadata = this.metadata; + } + // Instances + serializationObject.instances = []; + for (var index = 0; index < this.instances.length; index++) { + var instance = this.instances[index]; + if (instance.doNotSerialize) { + continue; + } + var serializationInstance = { + name: instance.name, + id: instance.id, + position: instance.position.asArray(), + scaling: instance.scaling.asArray() + }; + if (instance.parent) { + serializationInstance.parentId = instance.parent.id; + } + if (instance.rotationQuaternion) { + serializationInstance.rotationQuaternion = instance.rotationQuaternion.asArray(); + } + else if (instance.rotation) { + serializationInstance.rotation = instance.rotation.asArray(); + } + serializationObject.instances.push(serializationInstance); + // Animations + BABYLON.Animation.AppendSerializedAnimations(instance, serializationInstance); + serializationInstance.ranges = instance.serializeAnimationRanges(); + } + // + // Animations + BABYLON.Animation.AppendSerializedAnimations(this, serializationObject); + serializationObject.ranges = this.serializeAnimationRanges(); + // Layer mask + serializationObject.layerMask = this.layerMask; + // Alpha + serializationObject.alphaIndex = this.alphaIndex; + serializationObject.hasVertexAlpha = this.hasVertexAlpha; + // Overlay + serializationObject.overlayAlpha = this.overlayAlpha; + serializationObject.overlayColor = this.overlayColor.asArray(); + serializationObject.renderOverlay = this.renderOverlay; + // Fog + serializationObject.applyFog = this.applyFog; + // Action Manager + if (this.actionManager) { + serializationObject.actions = this.actionManager.serialize(this.name); + } + }; + /** @hidden */ + Mesh.prototype._syncGeometryWithMorphTargetManager = function () { + if (!this.geometry) { + return; + } + this._markSubMeshesAsAttributesDirty(); + var morphTargetManager = this._morphTargetManager; + if (morphTargetManager && morphTargetManager.vertexCount) { + if (morphTargetManager.vertexCount !== this.getTotalVertices()) { + BABYLON.Tools.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."); + this.morphTargetManager = null; + return; + } + for (var index = 0; index < morphTargetManager.numInfluencers; index++) { + var morphTarget = morphTargetManager.getActiveTarget(index); + var positions = morphTarget.getPositions(); + if (!positions) { + BABYLON.Tools.Error("Invalid morph target. Target must have positions."); + return; + } + this.geometry.setVerticesData(BABYLON.VertexBuffer.PositionKind + index, positions, false, 3); + var normals = morphTarget.getNormals(); + if (normals) { + this.geometry.setVerticesData(BABYLON.VertexBuffer.NormalKind + index, normals, false, 3); + } + var tangents = morphTarget.getTangents(); + if (tangents) { + this.geometry.setVerticesData(BABYLON.VertexBuffer.TangentKind + index, tangents, false, 3); + } + } + } + else { + var index = 0; + // Positions + while (this.geometry.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind + index)) { + this.geometry.removeVerticesData(BABYLON.VertexBuffer.PositionKind + index); + if (this.geometry.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind + index)) { + this.geometry.removeVerticesData(BABYLON.VertexBuffer.NormalKind + index); + } + if (this.geometry.isVerticesDataPresent(BABYLON.VertexBuffer.TangentKind + index)) { + this.geometry.removeVerticesData(BABYLON.VertexBuffer.TangentKind + index); + } + index++; + } + } + }; + // Statics + /** + * Returns a new Mesh object parsed from the source provided. + * @param parsedMesh is the source + * @param scene defines the hosting scene + * @param rootUrl is the root URL to prefix the `delayLoadingFile` property with + * @returns a new Mesh + */ + Mesh.Parse = function (parsedMesh, scene, rootUrl) { + var mesh; + if (parsedMesh.type && parsedMesh.type === "GroundMesh") { + mesh = BABYLON.GroundMesh.Parse(parsedMesh, scene); + } + else { + mesh = new Mesh(parsedMesh.name, scene); + } + mesh.id = parsedMesh.id; + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(mesh, parsedMesh.tags); + } + mesh.position = BABYLON.Vector3.FromArray(parsedMesh.position); + if (parsedMesh.metadata !== undefined) { + mesh.metadata = parsedMesh.metadata; + } + if (parsedMesh.rotationQuaternion) { + mesh.rotationQuaternion = BABYLON.Quaternion.FromArray(parsedMesh.rotationQuaternion); + } + else if (parsedMesh.rotation) { + mesh.rotation = BABYLON.Vector3.FromArray(parsedMesh.rotation); + } + mesh.scaling = BABYLON.Vector3.FromArray(parsedMesh.scaling); + if (parsedMesh.localMatrix) { + mesh.setPreTransformMatrix(BABYLON.Matrix.FromArray(parsedMesh.localMatrix)); + } + else if (parsedMesh.pivotMatrix) { + mesh.setPivotMatrix(BABYLON.Matrix.FromArray(parsedMesh.pivotMatrix)); + } + mesh.setEnabled(parsedMesh.isEnabled); + mesh.isVisible = parsedMesh.isVisible; + mesh.infiniteDistance = parsedMesh.infiniteDistance; + mesh.showBoundingBox = parsedMesh.showBoundingBox; + mesh.showSubMeshesBoundingBox = parsedMesh.showSubMeshesBoundingBox; + if (parsedMesh.applyFog !== undefined) { + mesh.applyFog = parsedMesh.applyFog; + } + if (parsedMesh.pickable !== undefined) { + mesh.isPickable = parsedMesh.pickable; + } + if (parsedMesh.alphaIndex !== undefined) { + mesh.alphaIndex = parsedMesh.alphaIndex; + } + mesh.receiveShadows = parsedMesh.receiveShadows; + mesh.billboardMode = parsedMesh.billboardMode; + if (parsedMesh.visibility !== undefined) { + mesh.visibility = parsedMesh.visibility; + } + mesh.checkCollisions = parsedMesh.checkCollisions; + if (parsedMesh.isBlocker !== undefined) { + mesh.isBlocker = parsedMesh.isBlocker; + } + mesh._shouldGenerateFlatShading = parsedMesh.useFlatShading; + // freezeWorldMatrix + if (parsedMesh.freezeWorldMatrix) { + mesh._waitingFreezeWorldMatrix = parsedMesh.freezeWorldMatrix; + } + // Parent + if (parsedMesh.parentId) { + mesh._waitingParentId = parsedMesh.parentId; + } + // Actions + if (parsedMesh.actions !== undefined) { + mesh._waitingActions = parsedMesh.actions; + } + // Overlay + if (parsedMesh.overlayAlpha !== undefined) { + mesh.overlayAlpha = parsedMesh.overlayAlpha; + } + if (parsedMesh.overlayColor !== undefined) { + mesh.overlayColor = BABYLON.Color3.FromArray(parsedMesh.overlayColor); + } + if (parsedMesh.renderOverlay !== undefined) { + mesh.renderOverlay = parsedMesh.renderOverlay; + } + // Geometry + mesh.isUnIndexed = !!parsedMesh.isUnIndexed; + mesh.hasVertexAlpha = parsedMesh.hasVertexAlpha; + if (parsedMesh.delayLoadingFile) { + mesh.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED; + mesh.delayLoadingFile = rootUrl + parsedMesh.delayLoadingFile; + mesh._boundingInfo = new BABYLON.BoundingInfo(BABYLON.Vector3.FromArray(parsedMesh.boundingBoxMinimum), BABYLON.Vector3.FromArray(parsedMesh.boundingBoxMaximum)); + if (parsedMesh._binaryInfo) { + mesh._binaryInfo = parsedMesh._binaryInfo; + } + mesh._delayInfo = []; + if (parsedMesh.hasUVs) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UVKind); + } + if (parsedMesh.hasUVs2) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UV2Kind); + } + if (parsedMesh.hasUVs3) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UV3Kind); + } + if (parsedMesh.hasUVs4) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UV4Kind); + } + if (parsedMesh.hasUVs5) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UV5Kind); + } + if (parsedMesh.hasUVs6) { + mesh._delayInfo.push(BABYLON.VertexBuffer.UV6Kind); + } + if (parsedMesh.hasColors) { + mesh._delayInfo.push(BABYLON.VertexBuffer.ColorKind); + } + if (parsedMesh.hasMatricesIndices) { + mesh._delayInfo.push(BABYLON.VertexBuffer.MatricesIndicesKind); + } + if (parsedMesh.hasMatricesWeights) { + mesh._delayInfo.push(BABYLON.VertexBuffer.MatricesWeightsKind); + } + mesh._delayLoadingFunction = BABYLON.Geometry._ImportGeometry; + if (BABYLON.SceneLoader.ForceFullSceneLoadingForIncremental) { + mesh._checkDelayState(); + } + } + else { + BABYLON.Geometry._ImportGeometry(parsedMesh, mesh); + } + // Material + if (parsedMesh.materialId) { + mesh.setMaterialByID(parsedMesh.materialId); + } + else { + mesh.material = null; + } + // Morph targets + if (parsedMesh.morphTargetManagerId > -1) { + mesh.morphTargetManager = scene.getMorphTargetManagerById(parsedMesh.morphTargetManagerId); + } + // Skeleton + if (parsedMesh.skeletonId > -1) { + mesh.skeleton = scene.getLastSkeletonByID(parsedMesh.skeletonId); + if (parsedMesh.numBoneInfluencers) { + mesh.numBoneInfluencers = parsedMesh.numBoneInfluencers; + } + } + // Animations + if (parsedMesh.animations) { + for (var animationIndex = 0; animationIndex < parsedMesh.animations.length; animationIndex++) { + var parsedAnimation = parsedMesh.animations[animationIndex]; + mesh.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + BABYLON.Node.ParseAnimationRanges(mesh, parsedMesh, scene); + } + if (parsedMesh.autoAnimate) { + scene.beginAnimation(mesh, parsedMesh.autoAnimateFrom, parsedMesh.autoAnimateTo, parsedMesh.autoAnimateLoop, parsedMesh.autoAnimateSpeed || 1.0); + } + // Layer Mask + if (parsedMesh.layerMask && (!isNaN(parsedMesh.layerMask))) { + mesh.layerMask = Math.abs(parseInt(parsedMesh.layerMask)); + } + else { + mesh.layerMask = 0x0FFFFFFF; + } + // Physics + if (parsedMesh.physicsImpostor) { + mesh.physicsImpostor = new BABYLON.PhysicsImpostor(mesh, parsedMesh.physicsImpostor, { + mass: parsedMesh.physicsMass, + friction: parsedMesh.physicsFriction, + restitution: parsedMesh.physicsRestitution + }, scene); + } + // Instances + if (parsedMesh.instances) { + for (var index = 0; index < parsedMesh.instances.length; index++) { + var parsedInstance = parsedMesh.instances[index]; + var instance = mesh.createInstance(parsedInstance.name); + if (parsedInstance.id) { + instance.id = parsedInstance.id; + } + if (BABYLON.Tags) { + if (parsedInstance.tags) { + BABYLON.Tags.AddTagsTo(instance, parsedInstance.tags); + } + else { + BABYLON.Tags.AddTagsTo(instance, parsedMesh.tags); + } + } + instance.position = BABYLON.Vector3.FromArray(parsedInstance.position); + if (parsedInstance.parentId) { + instance._waitingParentId = parsedInstance.parentId; + } + if (parsedInstance.rotationQuaternion) { + instance.rotationQuaternion = BABYLON.Quaternion.FromArray(parsedInstance.rotationQuaternion); + } + else if (parsedInstance.rotation) { + instance.rotation = BABYLON.Vector3.FromArray(parsedInstance.rotation); + } + instance.scaling = BABYLON.Vector3.FromArray(parsedInstance.scaling); + if (parsedInstance.checkCollisions != undefined && parsedInstance.checkCollisions != null) { + instance.checkCollisions = parsedInstance.checkCollisions; + } + if (parsedInstance.pickable != undefined && parsedInstance.pickable != null) { + instance.isPickable = parsedInstance.pickable; + } + if (parsedInstance.showBoundingBox != undefined && parsedInstance.showBoundingBox != null) { + instance.showBoundingBox = parsedInstance.showBoundingBox; + } + if (parsedInstance.showSubMeshesBoundingBox != undefined && parsedInstance.showSubMeshesBoundingBox != null) { + instance.showSubMeshesBoundingBox = parsedInstance.showSubMeshesBoundingBox; + } + if (parsedInstance.alphaIndex != undefined && parsedInstance.showSubMeshesBoundingBox != null) { + instance.alphaIndex = parsedInstance.alphaIndex; + } + // Physics + if (parsedInstance.physicsImpostor) { + instance.physicsImpostor = new BABYLON.PhysicsImpostor(instance, parsedInstance.physicsImpostor, { + mass: parsedInstance.physicsMass, + friction: parsedInstance.physicsFriction, + restitution: parsedInstance.physicsRestitution + }, scene); + } + // Animation + if (parsedInstance.animations) { + for (animationIndex = 0; animationIndex < parsedInstance.animations.length; animationIndex++) { + parsedAnimation = parsedInstance.animations[animationIndex]; + instance.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + BABYLON.Node.ParseAnimationRanges(instance, parsedInstance, scene); + if (parsedInstance.autoAnimate) { + scene.beginAnimation(instance, parsedInstance.autoAnimateFrom, parsedInstance.autoAnimateTo, parsedInstance.autoAnimateLoop, parsedInstance.autoAnimateSpeed || 1.0); + } + } + } + } + return mesh; + }; + /** + * Creates a ribbon mesh. Please consider using the same method from the MeshBuilder class instead + * @see http://doc.babylonjs.com/how_to/parametric_shapes + * @param name defines the name of the mesh to create + * @param pathArray is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry. + * @param closeArray creates a seam between the first and the last paths of the path array (default is false) + * @param closePath creates a seam between the first and the last points of each path of the path array + * @param offset is taken in account only if the `pathArray` is containing a single path + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @param instance defines an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter (http://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#ribbon) + * @returns a new Mesh + */ + Mesh.CreateRibbon = function (name, pathArray, closeArray, closePath, offset, scene, updatable, sideOrientation, instance) { + if (closeArray === void 0) { closeArray = false; } + if (updatable === void 0) { updatable = false; } + return BABYLON.MeshBuilder.CreateRibbon(name, { + pathArray: pathArray, + closeArray: closeArray, + closePath: closePath, + offset: offset, + updatable: updatable, + sideOrientation: sideOrientation, + instance: instance + }, scene); + }; + /** + * Creates a plane polygonal mesh. By default, this is a disc. Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param radius sets the radius size (float) of the polygon (default 0.5) + * @param tessellation sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @returns a new Mesh + */ + Mesh.CreateDisc = function (name, radius, tessellation, scene, updatable, sideOrientation) { + if (scene === void 0) { scene = null; } + var options = { + radius: radius, + tessellation: tessellation, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateDisc(name, options, scene); + }; + /** + * Creates a box mesh. Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param size sets the size (float) of each box side (default 1) + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @returns a new Mesh + */ + Mesh.CreateBox = function (name, size, scene, updatable, sideOrientation) { + if (scene === void 0) { scene = null; } + var options = { + size: size, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateBox(name, options, scene); + }; + /** + * Creates a sphere mesh. Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param segments sets the sphere number of horizontal stripes (positive integer, default 32) + * @param diameter sets the diameter size (float) of the sphere (default 1) + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @returns a new Mesh + */ + Mesh.CreateSphere = function (name, segments, diameter, scene, updatable, sideOrientation) { + var options = { + segments: segments, + diameterX: diameter, + diameterY: diameter, + diameterZ: diameter, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateSphere(name, options, scene); + }; + /** + * Creates a cylinder or a cone mesh. Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param height sets the height size (float) of the cylinder/cone (float, default 2) + * @param diameterTop set the top cap diameter (floats, default 1) + * @param diameterBottom set the bottom cap diameter (floats, default 1). This value can't be zero + * @param tessellation sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance + * @param subdivisions sets the number of rings along the cylinder height (positive integer, default 1) + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @returns a new Mesh + */ + Mesh.CreateCylinder = function (name, height, diameterTop, diameterBottom, tessellation, subdivisions, scene, updatable, sideOrientation) { + if (scene === undefined || !(scene instanceof BABYLON.Scene)) { + if (scene !== undefined) { + sideOrientation = updatable || Mesh.DEFAULTSIDE; + updatable = scene; + } + scene = subdivisions; + subdivisions = 1; + } + var options = { + height: height, + diameterTop: diameterTop, + diameterBottom: diameterBottom, + tessellation: tessellation, + subdivisions: subdivisions, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateCylinder(name, options, scene); + }; + // Torus (Code from SharpDX.org) + /** + * Creates a torus mesh. Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param diameter sets the diameter size (float) of the torus (default 1) + * @param thickness sets the diameter size of the tube of the torus (float, default 0.5) + * @param tessellation sets the number of torus sides (postive integer, default 16) + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @returns a new Mesh + */ + Mesh.CreateTorus = function (name, diameter, thickness, tessellation, scene, updatable, sideOrientation) { + var options = { + diameter: diameter, + thickness: thickness, + tessellation: tessellation, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateTorus(name, options, scene); + }; + /** + * Creates a torus knot mesh. Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param radius sets the global radius size (float) of the torus knot (default 2) + * @param tube sets the diameter size of the tube of the torus (float, default 0.5) + * @param radialSegments sets the number of sides on each tube segments (positive integer, default 32) + * @param tubularSegments sets the number of tubes to decompose the knot into (positive integer, default 32) + * @param p the number of windings on X axis (positive integers, default 2) + * @param q the number of windings on Y axis (positive integers, default 3) + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @returns a new Mesh + */ + Mesh.CreateTorusKnot = function (name, radius, tube, radialSegments, tubularSegments, p, q, scene, updatable, sideOrientation) { + var options = { + radius: radius, + tube: tube, + radialSegments: radialSegments, + tubularSegments: tubularSegments, + p: p, + q: q, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateTorusKnot(name, options, scene); + }; + /** + * Creates a line mesh. Please consider using the same method from the MeshBuilder class instead. + * @param name defines the name of the mesh to create + * @param points is an array successive Vector3 + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param instance is an instance of an existing LineMesh object to be updated with the passed `points` parameter (http://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines). + * @returns a new Mesh + */ + Mesh.CreateLines = function (name, points, scene, updatable, instance) { + if (scene === void 0) { scene = null; } + if (updatable === void 0) { updatable = false; } + if (instance === void 0) { instance = null; } + var options = { + points: points, + updatable: updatable, + instance: instance + }; + return BABYLON.MeshBuilder.CreateLines(name, options, scene); + }; + /** + * Creates a dashed line mesh. Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param points is an array successive Vector3 + * @param dashSize is the size of the dashes relatively the dash number (positive float, default 3) + * @param gapSize is the size of the gap between two successive dashes relatively the dash number (positive float, default 1) + * @param dashNb is the intended total number of dashes (positive integer, default 200) + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param instance is an instance of an existing LineMesh object to be updated with the passed `points` parameter (http://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines) + * @returns a new Mesh + */ + Mesh.CreateDashedLines = function (name, points, dashSize, gapSize, dashNb, scene, updatable, instance) { + if (scene === void 0) { scene = null; } + var options = { + points: points, + dashSize: dashSize, + gapSize: gapSize, + dashNb: dashNb, + updatable: updatable, + instance: instance + }; + return BABYLON.MeshBuilder.CreateDashedLines(name, options, scene); + }; + /** + * Creates a polygon mesh. + * Please consider using the same method from the MeshBuilder class instead. + * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh. + * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors. + * You can set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. + * Remember you can only change the shape positions, not their number when updating a polygon. + */ + /** + * Creates a polygon mesh.Please consider using the same method from the MeshBuilder class instead + * @see http://doc.babylonjs.com/how_to/parametric_shapes#non-regular-polygon + * @param name defines the name of the mesh to create + * @param shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors + * @param scene defines the hosting scene + * @param holes is a required array of arrays of successive Vector3 used to defines holes in the polygon + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @returns a new Mesh + */ + Mesh.CreatePolygon = function (name, shape, scene, holes, updatable, sideOrientation) { + var options = { + shape: shape, + holes: holes, + updatable: updatable, + sideOrientation: sideOrientation + }; + return BABYLON.MeshBuilder.CreatePolygon(name, options, scene); + }; + /** + * Creates an extruded polygon mesh, with depth in the Y direction. Please consider using the same method from the MeshBuilder class instead. + * @see http://doc.babylonjs.com/how_to/parametric_shapes#extruded-non-regular-polygon + * @param name defines the name of the mesh to create + * @param shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors + * @param depth defines the height of extrusion + * @param scene defines the hosting scene + * @param holes is a required array of arrays of successive Vector3 used to defines holes in the polygon + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @returns a new Mesh + */ + Mesh.ExtrudePolygon = function (name, shape, depth, scene, holes, updatable, sideOrientation) { + var options = { + shape: shape, + holes: holes, + depth: depth, + updatable: updatable, + sideOrientation: sideOrientation + }; + return BABYLON.MeshBuilder.ExtrudePolygon(name, options, scene); + }; + /** + * Creates an extruded shape mesh. + * The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters. Please consider using the same method from the MeshBuilder class instead + * @see http://doc.babylonjs.com/how_to/parametric_shapes + * @see http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes + * @param name defines the name of the mesh to create + * @param shape is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis + * @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along + * @param scale is the value to scale the shape + * @param rotation is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve + * @param cap sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @param instance is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters (http://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#extruded-shape) + * @returns a new Mesh + */ + Mesh.ExtrudeShape = function (name, shape, path, scale, rotation, cap, scene, updatable, sideOrientation, instance) { + if (scene === void 0) { scene = null; } + var options = { + shape: shape, + path: path, + scale: scale, + rotation: rotation, + cap: (cap === 0) ? 0 : cap || Mesh.NO_CAP, + sideOrientation: sideOrientation, + instance: instance, + updatable: updatable + }; + return BABYLON.MeshBuilder.ExtrudeShape(name, options, scene); + }; + /** + * Creates an custom extruded shape mesh. + * The custom extrusion is a parametric shape. + * It has no predefined shape. Its final shape will depend on the input parameters. + * Please consider using the same method from the MeshBuilder class instead + * @see http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes + * @param name defines the name of the mesh to create + * @param shape is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis + * @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along + * @param scaleFunction is a custom Javascript function called on each path point + * @param rotationFunction is a custom Javascript function called on each path point + * @param ribbonCloseArray forces the extrusion underlying ribbon to close all the paths in its `pathArray` + * @param ribbonClosePath forces the extrusion underlying ribbon to close its `pathArray` + * @param cap sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @param instance is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters (http://doc.babylonjs.com/how_to/how_to_dynamically_morph_a_mesh#extruded-shape) + * @returns a new Mesh + */ + Mesh.ExtrudeShapeCustom = function (name, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene, updatable, sideOrientation, instance) { + var options = { + shape: shape, + path: path, + scaleFunction: scaleFunction, + rotationFunction: rotationFunction, + ribbonCloseArray: ribbonCloseArray, + ribbonClosePath: ribbonClosePath, + cap: (cap === 0) ? 0 : cap || Mesh.NO_CAP, + sideOrientation: sideOrientation, + instance: instance, + updatable: updatable + }; + return BABYLON.MeshBuilder.ExtrudeShapeCustom(name, options, scene); + }; + /** + * Creates lathe mesh. + * The lathe is a shape with a symetry axis : a 2D model shape is rotated around this axis to design the lathe. + * Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param shape is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero + * @param radius is the radius value of the lathe + * @param tessellation is the side number of the lathe. + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @returns a new Mesh + */ + Mesh.CreateLathe = function (name, shape, radius, tessellation, scene, updatable, sideOrientation) { + var options = { + shape: shape, + radius: radius, + tessellation: tessellation, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateLathe(name, options, scene); + }; + /** + * Creates a plane mesh. Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param size sets the size (float) of both sides of the plane at once (default 1) + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @returns a new Mesh + */ + Mesh.CreatePlane = function (name, size, scene, updatable, sideOrientation) { + var options = { + size: size, + width: size, + height: size, + sideOrientation: sideOrientation, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreatePlane(name, options, scene); + }; + /** + * Creates a ground mesh. + * Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param width set the width of the ground + * @param height set the height of the ground + * @param subdivisions sets the number of subdivisions per side + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @returns a new Mesh + */ + Mesh.CreateGround = function (name, width, height, subdivisions, scene, updatable) { + var options = { + width: width, + height: height, + subdivisions: subdivisions, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateGround(name, options, scene); + }; + /** + * Creates a tiled ground mesh. + * Please consider using the same method from the MeshBuilder class instead + * @param name defines the name of the mesh to create + * @param xmin set the ground minimum X coordinate + * @param zmin set the ground minimum Y coordinate + * @param xmax set the ground maximum X coordinate + * @param zmax set the ground maximum Z coordinate + * @param subdivisions is an object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile + * @param precision is an object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the numbers of subdivisions on the ground width and height of each tile + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @returns a new Mesh + */ + Mesh.CreateTiledGround = function (name, xmin, zmin, xmax, zmax, subdivisions, precision, scene, updatable) { + var options = { + xmin: xmin, + zmin: zmin, + xmax: xmax, + zmax: zmax, + subdivisions: subdivisions, + precision: precision, + updatable: updatable + }; + return BABYLON.MeshBuilder.CreateTiledGround(name, options, scene); + }; + /** + * Creates a ground mesh from a height map. + * Please consider using the same method from the MeshBuilder class instead + * @see http://doc.babylonjs.com/babylon101/height_map + * @param name defines the name of the mesh to create + * @param url sets the URL of the height map image resource + * @param width set the ground width size + * @param height set the ground height size + * @param subdivisions sets the number of subdivision per side + * @param minHeight is the minimum altitude on the ground + * @param maxHeight is the maximum altitude on the ground + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param onReady is a callback function that will be called once the mesh is built (the height map download can last some time) + * @param alphaFilter will filter any data where the alpha channel is below this value, defaults 0 (all data visible) + * @returns a new Mesh + */ + Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady, alphaFilter) { + var options = { + width: width, + height: height, + subdivisions: subdivisions, + minHeight: minHeight, + maxHeight: maxHeight, + updatable: updatable, + onReady: onReady, + alphaFilter: alphaFilter + }; + return BABYLON.MeshBuilder.CreateGroundFromHeightMap(name, url, options, scene); + }; + /** + * Creates a tube mesh. + * The tube is a parametric shape. + * It has no predefined shape. Its final shape will depend on the input parameters. + * Please consider using the same method from the MeshBuilder class instead + * @see http://doc.babylonjs.com/how_to/parametric_shapes + * @param name defines the name of the mesh to create + * @param path is a required array of successive Vector3. It is the curve used as the axis of the tube + * @param radius sets the tube radius size + * @param tessellation is the number of sides on the tubular surface + * @param radiusFunction is a custom function. If it is not null, it overwrittes the parameter `radius`. This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path + * @param cap sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL + * @param scene defines the hosting scene + * @param updatable defines if the mesh must be flagged as updatable + * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation) + * @param instance is an instance of an existing Tube object to be updated with the passed `pathArray` parameter (http://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#tube) + * @returns a new Mesh + */ + Mesh.CreateTube = function (name, path, radius, tessellation, radiusFunction, cap, scene, updatable, sideOrientation, instance) { + var options = { + path: path, + radius: radius, + tessellation: tessellation, + radiusFunction: radiusFunction, + arc: 1, + cap: cap, + updatable: updatable, + sideOrientation: sideOrientation, + instance: instance + }; + return BABYLON.MeshBuilder.CreateTube(name, options, scene); + }; + /** + * Creates a polyhedron mesh. + * Please consider using the same method from the MeshBuilder class instead. + * * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial to choose the wanted type + * * The parameter `size` (positive float, default 1) sets the polygon size + * * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value) + * * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type` + * * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron + * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`) + * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors + * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored + * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation + * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created + * @param name defines the name of the mesh to create + * @param options defines the options used to create the mesh + * @param scene defines the hosting scene + * @returns a new Mesh + */ + Mesh.CreatePolyhedron = function (name, options, scene) { + return BABYLON.MeshBuilder.CreatePolyhedron(name, options, scene); + }; + /** + * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided + * * The parameter `radius` sets the radius size (float) of the icosphere (default 1) + * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value than `radius`) + * * The parameter `subdivisions` sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size + * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface + * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation + * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created + * @param name defines the name of the mesh + * @param options defines the options used to create the mesh + * @param scene defines the hosting scene + * @returns a new Mesh + * @see http://doc.babylonjs.com/how_to/polyhedra_shapes#icosphere + */ + Mesh.CreateIcoSphere = function (name, options, scene) { + return BABYLON.MeshBuilder.CreateIcoSphere(name, options, scene); + }; + /** + * Creates a decal mesh. + * Please consider using the same method from the MeshBuilder class instead. + * A decal is a mesh usually applied as a model onto the surface of another mesh + * @param name defines the name of the mesh + * @param sourceMesh defines the mesh receiving the decal + * @param position sets the position of the decal in world coordinates + * @param normal sets the normal of the mesh where the decal is applied onto in world coordinates + * @param size sets the decal scaling + * @param angle sets the angle to rotate the decal + * @returns a new Mesh + */ + Mesh.CreateDecal = function (name, sourceMesh, position, normal, size, angle) { + var options = { + position: position, + normal: normal, + size: size, + angle: angle + }; + return BABYLON.MeshBuilder.CreateDecal(name, sourceMesh, options); + }; + // Skeletons + /** + * Prepare internal position array for software CPU skinning + * @returns original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh + */ + Mesh.prototype.setPositionsForCPUSkinning = function () { + if (!this._sourcePositions) { + var source = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (!source) { + return this._sourcePositions; + } + this._sourcePositions = new Float32Array(source); + if (!this.isVertexBufferUpdatable(BABYLON.VertexBuffer.PositionKind)) { + this.setVerticesData(BABYLON.VertexBuffer.PositionKind, source, true); + } + } + return this._sourcePositions; + }; + /** + * Prepare internal normal array for software CPU skinning + * @returns original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh. + */ + Mesh.prototype.setNormalsForCPUSkinning = function () { + if (!this._sourceNormals) { + var source = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + if (!source) { + return this._sourceNormals; + } + this._sourceNormals = new Float32Array(source); + if (!this.isVertexBufferUpdatable(BABYLON.VertexBuffer.NormalKind)) { + this.setVerticesData(BABYLON.VertexBuffer.NormalKind, source, true); + } + } + return this._sourceNormals; + }; + /** + * Updates the vertex buffer by applying transformation from the bones + * @param skeleton defines the skeleton to apply to current mesh + * @returns the current mesh + */ + Mesh.prototype.applySkeleton = function (skeleton) { + if (!this.geometry) { + return this; + } + if (this.geometry._softwareSkinningFrameId == this.getScene().getFrameId()) { + return this; + } + this.geometry._softwareSkinningFrameId = this.getScene().getFrameId(); + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) { + return this; + } + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + return this; + } + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind)) { + return this; + } + if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) { + return this; + } + if (!this._sourcePositions) { + var submeshes = this.subMeshes.slice(); + this.setPositionsForCPUSkinning(); + this.subMeshes = submeshes; + } + if (!this._sourceNormals) { + this.setNormalsForCPUSkinning(); + } + // positionsData checks for not being Float32Array will only pass at most once + var positionsData = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (!positionsData) { + return this; + } + if (!(positionsData instanceof Float32Array)) { + positionsData = new Float32Array(positionsData); + } + // normalsData checks for not being Float32Array will only pass at most once + var normalsData = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); + if (!normalsData) { + return this; + } + if (!(normalsData instanceof Float32Array)) { + normalsData = new Float32Array(normalsData); + } + var matricesIndicesData = this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind); + var matricesWeightsData = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind); + if (!matricesWeightsData || !matricesIndicesData) { + return this; + } + var needExtras = this.numBoneInfluencers > 4; + var matricesIndicesExtraData = needExtras ? this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind) : null; + var matricesWeightsExtraData = needExtras ? this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind) : null; + var skeletonMatrices = skeleton.getTransformMatrices(this); + var tempVector3 = BABYLON.Vector3.Zero(); + var finalMatrix = new BABYLON.Matrix(); + var tempMatrix = new BABYLON.Matrix(); + var matWeightIdx = 0; + var inf; + for (var index = 0; index < positionsData.length; index += 3, matWeightIdx += 4) { + var weight; + for (inf = 0; inf < 4; inf++) { + weight = matricesWeightsData[matWeightIdx + inf]; + if (weight > 0) { + BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix); + finalMatrix.addToSelf(tempMatrix); + } + } + if (needExtras) { + for (inf = 0; inf < 4; inf++) { + weight = matricesWeightsExtraData[matWeightIdx + inf]; + if (weight > 0) { + BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix); + finalMatrix.addToSelf(tempMatrix); + } + } + } + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(this._sourcePositions[index], this._sourcePositions[index + 1], this._sourcePositions[index + 2], finalMatrix, tempVector3); + tempVector3.toArray(positionsData, index); + BABYLON.Vector3.TransformNormalFromFloatsToRef(this._sourceNormals[index], this._sourceNormals[index + 1], this._sourceNormals[index + 2], finalMatrix, tempVector3); + tempVector3.toArray(normalsData, index); + finalMatrix.reset(); + } + this.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positionsData); + this.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normalsData); + return this; + }; + // Tools + /** + * Returns an object containing a min and max Vector3 which are the minimum and maximum vectors of each mesh bounding box from the passed array, in the world coordinates + * @param meshes defines the list of meshes to scan + * @returns an object `{min:` Vector3`, max:` Vector3`}` + */ + Mesh.MinMax = function (meshes) { + var minVector = null; + var maxVector = null; + meshes.forEach(function (mesh, index, array) { + var boundingInfo = mesh.getBoundingInfo(); + var boundingBox = boundingInfo.boundingBox; + if (!minVector || !maxVector) { + minVector = boundingBox.minimumWorld; + maxVector = boundingBox.maximumWorld; + } + else { + minVector.minimizeInPlace(boundingBox.minimumWorld); + maxVector.maximizeInPlace(boundingBox.maximumWorld); + } + }); + if (!minVector || !maxVector) { + return { + min: BABYLON.Vector3.Zero(), + max: BABYLON.Vector3.Zero() + }; + } + return { + min: minVector, + max: maxVector + }; + }; + /** + * Returns the center of the `{min:` Vector3`, max:` Vector3`}` or the center of MinMax vector3 computed from a mesh array + * @param meshesOrMinMaxVector could be an array of meshes or a `{min:` Vector3`, max:` Vector3`}` object + * @returns a vector3 + */ + Mesh.Center = function (meshesOrMinMaxVector) { + var minMaxVector = (meshesOrMinMaxVector instanceof Array) ? Mesh.MinMax(meshesOrMinMaxVector) : meshesOrMinMaxVector; + return BABYLON.Vector3.Center(minMaxVector.min, minMaxVector.max); + }; + /** + * Merge the array of meshes into a single mesh for performance reasons. + * @param meshes defines he vertices source. They should all be of the same material. Entries can empty + * @param disposeSource when true (default), dispose of the vertices from the source meshes + * @param allow32BitsIndices when the sum of the vertices > 64k, this must be set to true + * @param meshSubclass when set, vertices inserted into this Mesh. Meshes can then be merged into a Mesh sub-class. + * @param subdivideWithSubMeshes when true (false default), subdivide mesh to his subMesh array with meshes source. + * @returns a new mesh + */ + Mesh.MergeMeshes = function (meshes, disposeSource, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes) { + if (disposeSource === void 0) { disposeSource = true; } + var index; + if (!allow32BitsIndices) { + var totalVertices = 0; + // Counting vertices + for (index = 0; index < meshes.length; index++) { + if (meshes[index]) { + totalVertices += meshes[index].getTotalVertices(); + if (totalVertices > 65536) { + BABYLON.Tools.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"); + return null; + } + } + } + } + // Merge + var vertexData = null; + var otherVertexData; + var indiceArray = new Array(); + var source = null; + for (index = 0; index < meshes.length; index++) { + if (meshes[index]) { + var wm = meshes[index].computeWorldMatrix(true); + otherVertexData = BABYLON.VertexData.ExtractFromMesh(meshes[index], true, true); + otherVertexData.transform(wm); + if (vertexData) { + vertexData.merge(otherVertexData, allow32BitsIndices); + } + else { + vertexData = otherVertexData; + source = meshes[index]; + } + if (subdivideWithSubMeshes) { + indiceArray.push(meshes[index].getTotalIndices()); + } + } + } + source = source; + if (!meshSubclass) { + meshSubclass = new Mesh(source.name + "_merged", source.getScene()); + } + vertexData.applyToMesh(meshSubclass); + // Setting properties + meshSubclass.material = source.material; + meshSubclass.checkCollisions = source.checkCollisions; + // Cleaning + if (disposeSource) { + for (index = 0; index < meshes.length; index++) { + if (meshes[index]) { + meshes[index].dispose(); + } + } + } + // Subdivide + if (subdivideWithSubMeshes) { + //-- removal of global submesh + meshSubclass.releaseSubMeshes(); + index = 0; + var offset = 0; + //-- apply subdivision according to index table + while (index < indiceArray.length) { + BABYLON.SubMesh.CreateFromIndices(0, offset, indiceArray[index], meshSubclass); + offset += indiceArray[index]; + index++; + } + } + return meshSubclass; + }; + // Consts + /** + * Mesh side orientation : usually the external or front surface + */ + Mesh.FRONTSIDE = 0; + /** + * Mesh side orientation : usually the internal or back surface + */ + Mesh.BACKSIDE = 1; + /** + * Mesh side orientation : both internal and external or front and back surfaces + */ + Mesh.DOUBLESIDE = 2; + /** + * Mesh side orientation : by default, `FRONTSIDE` + */ + Mesh.DEFAULTSIDE = 0; + /** + * Mesh cap setting : no cap + */ + Mesh.NO_CAP = 0; + /** + * Mesh cap setting : one cap at the beginning of the mesh + */ + Mesh.CAP_START = 1; + /** + * Mesh cap setting : one cap at the end of the mesh + */ + Mesh.CAP_END = 2; + /** + * Mesh cap setting : two caps, one at the beginning and one at the end of the mesh + */ + Mesh.CAP_ALL = 3; + return Mesh; + }(BABYLON.AbstractMesh)); + BABYLON.Mesh = Mesh; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.mesh.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Base class for submeshes + */ + var BaseSubMesh = /** @class */ (function () { + function BaseSubMesh() { + } + Object.defineProperty(BaseSubMesh.prototype, "effect", { + /** + * Gets associated effect + */ + get: function () { + return this._materialEffect; + }, + enumerable: true, + configurable: true + }); + /** + * Sets associated effect (effect used to render this submesh) + * @param effect defines the effect to associate with + * @param defines defines the set of defines used to compile this effect + */ + BaseSubMesh.prototype.setEffect = function (effect, defines) { + if (defines === void 0) { defines = null; } + if (this._materialEffect === effect) { + if (!effect) { + this._materialDefines = null; + } + return; + } + this._materialDefines = defines; + this._materialEffect = effect; + }; + return BaseSubMesh; + }()); + BABYLON.BaseSubMesh = BaseSubMesh; + /** + * Defines a subdivision inside a mesh + */ + var SubMesh = /** @class */ (function (_super) { + __extends(SubMesh, _super); + /** + * Creates a new submesh + * @param materialIndex defines the material index to use + * @param verticesStart defines vertex index start + * @param verticesCount defines vertices count + * @param indexStart defines index start + * @param indexCount defines indices count + * @param mesh defines the parent mesh + * @param renderingMesh defines an optional rendering mesh + * @param createBoundingBox defines if bounding box should be created for this submesh + */ + function SubMesh( + /** the material index to use */ + materialIndex, + /** vertex index start */ + verticesStart, + /** vertices count */ + verticesCount, + /** index start */ + indexStart, + /** indices count */ + indexCount, mesh, renderingMesh, createBoundingBox) { + if (createBoundingBox === void 0) { createBoundingBox = true; } + var _this = _super.call(this) || this; + _this.materialIndex = materialIndex; + _this.verticesStart = verticesStart; + _this.verticesCount = verticesCount; + _this.indexStart = indexStart; + _this.indexCount = indexCount; + /** @hidden */ + _this._renderId = 0; + _this._mesh = mesh; + _this._renderingMesh = renderingMesh || mesh; + mesh.subMeshes.push(_this); + _this._trianglePlanes = []; + _this._id = mesh.subMeshes.length - 1; + if (createBoundingBox) { + _this.refreshBoundingInfo(); + mesh.computeWorldMatrix(true); + } + return _this; + } + /** + * Add a new submesh to a mesh + * @param materialIndex defines the material index to use + * @param verticesStart defines vertex index start + * @param verticesCount defines vertices count + * @param indexStart defines index start + * @param indexCount defines indices count + * @param mesh defines the parent mesh + * @param renderingMesh defines an optional rendering mesh + * @param createBoundingBox defines if bounding box should be created for this submesh + * @returns the new submesh + */ + SubMesh.AddToMesh = function (materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox) { + if (createBoundingBox === void 0) { createBoundingBox = true; } + return new SubMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox); + }; + Object.defineProperty(SubMesh.prototype, "IsGlobal", { + /** + * Returns true if this submesh covers the entire parent mesh + * @ignorenaming + */ + get: function () { + return (this.verticesStart === 0 && this.verticesCount === this._mesh.getTotalVertices()); + }, + enumerable: true, + configurable: true + }); + /** + * Returns the submesh BoudingInfo object + * @returns current bounding info (or mesh's one if the submesh is global) + */ + SubMesh.prototype.getBoundingInfo = function () { + if (this.IsGlobal) { + return this._mesh.getBoundingInfo(); + } + return this._boundingInfo; + }; + /** + * Sets the submesh BoundingInfo + * @param boundingInfo defines the new bounding info to use + * @returns the SubMesh + */ + SubMesh.prototype.setBoundingInfo = function (boundingInfo) { + this._boundingInfo = boundingInfo; + return this; + }; + /** + * Returns the mesh of the current submesh + * @return the parent mesh + */ + SubMesh.prototype.getMesh = function () { + return this._mesh; + }; + /** + * Returns the rendering mesh of the submesh + * @returns the rendering mesh (could be different from parent mesh) + */ + SubMesh.prototype.getRenderingMesh = function () { + return this._renderingMesh; + }; + /** + * Returns the submesh material + * @returns null or the current material + */ + SubMesh.prototype.getMaterial = function () { + var rootMaterial = this._renderingMesh.material; + if (rootMaterial === null || rootMaterial === undefined) { + return this._mesh.getScene().defaultMaterial; + } + else if (rootMaterial.getSubMaterial) { + var multiMaterial = rootMaterial; + var effectiveMaterial = multiMaterial.getSubMaterial(this.materialIndex); + if (this._currentMaterial !== effectiveMaterial) { + this._currentMaterial = effectiveMaterial; + this._materialDefines = null; + } + return effectiveMaterial; + } + return rootMaterial; + }; + // Methods + /** + * Sets a new updated BoundingInfo object to the submesh + * @returns the SubMesh + */ + SubMesh.prototype.refreshBoundingInfo = function () { + this._lastColliderWorldVertices = null; + if (this.IsGlobal || !this._renderingMesh || !this._renderingMesh.geometry) { + return this; + } + var data = this._renderingMesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (!data) { + this._boundingInfo = this._mesh.getBoundingInfo(); + return this; + } + var indices = this._renderingMesh.getIndices(); + var extend; + //is this the only submesh? + if (this.indexStart === 0 && this.indexCount === indices.length) { + var boundingInfo = this._renderingMesh.getBoundingInfo(); + //the rendering mesh's bounding info can be used, it is the standard submesh for all indices. + extend = { minimum: boundingInfo.minimum.clone(), maximum: boundingInfo.maximum.clone() }; + } + else { + extend = BABYLON.Tools.ExtractMinAndMaxIndexed(data, indices, this.indexStart, this.indexCount, this._renderingMesh.geometry.boundingBias); + } + this._boundingInfo = new BABYLON.BoundingInfo(extend.minimum, extend.maximum); + return this; + }; + /** @hidden */ + SubMesh.prototype._checkCollision = function (collider) { + var boundingInfo = this.getBoundingInfo(); + return boundingInfo._checkCollision(collider); + }; + /** + * Updates the submesh BoundingInfo + * @param world defines the world matrix to use to update the bounding info + * @returns the submesh + */ + SubMesh.prototype.updateBoundingInfo = function (world) { + var boundingInfo = this.getBoundingInfo(); + if (!boundingInfo) { + this.refreshBoundingInfo(); + boundingInfo = this.getBoundingInfo(); + } + boundingInfo.update(world); + return this; + }; + /** + * True is the submesh bounding box intersects the frustum defined by the passed array of planes. + * @param frustumPlanes defines the frustum planes + * @returns true if the submesh is intersecting with the frustum + */ + SubMesh.prototype.isInFrustum = function (frustumPlanes) { + var boundingInfo = this.getBoundingInfo(); + if (!boundingInfo) { + return false; + } + return boundingInfo.isInFrustum(frustumPlanes, this._mesh.cullingStrategy); + }; + /** + * True is the submesh bounding box is completely inside the frustum defined by the passed array of planes + * @param frustumPlanes defines the frustum planes + * @returns true if the submesh is inside the frustum + */ + SubMesh.prototype.isCompletelyInFrustum = function (frustumPlanes) { + var boundingInfo = this.getBoundingInfo(); + if (!boundingInfo) { + return false; + } + return boundingInfo.isCompletelyInFrustum(frustumPlanes); + }; + /** + * Renders the submesh + * @param enableAlphaMode defines if alpha needs to be used + * @returns the submesh + */ + SubMesh.prototype.render = function (enableAlphaMode) { + this._renderingMesh.render(this, enableAlphaMode); + return this; + }; + /** + * @hidden + */ + SubMesh.prototype._getLinesIndexBuffer = function (indices, engine) { + if (!this._linesIndexBuffer) { + var linesIndices = []; + for (var index = this.indexStart; index < this.indexStart + this.indexCount; index += 3) { + linesIndices.push(indices[index], indices[index + 1], indices[index + 1], indices[index + 2], indices[index + 2], indices[index]); + } + this._linesIndexBuffer = engine.createIndexBuffer(linesIndices); + this._linesIndexCount = linesIndices.length; + } + return this._linesIndexBuffer; + }; + /** + * Checks if the submesh intersects with a ray + * @param ray defines the ray to test + * @returns true is the passed ray intersects the submesh bounding box + */ + SubMesh.prototype.canIntersects = function (ray) { + var boundingInfo = this.getBoundingInfo(); + if (!boundingInfo) { + return false; + } + return ray.intersectsBox(boundingInfo.boundingBox); + }; + /** + * Intersects current submesh with a ray + * @param ray defines the ray to test + * @param positions defines mesh's positions array + * @param indices defines mesh's indices array + * @param fastCheck defines if only bounding info should be used + * @returns intersection info or null if no intersection + */ + SubMesh.prototype.intersects = function (ray, positions, indices, fastCheck) { + var material = this.getMaterial(); + if (!material) { + return null; + } + switch (material.fillMode) { + case BABYLON.Material.PointListDrawMode: + case BABYLON.Material.LineListDrawMode: + case BABYLON.Material.LineLoopDrawMode: + case BABYLON.Material.LineStripDrawMode: + case BABYLON.Material.TriangleFanDrawMode: + case BABYLON.Material.TriangleStripDrawMode: + return null; + } + // LineMesh first as it's also a Mesh... + if (BABYLON.LinesMesh) { + var mesh = this._mesh instanceof BABYLON.InstancedMesh ? this._mesh.sourceMesh : this._mesh; + if (mesh instanceof BABYLON.LinesMesh) { + var linesMesh = mesh; + return this._intersectLines(ray, positions, indices, linesMesh.intersectionThreshold, fastCheck); + } + } + return this._intersectTriangles(ray, positions, indices, fastCheck); + }; + /** @hidden */ + SubMesh.prototype._intersectLines = function (ray, positions, indices, intersectionThreshold, fastCheck) { + var intersectInfo = null; + // Line test + for (var index = this.indexStart; index < this.indexStart + this.indexCount; index += 2) { + var p0 = positions[indices[index]]; + var p1 = positions[indices[index + 1]]; + var length = ray.intersectionSegment(p0, p1, intersectionThreshold); + if (length < 0) { + continue; + } + if (fastCheck || !intersectInfo || length < intersectInfo.distance) { + intersectInfo = new BABYLON.IntersectionInfo(null, null, length); + if (fastCheck) { + break; + } + } + } + return intersectInfo; + }; + /** @hidden */ + SubMesh.prototype._intersectTriangles = function (ray, positions, indices, fastCheck) { + var intersectInfo = null; + // Triangles test + for (var index = this.indexStart; index < this.indexStart + this.indexCount; index += 3) { + var p0 = positions[indices[index]]; + var p1 = positions[indices[index + 1]]; + var p2 = positions[indices[index + 2]]; + var currentIntersectInfo = ray.intersectsTriangle(p0, p1, p2); + if (currentIntersectInfo) { + if (currentIntersectInfo.distance < 0) { + continue; + } + if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) { + intersectInfo = currentIntersectInfo; + intersectInfo.faceId = index / 3; + if (fastCheck) { + break; + } + } + } + } + return intersectInfo; + }; + /** @hidden */ + SubMesh.prototype._rebuild = function () { + if (this._linesIndexBuffer) { + this._linesIndexBuffer = null; + } + }; + // Clone + /** + * Creates a new submesh from the passed mesh + * @param newMesh defines the new hosting mesh + * @param newRenderingMesh defines an optional rendering mesh + * @returns the new submesh + */ + SubMesh.prototype.clone = function (newMesh, newRenderingMesh) { + var result = new SubMesh(this.materialIndex, this.verticesStart, this.verticesCount, this.indexStart, this.indexCount, newMesh, newRenderingMesh, false); + if (!this.IsGlobal) { + var boundingInfo = this.getBoundingInfo(); + if (!boundingInfo) { + return result; + } + result._boundingInfo = new BABYLON.BoundingInfo(boundingInfo.minimum, boundingInfo.maximum); + } + return result; + }; + // Dispose + /** + * Release associated resources + */ + SubMesh.prototype.dispose = function () { + if (this._linesIndexBuffer) { + this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer); + this._linesIndexBuffer = null; + } + // Remove from mesh + var index = this._mesh.subMeshes.indexOf(this); + this._mesh.subMeshes.splice(index, 1); + }; + // Statics + /** + * Creates a new submesh from indices data + * @param materialIndex the index of the main mesh material + * @param startIndex the index where to start the copy in the mesh indices array + * @param indexCount the number of indices to copy then from the startIndex + * @param mesh the main mesh to create the submesh from + * @param renderingMesh the optional rendering mesh + * @returns a new submesh + */ + SubMesh.CreateFromIndices = function (materialIndex, startIndex, indexCount, mesh, renderingMesh) { + var minVertexIndex = Number.MAX_VALUE; + var maxVertexIndex = -Number.MAX_VALUE; + renderingMesh = (renderingMesh || mesh); + var indices = renderingMesh.getIndices(); + for (var index = startIndex; index < startIndex + indexCount; index++) { + var vertexIndex = indices[index]; + if (vertexIndex < minVertexIndex) { + minVertexIndex = vertexIndex; + } + if (vertexIndex > maxVertexIndex) { + maxVertexIndex = vertexIndex; + } + } + return new SubMesh(materialIndex, minVertexIndex, maxVertexIndex - minVertexIndex + 1, startIndex, indexCount, mesh, renderingMesh); + }; + return SubMesh; + }(BaseSubMesh)); + BABYLON.SubMesh = SubMesh; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.subMesh.js.map + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; + +var BABYLON; +(function (BABYLON) { + /** + * Manages the defines for the Material + */ + var MaterialDefines = /** @class */ (function () { + function MaterialDefines() { + this._isDirty = true; + /** @hidden */ + this._areLightsDirty = true; + /** @hidden */ + this._areAttributesDirty = true; + /** @hidden */ + this._areTexturesDirty = true; + /** @hidden */ + this._areFresnelDirty = true; + /** @hidden */ + this._areMiscDirty = true; + /** @hidden */ + this._areImageProcessingDirty = true; + /** @hidden */ + this._normals = false; + /** @hidden */ + this._uvs = false; + /** @hidden */ + this._needNormals = false; + /** @hidden */ + this._needUVs = false; + } + Object.defineProperty(MaterialDefines.prototype, "isDirty", { + /** + * Specifies if the material needs to be re-calculated + */ + get: function () { + return this._isDirty; + }, + enumerable: true, + configurable: true + }); + /** + * Marks the material to indicate that it has been re-calculated + */ + MaterialDefines.prototype.markAsProcessed = function () { + this._isDirty = false; + this._areAttributesDirty = false; + this._areTexturesDirty = false; + this._areFresnelDirty = false; + this._areLightsDirty = false; + this._areMiscDirty = false; + this._areImageProcessingDirty = false; + }; + /** + * Marks the material to indicate that it needs to be re-calculated + */ + MaterialDefines.prototype.markAsUnprocessed = function () { + this._isDirty = true; + }; + /** + * Marks the material to indicate all of its defines need to be re-calculated + */ + MaterialDefines.prototype.markAllAsDirty = function () { + this._areTexturesDirty = true; + this._areAttributesDirty = true; + this._areLightsDirty = true; + this._areFresnelDirty = true; + this._areMiscDirty = true; + this._areImageProcessingDirty = true; + this._isDirty = true; + }; + /** + * Marks the material to indicate that image processing needs to be re-calculated + */ + MaterialDefines.prototype.markAsImageProcessingDirty = function () { + this._areImageProcessingDirty = true; + this._isDirty = true; + }; + /** + * Marks the material to indicate the lights need to be re-calculated + */ + MaterialDefines.prototype.markAsLightDirty = function () { + this._areLightsDirty = true; + this._isDirty = true; + }; + /** + * Marks the attribute state as changed + */ + MaterialDefines.prototype.markAsAttributesDirty = function () { + this._areAttributesDirty = true; + this._isDirty = true; + }; + /** + * Marks the texture state as changed + */ + MaterialDefines.prototype.markAsTexturesDirty = function () { + this._areTexturesDirty = true; + this._isDirty = true; + }; + /** + * Marks the fresnel state as changed + */ + MaterialDefines.prototype.markAsFresnelDirty = function () { + this._areFresnelDirty = true; + this._isDirty = true; + }; + /** + * Marks the misc state as changed + */ + MaterialDefines.prototype.markAsMiscDirty = function () { + this._areMiscDirty = true; + this._isDirty = true; + }; + /** + * Rebuilds the material defines + */ + MaterialDefines.prototype.rebuild = function () { + if (this._keys) { + delete this._keys; + } + this._keys = []; + for (var _i = 0, _a = Object.keys(this); _i < _a.length; _i++) { + var key = _a[_i]; + if (key[0] === "_") { + continue; + } + this._keys.push(key); + } + }; + /** + * Specifies if two material defines are equal + * @param other - A material define instance to compare to + * @returns - Boolean indicating if the material defines are equal (true) or not (false) + */ + MaterialDefines.prototype.isEqual = function (other) { + if (this._keys.length !== other._keys.length) { + return false; + } + for (var index = 0; index < this._keys.length; index++) { + var prop = this._keys[index]; + if (this[prop] !== other[prop]) { + return false; + } + } + return true; + }; + /** + * Clones this instance's defines to another instance + * @param other - material defines to clone values to + */ + MaterialDefines.prototype.cloneTo = function (other) { + if (this._keys.length !== other._keys.length) { + other._keys = this._keys.slice(0); + } + for (var index = 0; index < this._keys.length; index++) { + var prop = this._keys[index]; + other[prop] = this[prop]; + } + }; + /** + * Resets the material define values + */ + MaterialDefines.prototype.reset = function () { + for (var index = 0; index < this._keys.length; index++) { + var prop = this._keys[index]; + var type = typeof this[prop]; + switch (type) { + case "number": + this[prop] = 0; + break; + case "string": + this[prop] = ""; + break; + default: + this[prop] = false; + break; + } + } + }; + /** + * Converts the material define values to a string + * @returns - String of material define information + */ + MaterialDefines.prototype.toString = function () { + var result = ""; + for (var index = 0; index < this._keys.length; index++) { + var prop = this._keys[index]; + var value = this[prop]; + var type = typeof value; + switch (type) { + case "number": + case "string": + result += "#define " + prop + " " + value + "\n"; + break; + default: + if (value) { + result += "#define " + prop + "\n"; + } + break; + } + } + return result; + }; + return MaterialDefines; + }()); + BABYLON.MaterialDefines = MaterialDefines; + /** + * Base class for the main features of a material in Babylon.js + */ + var Material = /** @class */ (function () { + /** + * Creates a material instance + * @param name defines the name of the material + * @param scene defines the scene to reference + * @param doNotAdd specifies if the material should be added to the scene + */ + function Material(name, scene, doNotAdd) { + /** + * Specifies if the ready state should be checked on each call + */ + this.checkReadyOnEveryCall = false; + /** + * Specifies if the ready state should be checked once + */ + this.checkReadyOnlyOnce = false; + /** + * The state of the material + */ + this.state = ""; + /** + * The alpha value of the material + */ + this._alpha = 1.0; + /** + * Specifies if back face culling is enabled + */ + this._backFaceCulling = true; + /** + * Specifies if the material should be serialized + */ + this.doNotSerialize = false; + /** + * Specifies if the effect should be stored on sub meshes + */ + this.storeEffectOnSubMeshes = false; + /** + * An event triggered when the material is disposed + */ + this.onDisposeObservable = new BABYLON.Observable(); + /** + * Stores the value of the alpha mode + */ + this._alphaMode = BABYLON.Engine.ALPHA_COMBINE; + /** + * Stores the state of the need depth pre-pass value + */ + this._needDepthPrePass = false; + /** + * Specifies if depth writing should be disabled + */ + this.disableDepthWrite = false; + /** + * Specifies if depth writing should be forced + */ + this.forceDepthWrite = false; + /** + * Specifies if there should be a separate pass for culling + */ + this.separateCullingPass = false; + /** + * Stores the state specifing if fog should be enabled + */ + this._fogEnabled = true; + /** + * Stores the size of points + */ + this.pointSize = 1.0; + /** + * Stores the z offset value + */ + this.zOffset = 0; + /** + * @hidden + * Specifies if the material was previously ready + */ + this._wasPreviouslyReady = false; + /** + * Stores the fill mode state + */ + this._fillMode = Material.TriangleFillMode; + this.name = name; + this.id = name || BABYLON.Tools.RandomId(); + this._scene = scene || BABYLON.Engine.LastCreatedScene; + this.uniqueId = this._scene.getUniqueId(); + if (this._scene.useRightHandedSystem) { + this.sideOrientation = Material.ClockWiseSideOrientation; + } + else { + this.sideOrientation = Material.CounterClockWiseSideOrientation; + } + this._uniformBuffer = new BABYLON.UniformBuffer(this._scene.getEngine()); + this._useUBO = this.getScene().getEngine().supportsUniformBuffers; + if (!doNotAdd) { + this._scene.materials.push(this); + this._scene.onNewMaterialAddedObservable.notifyObservers(this); + } + } + Object.defineProperty(Material, "TriangleFillMode", { + /** + * Returns the triangle fill mode + */ + get: function () { + return Material._TriangleFillMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "WireFrameFillMode", { + /** + * Returns the wireframe mode + */ + get: function () { + return Material._WireFrameFillMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "PointFillMode", { + /** + * Returns the point fill mode + */ + get: function () { + return Material._PointFillMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "PointListDrawMode", { + /** + * Returns the point list draw mode + */ + get: function () { + return Material._PointListDrawMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "LineListDrawMode", { + /** + * Returns the line list draw mode + */ + get: function () { + return Material._LineListDrawMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "LineLoopDrawMode", { + /** + * Returns the line loop draw mode + */ + get: function () { + return Material._LineLoopDrawMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "LineStripDrawMode", { + /** + * Returns the line strip draw mode + */ + get: function () { + return Material._LineStripDrawMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "TriangleStripDrawMode", { + /** + * Returns the triangle strip draw mode + */ + get: function () { + return Material._TriangleStripDrawMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "TriangleFanDrawMode", { + /** + * Returns the triangle fan draw mode + */ + get: function () { + return Material._TriangleFanDrawMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "ClockWiseSideOrientation", { + /** + * Returns the clock-wise side orientation + */ + get: function () { + return Material._ClockWiseSideOrientation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material, "CounterClockWiseSideOrientation", { + /** + * Returns the counter clock-wise side orientation + */ + get: function () { + return Material._CounterClockWiseSideOrientation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "alpha", { + /** + * Gets the alpha value of the material + */ + get: function () { + return this._alpha; + }, + /** + * Sets the alpha value of the material + */ + set: function (value) { + if (this._alpha === value) { + return; + } + this._alpha = value; + this.markAsDirty(Material.MiscDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "backFaceCulling", { + /** + * Gets the back-face culling state + */ + get: function () { + return this._backFaceCulling; + }, + /** + * Sets the back-face culling state + */ + set: function (value) { + if (this._backFaceCulling === value) { + return; + } + this._backFaceCulling = value; + this.markAsDirty(Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "hasRenderTargetTextures", { + /** + * Gets a boolean indicating that current material needs to register RTT + */ + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "onDispose", { + /** + * Called during a dispose event + */ + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "onBindObservable", { + /** + * An event triggered when the material is bound + */ + get: function () { + if (!this._onBindObservable) { + this._onBindObservable = new BABYLON.Observable(); + } + return this._onBindObservable; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "onBind", { + /** + * Called during a bind event + */ + set: function (callback) { + if (this._onBindObserver) { + this.onBindObservable.remove(this._onBindObserver); + } + this._onBindObserver = this.onBindObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "onUnBindObservable", { + /** + * An event triggered when the material is unbound + */ + get: function () { + if (!this._onUnBindObservable) { + this._onUnBindObservable = new BABYLON.Observable(); + } + return this._onUnBindObservable; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "alphaMode", { + /** + * Gets the value of the alpha mode + */ + get: function () { + return this._alphaMode; + }, + /** + * Sets the value of the alpha mode. + * + * | Value | Type | Description | + * | --- | --- | --- | + * | 0 | ALPHA_DISABLE | | + * | 1 | ALPHA_ADD | | + * | 2 | ALPHA_COMBINE | | + * | 3 | ALPHA_SUBTRACT | | + * | 4 | ALPHA_MULTIPLY | | + * | 5 | ALPHA_MAXIMIZED | | + * | 6 | ALPHA_ONEONE | | + * | 7 | ALPHA_PREMULTIPLIED | | + * | 8 | ALPHA_PREMULTIPLIED_PORTERDUFF | | + * | 9 | ALPHA_INTERPOLATE | | + * | 10 | ALPHA_SCREENMODE | | + * + */ + set: function (value) { + if (this._alphaMode === value) { + return; + } + this._alphaMode = value; + this.markAsDirty(Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "needDepthPrePass", { + /** + * Gets the depth pre-pass value + */ + get: function () { + return this._needDepthPrePass; + }, + /** + * Sets the need depth pre-pass value + */ + set: function (value) { + if (this._needDepthPrePass === value) { + return; + } + this._needDepthPrePass = value; + if (this._needDepthPrePass) { + this.checkReadyOnEveryCall = true; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "fogEnabled", { + /** + * Gets the value of the fog enabled state + */ + get: function () { + return this._fogEnabled; + }, + /** + * Sets the state for enabling fog + */ + set: function (value) { + if (this._fogEnabled === value) { + return; + } + this._fogEnabled = value; + this.markAsDirty(Material.MiscDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "wireframe", { + /** + * Gets a value specifying if wireframe mode is enabled + */ + get: function () { + switch (this._fillMode) { + case Material.WireFrameFillMode: + case Material.LineListDrawMode: + case Material.LineLoopDrawMode: + case Material.LineStripDrawMode: + return true; + } + return this._scene.forceWireframe; + }, + /** + * Sets the state of wireframe mode + */ + set: function (value) { + this.fillMode = (value ? Material.WireFrameFillMode : Material.TriangleFillMode); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "pointsCloud", { + /** + * Gets the value specifying if point clouds are enabled + */ + get: function () { + switch (this._fillMode) { + case Material.PointFillMode: + case Material.PointListDrawMode: + return true; + } + return this._scene.forcePointsCloud; + }, + /** + * Sets the state of point cloud mode + */ + set: function (value) { + this.fillMode = (value ? Material.PointFillMode : Material.TriangleFillMode); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Material.prototype, "fillMode", { + /** + * Gets the material fill mode + */ + get: function () { + return this._fillMode; + }, + /** + * Sets the material fill mode + */ + set: function (value) { + if (this._fillMode === value) { + return; + } + this._fillMode = value; + this.markAsDirty(Material.MiscDirtyFlag); + }, + enumerable: true, + configurable: true + }); + /** + * Returns a string representation of the current material + * @param fullDetails defines a boolean indicating which levels of logging is desired + * @returns a string with material information + */ + Material.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name; + if (fullDetails) { + } + return ret; + }; + /** + * Gets the class name of the material + * @returns a string with the class name of the material + */ + Material.prototype.getClassName = function () { + return "Material"; + }; + Object.defineProperty(Material.prototype, "isFrozen", { + /** + * Specifies if updates for the material been locked + */ + get: function () { + return this.checkReadyOnlyOnce; + }, + enumerable: true, + configurable: true + }); + /** + * Locks updates for the material + */ + Material.prototype.freeze = function () { + this.checkReadyOnlyOnce = true; + }; + /** + * Unlocks updates for the material + */ + Material.prototype.unfreeze = function () { + this.checkReadyOnlyOnce = false; + }; + /** + * Specifies if the material is ready to be used + * @param mesh defines the mesh to check + * @param useInstances specifies if instances should be used + * @returns a boolean indicating if the material is ready to be used + */ + Material.prototype.isReady = function (mesh, useInstances) { + return true; + }; + /** + * Specifies that the submesh is ready to be used + * @param mesh defines the mesh to check + * @param subMesh defines which submesh to check + * @param useInstances specifies that instances should be used + * @returns a boolean indicating that the submesh is ready or not + */ + Material.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + return false; + }; + /** + * Returns the material effect + * @returns the effect associated with the material + */ + Material.prototype.getEffect = function () { + return this._effect; + }; + /** + * Returns the current scene + * @returns a Scene + */ + Material.prototype.getScene = function () { + return this._scene; + }; + /** + * Specifies if the material will require alpha blending + * @returns a boolean specifying if alpha blending is needed + */ + Material.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + /** + * Specifies if the mesh will require alpha blending + * @param mesh defines the mesh to check + * @returns a boolean specifying if alpha blending is needed for the mesh + */ + Material.prototype.needAlphaBlendingForMesh = function (mesh) { + return this.needAlphaBlending() || (mesh.visibility < 1.0) || mesh.hasVertexAlpha; + }; + /** + * Specifies if this material should be rendered in alpha test mode + * @returns a boolean specifying if an alpha test is needed. + */ + Material.prototype.needAlphaTesting = function () { + return false; + }; + /** + * Gets the texture used for the alpha test + * @returns the texture to use for alpha testing + */ + Material.prototype.getAlphaTestTexture = function () { + return null; + }; + /** + * Marks the material to indicate that it needs to be re-calculated + */ + Material.prototype.markDirty = function () { + this._wasPreviouslyReady = false; + }; + /** @hidden */ + Material.prototype._preBind = function (effect, overrideOrientation) { + if (overrideOrientation === void 0) { overrideOrientation = null; } + var engine = this._scene.getEngine(); + var orientation = (overrideOrientation == null) ? this.sideOrientation : overrideOrientation; + var reverse = orientation === Material.ClockWiseSideOrientation; + engine.enableEffect(effect ? effect : this._effect); + engine.setState(this.backFaceCulling, this.zOffset, false, reverse); + return reverse; + }; + /** + * Binds the material to the mesh + * @param world defines the world transformation matrix + * @param mesh defines the mesh to bind the material to + */ + Material.prototype.bind = function (world, mesh) { + }; + /** + * Binds the submesh to the material + * @param world defines the world transformation matrix + * @param mesh defines the mesh containing the submesh + * @param subMesh defines the submesh to bind the material to + */ + Material.prototype.bindForSubMesh = function (world, mesh, subMesh) { + }; + /** + * Binds the world matrix to the material + * @param world defines the world transformation matrix + */ + Material.prototype.bindOnlyWorldMatrix = function (world) { + }; + /** + * Binds the scene's uniform buffer to the effect. + * @param effect defines the effect to bind to the scene uniform buffer + * @param sceneUbo defines the uniform buffer storing scene data + */ + Material.prototype.bindSceneUniformBuffer = function (effect, sceneUbo) { + sceneUbo.bindToEffect(effect, "Scene"); + }; + /** + * Binds the view matrix to the effect + * @param effect defines the effect to bind the view matrix to + */ + Material.prototype.bindView = function (effect) { + if (!this._useUBO) { + effect.setMatrix("view", this.getScene().getViewMatrix()); + } + else { + this.bindSceneUniformBuffer(effect, this.getScene().getSceneUniformBuffer()); + } + }; + /** + * Binds the view projection matrix to the effect + * @param effect defines the effect to bind the view projection matrix to + */ + Material.prototype.bindViewProjection = function (effect) { + if (!this._useUBO) { + effect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); + } + else { + this.bindSceneUniformBuffer(effect, this.getScene().getSceneUniformBuffer()); + } + }; + /** + * Specifies if material alpha testing should be turned on for the mesh + * @param mesh defines the mesh to check + */ + Material.prototype._shouldTurnAlphaTestOn = function (mesh) { + return (!this.needAlphaBlendingForMesh(mesh) && this.needAlphaTesting()); + }; + /** + * Processes to execute after binding the material to a mesh + * @param mesh defines the rendered mesh + */ + Material.prototype._afterBind = function (mesh) { + this._scene._cachedMaterial = this; + if (mesh) { + this._scene._cachedVisibility = mesh.visibility; + } + else { + this._scene._cachedVisibility = 1; + } + if (this._onBindObservable && mesh) { + this._onBindObservable.notifyObservers(mesh); + } + if (this.disableDepthWrite) { + var engine = this._scene.getEngine(); + this._cachedDepthWriteState = engine.getDepthWrite(); + engine.setDepthWrite(false); + } + }; + /** + * Unbinds the material from the mesh + */ + Material.prototype.unbind = function () { + if (this._onUnBindObservable) { + this._onUnBindObservable.notifyObservers(this); + } + if (this.disableDepthWrite) { + var engine = this._scene.getEngine(); + engine.setDepthWrite(this._cachedDepthWriteState); + } + }; + /** + * Gets the active textures from the material + * @returns an array of textures + */ + Material.prototype.getActiveTextures = function () { + return []; + }; + /** + * Specifies if the material uses a texture + * @param texture defines the texture to check against the material + * @returns a boolean specifying if the material uses the texture + */ + Material.prototype.hasTexture = function (texture) { + return false; + }; + /** + * Makes a duplicate of the material, and gives it a new name + * @param name defines the new name for the duplicated material + * @returns the cloned material + */ + Material.prototype.clone = function (name) { + return null; + }; + /** + * Gets the meshes bound to the material + * @returns an array of meshes bound to the material + */ + Material.prototype.getBindedMeshes = function () { + var result = new Array(); + for (var index = 0; index < this._scene.meshes.length; index++) { + var mesh = this._scene.meshes[index]; + if (mesh.material === this) { + result.push(mesh); + } + } + return result; + }; + /** + * Force shader compilation + * @param mesh defines the mesh associated with this material + * @param onCompiled defines a function to execute once the material is compiled + * @param options defines the options to configure the compilation + */ + Material.prototype.forceCompilation = function (mesh, onCompiled, options) { + var _this = this; + var localOptions = __assign({ clipPlane: false }, options); + var subMesh = new BABYLON.BaseSubMesh(); + var scene = this.getScene(); + var checkReady = function () { + if (!_this._scene || !_this._scene.getEngine()) { + return; + } + if (subMesh._materialDefines) { + subMesh._materialDefines._renderId = -1; + } + var clipPlaneState = scene.clipPlane; + if (localOptions.clipPlane) { + scene.clipPlane = new BABYLON.Plane(0, 0, 0, 1); + } + if (_this.storeEffectOnSubMeshes) { + if (_this.isReadyForSubMesh(mesh, subMesh)) { + if (onCompiled) { + onCompiled(_this); + } + } + else { + setTimeout(checkReady, 16); + } + } + else { + if (_this.isReady(mesh)) { + if (onCompiled) { + onCompiled(_this); + } + } + else { + setTimeout(checkReady, 16); + } + } + if (localOptions.clipPlane) { + scene.clipPlane = clipPlaneState; + } + }; + checkReady(); + }; + /** + * Force shader compilation + * @param mesh defines the mesh that will use this material + * @param options defines additional options for compiling the shaders + * @returns a promise that resolves when the compilation completes + */ + Material.prototype.forceCompilationAsync = function (mesh, options) { + var _this = this; + return new Promise(function (resolve) { + _this.forceCompilation(mesh, function () { + resolve(); + }, options); + }); + }; + /** + * Marks a define in the material to indicate that it needs to be re-computed + * @param flag defines a flag used to determine which parts of the material have to be marked as dirty + */ + Material.prototype.markAsDirty = function (flag) { + if (flag & Material.TextureDirtyFlag) { + this._markAllSubMeshesAsTexturesDirty(); + } + if (flag & Material.LightDirtyFlag) { + this._markAllSubMeshesAsLightsDirty(); + } + if (flag & Material.FresnelDirtyFlag) { + this._markAllSubMeshesAsFresnelDirty(); + } + if (flag & Material.AttributesDirtyFlag) { + this._markAllSubMeshesAsAttributesDirty(); + } + if (flag & Material.MiscDirtyFlag) { + this._markAllSubMeshesAsMiscDirty(); + } + this.getScene().resetCachedMaterial(); + }; + /** + * Marks all submeshes of a material to indicate that their material defines need to be re-calculated + * @param func defines a function which checks material defines against the submeshes + */ + Material.prototype._markAllSubMeshesAsDirty = function (func) { + for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) { + var mesh = _a[_i]; + if (!mesh.subMeshes) { + continue; + } + for (var _b = 0, _c = mesh.subMeshes; _b < _c.length; _b++) { + var subMesh = _c[_b]; + if (subMesh.getMaterial() !== this) { + continue; + } + if (!subMesh._materialDefines) { + continue; + } + func(subMesh._materialDefines); + } + } + }; + /** + * Indicates that image processing needs to be re-calculated for all submeshes + */ + Material.prototype._markAllSubMeshesAsImageProcessingDirty = function () { + this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsImageProcessingDirty(); }); + }; + /** + * Indicates that textures need to be re-calculated for all submeshes + */ + Material.prototype._markAllSubMeshesAsTexturesDirty = function () { + this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsTexturesDirty(); }); + }; + /** + * Indicates that fresnel needs to be re-calculated for all submeshes + */ + Material.prototype._markAllSubMeshesAsFresnelDirty = function () { + this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsFresnelDirty(); }); + }; + /** + * Indicates that fresnel and misc need to be re-calculated for all submeshes + */ + Material.prototype._markAllSubMeshesAsFresnelAndMiscDirty = function () { + this._markAllSubMeshesAsDirty(function (defines) { + defines.markAsFresnelDirty(); + defines.markAsMiscDirty(); + }); + }; + /** + * Indicates that lights need to be re-calculated for all submeshes + */ + Material.prototype._markAllSubMeshesAsLightsDirty = function () { + this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsLightDirty(); }); + }; + /** + * Indicates that attributes need to be re-calculated for all submeshes + */ + Material.prototype._markAllSubMeshesAsAttributesDirty = function () { + this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsAttributesDirty(); }); + }; + /** + * Indicates that misc needs to be re-calculated for all submeshes + */ + Material.prototype._markAllSubMeshesAsMiscDirty = function () { + this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsMiscDirty(); }); + }; + /** + * Indicates that textures and misc need to be re-calculated for all submeshes + */ + Material.prototype._markAllSubMeshesAsTexturesAndMiscDirty = function () { + this._markAllSubMeshesAsDirty(function (defines) { + defines.markAsTexturesDirty(); + defines.markAsMiscDirty(); + }); + }; + /** + * Disposes the material + * @param forceDisposeEffect specifies if effects should be forcefully disposed + * @param forceDisposeTextures specifies if textures should be forcefully disposed + */ + Material.prototype.dispose = function (forceDisposeEffect, forceDisposeTextures) { + // Animations + this.getScene().stopAnimation(this); + this.getScene().freeProcessedMaterials(); + // Remove from scene + var index = this._scene.materials.indexOf(this); + if (index >= 0) { + this._scene.materials.splice(index, 1); + } + this._scene.onMaterialRemovedObservable.notifyObservers(this); + // Remove from meshes + for (index = 0; index < this._scene.meshes.length; index++) { + var mesh = this._scene.meshes[index]; + if (mesh.material === this) { + mesh.material = null; + if (mesh.geometry) { + var geometry = (mesh.geometry); + if (this.storeEffectOnSubMeshes) { + for (var _i = 0, _a = mesh.subMeshes; _i < _a.length; _i++) { + var subMesh = _a[_i]; + geometry._releaseVertexArrayObject(subMesh._materialEffect); + if (forceDisposeEffect && subMesh._materialEffect) { + this._scene.getEngine()._releaseEffect(subMesh._materialEffect); + } + } + } + else { + geometry._releaseVertexArrayObject(this._effect); + } + } + } + } + this._uniformBuffer.dispose(); + // Shader are kept in cache for further use but we can get rid of this by using forceDisposeEffect + if (forceDisposeEffect && this._effect) { + if (!this.storeEffectOnSubMeshes) { + this._scene.getEngine()._releaseEffect(this._effect); + } + this._effect = null; + } + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + if (this._onBindObservable) { + this._onBindObservable.clear(); + } + if (this._onUnBindObservable) { + this._onUnBindObservable.clear(); + } + }; + /** + * Serializes this material + * @returns the serialized material object + */ + Material.prototype.serialize = function () { + return BABYLON.SerializationHelper.Serialize(this); + }; + /** + * Creates a MultiMaterial from parsed MultiMaterial data. + * @param parsedMultiMaterial defines parsed MultiMaterial data. + * @param scene defines the hosting scene + * @returns a new MultiMaterial + */ + Material.ParseMultiMaterial = function (parsedMultiMaterial, scene) { + var multiMaterial = new BABYLON.MultiMaterial(parsedMultiMaterial.name, scene); + multiMaterial.id = parsedMultiMaterial.id; + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(multiMaterial, parsedMultiMaterial.tags); + } + for (var matIndex = 0; matIndex < parsedMultiMaterial.materials.length; matIndex++) { + var subMatId = parsedMultiMaterial.materials[matIndex]; + if (subMatId) { + multiMaterial.subMaterials.push(scene.getMaterialByID(subMatId)); + } + else { + multiMaterial.subMaterials.push(null); + } + } + return multiMaterial; + }; + /** + * Creates a material from parsed material data + * @param parsedMaterial defines parsed material data + * @param scene defines the hosting scene + * @param rootUrl defines the root URL to use to load textures + * @returns a new material + */ + Material.Parse = function (parsedMaterial, scene, rootUrl) { + if (!parsedMaterial.customType || parsedMaterial.customType === "BABYLON.StandardMaterial") { + return BABYLON.StandardMaterial.Parse(parsedMaterial, scene, rootUrl); + } + if (parsedMaterial.customType === "BABYLON.PBRMaterial" && parsedMaterial.overloadedAlbedo) { + parsedMaterial.customType = "BABYLON.LegacyPBRMaterial"; + if (!BABYLON.LegacyPBRMaterial) { + BABYLON.Tools.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."); + return; + } + } + var materialType = BABYLON.Tools.Instantiate(parsedMaterial.customType); + return materialType.Parse(parsedMaterial, scene, rootUrl); + }; + // Triangle views + Material._TriangleFillMode = 0; + Material._WireFrameFillMode = 1; + Material._PointFillMode = 2; + // Draw modes + Material._PointListDrawMode = 3; + Material._LineListDrawMode = 4; + Material._LineLoopDrawMode = 5; + Material._LineStripDrawMode = 6; + Material._TriangleStripDrawMode = 7; + Material._TriangleFanDrawMode = 8; + /** + * Stores the clock-wise side orientation + */ + Material._ClockWiseSideOrientation = 0; + /** + * Stores the counter clock-wise side orientation + */ + Material._CounterClockWiseSideOrientation = 1; + /** + * The dirty texture flag value + */ + Material.TextureDirtyFlag = 1; + /** + * The dirty light flag value + */ + Material.LightDirtyFlag = 2; + /** + * The dirty fresnel flag value + */ + Material.FresnelDirtyFlag = 4; + /** + * The dirty attribute flag value + */ + Material.AttributesDirtyFlag = 8; + /** + * The dirty misc flag value + */ + Material.MiscDirtyFlag = 16; + /** + * The all dirty flag value + */ + Material.AllDirtyFlag = 31; + __decorate([ + BABYLON.serialize() + ], Material.prototype, "id", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "uniqueId", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "name", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "checkReadyOnEveryCall", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "checkReadyOnlyOnce", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "state", void 0); + __decorate([ + BABYLON.serialize("alpha") + ], Material.prototype, "_alpha", void 0); + __decorate([ + BABYLON.serialize("backFaceCulling") + ], Material.prototype, "_backFaceCulling", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "sideOrientation", void 0); + __decorate([ + BABYLON.serialize("alphaMode") + ], Material.prototype, "_alphaMode", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "_needDepthPrePass", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "disableDepthWrite", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "forceDepthWrite", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "separateCullingPass", void 0); + __decorate([ + BABYLON.serialize("fogEnabled") + ], Material.prototype, "_fogEnabled", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "pointSize", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "zOffset", void 0); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "wireframe", null); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "pointsCloud", null); + __decorate([ + BABYLON.serialize() + ], Material.prototype, "fillMode", null); + return Material; + }()); + BABYLON.Material = Material; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.material.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Uniform buffer objects. + * + * Handles blocks of uniform on the GPU. + * + * If WebGL 2 is not available, this class falls back on traditionnal setUniformXXX calls. + * + * For more information, please refer to : + * https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object + */ + var UniformBuffer = /** @class */ (function () { + /** + * Instantiates a new Uniform buffer objects. + * + * Handles blocks of uniform on the GPU. + * + * If WebGL 2 is not available, this class falls back on traditionnal setUniformXXX calls. + * + * For more information, please refer to : + * @see https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object + * @param engine Define the engine the buffer is associated with + * @param data Define the data contained in the buffer + * @param dynamic Define if the buffer is updatable + */ + function UniformBuffer(engine, data, dynamic) { + this._engine = engine; + this._noUBO = !engine.supportsUniformBuffers; + this._dynamic = dynamic; + this._data = data || []; + this._uniformLocations = {}; + this._uniformSizes = {}; + this._uniformLocationPointer = 0; + this._needSync = false; + if (this._noUBO) { + this.updateMatrix3x3 = this._updateMatrix3x3ForEffect; + this.updateMatrix2x2 = this._updateMatrix2x2ForEffect; + this.updateFloat = this._updateFloatForEffect; + this.updateFloat2 = this._updateFloat2ForEffect; + this.updateFloat3 = this._updateFloat3ForEffect; + this.updateFloat4 = this._updateFloat4ForEffect; + this.updateMatrix = this._updateMatrixForEffect; + this.updateVector3 = this._updateVector3ForEffect; + this.updateVector4 = this._updateVector4ForEffect; + this.updateColor3 = this._updateColor3ForEffect; + this.updateColor4 = this._updateColor4ForEffect; + } + else { + this._engine._uniformBuffers.push(this); + this.updateMatrix3x3 = this._updateMatrix3x3ForUniform; + this.updateMatrix2x2 = this._updateMatrix2x2ForUniform; + this.updateFloat = this._updateFloatForUniform; + this.updateFloat2 = this._updateFloat2ForUniform; + this.updateFloat3 = this._updateFloat3ForUniform; + this.updateFloat4 = this._updateFloat4ForUniform; + this.updateMatrix = this._updateMatrixForUniform; + this.updateVector3 = this._updateVector3ForUniform; + this.updateVector4 = this._updateVector4ForUniform; + this.updateColor3 = this._updateColor3ForUniform; + this.updateColor4 = this._updateColor4ForUniform; + } + } + Object.defineProperty(UniformBuffer.prototype, "useUbo", { + /** + * Indicates if the buffer is using the WebGL2 UBO implementation, + * or just falling back on setUniformXXX calls. + */ + get: function () { + return !this._noUBO; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(UniformBuffer.prototype, "isSync", { + /** + * Indicates if the WebGL underlying uniform buffer is in sync + * with the javascript cache data. + */ + get: function () { + return !this._needSync; + }, + enumerable: true, + configurable: true + }); + /** + * Indicates if the WebGL underlying uniform buffer is dynamic. + * Also, a dynamic UniformBuffer will disable cache verification and always + * update the underlying WebGL uniform buffer to the GPU. + * @returns if Dynamic, otherwise false + */ + UniformBuffer.prototype.isDynamic = function () { + return this._dynamic !== undefined; + }; + /** + * The data cache on JS side. + * @returns the underlying data as a float array + */ + UniformBuffer.prototype.getData = function () { + return this._bufferData; + }; + /** + * The underlying WebGL Uniform buffer. + * @returns the webgl buffer + */ + UniformBuffer.prototype.getBuffer = function () { + return this._buffer; + }; + /** + * std140 layout specifies how to align data within an UBO structure. + * See https://khronos.org/registry/OpenGL/specs/gl/glspec45.core.pdf#page=159 + * for specs. + */ + UniformBuffer.prototype._fillAlignment = function (size) { + // This code has been simplified because we only use floats, vectors of 1, 2, 3, 4 components + // and 4x4 matrices + // TODO : change if other types are used + var alignment; + if (size <= 2) { + alignment = size; + } + else { + alignment = 4; + } + if ((this._uniformLocationPointer % alignment) !== 0) { + var oldPointer = this._uniformLocationPointer; + this._uniformLocationPointer += alignment - (this._uniformLocationPointer % alignment); + var diff = this._uniformLocationPointer - oldPointer; + for (var i = 0; i < diff; i++) { + this._data.push(0); + } + } + }; + /** + * Adds an uniform in the buffer. + * Warning : the subsequents calls of this function must be in the same order as declared in the shader + * for the layout to be correct ! + * @param name Name of the uniform, as used in the uniform block in the shader. + * @param size Data size, or data directly. + */ + UniformBuffer.prototype.addUniform = function (name, size) { + if (this._noUBO) { + return; + } + if (this._uniformLocations[name] !== undefined) { + // Already existing uniform + return; + } + // This function must be called in the order of the shader layout ! + // size can be the size of the uniform, or data directly + var data; + if (size instanceof Array) { + data = size; + size = data.length; + } + else { + size = size; + data = []; + // Fill with zeros + for (var i = 0; i < size; i++) { + data.push(0); + } + } + this._fillAlignment(size); + this._uniformSizes[name] = size; + this._uniformLocations[name] = this._uniformLocationPointer; + this._uniformLocationPointer += size; + for (var i = 0; i < size; i++) { + this._data.push(data[i]); + } + this._needSync = true; + }; + /** + * Adds a Matrix 4x4 to the uniform buffer. + * @param name Name of the uniform, as used in the uniform block in the shader. + * @param mat A 4x4 matrix. + */ + UniformBuffer.prototype.addMatrix = function (name, mat) { + this.addUniform(name, Array.prototype.slice.call(mat.toArray())); + }; + /** + * Adds a vec2 to the uniform buffer. + * @param name Name of the uniform, as used in the uniform block in the shader. + * @param x Define the x component value of the vec2 + * @param y Define the y component value of the vec2 + */ + UniformBuffer.prototype.addFloat2 = function (name, x, y) { + var temp = [x, y]; + this.addUniform(name, temp); + }; + /** + * Adds a vec3 to the uniform buffer. + * @param name Name of the uniform, as used in the uniform block in the shader. + * @param x Define the x component value of the vec3 + * @param y Define the y component value of the vec3 + * @param z Define the z component value of the vec3 + */ + UniformBuffer.prototype.addFloat3 = function (name, x, y, z) { + var temp = [x, y, z]; + this.addUniform(name, temp); + }; + /** + * Adds a vec3 to the uniform buffer. + * @param name Name of the uniform, as used in the uniform block in the shader. + * @param color Define the vec3 from a Color + */ + UniformBuffer.prototype.addColor3 = function (name, color) { + var temp = new Array(); + color.toArray(temp); + this.addUniform(name, temp); + }; + /** + * Adds a vec4 to the uniform buffer. + * @param name Name of the uniform, as used in the uniform block in the shader. + * @param color Define the rgb components from a Color + * @param alpha Define the a component of the vec4 + */ + UniformBuffer.prototype.addColor4 = function (name, color, alpha) { + var temp = new Array(); + color.toArray(temp); + temp.push(alpha); + this.addUniform(name, temp); + }; + /** + * Adds a vec3 to the uniform buffer. + * @param name Name of the uniform, as used in the uniform block in the shader. + * @param vector Define the vec3 components from a Vector + */ + UniformBuffer.prototype.addVector3 = function (name, vector) { + var temp = new Array(); + vector.toArray(temp); + this.addUniform(name, temp); + }; + /** + * Adds a Matrix 3x3 to the uniform buffer. + * @param name Name of the uniform, as used in the uniform block in the shader. + */ + UniformBuffer.prototype.addMatrix3x3 = function (name) { + this.addUniform(name, 12); + }; + /** + * Adds a Matrix 2x2 to the uniform buffer. + * @param name Name of the uniform, as used in the uniform block in the shader. + */ + UniformBuffer.prototype.addMatrix2x2 = function (name) { + this.addUniform(name, 8); + }; + /** + * Effectively creates the WebGL Uniform Buffer, once layout is completed with `addUniform`. + */ + UniformBuffer.prototype.create = function () { + if (this._noUBO) { + return; + } + if (this._buffer) { + return; // nothing to do + } + // See spec, alignment must be filled as a vec4 + this._fillAlignment(4); + this._bufferData = new Float32Array(this._data); + this._rebuild(); + this._needSync = true; + }; + /** @hidden */ + UniformBuffer.prototype._rebuild = function () { + if (this._noUBO) { + return; + } + if (this._dynamic) { + this._buffer = this._engine.createDynamicUniformBuffer(this._bufferData); + } + else { + this._buffer = this._engine.createUniformBuffer(this._bufferData); + } + }; + /** + * Updates the WebGL Uniform Buffer on the GPU. + * If the `dynamic` flag is set to true, no cache comparison is done. + * Otherwise, the buffer will be updated only if the cache differs. + */ + UniformBuffer.prototype.update = function () { + if (!this._buffer) { + this.create(); + return; + } + if (!this._dynamic && !this._needSync) { + return; + } + this._engine.updateUniformBuffer(this._buffer, this._bufferData); + this._needSync = false; + }; + /** + * Updates the value of an uniform. The `update` method must be called afterwards to make it effective in the GPU. + * @param uniformName Define the name of the uniform, as used in the uniform block in the shader. + * @param data Define the flattened data + * @param size Define the size of the data. + */ + UniformBuffer.prototype.updateUniform = function (uniformName, data, size) { + var location = this._uniformLocations[uniformName]; + if (location === undefined) { + if (this._buffer) { + // Cannot add an uniform if the buffer is already created + BABYLON.Tools.Error("Cannot add an uniform after UBO has been created."); + return; + } + this.addUniform(uniformName, size); + location = this._uniformLocations[uniformName]; + } + if (!this._buffer) { + this.create(); + } + if (!this._dynamic) { + // Cache for static uniform buffers + var changed = false; + for (var i = 0; i < size; i++) { + if (this._bufferData[location + i] !== data[i]) { + changed = true; + this._bufferData[location + i] = data[i]; + } + } + this._needSync = this._needSync || changed; + } + else { + // No cache for dynamic + for (var i = 0; i < size; i++) { + this._bufferData[location + i] = data[i]; + } + } + }; + // Update methods + UniformBuffer.prototype._updateMatrix3x3ForUniform = function (name, matrix) { + // To match std140, matrix must be realigned + for (var i = 0; i < 3; i++) { + UniformBuffer._tempBuffer[i * 4] = matrix[i * 3]; + UniformBuffer._tempBuffer[i * 4 + 1] = matrix[i * 3 + 1]; + UniformBuffer._tempBuffer[i * 4 + 2] = matrix[i * 3 + 2]; + UniformBuffer._tempBuffer[i * 4 + 3] = 0.0; + } + this.updateUniform(name, UniformBuffer._tempBuffer, 12); + }; + UniformBuffer.prototype._updateMatrix3x3ForEffect = function (name, matrix) { + this._currentEffect.setMatrix3x3(name, matrix); + }; + UniformBuffer.prototype._updateMatrix2x2ForEffect = function (name, matrix) { + this._currentEffect.setMatrix2x2(name, matrix); + }; + UniformBuffer.prototype._updateMatrix2x2ForUniform = function (name, matrix) { + // To match std140, matrix must be realigned + for (var i = 0; i < 2; i++) { + UniformBuffer._tempBuffer[i * 4] = matrix[i * 2]; + UniformBuffer._tempBuffer[i * 4 + 1] = matrix[i * 2 + 1]; + UniformBuffer._tempBuffer[i * 4 + 2] = 0.0; + UniformBuffer._tempBuffer[i * 4 + 3] = 0.0; + } + this.updateUniform(name, UniformBuffer._tempBuffer, 8); + }; + UniformBuffer.prototype._updateFloatForEffect = function (name, x) { + this._currentEffect.setFloat(name, x); + }; + UniformBuffer.prototype._updateFloatForUniform = function (name, x) { + UniformBuffer._tempBuffer[0] = x; + this.updateUniform(name, UniformBuffer._tempBuffer, 1); + }; + UniformBuffer.prototype._updateFloat2ForEffect = function (name, x, y, suffix) { + if (suffix === void 0) { suffix = ""; } + this._currentEffect.setFloat2(name + suffix, x, y); + }; + UniformBuffer.prototype._updateFloat2ForUniform = function (name, x, y, suffix) { + if (suffix === void 0) { suffix = ""; } + UniformBuffer._tempBuffer[0] = x; + UniformBuffer._tempBuffer[1] = y; + this.updateUniform(name, UniformBuffer._tempBuffer, 2); + }; + UniformBuffer.prototype._updateFloat3ForEffect = function (name, x, y, z, suffix) { + if (suffix === void 0) { suffix = ""; } + this._currentEffect.setFloat3(name + suffix, x, y, z); + }; + UniformBuffer.prototype._updateFloat3ForUniform = function (name, x, y, z, suffix) { + if (suffix === void 0) { suffix = ""; } + UniformBuffer._tempBuffer[0] = x; + UniformBuffer._tempBuffer[1] = y; + UniformBuffer._tempBuffer[2] = z; + this.updateUniform(name, UniformBuffer._tempBuffer, 3); + }; + UniformBuffer.prototype._updateFloat4ForEffect = function (name, x, y, z, w, suffix) { + if (suffix === void 0) { suffix = ""; } + this._currentEffect.setFloat4(name + suffix, x, y, z, w); + }; + UniformBuffer.prototype._updateFloat4ForUniform = function (name, x, y, z, w, suffix) { + if (suffix === void 0) { suffix = ""; } + UniformBuffer._tempBuffer[0] = x; + UniformBuffer._tempBuffer[1] = y; + UniformBuffer._tempBuffer[2] = z; + UniformBuffer._tempBuffer[3] = w; + this.updateUniform(name, UniformBuffer._tempBuffer, 4); + }; + UniformBuffer.prototype._updateMatrixForEffect = function (name, mat) { + this._currentEffect.setMatrix(name, mat); + }; + UniformBuffer.prototype._updateMatrixForUniform = function (name, mat) { + this.updateUniform(name, mat.toArray(), 16); + }; + UniformBuffer.prototype._updateVector3ForEffect = function (name, vector) { + this._currentEffect.setVector3(name, vector); + }; + UniformBuffer.prototype._updateVector3ForUniform = function (name, vector) { + vector.toArray(UniformBuffer._tempBuffer); + this.updateUniform(name, UniformBuffer._tempBuffer, 3); + }; + UniformBuffer.prototype._updateVector4ForEffect = function (name, vector) { + this._currentEffect.setVector4(name, vector); + }; + UniformBuffer.prototype._updateVector4ForUniform = function (name, vector) { + vector.toArray(UniformBuffer._tempBuffer); + this.updateUniform(name, UniformBuffer._tempBuffer, 4); + }; + UniformBuffer.prototype._updateColor3ForEffect = function (name, color, suffix) { + if (suffix === void 0) { suffix = ""; } + this._currentEffect.setColor3(name + suffix, color); + }; + UniformBuffer.prototype._updateColor3ForUniform = function (name, color, suffix) { + if (suffix === void 0) { suffix = ""; } + color.toArray(UniformBuffer._tempBuffer); + this.updateUniform(name, UniformBuffer._tempBuffer, 3); + }; + UniformBuffer.prototype._updateColor4ForEffect = function (name, color, alpha, suffix) { + if (suffix === void 0) { suffix = ""; } + this._currentEffect.setColor4(name + suffix, color, alpha); + }; + UniformBuffer.prototype._updateColor4ForUniform = function (name, color, alpha, suffix) { + if (suffix === void 0) { suffix = ""; } + color.toArray(UniformBuffer._tempBuffer); + UniformBuffer._tempBuffer[3] = alpha; + this.updateUniform(name, UniformBuffer._tempBuffer, 4); + }; + /** + * Sets a sampler uniform on the effect. + * @param name Define the name of the sampler. + * @param texture Define the texture to set in the sampler + */ + UniformBuffer.prototype.setTexture = function (name, texture) { + this._currentEffect.setTexture(name, texture); + }; + /** + * Directly updates the value of the uniform in the cache AND on the GPU. + * @param uniformName Define the name of the uniform, as used in the uniform block in the shader. + * @param data Define the flattened data + */ + UniformBuffer.prototype.updateUniformDirectly = function (uniformName, data) { + this.updateUniform(uniformName, data, data.length); + this.update(); + }; + /** + * Binds this uniform buffer to an effect. + * @param effect Define the effect to bind the buffer to + * @param name Name of the uniform block in the shader. + */ + UniformBuffer.prototype.bindToEffect = function (effect, name) { + this._currentEffect = effect; + if (this._noUBO || !this._buffer) { + return; + } + effect.bindUniformBuffer(this._buffer, name); + }; + /** + * Disposes the uniform buffer. + */ + UniformBuffer.prototype.dispose = function () { + if (this._noUBO) { + return; + } + var index = this._engine._uniformBuffers.indexOf(this); + if (index !== -1) { + this._engine._uniformBuffers.splice(index, 1); + } + if (!this._buffer) { + return; + } + if (this._engine._releaseBuffer(this._buffer)) { + this._buffer = null; + } + }; + // Pool for avoiding memory leaks + UniformBuffer._MAX_UNIFORM_SIZE = 256; + UniformBuffer._tempBuffer = new Float32Array(UniformBuffer._MAX_UNIFORM_SIZE); + return UniformBuffer; + }()); + BABYLON.UniformBuffer = UniformBuffer; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.uniformBuffer.js.map + +var BABYLON; +(function (BABYLON) { + /** + * This class contains the various kinds of data on every vertex of a mesh used in determining its shape and appearance + */ + var VertexData = /** @class */ (function () { + function VertexData() { + } + /** + * Uses the passed data array to set the set the values for the specified kind of data + * @param data a linear array of floating numbers + * @param kind the type of data that is being set, eg positions, colors etc + */ + VertexData.prototype.set = function (data, kind) { + switch (kind) { + case BABYLON.VertexBuffer.PositionKind: + this.positions = data; + break; + case BABYLON.VertexBuffer.NormalKind: + this.normals = data; + break; + case BABYLON.VertexBuffer.TangentKind: + this.tangents = data; + break; + case BABYLON.VertexBuffer.UVKind: + this.uvs = data; + break; + case BABYLON.VertexBuffer.UV2Kind: + this.uvs2 = data; + break; + case BABYLON.VertexBuffer.UV3Kind: + this.uvs3 = data; + break; + case BABYLON.VertexBuffer.UV4Kind: + this.uvs4 = data; + break; + case BABYLON.VertexBuffer.UV5Kind: + this.uvs5 = data; + break; + case BABYLON.VertexBuffer.UV6Kind: + this.uvs6 = data; + break; + case BABYLON.VertexBuffer.ColorKind: + this.colors = data; + break; + case BABYLON.VertexBuffer.MatricesIndicesKind: + this.matricesIndices = data; + break; + case BABYLON.VertexBuffer.MatricesWeightsKind: + this.matricesWeights = data; + break; + case BABYLON.VertexBuffer.MatricesIndicesExtraKind: + this.matricesIndicesExtra = data; + break; + case BABYLON.VertexBuffer.MatricesWeightsExtraKind: + this.matricesWeightsExtra = data; + break; + } + }; + /** + * Associates the vertexData to the passed Mesh. + * Sets it as updatable or not (default `false`) + * @param mesh the mesh the vertexData is applied to + * @param updatable when used and having the value true allows new data to update the vertexData + * @returns the VertexData + */ + VertexData.prototype.applyToMesh = function (mesh, updatable) { + this._applyTo(mesh, updatable); + return this; + }; + /** + * Associates the vertexData to the passed Geometry. + * Sets it as updatable or not (default `false`) + * @param geometry the geometry the vertexData is applied to + * @param updatable when used and having the value true allows new data to update the vertexData + * @returns VertexData + */ + VertexData.prototype.applyToGeometry = function (geometry, updatable) { + this._applyTo(geometry, updatable); + return this; + }; + /** + * Updates the associated mesh + * @param mesh the mesh to be updated + * @param updateExtends when true the mesh BoundingInfo will be renewed when and if position kind is updated, optional with default false + * @param makeItUnique when true, and when and if position kind is updated, a new global geometry will be created from these positions and set to the mesh, optional with default false + * @returns VertexData + */ + VertexData.prototype.updateMesh = function (mesh, updateExtends, makeItUnique) { + this._update(mesh); + return this; + }; + /** + * Updates the associated geometry + * @param geometry the geometry to be updated + * @param updateExtends when true BoundingInfo will be renewed when and if position kind is updated, optional with default false + * @param makeItUnique when true, and when and if position kind is updated, a new global geometry will be created from these positions and set to the mesh, optional with default false + * @returns VertexData. + */ + VertexData.prototype.updateGeometry = function (geometry, updateExtends, makeItUnique) { + this._update(geometry); + return this; + }; + VertexData.prototype._applyTo = function (meshOrGeometry, updatable) { + if (updatable === void 0) { updatable = false; } + if (this.positions) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.PositionKind, this.positions, updatable); + } + if (this.normals) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.NormalKind, this.normals, updatable); + } + if (this.tangents) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.TangentKind, this.tangents, updatable); + } + if (this.uvs) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UVKind, this.uvs, updatable); + } + if (this.uvs2) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV2Kind, this.uvs2, updatable); + } + if (this.uvs3) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV3Kind, this.uvs3, updatable); + } + if (this.uvs4) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV4Kind, this.uvs4, updatable); + } + if (this.uvs5) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV5Kind, this.uvs5, updatable); + } + if (this.uvs6) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV6Kind, this.uvs6, updatable); + } + if (this.colors) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.ColorKind, this.colors, updatable); + } + if (this.matricesIndices) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, this.matricesIndices, updatable); + } + if (this.matricesWeights) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, this.matricesWeights, updatable); + } + if (this.matricesIndicesExtra) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, this.matricesIndicesExtra, updatable); + } + if (this.matricesWeightsExtra) { + meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind, this.matricesWeightsExtra, updatable); + } + if (this.indices) { + meshOrGeometry.setIndices(this.indices, null, updatable); + } + else { + meshOrGeometry.setIndices([], null); + } + return this; + }; + VertexData.prototype._update = function (meshOrGeometry, updateExtends, makeItUnique) { + if (this.positions) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.PositionKind, this.positions, updateExtends, makeItUnique); + } + if (this.normals) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.NormalKind, this.normals, updateExtends, makeItUnique); + } + if (this.tangents) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.TangentKind, this.tangents, updateExtends, makeItUnique); + } + if (this.uvs) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UVKind, this.uvs, updateExtends, makeItUnique); + } + if (this.uvs2) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV2Kind, this.uvs2, updateExtends, makeItUnique); + } + if (this.uvs3) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV3Kind, this.uvs3, updateExtends, makeItUnique); + } + if (this.uvs4) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV4Kind, this.uvs4, updateExtends, makeItUnique); + } + if (this.uvs5) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV5Kind, this.uvs5, updateExtends, makeItUnique); + } + if (this.uvs6) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV6Kind, this.uvs6, updateExtends, makeItUnique); + } + if (this.colors) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.ColorKind, this.colors, updateExtends, makeItUnique); + } + if (this.matricesIndices) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, this.matricesIndices, updateExtends, makeItUnique); + } + if (this.matricesWeights) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, this.matricesWeights, updateExtends, makeItUnique); + } + if (this.matricesIndicesExtra) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, this.matricesIndicesExtra, updateExtends, makeItUnique); + } + if (this.matricesWeightsExtra) { + meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind, this.matricesWeightsExtra, updateExtends, makeItUnique); + } + if (this.indices) { + meshOrGeometry.setIndices(this.indices, null); + } + return this; + }; + /** + * Transforms each position and each normal of the vertexData according to the passed Matrix + * @param matrix the transforming matrix + * @returns the VertexData + */ + VertexData.prototype.transform = function (matrix) { + var flip = matrix.m[0] * matrix.m[5] * matrix.m[10] < 0; + var transformed = BABYLON.Vector3.Zero(); + var index; + if (this.positions) { + var position = BABYLON.Vector3.Zero(); + for (index = 0; index < this.positions.length; index += 3) { + BABYLON.Vector3.FromArrayToRef(this.positions, index, position); + BABYLON.Vector3.TransformCoordinatesToRef(position, matrix, transformed); + this.positions[index] = transformed.x; + this.positions[index + 1] = transformed.y; + this.positions[index + 2] = transformed.z; + } + } + if (this.normals) { + var normal = BABYLON.Vector3.Zero(); + for (index = 0; index < this.normals.length; index += 3) { + BABYLON.Vector3.FromArrayToRef(this.normals, index, normal); + BABYLON.Vector3.TransformNormalToRef(normal, matrix, transformed); + this.normals[index] = transformed.x; + this.normals[index + 1] = transformed.y; + this.normals[index + 2] = transformed.z; + } + } + if (this.tangents) { + var tangent = BABYLON.Vector4.Zero(); + var tangentTransformed = BABYLON.Vector4.Zero(); + for (index = 0; index < this.tangents.length; index += 4) { + BABYLON.Vector4.FromArrayToRef(this.tangents, index, tangent); + BABYLON.Vector4.TransformNormalToRef(tangent, matrix, tangentTransformed); + this.tangents[index] = tangentTransformed.x; + this.tangents[index + 1] = tangentTransformed.y; + this.tangents[index + 2] = tangentTransformed.z; + this.tangents[index + 3] = tangentTransformed.w; + } + } + if (flip && this.indices) { + for (index = 0; index < this.indices.length; index += 3) { + var tmp = this.indices[index + 1]; + this.indices[index + 1] = this.indices[index + 2]; + this.indices[index + 2] = tmp; + } + } + return this; + }; + /** + * Merges the passed VertexData into the current one + * @param other the VertexData to be merged into the current one + * @param use32BitsIndices defines a boolean indicating if indices must be store in a 32 bits array + * @returns the modified VertexData + */ + VertexData.prototype.merge = function (other, use32BitsIndices) { + if (use32BitsIndices === void 0) { use32BitsIndices = false; } + this._validate(); + other._validate(); + if (!this.normals !== !other.normals || + !this.tangents !== !other.tangents || + !this.uvs !== !other.uvs || + !this.uvs2 !== !other.uvs2 || + !this.uvs3 !== !other.uvs3 || + !this.uvs4 !== !other.uvs4 || + !this.uvs5 !== !other.uvs5 || + !this.uvs6 !== !other.uvs6 || + !this.colors !== !other.colors || + !this.matricesIndices !== !other.matricesIndices || + !this.matricesWeights !== !other.matricesWeights || + !this.matricesIndicesExtra !== !other.matricesIndicesExtra || + !this.matricesWeightsExtra !== !other.matricesWeightsExtra) { + throw new Error("Cannot merge vertex data that do not have the same set of attributes"); + } + if (other.indices) { + if (!this.indices) { + this.indices = []; + } + var offset = this.positions ? this.positions.length / 3 : 0; + var isSrcTypedArray = this.indices.BYTES_PER_ELEMENT !== undefined; + if (isSrcTypedArray) { + var len = this.indices.length + other.indices.length; + var temp = use32BitsIndices || this.indices instanceof Uint32Array ? new Uint32Array(len) : new Uint16Array(len); + temp.set(this.indices); + var decal = this.indices.length; + for (var index = 0; index < other.indices.length; index++) { + temp[decal + index] = other.indices[index] + offset; + } + this.indices = temp; + } + else { + for (var index = 0; index < other.indices.length; index++) { + this.indices.push(other.indices[index] + offset); + } + } + } + this.positions = this._mergeElement(this.positions, other.positions); + this.normals = this._mergeElement(this.normals, other.normals); + this.tangents = this._mergeElement(this.tangents, other.tangents); + this.uvs = this._mergeElement(this.uvs, other.uvs); + this.uvs2 = this._mergeElement(this.uvs2, other.uvs2); + this.uvs3 = this._mergeElement(this.uvs3, other.uvs3); + this.uvs4 = this._mergeElement(this.uvs4, other.uvs4); + this.uvs5 = this._mergeElement(this.uvs5, other.uvs5); + this.uvs6 = this._mergeElement(this.uvs6, other.uvs6); + this.colors = this._mergeElement(this.colors, other.colors); + this.matricesIndices = this._mergeElement(this.matricesIndices, other.matricesIndices); + this.matricesWeights = this._mergeElement(this.matricesWeights, other.matricesWeights); + this.matricesIndicesExtra = this._mergeElement(this.matricesIndicesExtra, other.matricesIndicesExtra); + this.matricesWeightsExtra = this._mergeElement(this.matricesWeightsExtra, other.matricesWeightsExtra); + return this; + }; + VertexData.prototype._mergeElement = function (source, other) { + if (!source) { + return other; + } + if (!other) { + return source; + } + var len = other.length + source.length; + var isSrcTypedArray = source instanceof Float32Array; + var isOthTypedArray = other instanceof Float32Array; + // use non-loop method when the source is Float32Array + if (isSrcTypedArray) { + var ret32 = new Float32Array(len); + ret32.set(source); + ret32.set(other, source.length); + return ret32; + // source is number[], when other is also use concat + } + else if (!isOthTypedArray) { + return source.concat(other); + // source is a number[], but other is a Float32Array, loop required + } + else { + var ret = source.slice(0); // copy source to a separate array + for (var i = 0, len = other.length; i < len; i++) { + ret.push(other[i]); + } + return ret; + } + }; + VertexData.prototype._validate = function () { + if (!this.positions) { + throw new Error("Positions are required"); + } + var getElementCount = function (kind, values) { + var stride = BABYLON.VertexBuffer.DeduceStride(kind); + if ((values.length % stride) !== 0) { + throw new Error("The " + kind + "s array count must be a multiple of " + stride); + } + return values.length / stride; + }; + var positionsElementCount = getElementCount(BABYLON.VertexBuffer.PositionKind, this.positions); + var validateElementCount = function (kind, values) { + var elementCount = getElementCount(kind, values); + if (elementCount !== positionsElementCount) { + throw new Error("The " + kind + "s element count (" + elementCount + ") does not match the positions count (" + positionsElementCount + ")"); + } + }; + if (this.normals) { + validateElementCount(BABYLON.VertexBuffer.NormalKind, this.normals); + } + if (this.tangents) { + validateElementCount(BABYLON.VertexBuffer.TangentKind, this.tangents); + } + if (this.uvs) { + validateElementCount(BABYLON.VertexBuffer.UVKind, this.uvs); + } + if (this.uvs2) { + validateElementCount(BABYLON.VertexBuffer.UV2Kind, this.uvs2); + } + if (this.uvs3) { + validateElementCount(BABYLON.VertexBuffer.UV3Kind, this.uvs3); + } + if (this.uvs4) { + validateElementCount(BABYLON.VertexBuffer.UV4Kind, this.uvs4); + } + if (this.uvs5) { + validateElementCount(BABYLON.VertexBuffer.UV5Kind, this.uvs5); + } + if (this.uvs6) { + validateElementCount(BABYLON.VertexBuffer.UV6Kind, this.uvs6); + } + if (this.colors) { + validateElementCount(BABYLON.VertexBuffer.ColorKind, this.colors); + } + if (this.matricesIndices) { + validateElementCount(BABYLON.VertexBuffer.MatricesIndicesKind, this.matricesIndices); + } + if (this.matricesWeights) { + validateElementCount(BABYLON.VertexBuffer.MatricesWeightsKind, this.matricesWeights); + } + if (this.matricesIndicesExtra) { + validateElementCount(BABYLON.VertexBuffer.MatricesIndicesExtraKind, this.matricesIndicesExtra); + } + if (this.matricesWeightsExtra) { + validateElementCount(BABYLON.VertexBuffer.MatricesWeightsExtraKind, this.matricesWeightsExtra); + } + }; + /** + * Serializes the VertexData + * @returns a serialized object + */ + VertexData.prototype.serialize = function () { + var serializationObject = this.serialize(); + if (this.positions) { + serializationObject.positions = this.positions; + } + if (this.normals) { + serializationObject.normals = this.normals; + } + if (this.tangents) { + serializationObject.tangents = this.tangents; + } + if (this.uvs) { + serializationObject.uvs = this.uvs; + } + if (this.uvs2) { + serializationObject.uvs2 = this.uvs2; + } + if (this.uvs3) { + serializationObject.uvs3 = this.uvs3; + } + if (this.uvs4) { + serializationObject.uvs4 = this.uvs4; + } + if (this.uvs5) { + serializationObject.uvs5 = this.uvs5; + } + if (this.uvs6) { + serializationObject.uvs6 = this.uvs6; + } + if (this.colors) { + serializationObject.colors = this.colors; + } + if (this.matricesIndices) { + serializationObject.matricesIndices = this.matricesIndices; + serializationObject.matricesIndices._isExpanded = true; + } + if (this.matricesWeights) { + serializationObject.matricesWeights = this.matricesWeights; + } + if (this.matricesIndicesExtra) { + serializationObject.matricesIndicesExtra = this.matricesIndicesExtra; + serializationObject.matricesIndicesExtra._isExpanded = true; + } + if (this.matricesWeightsExtra) { + serializationObject.matricesWeightsExtra = this.matricesWeightsExtra; + } + serializationObject.indices = this.indices; + return serializationObject; + }; + // Statics + /** + * Extracts the vertexData from a mesh + * @param mesh the mesh from which to extract the VertexData + * @param copyWhenShared defines if the VertexData must be cloned when shared between multiple meshes, optional, default false + * @param forceCopy indicating that the VertexData must be cloned, optional, default false + * @returns the object VertexData associated to the passed mesh + */ + VertexData.ExtractFromMesh = function (mesh, copyWhenShared, forceCopy) { + return VertexData._ExtractFrom(mesh, copyWhenShared, forceCopy); + }; + /** + * Extracts the vertexData from the geometry + * @param geometry the geometry from which to extract the VertexData + * @param copyWhenShared defines if the VertexData must be cloned when the geometrty is shared between multiple meshes, optional, default false + * @param forceCopy indicating that the VertexData must be cloned, optional, default false + * @returns the object VertexData associated to the passed mesh + */ + VertexData.ExtractFromGeometry = function (geometry, copyWhenShared, forceCopy) { + return VertexData._ExtractFrom(geometry, copyWhenShared, forceCopy); + }; + VertexData._ExtractFrom = function (meshOrGeometry, copyWhenShared, forceCopy) { + var result = new VertexData(); + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) { + result.positions = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.PositionKind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + result.normals = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.NormalKind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.TangentKind)) { + result.tangents = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.TangentKind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + result.uvs = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UVKind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) { + result.uvs2 = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV2Kind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV3Kind)) { + result.uvs3 = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV3Kind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV4Kind)) { + result.uvs4 = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV4Kind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV5Kind)) { + result.uvs5 = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV5Kind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV6Kind)) { + result.uvs6 = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV6Kind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) { + result.colors = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.ColorKind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind)) { + result.matricesIndices = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) { + result.matricesWeights = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesExtraKind)) { + result.matricesIndicesExtra = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, copyWhenShared, forceCopy); + } + if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsExtraKind)) { + result.matricesWeightsExtra = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind, copyWhenShared, forceCopy); + } + result.indices = meshOrGeometry.getIndices(copyWhenShared, forceCopy); + return result; + }; + /** + * Creates the VertexData for a Ribbon + * @param options an object used to set the following optional parameters for the ribbon, required but can be empty + * * pathArray array of paths, each of which an array of successive Vector3 + * * closeArray creates a seam between the first and the last paths of the pathArray, optional, default false + * * closePath creates a seam between the first and the last points of each path of the path array, optional, default false + * * offset a positive integer, only used when pathArray contains a single path (offset = 10 means the point 1 is joined to the point 11), default rounded half size of the pathArray length + * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * * invertUV swaps in the U and V coordinates when applying a texture, optional, default false + * * uvs a linear array, of length 2 * number of vertices, of custom UV values, optional + * * colors a linear array, of length 4 * number of vertices, of custom color values, optional + * @returns the VertexData of the ribbon + */ + VertexData.CreateRibbon = function (options) { + var pathArray = options.pathArray; + var closeArray = options.closeArray || false; + var closePath = options.closePath || false; + var invertUV = options.invertUV || false; + var defaultOffset = Math.floor(pathArray[0].length / 2); + var offset = options.offset || defaultOffset; + offset = offset > defaultOffset ? defaultOffset : Math.floor(offset); // offset max allowed : defaultOffset + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var customUV = options.uvs; + var customColors = options.colors; + var positions = []; + var indices = []; + var normals = []; + var uvs = []; + var us = []; // us[path_id] = [uDist1, uDist2, uDist3 ... ] distances between points on path path_id + var vs = []; // vs[i] = [vDist1, vDist2, vDist3, ... ] distances between points i of consecutives paths from pathArray + var uTotalDistance = []; // uTotalDistance[p] : total distance of path p + var vTotalDistance = []; // vTotalDistance[i] : total distance between points i of first and last path from pathArray + var minlg; // minimal length among all paths from pathArray + var lg = []; // array of path lengths : nb of vertex per path + var idx = []; // array of path indexes : index of each path (first vertex) in the total vertex number + var p; // path iterator + var i; // point iterator + var j; // point iterator + // if single path in pathArray + if (pathArray.length < 2) { + var ar1 = []; + var ar2 = []; + for (i = 0; i < pathArray[0].length - offset; i++) { + ar1.push(pathArray[0][i]); + ar2.push(pathArray[0][i + offset]); + } + pathArray = [ar1, ar2]; + } + // positions and horizontal distances (u) + var idc = 0; + var closePathCorr = (closePath) ? 1 : 0; // the final index will be +1 if closePath + var path; + var l; + minlg = pathArray[0].length; + var vectlg; + var dist; + for (p = 0; p < pathArray.length; p++) { + uTotalDistance[p] = 0; + us[p] = [0]; + path = pathArray[p]; + l = path.length; + minlg = (minlg < l) ? minlg : l; + j = 0; + while (j < l) { + positions.push(path[j].x, path[j].y, path[j].z); + if (j > 0) { + vectlg = path[j].subtract(path[j - 1]).length(); + dist = vectlg + uTotalDistance[p]; + us[p].push(dist); + uTotalDistance[p] = dist; + } + j++; + } + if (closePath) { // an extra hidden vertex is added in the "positions" array + j--; + positions.push(path[0].x, path[0].y, path[0].z); + vectlg = path[j].subtract(path[0]).length(); + dist = vectlg + uTotalDistance[p]; + us[p].push(dist); + uTotalDistance[p] = dist; + } + lg[p] = l + closePathCorr; + idx[p] = idc; + idc += (l + closePathCorr); + } + // vertical distances (v) + var path1; + var path2; + var vertex1 = null; + var vertex2 = null; + for (i = 0; i < minlg + closePathCorr; i++) { + vTotalDistance[i] = 0; + vs[i] = [0]; + for (p = 0; p < pathArray.length - 1; p++) { + path1 = pathArray[p]; + path2 = pathArray[p + 1]; + if (i === minlg) { // closePath + vertex1 = path1[0]; + vertex2 = path2[0]; + } + else { + vertex1 = path1[i]; + vertex2 = path2[i]; + } + vectlg = vertex2.subtract(vertex1).length(); + dist = vectlg + vTotalDistance[i]; + vs[i].push(dist); + vTotalDistance[i] = dist; + } + if (closeArray && vertex2 && vertex1) { + path1 = pathArray[p]; + path2 = pathArray[0]; + if (i === minlg) { // closePath + vertex2 = path2[0]; + } + vectlg = vertex2.subtract(vertex1).length(); + dist = vectlg + vTotalDistance[i]; + vTotalDistance[i] = dist; + } + } + // uvs + var u; + var v; + if (customUV) { + for (p = 0; p < customUV.length; p++) { + uvs.push(customUV[p].x, customUV[p].y); + } + } + else { + for (p = 0; p < pathArray.length; p++) { + for (i = 0; i < minlg + closePathCorr; i++) { + u = (uTotalDistance[p] != 0.0) ? us[p][i] / uTotalDistance[p] : 0.0; + v = (vTotalDistance[i] != 0.0) ? vs[i][p] / vTotalDistance[i] : 0.0; + if (invertUV) { + uvs.push(v, u); + } + else { + uvs.push(u, v); + } + } + } + } + // indices + p = 0; // path index + var pi = 0; // positions array index + var l1 = lg[p] - 1; // path1 length + var l2 = lg[p + 1] - 1; // path2 length + var min = (l1 < l2) ? l1 : l2; // current path stop index + var shft = idx[1] - idx[0]; // shift + var path1nb = closeArray ? lg.length : lg.length - 1; // number of path1 to iterate on + while (pi <= min && p < path1nb) { // stay under min and don't go over next to last path + // draw two triangles between path1 (p1) and path2 (p2) : (p1.pi, p2.pi, p1.pi+1) and (p2.pi+1, p1.pi+1, p2.pi) clockwise + indices.push(pi, pi + shft, pi + 1); + indices.push(pi + shft + 1, pi + 1, pi + shft); + pi += 1; + if (pi === min) { // if end of one of two consecutive paths reached, go to next existing path + p++; + if (p === lg.length - 1) { // last path of pathArray reached <=> closeArray == true + shft = idx[0] - idx[p]; + l1 = lg[p] - 1; + l2 = lg[0] - 1; + } + else { + shft = idx[p + 1] - idx[p]; + l1 = lg[p] - 1; + l2 = lg[p + 1] - 1; + } + pi = idx[p]; + min = (l1 < l2) ? l1 + pi : l2 + pi; + } + } + // normals + VertexData.ComputeNormals(positions, indices, normals); + if (closePath) { // update both the first and last vertex normals to their average value + var indexFirst = 0; + var indexLast = 0; + for (p = 0; p < pathArray.length; p++) { + indexFirst = idx[p] * 3; + if (p + 1 < pathArray.length) { + indexLast = (idx[p + 1] - 1) * 3; + } + else { + indexLast = normals.length - 3; + } + normals[indexFirst] = (normals[indexFirst] + normals[indexLast]) * 0.5; + normals[indexFirst + 1] = (normals[indexFirst + 1] + normals[indexLast + 1]) * 0.5; + normals[indexFirst + 2] = (normals[indexFirst + 2] + normals[indexLast + 2]) * 0.5; + normals[indexLast] = normals[indexFirst]; + normals[indexLast + 1] = normals[indexFirst + 1]; + normals[indexLast + 2] = normals[indexFirst + 2]; + } + } + // sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs); + // Colors + var colors = null; + if (customColors) { + colors = new Float32Array(customColors.length * 4); + for (var c = 0; c < customColors.length; c++) { + colors[c * 4] = customColors[c].r; + colors[c * 4 + 1] = customColors[c].g; + colors[c * 4 + 2] = customColors[c].b; + colors[c * 4 + 3] = customColors[c].a; + } + } + // Result + var vertexData = new VertexData(); + var positions32 = new Float32Array(positions); + var normals32 = new Float32Array(normals); + var uvs32 = new Float32Array(uvs); + vertexData.indices = indices; + vertexData.positions = positions32; + vertexData.normals = normals32; + vertexData.uvs = uvs32; + if (colors) { + vertexData.set(colors, BABYLON.VertexBuffer.ColorKind); + } + if (closePath) { + vertexData._idx = idx; + } + return vertexData; + }; + /** + * Creates the VertexData for a box + * @param options an object used to set the following optional parameters for the box, required but can be empty + * * size sets the width, height and depth of the box to the value of size, optional default 1 + * * width sets the width (x direction) of the box, overwrites the width set by size, optional, default size + * * height sets the height (y direction) of the box, overwrites the height set by size, optional, default size + * * depth sets the depth (z direction) of the box, overwrites the depth set by size, optional, default size + * * faceUV an array of 6 Vector4 elements used to set different images to each box side + * * faceColors an array of 6 Color3 elements used to set different colors to each box side + * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * @returns the VertexData of the box + */ + VertexData.CreateBox = function (options) { + var normalsSource = [ + new BABYLON.Vector3(0, 0, 1), + new BABYLON.Vector3(0, 0, -1), + new BABYLON.Vector3(1, 0, 0), + new BABYLON.Vector3(-1, 0, 0), + new BABYLON.Vector3(0, 1, 0), + new BABYLON.Vector3(0, -1, 0) + ]; + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var width = options.width || options.size || 1; + var height = options.height || options.size || 1; + var depth = options.depth || options.size || 1; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var faceUV = options.faceUV || new Array(6); + var faceColors = options.faceColors; + var colors = []; + // default face colors and UV if undefined + for (var f = 0; f < 6; f++) { + if (faceUV[f] === undefined) { + faceUV[f] = new BABYLON.Vector4(0, 0, 1, 1); + } + if (faceColors && faceColors[f] === undefined) { + faceColors[f] = new BABYLON.Color4(1, 1, 1, 1); + } + } + var scaleVector = new BABYLON.Vector3(width / 2, height / 2, depth / 2); + // Create each face in turn. + for (var index = 0; index < normalsSource.length; index++) { + var normal = normalsSource[index]; + // Get two vectors perpendicular to the face normal and to each other. + var side1 = new BABYLON.Vector3(normal.y, normal.z, normal.x); + var side2 = BABYLON.Vector3.Cross(normal, side1); + // Six indices (two triangles) per face. + var verticesLength = positions.length / 3; + indices.push(verticesLength); + indices.push(verticesLength + 1); + indices.push(verticesLength + 2); + indices.push(verticesLength); + indices.push(verticesLength + 2); + indices.push(verticesLength + 3); + // Four vertices per face. + var vertex = normal.subtract(side1).subtract(side2).multiply(scaleVector); + positions.push(vertex.x, vertex.y, vertex.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(faceUV[index].z, faceUV[index].w); + if (faceColors) { + colors.push(faceColors[index].r, faceColors[index].g, faceColors[index].b, faceColors[index].a); + } + vertex = normal.subtract(side1).add(side2).multiply(scaleVector); + positions.push(vertex.x, vertex.y, vertex.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(faceUV[index].x, faceUV[index].w); + if (faceColors) { + colors.push(faceColors[index].r, faceColors[index].g, faceColors[index].b, faceColors[index].a); + } + vertex = normal.add(side1).add(side2).multiply(scaleVector); + positions.push(vertex.x, vertex.y, vertex.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(faceUV[index].x, faceUV[index].y); + if (faceColors) { + colors.push(faceColors[index].r, faceColors[index].g, faceColors[index].b, faceColors[index].a); + } + vertex = normal.add(side1).subtract(side2).multiply(scaleVector); + positions.push(vertex.x, vertex.y, vertex.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(faceUV[index].z, faceUV[index].y); + if (faceColors) { + colors.push(faceColors[index].r, faceColors[index].g, faceColors[index].b, faceColors[index].a); + } + } + // sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + if (faceColors) { + var totalColors = (sideOrientation === BABYLON.Mesh.DOUBLESIDE) ? colors.concat(colors) : colors; + vertexData.colors = totalColors; + } + return vertexData; + }; + /** + * Creates the VertexData for an ellipsoid, defaults to a sphere + * @param options an object used to set the following optional parameters for the box, required but can be empty + * * segments sets the number of horizontal strips optional, default 32 + * * diameter sets the axes dimensions, diameterX, diameterY and diameterZ to the value of diameter, optional default 1 + * * diameterX sets the diameterX (x direction) of the ellipsoid, overwrites the diameterX set by diameter, optional, default diameter + * * diameterY sets the diameterY (y direction) of the ellipsoid, overwrites the diameterY set by diameter, optional, default diameter + * * diameterZ sets the diameterZ (z direction) of the ellipsoid, overwrites the diameterZ set by diameter, optional, default diameter + * * arc a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the circumference (latitude) given by the arc value, optional, default 1 + * * slice a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the height (latitude) given by the arc value, optional, default 1 + * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * @returns the VertexData of the ellipsoid + */ + VertexData.CreateSphere = function (options) { + var segments = options.segments || 32; + var diameterX = options.diameterX || options.diameter || 1; + var diameterY = options.diameterY || options.diameter || 1; + var diameterZ = options.diameterZ || options.diameter || 1; + var arc = options.arc && (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0; + var slice = options.slice && (options.slice <= 0) ? 1.0 : options.slice || 1.0; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var radius = new BABYLON.Vector3(diameterX / 2, diameterY / 2, diameterZ / 2); + var totalZRotationSteps = 2 + segments; + var totalYRotationSteps = 2 * totalZRotationSteps; + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + for (var zRotationStep = 0; zRotationStep <= totalZRotationSteps; zRotationStep++) { + var normalizedZ = zRotationStep / totalZRotationSteps; + var angleZ = normalizedZ * Math.PI * slice; + for (var yRotationStep = 0; yRotationStep <= totalYRotationSteps; yRotationStep++) { + var normalizedY = yRotationStep / totalYRotationSteps; + var angleY = normalizedY * Math.PI * 2 * arc; + var rotationZ = BABYLON.Matrix.RotationZ(-angleZ); + var rotationY = BABYLON.Matrix.RotationY(angleY); + var afterRotZ = BABYLON.Vector3.TransformCoordinates(BABYLON.Vector3.Up(), rotationZ); + var complete = BABYLON.Vector3.TransformCoordinates(afterRotZ, rotationY); + var vertex = complete.multiply(radius); + var normal = complete.divide(radius).normalize(); + positions.push(vertex.x, vertex.y, vertex.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(normalizedY, normalizedZ); + } + if (zRotationStep > 0) { + var verticesCount = positions.length / 3; + for (var firstIndex = verticesCount - 2 * (totalYRotationSteps + 1); (firstIndex + totalYRotationSteps + 2) < verticesCount; firstIndex++) { + indices.push((firstIndex)); + indices.push((firstIndex + 1)); + indices.push(firstIndex + totalYRotationSteps + 1); + indices.push((firstIndex + totalYRotationSteps + 1)); + indices.push((firstIndex + 1)); + indices.push((firstIndex + totalYRotationSteps + 2)); + } + } + } + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + /** + * Creates the VertexData for a cylinder, cone or prism + * @param options an object used to set the following optional parameters for the box, required but can be empty + * * height sets the height (y direction) of the cylinder, optional, default 2 + * * diameterTop sets the diameter of the top of the cone, overwrites diameter, optional, default diameter + * * diameterBottom sets the diameter of the bottom of the cone, overwrites diameter, optional, default diameter + * * diameter sets the diameter of the top and bottom of the cone, optional default 1 + * * tessellation the number of prism sides, 3 for a triangular prism, optional, default 24 + * * subdivisions` the number of rings along the cylinder height, optional, default 1 + * * arc a number from 0 to 1, to create an unclosed cylinder based on the fraction of the circumference given by the arc value, optional, default 1 + * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively + * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively + * * hasRings when true makes each subdivision independantly treated as a face for faceUV and faceColors, optional, default false + * * enclose when true closes an open cylinder by adding extra flat faces between the height axis and vertical edges, think cut cake + * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * @returns the VertexData of the cylinder, cone or prism + */ + VertexData.CreateCylinder = function (options) { + var height = options.height || 2; + var diameterTop = (options.diameterTop === 0) ? 0 : options.diameterTop || options.diameter || 1; + var diameterBottom = (options.diameterBottom === 0) ? 0 : options.diameterBottom || options.diameter || 1; + var tessellation = options.tessellation || 24; + var subdivisions = options.subdivisions || 1; + var hasRings = options.hasRings ? true : false; + var enclose = options.enclose ? true : false; + var arc = options.arc && (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var faceUV = options.faceUV || new Array(3); + var faceColors = options.faceColors; + // default face colors and UV if undefined + var quadNb = (arc !== 1 && enclose) ? 2 : 0; + var ringNb = (hasRings) ? subdivisions : 1; + var surfaceNb = 2 + (1 + quadNb) * ringNb; + var f; + for (f = 0; f < surfaceNb; f++) { + if (faceColors && faceColors[f] === undefined) { + faceColors[f] = new BABYLON.Color4(1, 1, 1, 1); + } + } + for (f = 0; f < surfaceNb; f++) { + if (faceUV && faceUV[f] === undefined) { + faceUV[f] = new BABYLON.Vector4(0, 0, 1, 1); + } + } + var indices = new Array(); + var positions = new Array(); + var normals = new Array(); + var uvs = new Array(); + var colors = new Array(); + var angle_step = Math.PI * 2 * arc / tessellation; + var angle; + var h; + var radius; + var tan = (diameterBottom - diameterTop) / 2 / height; + var ringVertex = BABYLON.Vector3.Zero(); + var ringNormal = BABYLON.Vector3.Zero(); + var ringFirstVertex = BABYLON.Vector3.Zero(); + var ringFirstNormal = BABYLON.Vector3.Zero(); + var quadNormal = BABYLON.Vector3.Zero(); + var Y = BABYLON.Axis.Y; + // positions, normals, uvs + var i; + var j; + var r; + var ringIdx = 1; + var s = 1; // surface index + var cs = 0; + var v = 0; + for (i = 0; i <= subdivisions; i++) { + h = i / subdivisions; + radius = (h * (diameterTop - diameterBottom) + diameterBottom) / 2; + ringIdx = (hasRings && i !== 0 && i !== subdivisions) ? 2 : 1; + for (r = 0; r < ringIdx; r++) { + if (hasRings) { + s += r; + } + if (enclose) { + s += 2 * r; + } + for (j = 0; j <= tessellation; j++) { + angle = j * angle_step; + // position + ringVertex.x = Math.cos(-angle) * radius; + ringVertex.y = -height / 2 + h * height; + ringVertex.z = Math.sin(-angle) * radius; + // normal + if (diameterTop === 0 && i === subdivisions) { + // if no top cap, reuse former normals + ringNormal.x = normals[normals.length - (tessellation + 1) * 3]; + ringNormal.y = normals[normals.length - (tessellation + 1) * 3 + 1]; + ringNormal.z = normals[normals.length - (tessellation + 1) * 3 + 2]; + } + else { + ringNormal.x = ringVertex.x; + ringNormal.z = ringVertex.z; + ringNormal.y = Math.sqrt(ringNormal.x * ringNormal.x + ringNormal.z * ringNormal.z) * tan; + ringNormal.normalize(); + } + // keep first ring vertex values for enclose + if (j === 0) { + ringFirstVertex.copyFrom(ringVertex); + ringFirstNormal.copyFrom(ringNormal); + } + positions.push(ringVertex.x, ringVertex.y, ringVertex.z); + normals.push(ringNormal.x, ringNormal.y, ringNormal.z); + if (hasRings) { + v = (cs !== s) ? faceUV[s].y : faceUV[s].w; + } + else { + v = faceUV[s].y + (faceUV[s].w - faceUV[s].y) * h; + } + uvs.push(faceUV[s].x + (faceUV[s].z - faceUV[s].x) * j / tessellation, v); + if (faceColors) { + colors.push(faceColors[s].r, faceColors[s].g, faceColors[s].b, faceColors[s].a); + } + } + // if enclose, add four vertices and their dedicated normals + if (arc !== 1 && enclose) { + positions.push(ringVertex.x, ringVertex.y, ringVertex.z); + positions.push(0, ringVertex.y, 0); + positions.push(0, ringVertex.y, 0); + positions.push(ringFirstVertex.x, ringFirstVertex.y, ringFirstVertex.z); + BABYLON.Vector3.CrossToRef(Y, ringNormal, quadNormal); + quadNormal.normalize(); + normals.push(quadNormal.x, quadNormal.y, quadNormal.z, quadNormal.x, quadNormal.y, quadNormal.z); + BABYLON.Vector3.CrossToRef(ringFirstNormal, Y, quadNormal); + quadNormal.normalize(); + normals.push(quadNormal.x, quadNormal.y, quadNormal.z, quadNormal.x, quadNormal.y, quadNormal.z); + if (hasRings) { + v = (cs !== s) ? faceUV[s + 1].y : faceUV[s + 1].w; + } + else { + v = faceUV[s + 1].y + (faceUV[s + 1].w - faceUV[s + 1].y) * h; + } + uvs.push(faceUV[s + 1].x, v); + uvs.push(faceUV[s + 1].z, v); + if (hasRings) { + v = (cs !== s) ? faceUV[s + 2].y : faceUV[s + 2].w; + } + else { + v = faceUV[s + 2].y + (faceUV[s + 2].w - faceUV[s + 2].y) * h; + } + uvs.push(faceUV[s + 2].x, v); + uvs.push(faceUV[s + 2].z, v); + if (faceColors) { + colors.push(faceColors[s + 1].r, faceColors[s + 1].g, faceColors[s + 1].b, faceColors[s + 1].a); + colors.push(faceColors[s + 1].r, faceColors[s + 1].g, faceColors[s + 1].b, faceColors[s + 1].a); + colors.push(faceColors[s + 2].r, faceColors[s + 2].g, faceColors[s + 2].b, faceColors[s + 2].a); + colors.push(faceColors[s + 2].r, faceColors[s + 2].g, faceColors[s + 2].b, faceColors[s + 2].a); + } + } + if (cs !== s) { + cs = s; + } + } + } + // indices + var e = (arc !== 1 && enclose) ? tessellation + 4 : tessellation; // correction of number of iteration if enclose + var s; + i = 0; + for (s = 0; s < subdivisions; s++) { + var i0 = 0; + var i1 = 0; + var i2 = 0; + var i3 = 0; + for (j = 0; j < tessellation; j++) { + i0 = i * (e + 1) + j; + i1 = (i + 1) * (e + 1) + j; + i2 = i * (e + 1) + (j + 1); + i3 = (i + 1) * (e + 1) + (j + 1); + indices.push(i0, i1, i2); + indices.push(i3, i2, i1); + } + if (arc !== 1 && enclose) { // if enclose, add two quads + indices.push(i0 + 2, i1 + 2, i2 + 2); + indices.push(i3 + 2, i2 + 2, i1 + 2); + indices.push(i0 + 4, i1 + 4, i2 + 4); + indices.push(i3 + 4, i2 + 4, i1 + 4); + } + i = (hasRings) ? (i + 2) : (i + 1); + } + // Caps + var createCylinderCap = function (isTop) { + var radius = isTop ? diameterTop / 2 : diameterBottom / 2; + if (radius === 0) { + return; + } + // Cap positions, normals & uvs + var angle; + var circleVector; + var i; + var u = (isTop) ? faceUV[surfaceNb - 1] : faceUV[0]; + var c = null; + if (faceColors) { + c = (isTop) ? faceColors[surfaceNb - 1] : faceColors[0]; + } + // cap center + var vbase = positions.length / 3; + var offset = isTop ? height / 2 : -height / 2; + var center = new BABYLON.Vector3(0, offset, 0); + positions.push(center.x, center.y, center.z); + normals.push(0, isTop ? 1 : -1, 0); + uvs.push(u.x + (u.z - u.x) * 0.5, u.y + (u.w - u.y) * 0.5); + if (c) { + colors.push(c.r, c.g, c.b, c.a); + } + var textureScale = new BABYLON.Vector2(0.5, 0.5); + for (i = 0; i <= tessellation; i++) { + angle = Math.PI * 2 * i * arc / tessellation; + var cos = Math.cos(-angle); + var sin = Math.sin(-angle); + circleVector = new BABYLON.Vector3(cos * radius, offset, sin * radius); + var textureCoordinate = new BABYLON.Vector2(cos * textureScale.x + 0.5, sin * textureScale.y + 0.5); + positions.push(circleVector.x, circleVector.y, circleVector.z); + normals.push(0, isTop ? 1 : -1, 0); + uvs.push(u.x + (u.z - u.x) * textureCoordinate.x, u.y + (u.w - u.y) * textureCoordinate.y); + if (c) { + colors.push(c.r, c.g, c.b, c.a); + } + } + // Cap indices + for (i = 0; i < tessellation; i++) { + if (!isTop) { + indices.push(vbase); + indices.push(vbase + (i + 1)); + indices.push(vbase + (i + 2)); + } + else { + indices.push(vbase); + indices.push(vbase + (i + 2)); + indices.push(vbase + (i + 1)); + } + } + }; + // add caps to geometry + createCylinderCap(false); + createCylinderCap(true); + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs); + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + if (faceColors) { + vertexData.colors = colors; + } + return vertexData; + }; + /** + * Creates the VertexData for a torus + * @param options an object used to set the following optional parameters for the box, required but can be empty + * * diameter the diameter of the torus, optional default 1 + * * thickness the diameter of the tube forming the torus, optional default 0.5 + * * tessellation the number of prism sides, 3 for a triangular prism, optional, default 24 + * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * @returns the VertexData of the torus + */ + VertexData.CreateTorus = function (options) { + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var diameter = options.diameter || 1; + var thickness = options.thickness || 0.5; + var tessellation = options.tessellation || 16; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var stride = tessellation + 1; + for (var i = 0; i <= tessellation; i++) { + var u = i / tessellation; + var outerAngle = i * Math.PI * 2.0 / tessellation - Math.PI / 2.0; + var transform = BABYLON.Matrix.Translation(diameter / 2.0, 0, 0).multiply(BABYLON.Matrix.RotationY(outerAngle)); + for (var j = 0; j <= tessellation; j++) { + var v = 1 - j / tessellation; + var innerAngle = j * Math.PI * 2.0 / tessellation + Math.PI; + var dx = Math.cos(innerAngle); + var dy = Math.sin(innerAngle); + // Create a vertex. + var normal = new BABYLON.Vector3(dx, dy, 0); + var position = normal.scale(thickness / 2); + var textureCoordinate = new BABYLON.Vector2(u, v); + position = BABYLON.Vector3.TransformCoordinates(position, transform); + normal = BABYLON.Vector3.TransformNormal(normal, transform); + positions.push(position.x, position.y, position.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(textureCoordinate.x, textureCoordinate.y); + // And create indices for two triangles. + var nextI = (i + 1) % stride; + var nextJ = (j + 1) % stride; + indices.push(i * stride + j); + indices.push(i * stride + nextJ); + indices.push(nextI * stride + j); + indices.push(i * stride + nextJ); + indices.push(nextI * stride + nextJ); + indices.push(nextI * stride + j); + } + } + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + /** + * Creates the VertexData of the LineSystem + * @param options an object used to set the following optional parameters for the LineSystem, required but can be empty + * - lines an array of lines, each line being an array of successive Vector3 + * - colors an array of line colors, each of the line colors being an array of successive Color4, one per line point + * @returns the VertexData of the LineSystem + */ + VertexData.CreateLineSystem = function (options) { + var indices = []; + var positions = []; + var lines = options.lines; + var colors = options.colors; + var vertexColors = []; + var idx = 0; + for (var l = 0; l < lines.length; l++) { + var points = lines[l]; + for (var index = 0; index < points.length; index++) { + positions.push(points[index].x, points[index].y, points[index].z); + if (colors) { + var color = colors[l]; + vertexColors.push(color[index].r, color[index].g, color[index].b, color[index].a); + } + if (index > 0) { + indices.push(idx - 1); + indices.push(idx); + } + idx++; + } + } + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + if (colors) { + vertexData.colors = vertexColors; + } + return vertexData; + }; + /** + * Create the VertexData for a DashedLines + * @param options an object used to set the following optional parameters for the DashedLines, required but can be empty + * - points an array successive Vector3 + * - dashSize the size of the dashes relative to the dash number, optional, default 3 + * - gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1 + * - dashNb the intended total number of dashes, optional, default 200 + * @returns the VertexData for the DashedLines + */ + VertexData.CreateDashedLines = function (options) { + var dashSize = options.dashSize || 3; + var gapSize = options.gapSize || 1; + var dashNb = options.dashNb || 200; + var points = options.points; + var positions = new Array(); + var indices = new Array(); + var curvect = BABYLON.Vector3.Zero(); + var lg = 0; + var nb = 0; + var shft = 0; + var dashshft = 0; + var curshft = 0; + var idx = 0; + var i = 0; + for (i = 0; i < points.length - 1; i++) { + points[i + 1].subtractToRef(points[i], curvect); + lg += curvect.length(); + } + shft = lg / dashNb; + dashshft = dashSize * shft / (dashSize + gapSize); + for (i = 0; i < points.length - 1; i++) { + points[i + 1].subtractToRef(points[i], curvect); + nb = Math.floor(curvect.length() / shft); + curvect.normalize(); + for (var j = 0; j < nb; j++) { + curshft = shft * j; + positions.push(points[i].x + curshft * curvect.x, points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z); + positions.push(points[i].x + (curshft + dashshft) * curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z); + indices.push(idx, idx + 1); + idx += 2; + } + } + // Result + var vertexData = new VertexData(); + vertexData.positions = positions; + vertexData.indices = indices; + return vertexData; + }; + /** + * Creates the VertexData for a Ground + * @param options an object used to set the following optional parameters for the Ground, required but can be empty + * - width the width (x direction) of the ground, optional, default 1 + * - height the height (z direction) of the ground, optional, default 1 + * - subdivisions the number of subdivisions per side, optional, default 1 + * @returns the VertexData of the Ground + */ + VertexData.CreateGround = function (options) { + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var row, col; + var width = options.width || 1; + var height = options.height || 1; + var subdivisionsX = options.subdivisionsX || options.subdivisions || 1; + var subdivisionsY = options.subdivisionsY || options.subdivisions || 1; + for (row = 0; row <= subdivisionsY; row++) { + for (col = 0; col <= subdivisionsX; col++) { + var position = new BABYLON.Vector3((col * width) / subdivisionsX - (width / 2.0), 0, ((subdivisionsY - row) * height) / subdivisionsY - (height / 2.0)); + var normal = new BABYLON.Vector3(0, 1.0, 0); + positions.push(position.x, position.y, position.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(col / subdivisionsX, 1.0 - row / subdivisionsY); + } + } + for (row = 0; row < subdivisionsY; row++) { + for (col = 0; col < subdivisionsX; col++) { + indices.push(col + 1 + (row + 1) * (subdivisionsX + 1)); + indices.push(col + 1 + row * (subdivisionsX + 1)); + indices.push(col + row * (subdivisionsX + 1)); + indices.push(col + (row + 1) * (subdivisionsX + 1)); + indices.push(col + 1 + (row + 1) * (subdivisionsX + 1)); + indices.push(col + row * (subdivisionsX + 1)); + } + } + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + /** + * Creates the VertexData for a TiledGround by subdividing the ground into tiles + * @param options an object used to set the following optional parameters for the Ground, required but can be empty + * * xmin the ground minimum X coordinate, optional, default -1 + * * zmin the ground minimum Z coordinate, optional, default -1 + * * xmax the ground maximum X coordinate, optional, default 1 + * * zmax the ground maximum Z coordinate, optional, default 1 + * * subdivisions a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the ground width and height creating 'tiles', default {w: 6, h: 6} + * * precision a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the tile width and height, default {w: 2, h: 2} + * @returns the VertexData of the TiledGround + */ + VertexData.CreateTiledGround = function (options) { + var xmin = (options.xmin !== undefined && options.xmin !== null) ? options.xmin : -1.0; + var zmin = (options.zmin !== undefined && options.zmin !== null) ? options.zmin : -1.0; + var xmax = (options.xmax !== undefined && options.xmax !== null) ? options.xmax : 1.0; + var zmax = (options.zmax !== undefined && options.zmax !== null) ? options.zmax : 1.0; + var subdivisions = options.subdivisions || { w: 1, h: 1 }; + var precision = options.precision || { w: 1, h: 1 }; + var indices = new Array(); + var positions = new Array(); + var normals = new Array(); + var uvs = new Array(); + var row, col, tileRow, tileCol; + subdivisions.h = (subdivisions.h < 1) ? 1 : subdivisions.h; + subdivisions.w = (subdivisions.w < 1) ? 1 : subdivisions.w; + precision.w = (precision.w < 1) ? 1 : precision.w; + precision.h = (precision.h < 1) ? 1 : precision.h; + var tileSize = { + 'w': (xmax - xmin) / subdivisions.w, + 'h': (zmax - zmin) / subdivisions.h + }; + function applyTile(xTileMin, zTileMin, xTileMax, zTileMax) { + // Indices + var base = positions.length / 3; + var rowLength = precision.w + 1; + for (row = 0; row < precision.h; row++) { + for (col = 0; col < precision.w; col++) { + var square = [ + base + col + row * rowLength, + base + (col + 1) + row * rowLength, + base + (col + 1) + (row + 1) * rowLength, + base + col + (row + 1) * rowLength + ]; + indices.push(square[1]); + indices.push(square[2]); + indices.push(square[3]); + indices.push(square[0]); + indices.push(square[1]); + indices.push(square[3]); + } + } + // Position, normals and uvs + var position = BABYLON.Vector3.Zero(); + var normal = new BABYLON.Vector3(0, 1.0, 0); + for (row = 0; row <= precision.h; row++) { + position.z = (row * (zTileMax - zTileMin)) / precision.h + zTileMin; + for (col = 0; col <= precision.w; col++) { + position.x = (col * (xTileMax - xTileMin)) / precision.w + xTileMin; + position.y = 0; + positions.push(position.x, position.y, position.z); + normals.push(normal.x, normal.y, normal.z); + uvs.push(col / precision.w, row / precision.h); + } + } + } + for (tileRow = 0; tileRow < subdivisions.h; tileRow++) { + for (tileCol = 0; tileCol < subdivisions.w; tileCol++) { + applyTile(xmin + tileCol * tileSize.w, zmin + tileRow * tileSize.h, xmin + (tileCol + 1) * tileSize.w, zmin + (tileRow + 1) * tileSize.h); + } + } + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + /** + * Creates the VertexData of the Ground designed from a heightmap + * @param options an object used to set the following parameters for the Ground, required and provided by MeshBuilder.CreateGroundFromHeightMap + * * width the width (x direction) of the ground + * * height the height (z direction) of the ground + * * subdivisions the number of subdivisions per side + * * minHeight the minimum altitude on the ground, optional, default 0 + * * maxHeight the maximum altitude on the ground, optional default 1 + * * colorFilter the filter to apply to the image pixel colors to compute the height, optional Color3, default (0.3, 0.59, 0.11) + * * buffer the array holding the image color data + * * bufferWidth the width of image + * * bufferHeight the height of image + * * alphaFilter Remove any data where the alpha channel is below this value, defaults 0 (all data visible) + * @returns the VertexData of the Ground designed from a heightmap + */ + VertexData.CreateGroundFromHeightMap = function (options) { + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var row, col; + var filter = options.colorFilter || new BABYLON.Color3(0.3, 0.59, 0.11); + var alphaFilter = options.alphaFilter || 0.0; + // Vertices + for (row = 0; row <= options.subdivisions; row++) { + for (col = 0; col <= options.subdivisions; col++) { + var position = new BABYLON.Vector3((col * options.width) / options.subdivisions - (options.width / 2.0), 0, ((options.subdivisions - row) * options.height) / options.subdivisions - (options.height / 2.0)); + // Compute height + var heightMapX = (((position.x + options.width / 2) / options.width) * (options.bufferWidth - 1)) | 0; + var heightMapY = ((1.0 - (position.z + options.height / 2) / options.height) * (options.bufferHeight - 1)) | 0; + var pos = (heightMapX + heightMapY * options.bufferWidth) * 4; + var r = options.buffer[pos] / 255.0; + var g = options.buffer[pos + 1] / 255.0; + var b = options.buffer[pos + 2] / 255.0; + var a = options.buffer[pos + 3] / 255.0; + var gradient = r * filter.r + g * filter.g + b * filter.b; + // If our alpha channel is not within our filter then we will assign a 'special' height + // Then when building the indices, we will ignore any vertex that is using the special height + if (a >= alphaFilter) { + position.y = options.minHeight + (options.maxHeight - options.minHeight) * gradient; + } + else { + position.y = options.minHeight - BABYLON.Epsilon; // We can't have a height below minHeight, normally. + } + // Add vertex + positions.push(position.x, position.y, position.z); + normals.push(0, 0, 0); + uvs.push(col / options.subdivisions, 1.0 - row / options.subdivisions); + } + } + // Indices + for (row = 0; row < options.subdivisions; row++) { + for (col = 0; col < options.subdivisions; col++) { + // Calculate Indices + var idx1 = (col + 1 + (row + 1) * (options.subdivisions + 1)); + var idx2 = (col + 1 + row * (options.subdivisions + 1)); + var idx3 = (col + row * (options.subdivisions + 1)); + var idx4 = (col + (row + 1) * (options.subdivisions + 1)); + // Check that all indices are visible (based on our special height) + // Only display the vertex if all Indices are visible + // Positions are stored x,y,z for each vertex, hence the * 3 and + 1 for height + var isVisibleIdx1 = positions[idx1 * 3 + 1] >= options.minHeight; + var isVisibleIdx2 = positions[idx2 * 3 + 1] >= options.minHeight; + var isVisibleIdx3 = positions[idx3 * 3 + 1] >= options.minHeight; + if (isVisibleIdx1 && isVisibleIdx2 && isVisibleIdx3) { + indices.push(idx1); + indices.push(idx2); + indices.push(idx3); + } + var isVisibleIdx4 = positions[idx4 * 3 + 1] >= options.minHeight; + if (isVisibleIdx4 && isVisibleIdx1 && isVisibleIdx3) { + indices.push(idx4); + indices.push(idx1); + indices.push(idx3); + } + } + } + // Normals + VertexData.ComputeNormals(positions, indices, normals); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + /** + * Creates the VertexData for a Plane + * @param options an object used to set the following optional parameters for the plane, required but can be empty + * * size sets the width and height of the plane to the value of size, optional default 1 + * * width sets the width (x direction) of the plane, overwrites the width set by size, optional, default size + * * height sets the height (y direction) of the plane, overwrites the height set by size, optional, default size + * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * @returns the VertexData of the box + */ + VertexData.CreatePlane = function (options) { + var indices = []; + var positions = []; + var normals = []; + var uvs = []; + var width = options.width || options.size || 1; + var height = options.height || options.size || 1; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + // Vertices + var halfWidth = width / 2.0; + var halfHeight = height / 2.0; + positions.push(-halfWidth, -halfHeight, 0); + normals.push(0, 0, -1.0); + uvs.push(0.0, 0.0); + positions.push(halfWidth, -halfHeight, 0); + normals.push(0, 0, -1.0); + uvs.push(1.0, 0.0); + positions.push(halfWidth, halfHeight, 0); + normals.push(0, 0, -1.0); + uvs.push(1.0, 1.0); + positions.push(-halfWidth, halfHeight, 0); + normals.push(0, 0, -1.0); + uvs.push(0.0, 1.0); + // Indices + indices.push(0); + indices.push(1); + indices.push(2); + indices.push(0); + indices.push(2); + indices.push(3); + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + /** + * Creates the VertexData of the Disc or regular Polygon + * @param options an object used to set the following optional parameters for the disc, required but can be empty + * * radius the radius of the disc, optional default 0.5 + * * tessellation the number of polygon sides, optional, default 64 + * * arc a number from 0 to 1, to create an unclosed polygon based on the fraction of the circumference given by the arc value, optional, default 1 + * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * @returns the VertexData of the box + */ + VertexData.CreateDisc = function (options) { + var positions = new Array(); + var indices = new Array(); + var normals = new Array(); + var uvs = new Array(); + var radius = options.radius || 0.5; + var tessellation = options.tessellation || 64; + var arc = options.arc && (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + // positions and uvs + positions.push(0, 0, 0); // disc center first + uvs.push(0.5, 0.5); + var theta = Math.PI * 2 * arc; + var step = theta / tessellation; + for (var a = 0; a < theta; a += step) { + var x = Math.cos(a); + var y = Math.sin(a); + var u = (x + 1) / 2; + var v = (1 - y) / 2; + positions.push(radius * x, radius * y, 0); + uvs.push(u, v); + } + if (arc === 1) { + positions.push(positions[3], positions[4], positions[5]); // close the circle + uvs.push(uvs[2], uvs[3]); + } + //indices + var vertexNb = positions.length / 3; + for (var i = 1; i < vertexNb - 1; i++) { + indices.push(i + 1, 0, i); + } + // result + VertexData.ComputeNormals(positions, indices, normals); + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs); + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + /** + * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build() + * All parameters are provided by MeshBuilder.CreatePolygon as needed + * @param polygon a mesh built from polygonTriangulation.build() + * @param sideOrientation takes the values BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively + * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively + * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * @returns the VertexData of the Polygon + */ + VertexData.CreatePolygon = function (polygon, sideOrientation, fUV, fColors, frontUVs, backUVs) { + var faceUV = fUV || new Array(3); + var faceColors = fColors; + var colors = []; + // default face colors and UV if undefined + for (var f = 0; f < 3; f++) { + if (faceUV[f] === undefined) { + faceUV[f] = new BABYLON.Vector4(0, 0, 1, 1); + } + if (faceColors && faceColors[f] === undefined) { + faceColors[f] = new BABYLON.Color4(1, 1, 1, 1); + } + } + var positions = polygon.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var normals = polygon.getVerticesData(BABYLON.VertexBuffer.NormalKind); + var uvs = polygon.getVerticesData(BABYLON.VertexBuffer.UVKind); + var indices = polygon.getIndices(); + // set face colours and textures + var idx = 0; + var face = 0; + for (var index = 0; index < normals.length; index += 3) { + //Edge Face no. 1 + if (Math.abs(normals[index + 1]) < 0.001) { + face = 1; + } + //Top Face no. 0 + if (Math.abs(normals[index + 1] - 1) < 0.001) { + face = 0; + } + //Bottom Face no. 2 + if (Math.abs(normals[index + 1] + 1) < 0.001) { + face = 2; + } + idx = index / 3; + uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z; + uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w; + if (faceColors) { + colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a); + } + } + // sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + if (faceColors) { + var totalColors = (sideOrientation === BABYLON.Mesh.DOUBLESIDE) ? colors.concat(colors) : colors; + vertexData.colors = totalColors; + } + return vertexData; + }; + /** + * Creates the VertexData of the IcoSphere + * @param options an object used to set the following optional parameters for the IcoSphere, required but can be empty + * * radius the radius of the IcoSphere, optional default 1 + * * radiusX allows stretching in the x direction, optional, default radius + * * radiusY allows stretching in the y direction, optional, default radius + * * radiusZ allows stretching in the z direction, optional, default radius + * * flat when true creates a flat shaded mesh, optional, default true + * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4 + * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * @returns the VertexData of the IcoSphere + */ + VertexData.CreateIcoSphere = function (options) { + var sideOrientation = options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var radius = options.radius || 1; + var flat = (options.flat === undefined) ? true : options.flat; + var subdivisions = options.subdivisions || 4; + var radiusX = options.radiusX || radius; + var radiusY = options.radiusY || radius; + var radiusZ = options.radiusZ || radius; + var t = (1 + Math.sqrt(5)) / 2; + // 12 vertex x,y,z + var ico_vertices = [ + -1, t, -0, 1, t, 0, -1, -t, 0, 1, -t, 0, + 0, -1, -t, 0, 1, -t, 0, -1, t, 0, 1, t, + t, 0, 1, t, 0, -1, -t, 0, 1, -t, 0, -1 // v8-11 + ]; + // index of 3 vertex makes a face of icopshere + var ico_indices = [ + 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, + 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, + 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, + 4, 21, 5, 13, 17, 23, 6, 13, 22, 19, 6, 18, 9, 8, 1 + ]; + // vertex for uv have aliased position, not for UV + var vertices_unalias_id = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + // vertex alias + 0, + 2, + 3, + 3, + 3, + 4, + 7, + 8, + 9, + 9, + 10, + 11 // 23: B + 12 + ]; + // uv as integer step (not pixels !) + var ico_vertexuv = [ + 5, 1, 3, 1, 6, 4, 0, 0, + 5, 3, 4, 2, 2, 2, 4, 0, + 2, 0, 1, 1, 6, 0, 6, 2, + // vertex alias (for same vertex on different faces) + 0, 4, + 3, 3, + 4, 4, + 3, 1, + 4, 2, + 4, 4, + 0, 2, + 1, 1, + 2, 2, + 3, 3, + 1, 3, + 2, 4 // 23: B + 12 + ]; + // Vertices[0, 1, ...9, A, B] : position on UV plane + // '+' indicate duplicate position to be fixed (3,9:0,2,3,4,7,8,A,B) + // First island of uv mapping + // v = 4h 3+ 2 + // v = 3h 9+ 4 + // v = 2h 9+ 5 B + // v = 1h 9 1 0 + // v = 0h 3 8 7 A + // u = 0 1 2 3 4 5 6 *a + // Second island of uv mapping + // v = 4h 0+ B+ 4+ + // v = 3h A+ 2+ + // v = 2h 7+ 6 3+ + // v = 1h 8+ 3+ + // v = 0h + // u = 0 1 2 3 4 5 6 *a + // Face layout on texture UV mapping + // ============ + // \ 4 /\ 16 / ====== + // \ / \ / /\ 11 / + // \/ 7 \/ / \ / + // ======= / 10 \/ + // /\ 17 /\ ======= + // / \ / \ \ 15 /\ + // / 8 \/ 12 \ \ / \ + // ============ \/ 6 \ + // \ 18 /\ ============ + // \ / \ \ 5 /\ 0 / + // \/ 13 \ \ / \ / + // ======= \/ 1 \/ + // ============= + // /\ 19 /\ 2 /\ + // / \ / \ / \ + // / 14 \/ 9 \/ 3 \ + // =================== + // uv step is u:1 or 0.5, v:cos(30)=sqrt(3)/2, ratio approx is 84/97 + var ustep = 138 / 1024; + var vstep = 239 / 1024; + var uoffset = 60 / 1024; + var voffset = 26 / 1024; + // Second island should have margin, not to touch the first island + // avoid any borderline artefact in pixel rounding + var island_u_offset = -40 / 1024; + var island_v_offset = +20 / 1024; + // face is either island 0 or 1 : + // second island is for faces : [4, 7, 8, 12, 13, 16, 17, 18] + var island = [ + 0, 0, 0, 0, 1, + 0, 0, 1, 1, 0, + 0, 0, 1, 1, 0, + 0, 1, 1, 1, 0 // 15 - 19 + ]; + var indices = new Array(); + var positions = new Array(); + var normals = new Array(); + var uvs = new Array(); + var current_indice = 0; + // prepare array of 3 vector (empty) (to be worked in place, shared for each face) + var face_vertex_pos = new Array(3); + var face_vertex_uv = new Array(3); + var v012; + for (v012 = 0; v012 < 3; v012++) { + face_vertex_pos[v012] = BABYLON.Vector3.Zero(); + face_vertex_uv[v012] = BABYLON.Vector2.Zero(); + } + // create all with normals + for (var face = 0; face < 20; face++) { + // 3 vertex per face + for (v012 = 0; v012 < 3; v012++) { + // look up vertex 0,1,2 to its index in 0 to 11 (or 23 including alias) + var v_id = ico_indices[3 * face + v012]; + // vertex have 3D position (x,y,z) + face_vertex_pos[v012].copyFromFloats(ico_vertices[3 * vertices_unalias_id[v_id]], ico_vertices[3 * vertices_unalias_id[v_id] + 1], ico_vertices[3 * vertices_unalias_id[v_id] + 2]); + // Normalize to get normal, then scale to radius + face_vertex_pos[v012].normalize().scaleInPlace(radius); + // uv Coordinates from vertex ID + face_vertex_uv[v012].copyFromFloats(ico_vertexuv[2 * v_id] * ustep + uoffset + island[face] * island_u_offset, ico_vertexuv[2 * v_id + 1] * vstep + voffset + island[face] * island_v_offset); + } + // Subdivide the face (interpolate pos, norm, uv) + // - pos is linear interpolation, then projected to sphere (converge polyhedron to sphere) + // - norm is linear interpolation of vertex corner normal + // (to be checked if better to re-calc from face vertex, or if approximation is OK ??? ) + // - uv is linear interpolation + // + // Topology is as below for sub-divide by 2 + // vertex shown as v0,v1,v2 + // interp index is i1 to progress in range [v0,v1[ + // interp index is i2 to progress in range [v0,v2[ + // face index as (i1,i2) for /\ : (i1,i2),(i1+1,i2),(i1,i2+1) + // and (i1,i2)' for \/ : (i1+1,i2),(i1+1,i2+1),(i1,i2+1) + // + // + // i2 v2 + // ^ ^ + // / / \ + // / / \ + // / / \ + // / / (0,1) \ + // / #---------\ + // / / \ (0,0)'/ \ + // / / \ / \ + // / / \ / \ + // / / (0,0) \ / (1,0) \ + // / #---------#---------\ + // v0 v1 + // + // --------------------> i1 + // + // interp of (i1,i2): + // along i2 : x0=lerp(v0,v2, i2/S) <---> x1=lerp(v1,v2, i2/S) + // along i1 : lerp(x0,x1, i1/(S-i2)) + // + // centroid of triangle is needed to get help normal computation + // (c1,c2) are used for centroid location + var interp_vertex = function (i1, i2, c1, c2) { + // vertex is interpolated from + // - face_vertex_pos[0..2] + // - face_vertex_uv[0..2] + var pos_x0 = BABYLON.Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], i2 / subdivisions); + var pos_x1 = BABYLON.Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], i2 / subdivisions); + var pos_interp = (subdivisions === i2) ? face_vertex_pos[2] : BABYLON.Vector3.Lerp(pos_x0, pos_x1, i1 / (subdivisions - i2)); + pos_interp.normalize(); + var vertex_normal; + if (flat) { + // in flat mode, recalculate normal as face centroid normal + var centroid_x0 = BABYLON.Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], c2 / subdivisions); + var centroid_x1 = BABYLON.Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], c2 / subdivisions); + vertex_normal = BABYLON.Vector3.Lerp(centroid_x0, centroid_x1, c1 / (subdivisions - c2)); + } + else { + // in smooth mode, recalculate normal from each single vertex position + vertex_normal = new BABYLON.Vector3(pos_interp.x, pos_interp.y, pos_interp.z); + } + // Vertex normal need correction due to X,Y,Z radius scaling + vertex_normal.x /= radiusX; + vertex_normal.y /= radiusY; + vertex_normal.z /= radiusZ; + vertex_normal.normalize(); + var uv_x0 = BABYLON.Vector2.Lerp(face_vertex_uv[0], face_vertex_uv[2], i2 / subdivisions); + var uv_x1 = BABYLON.Vector2.Lerp(face_vertex_uv[1], face_vertex_uv[2], i2 / subdivisions); + var uv_interp = (subdivisions === i2) ? face_vertex_uv[2] : BABYLON.Vector2.Lerp(uv_x0, uv_x1, i1 / (subdivisions - i2)); + positions.push(pos_interp.x * radiusX, pos_interp.y * radiusY, pos_interp.z * radiusZ); + normals.push(vertex_normal.x, vertex_normal.y, vertex_normal.z); + uvs.push(uv_interp.x, uv_interp.y); + // push each vertex has member of a face + // Same vertex can bleong to multiple face, it is pushed multiple time (duplicate vertex are present) + indices.push(current_indice); + current_indice++; + }; + for (var i2 = 0; i2 < subdivisions; i2++) { + for (var i1 = 0; i1 + i2 < subdivisions; i1++) { + // face : (i1,i2) for /\ : + // interp for : (i1,i2),(i1+1,i2),(i1,i2+1) + interp_vertex(i1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3); + interp_vertex(i1 + 1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3); + interp_vertex(i1, i2 + 1, i1 + 1.0 / 3, i2 + 1.0 / 3); + if (i1 + i2 + 1 < subdivisions) { + // face : (i1,i2)' for \/ : + // interp for (i1+1,i2),(i1+1,i2+1),(i1,i2+1) + interp_vertex(i1 + 1, i2, i1 + 2.0 / 3, i2 + 2.0 / 3); + interp_vertex(i1 + 1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3); + interp_vertex(i1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3); + } + } + } + } + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + // inspired from // http://stemkoski.github.io/Three.js/Polyhedra.html + /** + * Creates the VertexData for a Polyhedron + * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty + * * type provided types are: + * * 0 : Tetrahedron, 1 : Octahedron, 2 : Dodecahedron, 3 : Icosahedron, 4 : Rhombicuboctahedron, 5 : Triangular Prism, 6 : Pentagonal Prism, 7 : Hexagonal Prism, 8 : Square Pyramid (J1) + * * 9 : Pentagonal Pyramid (J2), 10 : Triangular Dipyramid (J12), 11 : Pentagonal Dipyramid (J13), 12 : Elongated Square Dipyramid (J15), 13 : Elongated Pentagonal Dipyramid (J16), 14 : Elongated Pentagonal Cupola (J20) + * * size the size of the IcoSphere, optional default 1 + * * sizeX allows stretching in the x direction, optional, default size + * * sizeY allows stretching in the y direction, optional, default size + * * sizeZ allows stretching in the z direction, optional, default size + * * custom a number that overwrites the type to create from an extended set of polyhedron from https://www.babylonjs-playground.com/#21QRSK#15 with minimised editor + * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively + * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively + * * flat when true creates a flat shaded mesh, optional, default true + * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4 + * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * @returns the VertexData of the Polyhedron + */ + VertexData.CreatePolyhedron = function (options) { + // provided polyhedron types : + // 0 : Tetrahedron, 1 : Octahedron, 2 : Dodecahedron, 3 : Icosahedron, 4 : Rhombicuboctahedron, 5 : Triangular Prism, 6 : Pentagonal Prism, 7 : Hexagonal Prism, 8 : Square Pyramid (J1) + // 9 : Pentagonal Pyramid (J2), 10 : Triangular Dipyramid (J12), 11 : Pentagonal Dipyramid (J13), 12 : Elongated Square Dipyramid (J15), 13 : Elongated Pentagonal Dipyramid (J16), 14 : Elongated Pentagonal Cupola (J20) + var polyhedra = []; + polyhedra[0] = { vertex: [[0, 0, 1.732051], [1.632993, 0, -0.5773503], [-0.8164966, 1.414214, -0.5773503], [-0.8164966, -1.414214, -0.5773503]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 1], [1, 3, 2]] }; + polyhedra[1] = { vertex: [[0, 0, 1.414214], [1.414214, 0, 0], [0, 1.414214, 0], [-1.414214, 0, 0], [0, -1.414214, 0], [0, 0, -1.414214]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [3, 5, 4]] }; + polyhedra[2] = { + vertex: [[0, 0, 1.070466], [0.7136442, 0, 0.7978784], [-0.3568221, 0.618034, 0.7978784], [-0.3568221, -0.618034, 0.7978784], [0.7978784, 0.618034, 0.3568221], [0.7978784, -0.618034, 0.3568221], [-0.9341724, 0.381966, 0.3568221], [0.1362939, 1, 0.3568221], [0.1362939, -1, 0.3568221], [-0.9341724, -0.381966, 0.3568221], [0.9341724, 0.381966, -0.3568221], [0.9341724, -0.381966, -0.3568221], [-0.7978784, 0.618034, -0.3568221], [-0.1362939, 1, -0.3568221], [-0.1362939, -1, -0.3568221], [-0.7978784, -0.618034, -0.3568221], [0.3568221, 0.618034, -0.7978784], [0.3568221, -0.618034, -0.7978784], [-0.7136442, 0, -0.7978784], [0, 0, -1.070466]], + face: [[0, 1, 4, 7, 2], [0, 2, 6, 9, 3], [0, 3, 8, 5, 1], [1, 5, 11, 10, 4], [2, 7, 13, 12, 6], [3, 9, 15, 14, 8], [4, 10, 16, 13, 7], [5, 8, 14, 17, 11], [6, 12, 18, 15, 9], [10, 11, 17, 19, 16], [12, 13, 16, 19, 18], [14, 15, 18, 19, 17]] + }; + polyhedra[3] = { + vertex: [[0, 0, 1.175571], [1.051462, 0, 0.5257311], [0.3249197, 1, 0.5257311], [-0.8506508, 0.618034, 0.5257311], [-0.8506508, -0.618034, 0.5257311], [0.3249197, -1, 0.5257311], [0.8506508, 0.618034, -0.5257311], [0.8506508, -0.618034, -0.5257311], [-0.3249197, 1, -0.5257311], [-1.051462, 0, -0.5257311], [-0.3249197, -1, -0.5257311], [0, 0, -1.175571]], + face: [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 5, 7], [1, 7, 6], [1, 6, 2], [2, 6, 8], [2, 8, 3], [3, 8, 9], [3, 9, 4], [4, 9, 10], [4, 10, 5], [5, 10, 7], [6, 7, 11], [6, 11, 8], [7, 10, 11], [8, 11, 9], [9, 11, 10]] + }; + polyhedra[4] = { + vertex: [[0, 0, 1.070722], [0.7148135, 0, 0.7971752], [-0.104682, 0.7071068, 0.7971752], [-0.6841528, 0.2071068, 0.7971752], [-0.104682, -0.7071068, 0.7971752], [0.6101315, 0.7071068, 0.5236279], [1.04156, 0.2071068, 0.1367736], [0.6101315, -0.7071068, 0.5236279], [-0.3574067, 1, 0.1367736], [-0.7888348, -0.5, 0.5236279], [-0.9368776, 0.5, 0.1367736], [-0.3574067, -1, 0.1367736], [0.3574067, 1, -0.1367736], [0.9368776, -0.5, -0.1367736], [0.7888348, 0.5, -0.5236279], [0.3574067, -1, -0.1367736], [-0.6101315, 0.7071068, -0.5236279], [-1.04156, -0.2071068, -0.1367736], [-0.6101315, -0.7071068, -0.5236279], [0.104682, 0.7071068, -0.7971752], [0.6841528, -0.2071068, -0.7971752], [0.104682, -0.7071068, -0.7971752], [-0.7148135, 0, -0.7971752], [0, 0, -1.070722]], + face: [[0, 2, 3], [1, 6, 5], [4, 9, 11], [7, 15, 13], [8, 16, 10], [12, 14, 19], [17, 22, 18], [20, 21, 23], [0, 1, 5, 2], [0, 3, 9, 4], [0, 4, 7, 1], [1, 7, 13, 6], [2, 5, 12, 8], [2, 8, 10, 3], [3, 10, 17, 9], [4, 11, 15, 7], [5, 6, 14, 12], [6, 13, 20, 14], [8, 12, 19, 16], [9, 17, 18, 11], [10, 16, 22, 17], [11, 18, 21, 15], [13, 15, 21, 20], [14, 20, 23, 19], [16, 19, 23, 22], [18, 22, 23, 21]] + }; + polyhedra[5] = { vertex: [[0, 0, 1.322876], [1.309307, 0, 0.1889822], [-0.9819805, 0.8660254, 0.1889822], [0.1636634, -1.299038, 0.1889822], [0.3273268, 0.8660254, -0.9449112], [-0.8183171, -0.4330127, -0.9449112]], face: [[0, 3, 1], [2, 4, 5], [0, 1, 4, 2], [0, 2, 5, 3], [1, 3, 5, 4]] }; + polyhedra[6] = { vertex: [[0, 0, 1.159953], [1.013464, 0, 0.5642542], [-0.3501431, 0.9510565, 0.5642542], [-0.7715208, -0.6571639, 0.5642542], [0.6633206, 0.9510565, -0.03144481], [0.8682979, -0.6571639, -0.3996071], [-1.121664, 0.2938926, -0.03144481], [-0.2348831, -1.063314, -0.3996071], [0.5181548, 0.2938926, -0.9953061], [-0.5850262, -0.112257, -0.9953061]], face: [[0, 1, 4, 2], [0, 2, 6, 3], [1, 5, 8, 4], [3, 6, 9, 7], [5, 7, 9, 8], [0, 3, 7, 5, 1], [2, 4, 8, 9, 6]] }; + polyhedra[7] = { vertex: [[0, 0, 1.118034], [0.8944272, 0, 0.6708204], [-0.2236068, 0.8660254, 0.6708204], [-0.7826238, -0.4330127, 0.6708204], [0.6708204, 0.8660254, 0.2236068], [1.006231, -0.4330127, -0.2236068], [-1.006231, 0.4330127, 0.2236068], [-0.6708204, -0.8660254, -0.2236068], [0.7826238, 0.4330127, -0.6708204], [0.2236068, -0.8660254, -0.6708204], [-0.8944272, 0, -0.6708204], [0, 0, -1.118034]], face: [[0, 1, 4, 2], [0, 2, 6, 3], [1, 5, 8, 4], [3, 6, 10, 7], [5, 9, 11, 8], [7, 10, 11, 9], [0, 3, 7, 9, 5, 1], [2, 4, 8, 11, 10, 6]] }; + polyhedra[8] = { vertex: [[-0.729665, 0.670121, 0.319155], [-0.655235, -0.29213, -0.754096], [-0.093922, -0.607123, 0.537818], [0.702196, 0.595691, 0.485187], [0.776626, -0.36656, -0.588064]], face: [[1, 4, 2], [0, 1, 2], [3, 0, 2], [4, 3, 2], [4, 1, 0, 3]] }; + polyhedra[9] = { vertex: [[-0.868849, -0.100041, 0.61257], [-0.329458, 0.976099, 0.28078], [-0.26629, -0.013796, -0.477654], [-0.13392, -1.034115, 0.229829], [0.738834, 0.707117, -0.307018], [0.859683, -0.535264, -0.338508]], face: [[3, 0, 2], [5, 3, 2], [4, 5, 2], [1, 4, 2], [0, 1, 2], [0, 3, 5, 4, 1]] }; + polyhedra[10] = { vertex: [[-0.610389, 0.243975, 0.531213], [-0.187812, -0.48795, -0.664016], [-0.187812, 0.9759, -0.664016], [0.187812, -0.9759, 0.664016], [0.798201, 0.243975, 0.132803]], face: [[1, 3, 0], [3, 4, 0], [3, 1, 4], [0, 2, 1], [0, 4, 2], [2, 4, 1]] }; + polyhedra[11] = { vertex: [[-1.028778, 0.392027, -0.048786], [-0.640503, -0.646161, 0.621837], [-0.125162, -0.395663, -0.540059], [0.004683, 0.888447, -0.651988], [0.125161, 0.395663, 0.540059], [0.632925, -0.791376, 0.433102], [1.031672, 0.157063, -0.354165]], face: [[3, 2, 0], [2, 1, 0], [2, 5, 1], [0, 4, 3], [0, 1, 4], [4, 1, 5], [2, 3, 6], [3, 4, 6], [5, 2, 6], [4, 5, 6]] }; + polyhedra[12] = { vertex: [[-0.669867, 0.334933, -0.529576], [-0.669867, 0.334933, 0.529577], [-0.4043, 1.212901, 0], [-0.334933, -0.669867, -0.529576], [-0.334933, -0.669867, 0.529577], [0.334933, 0.669867, -0.529576], [0.334933, 0.669867, 0.529577], [0.4043, -1.212901, 0], [0.669867, -0.334933, -0.529576], [0.669867, -0.334933, 0.529577]], face: [[8, 9, 7], [6, 5, 2], [3, 8, 7], [5, 0, 2], [4, 3, 7], [0, 1, 2], [9, 4, 7], [1, 6, 2], [9, 8, 5, 6], [8, 3, 0, 5], [3, 4, 1, 0], [4, 9, 6, 1]] }; + polyhedra[13] = { vertex: [[-0.931836, 0.219976, -0.264632], [-0.636706, 0.318353, 0.692816], [-0.613483, -0.735083, -0.264632], [-0.326545, 0.979634, 0], [-0.318353, -0.636706, 0.692816], [-0.159176, 0.477529, -0.856368], [0.159176, -0.477529, -0.856368], [0.318353, 0.636706, 0.692816], [0.326545, -0.979634, 0], [0.613482, 0.735082, -0.264632], [0.636706, -0.318353, 0.692816], [0.931835, -0.219977, -0.264632]], face: [[11, 10, 8], [7, 9, 3], [6, 11, 8], [9, 5, 3], [2, 6, 8], [5, 0, 3], [4, 2, 8], [0, 1, 3], [10, 4, 8], [1, 7, 3], [10, 11, 9, 7], [11, 6, 5, 9], [6, 2, 0, 5], [2, 4, 1, 0], [4, 10, 7, 1]] }; + polyhedra[14] = { + vertex: [[-0.93465, 0.300459, -0.271185], [-0.838689, -0.260219, -0.516017], [-0.711319, 0.717591, 0.128359], [-0.710334, -0.156922, 0.080946], [-0.599799, 0.556003, -0.725148], [-0.503838, -0.004675, -0.969981], [-0.487004, 0.26021, 0.48049], [-0.460089, -0.750282, -0.512622], [-0.376468, 0.973135, -0.325605], [-0.331735, -0.646985, 0.084342], [-0.254001, 0.831847, 0.530001], [-0.125239, -0.494738, -0.966586], [0.029622, 0.027949, 0.730817], [0.056536, -0.982543, -0.262295], [0.08085, 1.087391, 0.076037], [0.125583, -0.532729, 0.485984], [0.262625, 0.599586, 0.780328], [0.391387, -0.726999, -0.716259], [0.513854, -0.868287, 0.139347], [0.597475, 0.85513, 0.326364], [0.641224, 0.109523, 0.783723], [0.737185, -0.451155, 0.538891], [0.848705, -0.612742, -0.314616], [0.976075, 0.365067, 0.32976], [1.072036, -0.19561, 0.084927]], + face: [[15, 18, 21], [12, 20, 16], [6, 10, 2], [3, 0, 1], [9, 7, 13], [2, 8, 4, 0], [0, 4, 5, 1], [1, 5, 11, 7], [7, 11, 17, 13], [13, 17, 22, 18], [18, 22, 24, 21], [21, 24, 23, 20], [20, 23, 19, 16], [16, 19, 14, 10], [10, 14, 8, 2], [15, 9, 13, 18], [12, 15, 21, 20], [6, 12, 16, 10], [3, 6, 2, 0], [9, 3, 1, 7], [9, 15, 12, 6, 3], [22, 17, 11, 5, 4, 8, 14, 19, 23, 24]] + }; + var type = options.type && (options.type < 0 || options.type >= polyhedra.length) ? 0 : options.type || 0; + var size = options.size; + var sizeX = options.sizeX || size || 1; + var sizeY = options.sizeY || size || 1; + var sizeZ = options.sizeZ || size || 1; + var data = options.custom || polyhedra[type]; + var nbfaces = data.face.length; + var faceUV = options.faceUV || new Array(nbfaces); + var faceColors = options.faceColors; + var flat = (options.flat === undefined) ? true : options.flat; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + var positions = new Array(); + var indices = new Array(); + var normals = new Array(); + var uvs = new Array(); + var colors = new Array(); + var index = 0; + var faceIdx = 0; // face cursor in the array "indexes" + var indexes = new Array(); + var i = 0; + var f = 0; + var u, v, ang, x, y, tmp; + // default face colors and UV if undefined + if (flat) { + for (f = 0; f < nbfaces; f++) { + if (faceColors && faceColors[f] === undefined) { + faceColors[f] = new BABYLON.Color4(1, 1, 1, 1); + } + if (faceUV && faceUV[f] === undefined) { + faceUV[f] = new BABYLON.Vector4(0, 0, 1, 1); + } + } + } + if (!flat) { + for (i = 0; i < data.vertex.length; i++) { + positions.push(data.vertex[i][0] * sizeX, data.vertex[i][1] * sizeY, data.vertex[i][2] * sizeZ); + uvs.push(0, 0); + } + for (f = 0; f < nbfaces; f++) { + for (i = 0; i < data.face[f].length - 2; i++) { + indices.push(data.face[f][0], data.face[f][i + 2], data.face[f][i + 1]); + } + } + } + else { + for (f = 0; f < nbfaces; f++) { + var fl = data.face[f].length; // number of vertices of the current face + ang = 2 * Math.PI / fl; + x = 0.5 * Math.tan(ang / 2); + y = 0.5; + // positions, uvs, colors + for (i = 0; i < fl; i++) { + // positions + positions.push(data.vertex[data.face[f][i]][0] * sizeX, data.vertex[data.face[f][i]][1] * sizeY, data.vertex[data.face[f][i]][2] * sizeZ); + indexes.push(index); + index++; + // uvs + u = faceUV[f].x + (faceUV[f].z - faceUV[f].x) * (0.5 + x); + v = faceUV[f].y + (faceUV[f].w - faceUV[f].y) * (y - 0.5); + uvs.push(u, v); + tmp = x * Math.cos(ang) - y * Math.sin(ang); + y = x * Math.sin(ang) + y * Math.cos(ang); + x = tmp; + // colors + if (faceColors) { + colors.push(faceColors[f].r, faceColors[f].g, faceColors[f].b, faceColors[f].a); + } + } + // indices from indexes + for (i = 0; i < fl - 2; i++) { + indices.push(indexes[0 + faceIdx], indexes[i + 2 + faceIdx], indexes[i + 1 + faceIdx]); + } + faceIdx += fl; + } + } + VertexData.ComputeNormals(positions, indices, normals); + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs); + var vertexData = new VertexData(); + vertexData.positions = positions; + vertexData.indices = indices; + vertexData.normals = normals; + vertexData.uvs = uvs; + if (faceColors && flat) { + vertexData.colors = colors; + } + return vertexData; + }; + // based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3D/src/away3d/primitives/TorusKnot.as?spec=svn2473&r=2473 + /** + * Creates the VertexData for a TorusKnot + * @param options an object used to set the following optional parameters for the TorusKnot, required but can be empty + * * radius the radius of the torus knot, optional, default 2 + * * tube the thickness of the tube, optional, default 0.5 + * * radialSegments the number of sides on each tube segments, optional, default 32 + * * tubularSegments the number of tubes to decompose the knot into, optional, default 32 + * * p the number of windings around the z axis, optional, default 2 + * * q the number of windings around the x axis, optional, default 3 + * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE + * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1) + * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1) + * @returns the VertexData of the Torus Knot + */ + VertexData.CreateTorusKnot = function (options) { + var indices = new Array(); + var positions = new Array(); + var normals = new Array(); + var uvs = new Array(); + var radius = options.radius || 2; + var tube = options.tube || 0.5; + var radialSegments = options.radialSegments || 32; + var tubularSegments = options.tubularSegments || 32; + var p = options.p || 2; + var q = options.q || 3; + var sideOrientation = (options.sideOrientation === 0) ? 0 : options.sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + // Helper + var getPos = function (angle) { + var cu = Math.cos(angle); + var su = Math.sin(angle); + var quOverP = q / p * angle; + var cs = Math.cos(quOverP); + var tx = radius * (2 + cs) * 0.5 * cu; + var ty = radius * (2 + cs) * su * 0.5; + var tz = radius * Math.sin(quOverP) * 0.5; + return new BABYLON.Vector3(tx, ty, tz); + }; + // Vertices + var i; + var j; + for (i = 0; i <= radialSegments; i++) { + var modI = i % radialSegments; + var u = modI / radialSegments * 2 * p * Math.PI; + var p1 = getPos(u); + var p2 = getPos(u + 0.01); + var tang = p2.subtract(p1); + var n = p2.add(p1); + var bitan = BABYLON.Vector3.Cross(tang, n); + n = BABYLON.Vector3.Cross(bitan, tang); + bitan.normalize(); + n.normalize(); + for (j = 0; j < tubularSegments; j++) { + var modJ = j % tubularSegments; + var v = modJ / tubularSegments * 2 * Math.PI; + var cx = -tube * Math.cos(v); + var cy = tube * Math.sin(v); + positions.push(p1.x + cx * n.x + cy * bitan.x); + positions.push(p1.y + cx * n.y + cy * bitan.y); + positions.push(p1.z + cx * n.z + cy * bitan.z); + uvs.push(i / radialSegments); + uvs.push(j / tubularSegments); + } + } + for (i = 0; i < radialSegments; i++) { + for (j = 0; j < tubularSegments; j++) { + var jNext = (j + 1) % tubularSegments; + var a = i * tubularSegments + j; + var b = (i + 1) * tubularSegments + j; + var c = (i + 1) * tubularSegments + jNext; + var d = i * tubularSegments + jNext; + indices.push(d); + indices.push(b); + indices.push(a); + indices.push(d); + indices.push(c); + indices.push(b); + } + } + // Normals + VertexData.ComputeNormals(positions, indices, normals); + // Sides + VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs); + // Result + var vertexData = new VertexData(); + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.normals = normals; + vertexData.uvs = uvs; + return vertexData; + }; + // Tools + /** + * Compute normals for given positions and indices + * @param positions an array of vertex positions, [...., x, y, z, ......] + * @param indices an array of indices in groups of three for each triangular facet, [...., i, j, k, ......] + * @param normals an array of vertex normals, [...., x, y, z, ......] + * @param options an object used to set the following optional parameters for the TorusKnot, optional + * * facetNormals : optional array of facet normals (vector3) + * * facetPositions : optional array of facet positions (vector3) + * * facetPartitioning : optional partitioning array. facetPositions is required for facetPartitioning computation + * * ratio : optional partitioning ratio / bounding box, required for facetPartitioning computation + * * bInfo : optional bounding info, required for facetPartitioning computation + * * bbSize : optional bounding box size data, required for facetPartitioning computation + * * subDiv : optional partitioning data about subdivsions on each axis (int), required for facetPartitioning computation + * * useRightHandedSystem: optional boolean to for right handed system computation + * * depthSort : optional boolean to enable the facet depth sort computation + * * distanceTo : optional Vector3 to compute the facet depth from this location + * * depthSortedFacets : optional array of depthSortedFacets to store the facet distances from the reference location + */ + VertexData.ComputeNormals = function (positions, indices, normals, options) { + // temporary scalar variables + var index = 0; // facet index + var p1p2x = 0.0; // p1p2 vector x coordinate + var p1p2y = 0.0; // p1p2 vector y coordinate + var p1p2z = 0.0; // p1p2 vector z coordinate + var p3p2x = 0.0; // p3p2 vector x coordinate + var p3p2y = 0.0; // p3p2 vector y coordinate + var p3p2z = 0.0; // p3p2 vector z coordinate + var faceNormalx = 0.0; // facet normal x coordinate + var faceNormaly = 0.0; // facet normal y coordinate + var faceNormalz = 0.0; // facet normal z coordinate + var length = 0.0; // facet normal length before normalization + var v1x = 0; // vector1 x index in the positions array + var v1y = 0; // vector1 y index in the positions array + var v1z = 0; // vector1 z index in the positions array + var v2x = 0; // vector2 x index in the positions array + var v2y = 0; // vector2 y index in the positions array + var v2z = 0; // vector2 z index in the positions array + var v3x = 0; // vector3 x index in the positions array + var v3y = 0; // vector3 y index in the positions array + var v3z = 0; // vector3 z index in the positions array + var computeFacetNormals = false; + var computeFacetPositions = false; + var computeFacetPartitioning = false; + var computeDepthSort = false; + var faceNormalSign = 1; + var ratio = 0; + var distanceTo = null; + if (options) { + computeFacetNormals = (options.facetNormals) ? true : false; + computeFacetPositions = (options.facetPositions) ? true : false; + computeFacetPartitioning = (options.facetPartitioning) ? true : false; + faceNormalSign = (options.useRightHandedSystem === true) ? -1 : 1; + ratio = options.ratio || 0; + computeDepthSort = (options.depthSort) ? true : false; + distanceTo = (options.distanceTo); + if (computeDepthSort) { + if (distanceTo === undefined) { + distanceTo = BABYLON.Vector3.Zero(); + } + var depthSortedFacets = options.depthSortedFacets; + } + } + // facetPartitioning reinit if needed + var xSubRatio = 0; + var ySubRatio = 0; + var zSubRatio = 0; + var subSq = 0; + if (computeFacetPartitioning && options && options.bbSize) { + var ox = 0; // X partitioning index for facet position + var oy = 0; // Y partinioning index for facet position + var oz = 0; // Z partinioning index for facet position + var b1x = 0; // X partitioning index for facet v1 vertex + var b1y = 0; // Y partitioning index for facet v1 vertex + var b1z = 0; // z partitioning index for facet v1 vertex + var b2x = 0; // X partitioning index for facet v2 vertex + var b2y = 0; // Y partitioning index for facet v2 vertex + var b2z = 0; // Z partitioning index for facet v2 vertex + var b3x = 0; // X partitioning index for facet v3 vertex + var b3y = 0; // Y partitioning index for facet v3 vertex + var b3z = 0; // Z partitioning index for facet v3 vertex + var block_idx_o = 0; // facet barycenter block index + var block_idx_v1 = 0; // v1 vertex block index + var block_idx_v2 = 0; // v2 vertex block index + var block_idx_v3 = 0; // v3 vertex block index + var bbSizeMax = (options.bbSize.x > options.bbSize.y) ? options.bbSize.x : options.bbSize.y; + bbSizeMax = (bbSizeMax > options.bbSize.z) ? bbSizeMax : options.bbSize.z; + xSubRatio = options.subDiv.X * ratio / options.bbSize.x; + ySubRatio = options.subDiv.Y * ratio / options.bbSize.y; + zSubRatio = options.subDiv.Z * ratio / options.bbSize.z; + subSq = options.subDiv.max * options.subDiv.max; + options.facetPartitioning.length = 0; + } + // reset the normals + for (index = 0; index < positions.length; index++) { + normals[index] = 0.0; + } + // Loop : 1 indice triplet = 1 facet + var nbFaces = (indices.length / 3) | 0; + for (index = 0; index < nbFaces; index++) { + // get the indexes of the coordinates of each vertex of the facet + v1x = indices[index * 3] * 3; + v1y = v1x + 1; + v1z = v1x + 2; + v2x = indices[index * 3 + 1] * 3; + v2y = v2x + 1; + v2z = v2x + 2; + v3x = indices[index * 3 + 2] * 3; + v3y = v3x + 1; + v3z = v3x + 2; + p1p2x = positions[v1x] - positions[v2x]; // compute two vectors per facet : p1p2 and p3p2 + p1p2y = positions[v1y] - positions[v2y]; + p1p2z = positions[v1z] - positions[v2z]; + p3p2x = positions[v3x] - positions[v2x]; + p3p2y = positions[v3y] - positions[v2y]; + p3p2z = positions[v3z] - positions[v2z]; + // compute the face normal with the cross product + faceNormalx = faceNormalSign * (p1p2y * p3p2z - p1p2z * p3p2y); + faceNormaly = faceNormalSign * (p1p2z * p3p2x - p1p2x * p3p2z); + faceNormalz = faceNormalSign * (p1p2x * p3p2y - p1p2y * p3p2x); + // normalize this normal and store it in the array facetData + length = Math.sqrt(faceNormalx * faceNormalx + faceNormaly * faceNormaly + faceNormalz * faceNormalz); + length = (length === 0) ? 1.0 : length; + faceNormalx /= length; + faceNormaly /= length; + faceNormalz /= length; + if (computeFacetNormals && options) { + options.facetNormals[index].x = faceNormalx; + options.facetNormals[index].y = faceNormaly; + options.facetNormals[index].z = faceNormalz; + } + if (computeFacetPositions && options) { + // compute and the facet barycenter coordinates in the array facetPositions + options.facetPositions[index].x = (positions[v1x] + positions[v2x] + positions[v3x]) / 3.0; + options.facetPositions[index].y = (positions[v1y] + positions[v2y] + positions[v3y]) / 3.0; + options.facetPositions[index].z = (positions[v1z] + positions[v2z] + positions[v3z]) / 3.0; + } + if (computeFacetPartitioning && options) { + // store the facet indexes in arrays in the main facetPartitioning array : + // compute each facet vertex (+ facet barycenter) index in the partiniong array + ox = Math.floor((options.facetPositions[index].x - options.bInfo.minimum.x * ratio) * xSubRatio); + oy = Math.floor((options.facetPositions[index].y - options.bInfo.minimum.y * ratio) * ySubRatio); + oz = Math.floor((options.facetPositions[index].z - options.bInfo.minimum.z * ratio) * zSubRatio); + b1x = Math.floor((positions[v1x] - options.bInfo.minimum.x * ratio) * xSubRatio); + b1y = Math.floor((positions[v1y] - options.bInfo.minimum.y * ratio) * ySubRatio); + b1z = Math.floor((positions[v1z] - options.bInfo.minimum.z * ratio) * zSubRatio); + b2x = Math.floor((positions[v2x] - options.bInfo.minimum.x * ratio) * xSubRatio); + b2y = Math.floor((positions[v2y] - options.bInfo.minimum.y * ratio) * ySubRatio); + b2z = Math.floor((positions[v2z] - options.bInfo.minimum.z * ratio) * zSubRatio); + b3x = Math.floor((positions[v3x] - options.bInfo.minimum.x * ratio) * xSubRatio); + b3y = Math.floor((positions[v3y] - options.bInfo.minimum.y * ratio) * ySubRatio); + b3z = Math.floor((positions[v3z] - options.bInfo.minimum.z * ratio) * zSubRatio); + block_idx_v1 = b1x + options.subDiv.max * b1y + subSq * b1z; + block_idx_v2 = b2x + options.subDiv.max * b2y + subSq * b2z; + block_idx_v3 = b3x + options.subDiv.max * b3y + subSq * b3z; + block_idx_o = ox + options.subDiv.max * oy + subSq * oz; + options.facetPartitioning[block_idx_o] = options.facetPartitioning[block_idx_o] ? options.facetPartitioning[block_idx_o] : new Array(); + options.facetPartitioning[block_idx_v1] = options.facetPartitioning[block_idx_v1] ? options.facetPartitioning[block_idx_v1] : new Array(); + options.facetPartitioning[block_idx_v2] = options.facetPartitioning[block_idx_v2] ? options.facetPartitioning[block_idx_v2] : new Array(); + options.facetPartitioning[block_idx_v3] = options.facetPartitioning[block_idx_v3] ? options.facetPartitioning[block_idx_v3] : new Array(); + // push each facet index in each block containing the vertex + options.facetPartitioning[block_idx_v1].push(index); + if (block_idx_v2 != block_idx_v1) { + options.facetPartitioning[block_idx_v2].push(index); + } + if (!(block_idx_v3 == block_idx_v2 || block_idx_v3 == block_idx_v1)) { + options.facetPartitioning[block_idx_v3].push(index); + } + if (!(block_idx_o == block_idx_v1 || block_idx_o == block_idx_v2 || block_idx_o == block_idx_v3)) { + options.facetPartitioning[block_idx_o].push(index); + } + } + if (computeDepthSort && options && options.facetPositions) { + var dsf = depthSortedFacets[index]; + dsf.ind = index * 3; + dsf.sqDistance = BABYLON.Vector3.DistanceSquared(options.facetPositions[index], distanceTo); + } + // compute the normals anyway + normals[v1x] += faceNormalx; // accumulate all the normals per face + normals[v1y] += faceNormaly; + normals[v1z] += faceNormalz; + normals[v2x] += faceNormalx; + normals[v2y] += faceNormaly; + normals[v2z] += faceNormalz; + normals[v3x] += faceNormalx; + normals[v3y] += faceNormaly; + normals[v3z] += faceNormalz; + } + // last normalization of each normal + for (index = 0; index < normals.length / 3; index++) { + faceNormalx = normals[index * 3]; + faceNormaly = normals[index * 3 + 1]; + faceNormalz = normals[index * 3 + 2]; + length = Math.sqrt(faceNormalx * faceNormalx + faceNormaly * faceNormaly + faceNormalz * faceNormalz); + length = (length === 0) ? 1.0 : length; + faceNormalx /= length; + faceNormaly /= length; + faceNormalz /= length; + normals[index * 3] = faceNormalx; + normals[index * 3 + 1] = faceNormaly; + normals[index * 3 + 2] = faceNormalz; + } + }; + VertexData._ComputeSides = function (sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs) { + var li = indices.length; + var ln = normals.length; + var i; + var n; + sideOrientation = sideOrientation || BABYLON.Mesh.DEFAULTSIDE; + switch (sideOrientation) { + case BABYLON.Mesh.FRONTSIDE: + // nothing changed + break; + case BABYLON.Mesh.BACKSIDE: + var tmp; + // indices + for (i = 0; i < li; i += 3) { + tmp = indices[i]; + indices[i] = indices[i + 2]; + indices[i + 2] = tmp; + } + // normals + for (n = 0; n < ln; n++) { + normals[n] = -normals[n]; + } + break; + case BABYLON.Mesh.DOUBLESIDE: + // positions + var lp = positions.length; + var l = lp / 3; + for (var p = 0; p < lp; p++) { + positions[lp + p] = positions[p]; + } + // indices + for (i = 0; i < li; i += 3) { + indices[i + li] = indices[i + 2] + l; + indices[i + 1 + li] = indices[i + 1] + l; + indices[i + 2 + li] = indices[i] + l; + } + // normals + for (n = 0; n < ln; n++) { + normals[ln + n] = -normals[n]; + } + // uvs + var lu = uvs.length; + var u = 0; + for (u = 0; u < lu; u++) { + uvs[u + lu] = uvs[u]; + } + frontUVs = frontUVs ? frontUVs : new BABYLON.Vector4(0.0, 0.0, 1.0, 1.0); + backUVs = backUVs ? backUVs : new BABYLON.Vector4(0.0, 0.0, 1.0, 1.0); + u = 0; + for (i = 0; i < lu / 2; i++) { + uvs[u] = frontUVs.x + (frontUVs.z - frontUVs.x) * uvs[u]; + uvs[u + 1] = frontUVs.y + (frontUVs.w - frontUVs.y) * uvs[u + 1]; + uvs[u + lu] = backUVs.x + (backUVs.z - backUVs.x) * uvs[u + lu]; + uvs[u + lu + 1] = backUVs.y + (backUVs.w - backUVs.y) * uvs[u + lu + 1]; + u += 2; + } + break; + } + }; + /** + * Applies VertexData created from the imported parameters to the geometry + * @param parsedVertexData the parsed data from an imported file + * @param geometry the geometry to apply the VertexData to + */ + VertexData.ImportVertexData = function (parsedVertexData, geometry) { + var vertexData = new VertexData(); + // positions + var positions = parsedVertexData.positions; + if (positions) { + vertexData.set(positions, BABYLON.VertexBuffer.PositionKind); + } + // normals + var normals = parsedVertexData.normals; + if (normals) { + vertexData.set(normals, BABYLON.VertexBuffer.NormalKind); + } + // tangents + var tangents = parsedVertexData.tangents; + if (tangents) { + vertexData.set(tangents, BABYLON.VertexBuffer.TangentKind); + } + // uvs + var uvs = parsedVertexData.uvs; + if (uvs) { + vertexData.set(uvs, BABYLON.VertexBuffer.UVKind); + } + // uv2s + var uv2s = parsedVertexData.uv2s; + if (uv2s) { + vertexData.set(uv2s, BABYLON.VertexBuffer.UV2Kind); + } + // uv3s + var uv3s = parsedVertexData.uv3s; + if (uv3s) { + vertexData.set(uv3s, BABYLON.VertexBuffer.UV3Kind); + } + // uv4s + var uv4s = parsedVertexData.uv4s; + if (uv4s) { + vertexData.set(uv4s, BABYLON.VertexBuffer.UV4Kind); + } + // uv5s + var uv5s = parsedVertexData.uv5s; + if (uv5s) { + vertexData.set(uv5s, BABYLON.VertexBuffer.UV5Kind); + } + // uv6s + var uv6s = parsedVertexData.uv6s; + if (uv6s) { + vertexData.set(uv6s, BABYLON.VertexBuffer.UV6Kind); + } + // colors + var colors = parsedVertexData.colors; + if (colors) { + vertexData.set(BABYLON.Color4.CheckColors4(colors, positions.length / 3), BABYLON.VertexBuffer.ColorKind); + } + // matricesIndices + var matricesIndices = parsedVertexData.matricesIndices; + if (matricesIndices) { + vertexData.set(matricesIndices, BABYLON.VertexBuffer.MatricesIndicesKind); + } + // matricesWeights + var matricesWeights = parsedVertexData.matricesWeights; + if (matricesWeights) { + vertexData.set(matricesWeights, BABYLON.VertexBuffer.MatricesWeightsKind); + } + // indices + var indices = parsedVertexData.indices; + if (indices) { + vertexData.indices = indices; + } + geometry.setAllVerticesData(vertexData, parsedVertexData.updatable); + }; + return VertexData; + }()); + BABYLON.VertexData = VertexData; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.mesh.vertexData.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Class used to store geometry data (vertex buffers + index buffer) + */ + var Geometry = /** @class */ (function () { + /** + * Creates a new geometry + * @param id defines the unique ID + * @param scene defines the hosting scene + * @param vertexData defines the VertexData used to get geometry data + * @param updatable defines if geometry must be updatable (false by default) + * @param mesh defines the mesh that will be associated with the geometry + */ + function Geometry(id, scene, vertexData, updatable, mesh) { + if (updatable === void 0) { updatable = false; } + if (mesh === void 0) { mesh = null; } + /** + * Gets the delay loading state of the geometry (none by default which means not delayed) + */ + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NONE; + this._totalVertices = 0; + this._isDisposed = false; + this._indexBufferIsUpdatable = false; + this.id = id; + this._engine = scene.getEngine(); + this._meshes = []; + this._scene = scene; + //Init vertex buffer cache + this._vertexBuffers = {}; + this._indices = []; + this._updatable = updatable; + // vertexData + if (vertexData) { + this.setAllVerticesData(vertexData, updatable); + } + else { + this._totalVertices = 0; + this._indices = []; + } + if (this._engine.getCaps().vertexArrayObject) { + this._vertexArrayObjects = {}; + } + // applyToMesh + if (mesh) { + if (mesh.getClassName() === "LinesMesh") { + this.boundingBias = new BABYLON.Vector2(0, mesh.intersectionThreshold); + this._updateExtend(); + } + this.applyToMesh(mesh); + mesh.computeWorldMatrix(true); + } + } + Object.defineProperty(Geometry.prototype, "boundingBias", { + /** + * Gets or sets the Bias Vector to apply on the bounding elements (box/sphere), the max extend is computed as v += v * bias.x + bias.y, the min is computed as v -= v * bias.x + bias.y + */ + get: function () { + return this._boundingBias; + }, + /** + * Gets or sets the Bias Vector to apply on the bounding elements (box/sphere), the max extend is computed as v += v * bias.x + bias.y, the min is computed as v -= v * bias.x + bias.y + */ + set: function (value) { + if (this._boundingBias) { + if (this._boundingBias.equals(value)) { + return; + } + this._boundingBias.copyFrom(value); + } + else { + this._boundingBias = value.clone(); + } + this._updateBoundingInfo(true, null); + }, + enumerable: true, + configurable: true + }); + /** + * Static function used to attach a new empty geometry to a mesh + * @param mesh defines the mesh to attach the geometry to + * @returns the new Geometry + */ + Geometry.CreateGeometryForMesh = function (mesh) { + var geometry = new Geometry(Geometry.RandomId(), mesh.getScene()); + geometry.applyToMesh(mesh); + return geometry; + }; + Object.defineProperty(Geometry.prototype, "extend", { + /** + * Gets the current extend of the geometry + */ + get: function () { + return this._extend; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the hosting scene + * @returns the hosting Scene + */ + Geometry.prototype.getScene = function () { + return this._scene; + }; + /** + * Gets the hosting engine + * @returns the hosting Engine + */ + Geometry.prototype.getEngine = function () { + return this._engine; + }; + /** + * Defines if the geometry is ready to use + * @returns true if the geometry is ready to be used + */ + Geometry.prototype.isReady = function () { + return this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADED || this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_NONE; + }; + Object.defineProperty(Geometry.prototype, "doNotSerialize", { + /** + * Gets a value indicating that the geometry should not be serialized + */ + get: function () { + for (var index = 0; index < this._meshes.length; index++) { + if (!this._meshes[index].doNotSerialize) { + return false; + } + } + return true; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + Geometry.prototype._rebuild = function () { + if (this._vertexArrayObjects) { + this._vertexArrayObjects = {}; + } + // Index buffer + if (this._meshes.length !== 0 && this._indices) { + this._indexBuffer = this._engine.createIndexBuffer(this._indices); + } + // Vertex buffers + for (var key in this._vertexBuffers) { + var vertexBuffer = this._vertexBuffers[key]; + vertexBuffer._rebuild(); + } + }; + /** + * Affects all geometry data in one call + * @param vertexData defines the geometry data + * @param updatable defines if the geometry must be flagged as updatable (false as default) + */ + Geometry.prototype.setAllVerticesData = function (vertexData, updatable) { + vertexData.applyToGeometry(this, updatable); + this.notifyUpdate(); + }; + /** + * Set specific vertex data + * @param kind defines the data kind (Position, normal, etc...) + * @param data defines the vertex data to use + * @param updatable defines if the vertex must be flagged as updatable (false as default) + * @param stride defines the stride to use (0 by default). This value is deduced from the kind value if not specified + */ + Geometry.prototype.setVerticesData = function (kind, data, updatable, stride) { + if (updatable === void 0) { updatable = false; } + var buffer = new BABYLON.VertexBuffer(this._engine, data, kind, updatable, this._meshes.length === 0, stride); + this.setVerticesBuffer(buffer); + }; + /** + * Removes a specific vertex data + * @param kind defines the data kind (Position, normal, etc...) + */ + Geometry.prototype.removeVerticesData = function (kind) { + if (this._vertexBuffers[kind]) { + this._vertexBuffers[kind].dispose(); + delete this._vertexBuffers[kind]; + } + }; + /** + * Affect a vertex buffer to the geometry. the vertexBuffer.getKind() function is used to determine where to store the data + * @param buffer defines the vertex buffer to use + * @param totalVertices defines the total number of vertices for position kind (could be null) + */ + Geometry.prototype.setVerticesBuffer = function (buffer, totalVertices) { + if (totalVertices === void 0) { totalVertices = null; } + var kind = buffer.getKind(); + if (this._vertexBuffers[kind]) { + this._vertexBuffers[kind].dispose(); + } + this._vertexBuffers[kind] = buffer; + if (kind === BABYLON.VertexBuffer.PositionKind) { + var data = buffer.getData(); + if (totalVertices != null) { + this._totalVertices = totalVertices; + } + else { + if (data != null) { + this._totalVertices = data.length / (buffer.byteStride / 4); + } + } + this._updateExtend(data); + this._resetPointsArrayCache(); + var meshes = this._meshes; + var numOfMeshes = meshes.length; + for (var index = 0; index < numOfMeshes; index++) { + var mesh = meshes[index]; + mesh._boundingInfo = new BABYLON.BoundingInfo(this._extend.minimum, this._extend.maximum); + mesh._createGlobalSubMesh(false); + mesh.computeWorldMatrix(true); + } + } + this.notifyUpdate(kind); + if (this._vertexArrayObjects) { + this._disposeVertexArrayObjects(); + this._vertexArrayObjects = {}; // Will trigger a rebuild of the VAO if supported + } + }; + /** + * Update a specific vertex buffer + * This function will directly update the underlying WebGLBuffer according to the passed numeric array or Float32Array + * It will do nothing if the buffer is not updatable + * @param kind defines the data kind (Position, normal, etc...) + * @param data defines the data to use + * @param offset defines the offset in the target buffer where to store the data + * @param useBytes set to true if the offset is in bytes + */ + Geometry.prototype.updateVerticesDataDirectly = function (kind, data, offset, useBytes) { + if (useBytes === void 0) { useBytes = false; } + var vertexBuffer = this.getVertexBuffer(kind); + if (!vertexBuffer) { + return; + } + vertexBuffer.updateDirectly(data, offset, useBytes); + this.notifyUpdate(kind); + }; + /** + * Update a specific vertex buffer + * This function will create a new buffer if the current one is not updatable + * @param kind defines the data kind (Position, normal, etc...) + * @param data defines the data to use + * @param updateExtends defines if the geometry extends must be recomputed (false by default) + */ + Geometry.prototype.updateVerticesData = function (kind, data, updateExtends) { + if (updateExtends === void 0) { updateExtends = false; } + var vertexBuffer = this.getVertexBuffer(kind); + if (!vertexBuffer) { + return; + } + vertexBuffer.update(data); + if (kind === BABYLON.VertexBuffer.PositionKind) { + this._updateBoundingInfo(updateExtends, data); + } + this.notifyUpdate(kind); + }; + Geometry.prototype._updateBoundingInfo = function (updateExtends, data) { + if (updateExtends) { + this._updateExtend(data); + } + var meshes = this._meshes; + var numOfMeshes = meshes.length; + this._resetPointsArrayCache(); + for (var index = 0; index < numOfMeshes; index++) { + var mesh = meshes[index]; + if (updateExtends) { + mesh._boundingInfo = new BABYLON.BoundingInfo(this._extend.minimum, this._extend.maximum); + for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) { + var subMesh = mesh.subMeshes[subIndex]; + subMesh.refreshBoundingInfo(); + } + } + } + }; + /** @hidden */ + Geometry.prototype._bind = function (effect, indexToBind) { + if (!effect) { + return; + } + if (indexToBind === undefined) { + indexToBind = this._indexBuffer; + } + var vbs = this.getVertexBuffers(); + if (!vbs) { + return; + } + if (indexToBind != this._indexBuffer || !this._vertexArrayObjects) { + this._engine.bindBuffers(vbs, indexToBind, effect); + return; + } + // Using VAO + if (!this._vertexArrayObjects[effect.key]) { + this._vertexArrayObjects[effect.key] = this._engine.recordVertexArrayObject(vbs, indexToBind, effect); + } + this._engine.bindVertexArrayObject(this._vertexArrayObjects[effect.key], indexToBind); + }; + /** + * Gets total number of vertices + * @returns the total number of vertices + */ + Geometry.prototype.getTotalVertices = function () { + if (!this.isReady()) { + return 0; + } + return this._totalVertices; + }; + /** + * Gets a specific vertex data attached to this geometry. Float data is constructed if the vertex buffer data cannot be returned directly. + * @param kind defines the data kind (Position, normal, etc...) + * @param copyWhenShared defines if the returned array must be cloned upon returning it if the current geometry is shared between multiple meshes + * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it + * @returns a float array containing vertex data + */ + Geometry.prototype.getVerticesData = function (kind, copyWhenShared, forceCopy) { + var vertexBuffer = this.getVertexBuffer(kind); + if (!vertexBuffer) { + return null; + } + var data = vertexBuffer.getData(); + if (!data) { + return null; + } + var tightlyPackedByteStride = vertexBuffer.getSize() * BABYLON.VertexBuffer.GetTypeByteLength(vertexBuffer.type); + var count = this._totalVertices * vertexBuffer.getSize(); + if (vertexBuffer.type !== BABYLON.VertexBuffer.FLOAT || vertexBuffer.byteStride !== tightlyPackedByteStride) { + var copy_1 = new Array(count); + vertexBuffer.forEach(count, function (value, index) { + copy_1[index] = value; + }); + return copy_1; + } + if (!((data instanceof Array) || (data instanceof Float32Array)) || vertexBuffer.byteOffset !== 0 || data.length !== count) { + if (data instanceof Array) { + var offset = vertexBuffer.byteOffset / 4; + return BABYLON.Tools.Slice(data, offset, offset + count); + } + else if (data instanceof ArrayBuffer) { + return new Float32Array(data, vertexBuffer.byteOffset, count); + } + else { + var offset = data.byteOffset + vertexBuffer.byteOffset; + if (forceCopy || (copyWhenShared && this._meshes.length !== 1)) { + var result = new Float32Array(count); + var source = new Float32Array(data.buffer, offset, count); + result.set(source); + return result; + } + return new Float32Array(data.buffer, offset, count); + } + } + if (forceCopy || (copyWhenShared && this._meshes.length !== 1)) { + return BABYLON.Tools.Slice(data); + } + return data; + }; + /** + * Returns a boolean defining if the vertex data for the requested `kind` is updatable + * @param kind defines the data kind (Position, normal, etc...) + * @returns true if the vertex buffer with the specified kind is updatable + */ + Geometry.prototype.isVertexBufferUpdatable = function (kind) { + var vb = this._vertexBuffers[kind]; + if (!vb) { + return false; + } + return vb.isUpdatable(); + }; + /** + * Gets a specific vertex buffer + * @param kind defines the data kind (Position, normal, etc...) + * @returns a VertexBuffer + */ + Geometry.prototype.getVertexBuffer = function (kind) { + if (!this.isReady()) { + return null; + } + return this._vertexBuffers[kind]; + }; + /** + * Returns all vertex buffers + * @return an object holding all vertex buffers indexed by kind + */ + Geometry.prototype.getVertexBuffers = function () { + if (!this.isReady()) { + return null; + } + return this._vertexBuffers; + }; + /** + * Gets a boolean indicating if specific vertex buffer is present + * @param kind defines the data kind (Position, normal, etc...) + * @returns true if data is present + */ + Geometry.prototype.isVerticesDataPresent = function (kind) { + if (!this._vertexBuffers) { + if (this._delayInfo) { + return this._delayInfo.indexOf(kind) !== -1; + } + return false; + } + return this._vertexBuffers[kind] !== undefined; + }; + /** + * Gets a list of all attached data kinds (Position, normal, etc...) + * @returns a list of string containing all kinds + */ + Geometry.prototype.getVerticesDataKinds = function () { + var result = []; + var kind; + if (!this._vertexBuffers && this._delayInfo) { + for (kind in this._delayInfo) { + result.push(kind); + } + } + else { + for (kind in this._vertexBuffers) { + result.push(kind); + } + } + return result; + }; + /** + * Update index buffer + * @param indices defines the indices to store in the index buffer + * @param offset defines the offset in the target buffer where to store the data + */ + Geometry.prototype.updateIndices = function (indices, offset) { + if (!this._indexBuffer) { + return; + } + if (!this._indexBufferIsUpdatable) { + this.setIndices(indices, null, true); + } + else { + this._engine.updateDynamicIndexBuffer(this._indexBuffer, indices, offset); + } + }; + /** + * Creates a new index buffer + * @param indices defines the indices to store in the index buffer + * @param totalVertices defines the total number of vertices (could be null) + * @param updatable defines if the index buffer must be flagged as updatable (false by default) + */ + Geometry.prototype.setIndices = function (indices, totalVertices, updatable) { + if (totalVertices === void 0) { totalVertices = null; } + if (updatable === void 0) { updatable = false; } + if (this._indexBuffer) { + this._engine._releaseBuffer(this._indexBuffer); + } + this._disposeVertexArrayObjects(); + this._indices = indices; + this._indexBufferIsUpdatable = updatable; + if (this._meshes.length !== 0 && this._indices) { + this._indexBuffer = this._engine.createIndexBuffer(this._indices, updatable); + } + if (totalVertices != undefined) { // including null and undefined + this._totalVertices = totalVertices; + } + var meshes = this._meshes; + var numOfMeshes = meshes.length; + for (var index = 0; index < numOfMeshes; index++) { + meshes[index]._createGlobalSubMesh(true); + } + this.notifyUpdate(); + }; + /** + * Return the total number of indices + * @returns the total number of indices + */ + Geometry.prototype.getTotalIndices = function () { + if (!this.isReady()) { + return 0; + } + return this._indices.length; + }; + /** + * Gets the index buffer array + * @param copyWhenShared defines if the returned array must be cloned upon returning it if the current geometry is shared between multiple meshes + * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it + * @returns the index buffer array + */ + Geometry.prototype.getIndices = function (copyWhenShared, forceCopy) { + if (!this.isReady()) { + return null; + } + var orig = this._indices; + if (!forceCopy && (!copyWhenShared || this._meshes.length === 1)) { + return orig; + } + else { + var len = orig.length; + var copy = []; + for (var i = 0; i < len; i++) { + copy.push(orig[i]); + } + return copy; + } + }; + /** + * Gets the index buffer + * @return the index buffer + */ + Geometry.prototype.getIndexBuffer = function () { + if (!this.isReady()) { + return null; + } + return this._indexBuffer; + }; + /** @hidden */ + Geometry.prototype._releaseVertexArrayObject = function (effect) { + if (effect === void 0) { effect = null; } + if (!effect || !this._vertexArrayObjects) { + return; + } + if (this._vertexArrayObjects[effect.key]) { + this._engine.releaseVertexArrayObject(this._vertexArrayObjects[effect.key]); + delete this._vertexArrayObjects[effect.key]; + } + }; + /** + * Release the associated resources for a specific mesh + * @param mesh defines the source mesh + * @param shouldDispose defines if the geometry must be disposed if there is no more mesh pointing to it + */ + Geometry.prototype.releaseForMesh = function (mesh, shouldDispose) { + var meshes = this._meshes; + var index = meshes.indexOf(mesh); + if (index === -1) { + return; + } + meshes.splice(index, 1); + mesh._geometry = null; + if (meshes.length === 0 && shouldDispose) { + this.dispose(); + } + }; + /** + * Apply current geometry to a given mesh + * @param mesh defines the mesh to apply geometry to + */ + Geometry.prototype.applyToMesh = function (mesh) { + if (mesh._geometry === this) { + return; + } + var previousGeometry = mesh._geometry; + if (previousGeometry) { + previousGeometry.releaseForMesh(mesh); + } + var meshes = this._meshes; + // must be done before setting vertexBuffers because of mesh._createGlobalSubMesh() + mesh._geometry = this; + this._scene.pushGeometry(this); + meshes.push(mesh); + if (this.isReady()) { + this._applyToMesh(mesh); + } + else { + mesh._boundingInfo = this._boundingInfo; + } + }; + Geometry.prototype._updateExtend = function (data) { + if (data === void 0) { data = null; } + if (!data) { + data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + } + this._extend = BABYLON.Tools.ExtractMinAndMax(data, 0, this._totalVertices, this.boundingBias, 3); + }; + Geometry.prototype._applyToMesh = function (mesh) { + var numOfMeshes = this._meshes.length; + // vertexBuffers + for (var kind in this._vertexBuffers) { + if (numOfMeshes === 1) { + this._vertexBuffers[kind].create(); + } + var buffer = this._vertexBuffers[kind].getBuffer(); + if (buffer) { + buffer.references = numOfMeshes; + } + if (kind === BABYLON.VertexBuffer.PositionKind) { + if (!this._extend) { + this._updateExtend(); + } + mesh._boundingInfo = new BABYLON.BoundingInfo(this._extend.minimum, this._extend.maximum); + mesh._createGlobalSubMesh(false); + //bounding info was just created again, world matrix should be applied again. + mesh._updateBoundingInfo(); + } + } + // indexBuffer + if (numOfMeshes === 1 && this._indices && this._indices.length > 0) { + this._indexBuffer = this._engine.createIndexBuffer(this._indices); + } + if (this._indexBuffer) { + this._indexBuffer.references = numOfMeshes; + } + // morphTargets + mesh._syncGeometryWithMorphTargetManager(); + }; + Geometry.prototype.notifyUpdate = function (kind) { + if (this.onGeometryUpdated) { + this.onGeometryUpdated(this, kind); + } + for (var _i = 0, _a = this._meshes; _i < _a.length; _i++) { + var mesh = _a[_i]; + mesh._markSubMeshesAsAttributesDirty(); + } + }; + /** + * Load the geometry if it was flagged as delay loaded + * @param scene defines the hosting scene + * @param onLoaded defines a callback called when the geometry is loaded + */ + Geometry.prototype.load = function (scene, onLoaded) { + if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADING) { + return; + } + if (this.isReady()) { + if (onLoaded) { + onLoaded(); + } + return; + } + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADING; + this._queueLoad(scene, onLoaded); + }; + Geometry.prototype._queueLoad = function (scene, onLoaded) { + var _this = this; + if (!this.delayLoadingFile) { + return; + } + scene._addPendingData(this); + scene._loadFile(this.delayLoadingFile, function (data) { + if (!_this._delayLoadingFunction) { + return; + } + _this._delayLoadingFunction(JSON.parse(data), _this); + _this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED; + _this._delayInfo = []; + scene._removePendingData(_this); + var meshes = _this._meshes; + var numOfMeshes = meshes.length; + for (var index = 0; index < numOfMeshes; index++) { + _this._applyToMesh(meshes[index]); + } + if (onLoaded) { + onLoaded(); + } + }, undefined, true); + }; + /** + * Invert the geometry to move from a right handed system to a left handed one. + */ + Geometry.prototype.toLeftHanded = function () { + // Flip faces + var tIndices = this.getIndices(false); + if (tIndices != null && tIndices.length > 0) { + for (var i = 0; i < tIndices.length; i += 3) { + var tTemp = tIndices[i + 0]; + tIndices[i + 0] = tIndices[i + 2]; + tIndices[i + 2] = tTemp; + } + this.setIndices(tIndices); + } + // Negate position.z + var tPositions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind, false); + if (tPositions != null && tPositions.length > 0) { + for (var i = 0; i < tPositions.length; i += 3) { + tPositions[i + 2] = -tPositions[i + 2]; + } + this.setVerticesData(BABYLON.VertexBuffer.PositionKind, tPositions, false); + } + // Negate normal.z + var tNormals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind, false); + if (tNormals != null && tNormals.length > 0) { + for (var i = 0; i < tNormals.length; i += 3) { + tNormals[i + 2] = -tNormals[i + 2]; + } + this.setVerticesData(BABYLON.VertexBuffer.NormalKind, tNormals, false); + } + }; + // Cache + /** @hidden */ + Geometry.prototype._resetPointsArrayCache = function () { + this._positions = null; + }; + /** @hidden */ + Geometry.prototype._generatePointsArray = function () { + if (this._positions) { + return true; + } + var data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); + if (!data || data.length === 0) { + return false; + } + this._positions = []; + for (var index = 0; index < data.length; index += 3) { + this._positions.push(BABYLON.Vector3.FromArray(data, index)); + } + return true; + }; + /** + * Gets a value indicating if the geometry is disposed + * @returns true if the geometry was disposed + */ + Geometry.prototype.isDisposed = function () { + return this._isDisposed; + }; + Geometry.prototype._disposeVertexArrayObjects = function () { + if (this._vertexArrayObjects) { + for (var kind in this._vertexArrayObjects) { + this._engine.releaseVertexArrayObject(this._vertexArrayObjects[kind]); + } + this._vertexArrayObjects = {}; + } + }; + /** + * Free all associated resources + */ + Geometry.prototype.dispose = function () { + var meshes = this._meshes; + var numOfMeshes = meshes.length; + var index; + for (index = 0; index < numOfMeshes; index++) { + this.releaseForMesh(meshes[index]); + } + this._meshes = []; + this._disposeVertexArrayObjects(); + for (var kind in this._vertexBuffers) { + this._vertexBuffers[kind].dispose(); + } + this._vertexBuffers = {}; + this._totalVertices = 0; + if (this._indexBuffer) { + this._engine._releaseBuffer(this._indexBuffer); + } + this._indexBuffer = null; + this._indices = []; + this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NONE; + this.delayLoadingFile = null; + this._delayLoadingFunction = null; + this._delayInfo = []; + this._boundingInfo = null; + this._scene.removeGeometry(this); + this._isDisposed = true; + }; + /** + * Clone the current geometry into a new geometry + * @param id defines the unique ID of the new geometry + * @returns a new geometry object + */ + Geometry.prototype.copy = function (id) { + var vertexData = new BABYLON.VertexData(); + vertexData.indices = []; + var indices = this.getIndices(); + if (indices) { + for (var index = 0; index < indices.length; index++) { + vertexData.indices.push(indices[index]); + } + } + var updatable = false; + var stopChecking = false; + var kind; + for (kind in this._vertexBuffers) { + // using slice() to make a copy of the array and not just reference it + var data = this.getVerticesData(kind); + if (data instanceof Float32Array) { + vertexData.set(new Float32Array(data), kind); + } + else { + vertexData.set(data.slice(0), kind); + } + if (!stopChecking) { + var vb = this.getVertexBuffer(kind); + if (vb) { + updatable = vb.isUpdatable(); + stopChecking = !updatable; + } + } + } + var geometry = new Geometry(id, this._scene, vertexData, updatable); + geometry.delayLoadState = this.delayLoadState; + geometry.delayLoadingFile = this.delayLoadingFile; + geometry._delayLoadingFunction = this._delayLoadingFunction; + for (kind in this._delayInfo) { + geometry._delayInfo = geometry._delayInfo || []; + geometry._delayInfo.push(kind); + } + // Bounding info + geometry._boundingInfo = new BABYLON.BoundingInfo(this._extend.minimum, this._extend.maximum); + return geometry; + }; + /** + * Serialize the current geometry info (and not the vertices data) into a JSON object + * @return a JSON representation of the current geometry data (without the vertices data) + */ + Geometry.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.id = this.id; + serializationObject.updatable = this._updatable; + if (BABYLON.Tags && BABYLON.Tags.HasTags(this)) { + serializationObject.tags = BABYLON.Tags.GetTags(this); + } + return serializationObject; + }; + Geometry.prototype.toNumberArray = function (origin) { + if (Array.isArray(origin)) { + return origin; + } + else { + return Array.prototype.slice.call(origin); + } + }; + /** + * Serialize all vertices data into a JSON oject + * @returns a JSON representation of the current geometry data + */ + Geometry.prototype.serializeVerticeData = function () { + var serializationObject = this.serialize(); + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) { + serializationObject.positions = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.PositionKind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.PositionKind)) { + serializationObject.positions._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + serializationObject.normals = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.NormalKind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.NormalKind)) { + serializationObject.normals._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.TangentKind)) { + serializationObject.tangets = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.TangentKind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.TangentKind)) { + serializationObject.tangets._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + serializationObject.uvs = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UVKind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.UVKind)) { + serializationObject.uvs._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) { + serializationObject.uv2s = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UV2Kind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.UV2Kind)) { + serializationObject.uv2s._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV3Kind)) { + serializationObject.uv3s = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UV3Kind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.UV3Kind)) { + serializationObject.uv3s._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV4Kind)) { + serializationObject.uv4s = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UV4Kind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.UV4Kind)) { + serializationObject.uv4s._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV5Kind)) { + serializationObject.uv5s = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UV5Kind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.UV5Kind)) { + serializationObject.uv5s._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV6Kind)) { + serializationObject.uv6s = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UV6Kind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.UV6Kind)) { + serializationObject.uv6s._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) { + serializationObject.colors = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.ColorKind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.ColorKind)) { + serializationObject.colors._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind)) { + serializationObject.matricesIndices = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind)); + serializationObject.matricesIndices._isExpanded = true; + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.MatricesIndicesKind)) { + serializationObject.matricesIndices._updatable = true; + } + } + if (this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) { + serializationObject.matricesWeights = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind)); + if (this.isVertexBufferUpdatable(BABYLON.VertexBuffer.MatricesWeightsKind)) { + serializationObject.matricesWeights._updatable = true; + } + } + serializationObject.indices = this.toNumberArray(this.getIndices()); + return serializationObject; + }; + // Statics + /** + * Extracts a clone of a mesh geometry + * @param mesh defines the source mesh + * @param id defines the unique ID of the new geometry object + * @returns the new geometry object + */ + Geometry.ExtractFromMesh = function (mesh, id) { + var geometry = mesh._geometry; + if (!geometry) { + return null; + } + return geometry.copy(id); + }; + /** + * You should now use Tools.RandomId(), this method is still here for legacy reasons. + * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523 + * Be aware Math.random() could cause collisions, but: + * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide" + * @returns a string containing a new GUID + */ + Geometry.RandomId = function () { + return BABYLON.Tools.RandomId(); + }; + /** @hidden */ + Geometry._ImportGeometry = function (parsedGeometry, mesh) { + var scene = mesh.getScene(); + // Geometry + var geometryId = parsedGeometry.geometryId; + if (geometryId) { + var geometry = scene.getGeometryByID(geometryId); + if (geometry) { + geometry.applyToMesh(mesh); + } + } + else if (parsedGeometry instanceof ArrayBuffer) { + var binaryInfo = mesh._binaryInfo; + if (binaryInfo.positionsAttrDesc && binaryInfo.positionsAttrDesc.count > 0) { + var positionsData = new Float32Array(parsedGeometry, binaryInfo.positionsAttrDesc.offset, binaryInfo.positionsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, positionsData, false); + } + if (binaryInfo.normalsAttrDesc && binaryInfo.normalsAttrDesc.count > 0) { + var normalsData = new Float32Array(parsedGeometry, binaryInfo.normalsAttrDesc.offset, binaryInfo.normalsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.NormalKind, normalsData, false); + } + if (binaryInfo.tangetsAttrDesc && binaryInfo.tangetsAttrDesc.count > 0) { + var tangentsData = new Float32Array(parsedGeometry, binaryInfo.tangetsAttrDesc.offset, binaryInfo.tangetsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.TangentKind, tangentsData, false); + } + if (binaryInfo.uvsAttrDesc && binaryInfo.uvsAttrDesc.count > 0) { + var uvsData = new Float32Array(parsedGeometry, binaryInfo.uvsAttrDesc.offset, binaryInfo.uvsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UVKind, uvsData, false); + } + if (binaryInfo.uvs2AttrDesc && binaryInfo.uvs2AttrDesc.count > 0) { + var uvs2Data = new Float32Array(parsedGeometry, binaryInfo.uvs2AttrDesc.offset, binaryInfo.uvs2AttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UV2Kind, uvs2Data, false); + } + if (binaryInfo.uvs3AttrDesc && binaryInfo.uvs3AttrDesc.count > 0) { + var uvs3Data = new Float32Array(parsedGeometry, binaryInfo.uvs3AttrDesc.offset, binaryInfo.uvs3AttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UV3Kind, uvs3Data, false); + } + if (binaryInfo.uvs4AttrDesc && binaryInfo.uvs4AttrDesc.count > 0) { + var uvs4Data = new Float32Array(parsedGeometry, binaryInfo.uvs4AttrDesc.offset, binaryInfo.uvs4AttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UV4Kind, uvs4Data, false); + } + if (binaryInfo.uvs5AttrDesc && binaryInfo.uvs5AttrDesc.count > 0) { + var uvs5Data = new Float32Array(parsedGeometry, binaryInfo.uvs5AttrDesc.offset, binaryInfo.uvs5AttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UV5Kind, uvs5Data, false); + } + if (binaryInfo.uvs6AttrDesc && binaryInfo.uvs6AttrDesc.count > 0) { + var uvs6Data = new Float32Array(parsedGeometry, binaryInfo.uvs6AttrDesc.offset, binaryInfo.uvs6AttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.UV6Kind, uvs6Data, false); + } + if (binaryInfo.colorsAttrDesc && binaryInfo.colorsAttrDesc.count > 0) { + var colorsData = new Float32Array(parsedGeometry, binaryInfo.colorsAttrDesc.offset, binaryInfo.colorsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.ColorKind, colorsData, false, binaryInfo.colorsAttrDesc.stride); + } + if (binaryInfo.matricesIndicesAttrDesc && binaryInfo.matricesIndicesAttrDesc.count > 0) { + var matricesIndicesData = new Int32Array(parsedGeometry, binaryInfo.matricesIndicesAttrDesc.offset, binaryInfo.matricesIndicesAttrDesc.count); + var floatIndices = []; + for (var i = 0; i < matricesIndicesData.length; i++) { + var index = matricesIndicesData[i]; + floatIndices.push(index & 0x000000FF); + floatIndices.push((index & 0x0000FF00) >> 8); + floatIndices.push((index & 0x00FF0000) >> 16); + floatIndices.push(index >> 24); + } + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, floatIndices, false); + } + if (binaryInfo.matricesWeightsAttrDesc && binaryInfo.matricesWeightsAttrDesc.count > 0) { + var matricesWeightsData = new Float32Array(parsedGeometry, binaryInfo.matricesWeightsAttrDesc.offset, binaryInfo.matricesWeightsAttrDesc.count); + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, matricesWeightsData, false); + } + if (binaryInfo.indicesAttrDesc && binaryInfo.indicesAttrDesc.count > 0) { + var indicesData = new Int32Array(parsedGeometry, binaryInfo.indicesAttrDesc.offset, binaryInfo.indicesAttrDesc.count); + mesh.setIndices(indicesData, null); + } + if (binaryInfo.subMeshesAttrDesc && binaryInfo.subMeshesAttrDesc.count > 0) { + var subMeshesData = new Int32Array(parsedGeometry, binaryInfo.subMeshesAttrDesc.offset, binaryInfo.subMeshesAttrDesc.count * 5); + mesh.subMeshes = []; + for (var i = 0; i < binaryInfo.subMeshesAttrDesc.count; i++) { + var materialIndex = subMeshesData[(i * 5) + 0]; + var verticesStart = subMeshesData[(i * 5) + 1]; + var verticesCount = subMeshesData[(i * 5) + 2]; + var indexStart = subMeshesData[(i * 5) + 3]; + var indexCount = subMeshesData[(i * 5) + 4]; + BABYLON.SubMesh.AddToMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh); + } + } + } + else if (parsedGeometry.positions && parsedGeometry.normals && parsedGeometry.indices) { + mesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, parsedGeometry.positions, parsedGeometry.positions._updatable); + mesh.setVerticesData(BABYLON.VertexBuffer.NormalKind, parsedGeometry.normals, parsedGeometry.normals._updatable); + if (parsedGeometry.tangents) { + mesh.setVerticesData(BABYLON.VertexBuffer.TangentKind, parsedGeometry.tangents, parsedGeometry.tangents._updatable); + } + if (parsedGeometry.uvs) { + mesh.setVerticesData(BABYLON.VertexBuffer.UVKind, parsedGeometry.uvs, parsedGeometry.uvs._updatable); + } + if (parsedGeometry.uvs2) { + mesh.setVerticesData(BABYLON.VertexBuffer.UV2Kind, parsedGeometry.uvs2, parsedGeometry.uvs2._updatable); + } + if (parsedGeometry.uvs3) { + mesh.setVerticesData(BABYLON.VertexBuffer.UV3Kind, parsedGeometry.uvs3, parsedGeometry.uvs3._updatable); + } + if (parsedGeometry.uvs4) { + mesh.setVerticesData(BABYLON.VertexBuffer.UV4Kind, parsedGeometry.uvs4, parsedGeometry.uvs4._updatable); + } + if (parsedGeometry.uvs5) { + mesh.setVerticesData(BABYLON.VertexBuffer.UV5Kind, parsedGeometry.uvs5, parsedGeometry.uvs5._updatable); + } + if (parsedGeometry.uvs6) { + mesh.setVerticesData(BABYLON.VertexBuffer.UV6Kind, parsedGeometry.uvs6, parsedGeometry.uvs6._updatable); + } + if (parsedGeometry.colors) { + mesh.setVerticesData(BABYLON.VertexBuffer.ColorKind, BABYLON.Color4.CheckColors4(parsedGeometry.colors, parsedGeometry.positions.length / 3), parsedGeometry.colors._updatable); + } + if (parsedGeometry.matricesIndices) { + if (!parsedGeometry.matricesIndices._isExpanded) { + var floatIndices = []; + for (var i = 0; i < parsedGeometry.matricesIndices.length; i++) { + var matricesIndex = parsedGeometry.matricesIndices[i]; + floatIndices.push(matricesIndex & 0x000000FF); + floatIndices.push((matricesIndex & 0x0000FF00) >> 8); + floatIndices.push((matricesIndex & 0x00FF0000) >> 16); + floatIndices.push(matricesIndex >> 24); + } + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, floatIndices, parsedGeometry.matricesIndices._updatable); + } + else { + delete parsedGeometry.matricesIndices._isExpanded; + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, parsedGeometry.matricesIndices, parsedGeometry.matricesIndices._updatable); + } + } + if (parsedGeometry.matricesIndicesExtra) { + if (!parsedGeometry.matricesIndicesExtra._isExpanded) { + var floatIndices = []; + for (var i = 0; i < parsedGeometry.matricesIndicesExtra.length; i++) { + var matricesIndex = parsedGeometry.matricesIndicesExtra[i]; + floatIndices.push(matricesIndex & 0x000000FF); + floatIndices.push((matricesIndex & 0x0000FF00) >> 8); + floatIndices.push((matricesIndex & 0x00FF0000) >> 16); + floatIndices.push(matricesIndex >> 24); + } + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, floatIndices, parsedGeometry.matricesIndicesExtra._updatable); + } + else { + delete parsedGeometry.matricesIndices._isExpanded; + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, parsedGeometry.matricesIndicesExtra, parsedGeometry.matricesIndicesExtra._updatable); + } + } + if (parsedGeometry.matricesWeights) { + Geometry._CleanMatricesWeights(parsedGeometry, mesh); + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, parsedGeometry.matricesWeights, parsedGeometry.matricesWeights._updatable); + } + if (parsedGeometry.matricesWeightsExtra) { + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsExtraKind, parsedGeometry.matricesWeightsExtra, parsedGeometry.matricesWeights._updatable); + } + mesh.setIndices(parsedGeometry.indices, null); + } + // SubMeshes + if (parsedGeometry.subMeshes) { + mesh.subMeshes = []; + for (var subIndex = 0; subIndex < parsedGeometry.subMeshes.length; subIndex++) { + var parsedSubMesh = parsedGeometry.subMeshes[subIndex]; + BABYLON.SubMesh.AddToMesh(parsedSubMesh.materialIndex, parsedSubMesh.verticesStart, parsedSubMesh.verticesCount, parsedSubMesh.indexStart, parsedSubMesh.indexCount, mesh); + } + } + // Flat shading + if (mesh._shouldGenerateFlatShading) { + mesh.convertToFlatShadedMesh(); + delete mesh._shouldGenerateFlatShading; + } + // Update + mesh.computeWorldMatrix(true); + scene.onMeshImportedObservable.notifyObservers(mesh); + }; + Geometry._CleanMatricesWeights = function (parsedGeometry, mesh) { + var epsilon = 1e-3; + if (!BABYLON.SceneLoader.CleanBoneMatrixWeights) { + return; + } + var noInfluenceBoneIndex = 0.0; + if (parsedGeometry.skeletonId > -1) { + var skeleton = mesh.getScene().getLastSkeletonByID(parsedGeometry.skeletonId); + if (!skeleton) { + return; + } + noInfluenceBoneIndex = skeleton.bones.length; + } + else { + return; + } + var matricesIndices = mesh.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind); + var matricesIndicesExtra = mesh.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind); + var matricesWeights = parsedGeometry.matricesWeights; + var matricesWeightsExtra = parsedGeometry.matricesWeightsExtra; + var influencers = parsedGeometry.numBoneInfluencer; + var size = matricesWeights.length; + for (var i = 0; i < size; i += 4) { + var weight = 0.0; + var firstZeroWeight = -1; + for (var j = 0; j < 4; j++) { + var w = matricesWeights[i + j]; + weight += w; + if (w < epsilon && firstZeroWeight < 0) { + firstZeroWeight = j; + } + } + if (matricesWeightsExtra) { + for (var j = 0; j < 4; j++) { + var w = matricesWeightsExtra[i + j]; + weight += w; + if (w < epsilon && firstZeroWeight < 0) { + firstZeroWeight = j + 4; + } + } + } + if (firstZeroWeight < 0 || firstZeroWeight > (influencers - 1)) { + firstZeroWeight = influencers - 1; + } + if (weight > epsilon) { + var mweight = 1.0 / weight; + for (var j = 0; j < 4; j++) { + matricesWeights[i + j] *= mweight; + } + if (matricesWeightsExtra) { + for (var j = 0; j < 4; j++) { + matricesWeightsExtra[i + j] *= mweight; + } + } + } + else { + if (firstZeroWeight >= 4) { + matricesWeightsExtra[i + firstZeroWeight - 4] = 1.0 - weight; + matricesIndicesExtra[i + firstZeroWeight - 4] = noInfluenceBoneIndex; + } + else { + matricesWeights[i + firstZeroWeight] = 1.0 - weight; + matricesIndices[i + firstZeroWeight] = noInfluenceBoneIndex; + } + } + } + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, matricesIndices); + if (parsedGeometry.matricesWeightsExtra) { + mesh.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesExtraKind, matricesIndicesExtra); + } + }; + /** + * Create a new geometry from persisted data (Using .babylon file format) + * @param parsedVertexData defines the persisted data + * @param scene defines the hosting scene + * @param rootUrl defines the root url to use to load assets (like delayed data) + * @returns the new geometry object + */ + Geometry.Parse = function (parsedVertexData, scene, rootUrl) { + if (scene.getGeometryByID(parsedVertexData.id)) { + return null; // null since geometry could be something else than a box... + } + var geometry = new Geometry(parsedVertexData.id, scene, undefined, parsedVertexData.updatable); + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(geometry, parsedVertexData.tags); + } + if (parsedVertexData.delayLoadingFile) { + geometry.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED; + geometry.delayLoadingFile = rootUrl + parsedVertexData.delayLoadingFile; + geometry._boundingInfo = new BABYLON.BoundingInfo(BABYLON.Vector3.FromArray(parsedVertexData.boundingBoxMinimum), BABYLON.Vector3.FromArray(parsedVertexData.boundingBoxMaximum)); + geometry._delayInfo = []; + if (parsedVertexData.hasUVs) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UVKind); + } + if (parsedVertexData.hasUVs2) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UV2Kind); + } + if (parsedVertexData.hasUVs3) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UV3Kind); + } + if (parsedVertexData.hasUVs4) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UV4Kind); + } + if (parsedVertexData.hasUVs5) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UV5Kind); + } + if (parsedVertexData.hasUVs6) { + geometry._delayInfo.push(BABYLON.VertexBuffer.UV6Kind); + } + if (parsedVertexData.hasColors) { + geometry._delayInfo.push(BABYLON.VertexBuffer.ColorKind); + } + if (parsedVertexData.hasMatricesIndices) { + geometry._delayInfo.push(BABYLON.VertexBuffer.MatricesIndicesKind); + } + if (parsedVertexData.hasMatricesWeights) { + geometry._delayInfo.push(BABYLON.VertexBuffer.MatricesWeightsKind); + } + geometry._delayLoadingFunction = BABYLON.VertexData.ImportVertexData; + } + else { + BABYLON.VertexData.ImportVertexData(parsedVertexData, geometry); + } + scene.pushGeometry(geometry, true); + return geometry; + }; + return Geometry; + }()); + BABYLON.Geometry = Geometry; + // Primitives + /// Abstract class + /** + * Abstract class used to provide common services for all typed geometries + * @hidden + */ + var _PrimitiveGeometry = /** @class */ (function (_super) { + __extends(_PrimitiveGeometry, _super); + /** + * Creates a new typed geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param _canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + */ + function _PrimitiveGeometry(id, scene, _canBeRegenerated, mesh) { + if (_canBeRegenerated === void 0) { _canBeRegenerated = false; } + if (mesh === void 0) { mesh = null; } + var _this = _super.call(this, id, scene, undefined, false, mesh) || this; + _this._canBeRegenerated = _canBeRegenerated; + _this._beingRegenerated = true; + _this.regenerate(); + _this._beingRegenerated = false; + return _this; + } + /** + * Gets a value indicating if the geometry supports being regenerated with new parameters (false by default) + * @returns true if the geometry can be regenerated + */ + _PrimitiveGeometry.prototype.canBeRegenerated = function () { + return this._canBeRegenerated; + }; + /** + * If the geometry supports regeneration, the function will recreates the geometry with updated parameter values + */ + _PrimitiveGeometry.prototype.regenerate = function () { + if (!this._canBeRegenerated) { + return; + } + this._beingRegenerated = true; + this.setAllVerticesData(this._regenerateVertexData(), false); + this._beingRegenerated = false; + }; + /** + * Clone the geometry + * @param id defines the unique ID of the new geometry + * @returns the new geometry + */ + _PrimitiveGeometry.prototype.asNewGeometry = function (id) { + return _super.prototype.copy.call(this, id); + }; + // overrides + _PrimitiveGeometry.prototype.setAllVerticesData = function (vertexData, updatable) { + if (!this._beingRegenerated) { + return; + } + _super.prototype.setAllVerticesData.call(this, vertexData, false); + }; + _PrimitiveGeometry.prototype.setVerticesData = function (kind, data, updatable) { + if (!this._beingRegenerated) { + return; + } + _super.prototype.setVerticesData.call(this, kind, data, false); + }; + // to override + /** @hidden */ + _PrimitiveGeometry.prototype._regenerateVertexData = function () { + throw new Error("Abstract method"); + }; + _PrimitiveGeometry.prototype.copy = function (id) { + throw new Error("Must be overriden in sub-classes."); + }; + _PrimitiveGeometry.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.canBeRegenerated = this.canBeRegenerated(); + return serializationObject; + }; + return _PrimitiveGeometry; + }(Geometry)); + BABYLON._PrimitiveGeometry = _PrimitiveGeometry; + /** + * Creates a ribbon geometry + * @description See http://doc.babylonjs.com/how_to/ribbon_tutorial, http://doc.babylonjs.com/resources/maths_make_ribbons + */ + var RibbonGeometry = /** @class */ (function (_super) { + __extends(RibbonGeometry, _super); + /** + * Creates a ribbon geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param pathArray defines the array of paths to use + * @param closeArray defines if the last path and the first path must be joined + * @param closePath defines if the last and first points of each path in your pathArray must be joined + * @param offset defines the offset between points + * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + function RibbonGeometry(id, scene, + /** + * Defines the array of paths to use + */ + pathArray, + /** + * Defines if the last and first points of each path in your pathArray must be joined + */ + closeArray, + /** + * Defines if the last and first points of each path in your pathArray must be joined + */ + closePath, + /** + * Defines the offset between points + */ + offset, canBeRegenerated, mesh, + /** + * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + side) { + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this; + _this.pathArray = pathArray; + _this.closeArray = closeArray; + _this.closePath = closePath; + _this.offset = offset; + _this.side = side; + return _this; + } + /** @hidden */ + RibbonGeometry.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateRibbon({ pathArray: this.pathArray, closeArray: this.closeArray, closePath: this.closePath, offset: this.offset, sideOrientation: this.side }); + }; + RibbonGeometry.prototype.copy = function (id) { + return new RibbonGeometry(id, this.getScene(), this.pathArray, this.closeArray, this.closePath, this.offset, this.canBeRegenerated(), undefined, this.side); + }; + return RibbonGeometry; + }(_PrimitiveGeometry)); + BABYLON.RibbonGeometry = RibbonGeometry; + /** + * Creates a box geometry + * @description see http://doc.babylonjs.com/how_to/set_shapes#box + */ + var BoxGeometry = /** @class */ (function (_super) { + __extends(BoxGeometry, _super); + /** + * Creates a box geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param size defines the zise of the box (width, height and depth are the same) + * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + function BoxGeometry(id, scene, + /** + * Defines the zise of the box (width, height and depth are the same) + */ + size, canBeRegenerated, mesh, + /** + * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + side) { + if (mesh === void 0) { mesh = null; } + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this; + _this.size = size; + _this.side = side; + return _this; + } + /** @hidden */ + BoxGeometry.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateBox({ size: this.size, sideOrientation: this.side }); + }; + BoxGeometry.prototype.copy = function (id) { + return new BoxGeometry(id, this.getScene(), this.size, this.canBeRegenerated(), undefined, this.side); + }; + BoxGeometry.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.size = this.size; + return serializationObject; + }; + BoxGeometry.Parse = function (parsedBox, scene) { + if (scene.getGeometryByID(parsedBox.id)) { + return null; // null since geometry could be something else than a box... + } + var box = new BoxGeometry(parsedBox.id, scene, parsedBox.size, parsedBox.canBeRegenerated, null); + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(box, parsedBox.tags); + } + scene.pushGeometry(box, true); + return box; + }; + return BoxGeometry; + }(_PrimitiveGeometry)); + BABYLON.BoxGeometry = BoxGeometry; + /** + * Creates a sphere geometry + * @description see http://doc.babylonjs.com/how_to/set_shapes#sphere + */ + var SphereGeometry = /** @class */ (function (_super) { + __extends(SphereGeometry, _super); + /** + * Create a new sphere geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param segments defines the number of segments to use to create the sphere + * @param diameter defines the diameter of the sphere + * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + function SphereGeometry(id, scene, + /** + * Defines the number of segments to use to create the sphere + */ + segments, + /** + * Defines the diameter of the sphere + */ + diameter, canBeRegenerated, mesh, + /** + * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + side) { + if (mesh === void 0) { mesh = null; } + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this; + _this.segments = segments; + _this.diameter = diameter; + _this.side = side; + return _this; + } + /** @hidden */ + SphereGeometry.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateSphere({ segments: this.segments, diameter: this.diameter, sideOrientation: this.side }); + }; + SphereGeometry.prototype.copy = function (id) { + return new SphereGeometry(id, this.getScene(), this.segments, this.diameter, this.canBeRegenerated(), null, this.side); + }; + SphereGeometry.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.segments = this.segments; + serializationObject.diameter = this.diameter; + return serializationObject; + }; + SphereGeometry.Parse = function (parsedSphere, scene) { + if (scene.getGeometryByID(parsedSphere.id)) { + return null; // null since geometry could be something else than a sphere... + } + var sphere = new SphereGeometry(parsedSphere.id, scene, parsedSphere.segments, parsedSphere.diameter, parsedSphere.canBeRegenerated, null); + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(sphere, parsedSphere.tags); + } + scene.pushGeometry(sphere, true); + return sphere; + }; + return SphereGeometry; + }(_PrimitiveGeometry)); + BABYLON.SphereGeometry = SphereGeometry; + /** + * Creates a disc geometry + * @description see http://doc.babylonjs.com/how_to/set_shapes#disc-or-regular-polygon + */ + var DiscGeometry = /** @class */ (function (_super) { + __extends(DiscGeometry, _super); + /** + * Creates a new disc geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param radius defines the radius of the disc + * @param tessellation defines the tesselation factor to apply to the disc + * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + function DiscGeometry(id, scene, + /** + * Defines the radius of the disc + */ + radius, + /** + * Defines the tesselation factor to apply to the disc + */ + tessellation, canBeRegenerated, mesh, + /** + * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + side) { + if (mesh === void 0) { mesh = null; } + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this; + _this.radius = radius; + _this.tessellation = tessellation; + _this.side = side; + return _this; + } + /** @hidden */ + DiscGeometry.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateDisc({ radius: this.radius, tessellation: this.tessellation, sideOrientation: this.side }); + }; + DiscGeometry.prototype.copy = function (id) { + return new DiscGeometry(id, this.getScene(), this.radius, this.tessellation, this.canBeRegenerated(), null, this.side); + }; + return DiscGeometry; + }(_PrimitiveGeometry)); + BABYLON.DiscGeometry = DiscGeometry; + /** + * Creates a new cylinder geometry + * @description see http://doc.babylonjs.com/how_to/set_shapes#cylinder-or-cone + */ + var CylinderGeometry = /** @class */ (function (_super) { + __extends(CylinderGeometry, _super); + /** + * Creates a new cylinder geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param height defines the height of the cylinder + * @param diameterTop defines the diameter of the cylinder's top cap + * @param diameterBottom defines the diameter of the cylinder's bottom cap + * @param tessellation defines the tessellation factor to apply to the cylinder (number of radial sides) + * @param subdivisions defines the number of subdivisions to apply to the cylinder (number of rings) (1 by default) + * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + function CylinderGeometry(id, scene, + /** + * Defines the height of the cylinder + */ + height, + /** + * Defines the diameter of the cylinder's top cap + */ + diameterTop, + /** + * Defines the diameter of the cylinder's bottom cap + */ + diameterBottom, + /** + * Defines the tessellation factor to apply to the cylinder + */ + tessellation, + /** + * Defines the number of subdivisions to apply to the cylinder (1 by default) + */ + subdivisions, canBeRegenerated, mesh, + /** + * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + side) { + if (subdivisions === void 0) { subdivisions = 1; } + if (mesh === void 0) { mesh = null; } + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this; + _this.height = height; + _this.diameterTop = diameterTop; + _this.diameterBottom = diameterBottom; + _this.tessellation = tessellation; + _this.subdivisions = subdivisions; + _this.side = side; + return _this; + } + /** @hidden */ + CylinderGeometry.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateCylinder({ height: this.height, diameterTop: this.diameterTop, diameterBottom: this.diameterBottom, tessellation: this.tessellation, subdivisions: this.subdivisions, sideOrientation: this.side }); + }; + CylinderGeometry.prototype.copy = function (id) { + return new CylinderGeometry(id, this.getScene(), this.height, this.diameterTop, this.diameterBottom, this.tessellation, this.subdivisions, this.canBeRegenerated(), null, this.side); + }; + CylinderGeometry.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.height = this.height; + serializationObject.diameterTop = this.diameterTop; + serializationObject.diameterBottom = this.diameterBottom; + serializationObject.tessellation = this.tessellation; + return serializationObject; + }; + CylinderGeometry.Parse = function (parsedCylinder, scene) { + if (scene.getGeometryByID(parsedCylinder.id)) { + return null; // null since geometry could be something else than a cylinder... + } + var cylinder = new CylinderGeometry(parsedCylinder.id, scene, parsedCylinder.height, parsedCylinder.diameterTop, parsedCylinder.diameterBottom, parsedCylinder.tessellation, parsedCylinder.subdivisions, parsedCylinder.canBeRegenerated, null); + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(cylinder, parsedCylinder.tags); + } + scene.pushGeometry(cylinder, true); + return cylinder; + }; + return CylinderGeometry; + }(_PrimitiveGeometry)); + BABYLON.CylinderGeometry = CylinderGeometry; + /** + * Creates a new torus geometry + * @description see http://doc.babylonjs.com/how_to/set_shapes#torus + */ + var TorusGeometry = /** @class */ (function (_super) { + __extends(TorusGeometry, _super); + /** + * Creates a new torus geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param diameter defines the diameter of the torus + * @param thickness defines the thickness of the torus (ie. internal diameter) + * @param tessellation defines the tesselation factor to apply to the torus (number of segments along the circle) + * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + function TorusGeometry(id, scene, + /** + * Defines the diameter of the torus + */ + diameter, + /** + * Defines the thickness of the torus (ie. internal diameter) + */ + thickness, + /** + * Defines the tesselation factor to apply to the torus + */ + tessellation, canBeRegenerated, mesh, + /** + * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + side) { + if (mesh === void 0) { mesh = null; } + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this; + _this.diameter = diameter; + _this.thickness = thickness; + _this.tessellation = tessellation; + _this.side = side; + return _this; + } + /** @hidden */ + TorusGeometry.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateTorus({ diameter: this.diameter, thickness: this.thickness, tessellation: this.tessellation, sideOrientation: this.side }); + }; + TorusGeometry.prototype.copy = function (id) { + return new TorusGeometry(id, this.getScene(), this.diameter, this.thickness, this.tessellation, this.canBeRegenerated(), null, this.side); + }; + TorusGeometry.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.diameter = this.diameter; + serializationObject.thickness = this.thickness; + serializationObject.tessellation = this.tessellation; + return serializationObject; + }; + TorusGeometry.Parse = function (parsedTorus, scene) { + if (scene.getGeometryByID(parsedTorus.id)) { + return null; // null since geometry could be something else than a torus... + } + var torus = new TorusGeometry(parsedTorus.id, scene, parsedTorus.diameter, parsedTorus.thickness, parsedTorus.tessellation, parsedTorus.canBeRegenerated, null); + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(torus, parsedTorus.tags); + } + scene.pushGeometry(torus, true); + return torus; + }; + return TorusGeometry; + }(_PrimitiveGeometry)); + BABYLON.TorusGeometry = TorusGeometry; + /** + * Creates a new ground geometry + * @description see http://doc.babylonjs.com/how_to/set_shapes#ground + */ + var GroundGeometry = /** @class */ (function (_super) { + __extends(GroundGeometry, _super); + /** + * Creates a new ground geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param width defines the width of the ground + * @param height defines the height of the ground + * @param subdivisions defines the subdivisions to apply to the ground + * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + */ + function GroundGeometry(id, scene, + /** + * Defines the width of the ground + */ + width, + /** + * Defines the height of the ground + */ + height, + /** + * Defines the subdivisions to apply to the ground + */ + subdivisions, canBeRegenerated, mesh) { + if (mesh === void 0) { mesh = null; } + var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this; + _this.width = width; + _this.height = height; + _this.subdivisions = subdivisions; + return _this; + } + /** @hidden */ + GroundGeometry.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateGround({ width: this.width, height: this.height, subdivisions: this.subdivisions }); + }; + GroundGeometry.prototype.copy = function (id) { + return new GroundGeometry(id, this.getScene(), this.width, this.height, this.subdivisions, this.canBeRegenerated(), null); + }; + GroundGeometry.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.width = this.width; + serializationObject.height = this.height; + serializationObject.subdivisions = this.subdivisions; + return serializationObject; + }; + GroundGeometry.Parse = function (parsedGround, scene) { + if (scene.getGeometryByID(parsedGround.id)) { + return null; // null since geometry could be something else than a ground... + } + var ground = new GroundGeometry(parsedGround.id, scene, parsedGround.width, parsedGround.height, parsedGround.subdivisions, parsedGround.canBeRegenerated, null); + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(ground, parsedGround.tags); + } + scene.pushGeometry(ground, true); + return ground; + }; + return GroundGeometry; + }(_PrimitiveGeometry)); + BABYLON.GroundGeometry = GroundGeometry; + /** + * Creates a tiled ground geometry + * @description see http://doc.babylonjs.com/how_to/set_shapes#tiled-ground + */ + var TiledGroundGeometry = /** @class */ (function (_super) { + __extends(TiledGroundGeometry, _super); + /** + * Creates a tiled ground geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param xmin defines the minimum value on X axis + * @param zmin defines the minimum value on Z axis + * @param xmax defines the maximum value on X axis + * @param zmax defines the maximum value on Z axis + * @param subdivisions defines the subdivisions to apply to the ground (number of subdivisions (tiles) on the height and the width of the map) + * @param precision defines the precision to use when computing the tiles + * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + */ + function TiledGroundGeometry(id, scene, + /** + * Defines the minimum value on X axis + */ + xmin, + /** + * Defines the minimum value on Z axis + */ + zmin, + /** + * Defines the maximum value on X axis + */ + xmax, + /** + * Defines the maximum value on Z axis + */ + zmax, + /** + * Defines the subdivisions to apply to the ground + */ + subdivisions, + /** + * Defines the precision to use when computing the tiles + */ + precision, canBeRegenerated, mesh) { + if (mesh === void 0) { mesh = null; } + var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this; + _this.xmin = xmin; + _this.zmin = zmin; + _this.xmax = xmax; + _this.zmax = zmax; + _this.subdivisions = subdivisions; + _this.precision = precision; + return _this; + } + /** @hidden */ + TiledGroundGeometry.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateTiledGround({ xmin: this.xmin, zmin: this.zmin, xmax: this.xmax, zmax: this.zmax, subdivisions: this.subdivisions, precision: this.precision }); + }; + TiledGroundGeometry.prototype.copy = function (id) { + return new TiledGroundGeometry(id, this.getScene(), this.xmin, this.zmin, this.xmax, this.zmax, this.subdivisions, this.precision, this.canBeRegenerated(), null); + }; + return TiledGroundGeometry; + }(_PrimitiveGeometry)); + BABYLON.TiledGroundGeometry = TiledGroundGeometry; + /** + * Creates a plane geometry + * @description see http://doc.babylonjs.com/how_to/set_shapes#plane + */ + var PlaneGeometry = /** @class */ (function (_super) { + __extends(PlaneGeometry, _super); + /** + * Creates a plane geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param size defines the size of the plane (width === height) + * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + function PlaneGeometry(id, scene, + /** + * Defines the size of the plane (width === height) + */ + size, canBeRegenerated, mesh, + /** + * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + side) { + if (mesh === void 0) { mesh = null; } + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this; + _this.size = size; + _this.side = side; + return _this; + } + /** @hidden */ + PlaneGeometry.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreatePlane({ size: this.size, sideOrientation: this.side }); + }; + PlaneGeometry.prototype.copy = function (id) { + return new PlaneGeometry(id, this.getScene(), this.size, this.canBeRegenerated(), null, this.side); + }; + PlaneGeometry.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.size = this.size; + return serializationObject; + }; + PlaneGeometry.Parse = function (parsedPlane, scene) { + if (scene.getGeometryByID(parsedPlane.id)) { + return null; // null since geometry could be something else than a ground... + } + var plane = new PlaneGeometry(parsedPlane.id, scene, parsedPlane.size, parsedPlane.canBeRegenerated, null); + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(plane, parsedPlane.tags); + } + scene.pushGeometry(plane, true); + return plane; + }; + return PlaneGeometry; + }(_PrimitiveGeometry)); + BABYLON.PlaneGeometry = PlaneGeometry; + /** + * Creates a torus knot geometry + * @description see http://doc.babylonjs.com/how_to/set_shapes#torus-knot + */ + var TorusKnotGeometry = /** @class */ (function (_super) { + __extends(TorusKnotGeometry, _super); + /** + * Creates a torus knot geometry + * @param id defines the unique ID of the geometry + * @param scene defines the hosting scene + * @param radius defines the radius of the torus knot + * @param tube defines the thickness of the torus knot tube + * @param radialSegments defines the number of radial segments + * @param tubularSegments defines the number of tubular segments + * @param p defines the first number of windings + * @param q defines the second number of windings + * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default) + * @param mesh defines the hosting mesh (can be null) + * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + function TorusKnotGeometry(id, scene, + /** + * Defines the radius of the torus knot + */ + radius, + /** + * Defines the thickness of the torus knot tube + */ + tube, + /** + * Defines the number of radial segments + */ + radialSegments, + /** + * Defines the number of tubular segments + */ + tubularSegments, + /** + * Defines the first number of windings + */ + p, + /** + * Defines the second number of windings + */ + q, canBeRegenerated, mesh, + /** + * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE) + */ + side) { + if (mesh === void 0) { mesh = null; } + if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; } + var _this = _super.call(this, id, scene, canBeRegenerated, mesh) || this; + _this.radius = radius; + _this.tube = tube; + _this.radialSegments = radialSegments; + _this.tubularSegments = tubularSegments; + _this.p = p; + _this.q = q; + _this.side = side; + return _this; + } + /** @hidden */ + TorusKnotGeometry.prototype._regenerateVertexData = function () { + return BABYLON.VertexData.CreateTorusKnot({ radius: this.radius, tube: this.tube, radialSegments: this.radialSegments, tubularSegments: this.tubularSegments, p: this.p, q: this.q, sideOrientation: this.side }); + }; + TorusKnotGeometry.prototype.copy = function (id) { + return new TorusKnotGeometry(id, this.getScene(), this.radius, this.tube, this.radialSegments, this.tubularSegments, this.p, this.q, this.canBeRegenerated(), null, this.side); + }; + TorusKnotGeometry.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.radius = this.radius; + serializationObject.tube = this.tube; + serializationObject.radialSegments = this.radialSegments; + serializationObject.tubularSegments = this.tubularSegments; + serializationObject.p = this.p; + serializationObject.q = this.q; + return serializationObject; + }; + TorusKnotGeometry.Parse = function (parsedTorusKnot, scene) { + if (scene.getGeometryByID(parsedTorusKnot.id)) { + return null; // null since geometry could be something else than a ground... + } + var torusKnot = new TorusKnotGeometry(parsedTorusKnot.id, scene, parsedTorusKnot.radius, parsedTorusKnot.tube, parsedTorusKnot.radialSegments, parsedTorusKnot.tubularSegments, parsedTorusKnot.p, parsedTorusKnot.q, parsedTorusKnot.canBeRegenerated, null); + if (BABYLON.Tags) { + BABYLON.Tags.AddTagsTo(torusKnot, parsedTorusKnot.tags); + } + scene.pushGeometry(torusKnot, true); + return torusKnot; + }; + return TorusKnotGeometry; + }(_PrimitiveGeometry)); + BABYLON.TorusKnotGeometry = TorusKnotGeometry; + //} +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.geometry.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window + */ + var PerformanceMonitor = /** @class */ (function () { + /** + * constructor + * @param frameSampleSize The number of samples required to saturate the sliding window + */ + function PerformanceMonitor(frameSampleSize) { + if (frameSampleSize === void 0) { frameSampleSize = 30; } + this._enabled = true; + this._rollingFrameTime = new RollingAverage(frameSampleSize); + } + /** + * Samples current frame + * @param timeMs A timestamp in milliseconds of the current frame to compare with other frames + */ + PerformanceMonitor.prototype.sampleFrame = function (timeMs) { + if (timeMs === void 0) { timeMs = BABYLON.Tools.Now; } + if (!this._enabled) { + return; + } + if (this._lastFrameTimeMs != null) { + var dt = timeMs - this._lastFrameTimeMs; + this._rollingFrameTime.add(dt); + } + this._lastFrameTimeMs = timeMs; + }; + Object.defineProperty(PerformanceMonitor.prototype, "averageFrameTime", { + /** + * Returns the average frame time in milliseconds over the sliding window (or the subset of frames sampled so far) + */ + get: function () { + return this._rollingFrameTime.average; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerformanceMonitor.prototype, "averageFrameTimeVariance", { + /** + * Returns the variance frame time in milliseconds over the sliding window (or the subset of frames sampled so far) + */ + get: function () { + return this._rollingFrameTime.variance; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerformanceMonitor.prototype, "instantaneousFrameTime", { + /** + * Returns the frame time of the most recent frame + */ + get: function () { + return this._rollingFrameTime.history(0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerformanceMonitor.prototype, "averageFPS", { + /** + * Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far) + */ + get: function () { + return 1000.0 / this._rollingFrameTime.average; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerformanceMonitor.prototype, "instantaneousFPS", { + /** + * Returns the average framerate in frames per second using the most recent frame time + */ + get: function () { + var history = this._rollingFrameTime.history(0); + if (history === 0) { + return 0; + } + return 1000.0 / history; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PerformanceMonitor.prototype, "isSaturated", { + /** + * Returns true if enough samples have been taken to completely fill the sliding window + */ + get: function () { + return this._rollingFrameTime.isSaturated(); + }, + enumerable: true, + configurable: true + }); + /** + * Enables contributions to the sliding window sample set + */ + PerformanceMonitor.prototype.enable = function () { + this._enabled = true; + }; + /** + * Disables contributions to the sliding window sample set + * Samples will not be interpolated over the disabled period + */ + PerformanceMonitor.prototype.disable = function () { + this._enabled = false; + //clear last sample to avoid interpolating over the disabled period when next enabled + this._lastFrameTimeMs = null; + }; + Object.defineProperty(PerformanceMonitor.prototype, "isEnabled", { + /** + * Returns true if sampling is enabled + */ + get: function () { + return this._enabled; + }, + enumerable: true, + configurable: true + }); + /** + * Resets performance monitor + */ + PerformanceMonitor.prototype.reset = function () { + //clear last sample to avoid interpolating over the disabled period when next enabled + this._lastFrameTimeMs = null; + //wipe record + this._rollingFrameTime.reset(); + }; + return PerformanceMonitor; + }()); + BABYLON.PerformanceMonitor = PerformanceMonitor; + /** + * RollingAverage + * + * Utility to efficiently compute the rolling average and variance over a sliding window of samples + */ + var RollingAverage = /** @class */ (function () { + /** + * constructor + * @param length The number of samples required to saturate the sliding window + */ + function RollingAverage(length) { + this._samples = new Array(length); + this.reset(); + } + /** + * Adds a sample to the sample set + * @param v The sample value + */ + RollingAverage.prototype.add = function (v) { + //http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance + var delta; + //we need to check if we've already wrapped round + if (this.isSaturated()) { + //remove bottom of stack from mean + var bottomValue = this._samples[this._pos]; + delta = bottomValue - this.average; + this.average -= delta / (this._sampleCount - 1); + this._m2 -= delta * (bottomValue - this.average); + } + else { + this._sampleCount++; + } + //add new value to mean + delta = v - this.average; + this.average += delta / (this._sampleCount); + this._m2 += delta * (v - this.average); + //set the new variance + this.variance = this._m2 / (this._sampleCount - 1); + this._samples[this._pos] = v; + this._pos++; + this._pos %= this._samples.length; //positive wrap around + }; + /** + * Returns previously added values or null if outside of history or outside the sliding window domain + * @param i Index in history. For example, pass 0 for the most recent value and 1 for the value before that + * @return Value previously recorded with add() or null if outside of range + */ + RollingAverage.prototype.history = function (i) { + if ((i >= this._sampleCount) || (i >= this._samples.length)) { + return 0; + } + var i0 = this._wrapPosition(this._pos - 1.0); + return this._samples[this._wrapPosition(i0 - i)]; + }; + /** + * Returns true if enough samples have been taken to completely fill the sliding window + * @return true if sample-set saturated + */ + RollingAverage.prototype.isSaturated = function () { + return this._sampleCount >= this._samples.length; + }; + /** + * Resets the rolling average (equivalent to 0 samples taken so far) + */ + RollingAverage.prototype.reset = function () { + this.average = 0; + this.variance = 0; + this._sampleCount = 0; + this._pos = 0; + this._m2 = 0; + }; + /** + * Wraps a value around the sample range boundaries + * @param i Position in sample range, for example if the sample length is 5, and i is -3, then 2 will be returned. + * @return Wrapped position in sample range + */ + RollingAverage.prototype._wrapPosition = function (i) { + var max = this._samples.length; + return ((i % max) + max) % max; + }; + return RollingAverage; + }()); + BABYLON.RollingAverage = RollingAverage; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.performanceMonitor.js.map + +var BABYLON; +(function (BABYLON) { + /** + * "Static Class" containing the most commonly used helper while dealing with material for + * rendering purpose. + * + * It contains the basic tools to help defining defines, binding uniform for the common part of the materials. + * + * This works by convention in BabylonJS but is meant to be use only with shader following the in place naming rules and conventions. + */ + var MaterialHelper = /** @class */ (function () { + function MaterialHelper() { + } + /** + * Bind the current view position to an effect. + * @param effect The effect to be bound + * @param scene The scene the eyes position is used from + */ + MaterialHelper.BindEyePosition = function (effect, scene) { + if (scene._forcedViewPosition) { + effect.setVector3("vEyePosition", scene._forcedViewPosition); + return; + } + effect.setVector3("vEyePosition", scene._mirroredCameraPosition ? scene._mirroredCameraPosition : scene.activeCamera.globalPosition); + }; + /** + * Helps preparing the defines values about the UVs in used in the effect. + * UVs are shared as much as we can accross channels in the shaders. + * @param texture The texture we are preparing the UVs for + * @param defines The defines to update + * @param key The channel key "diffuse", "specular"... used in the shader + */ + MaterialHelper.PrepareDefinesForMergedUV = function (texture, defines, key) { + defines._needUVs = true; + defines[key] = true; + if (texture.getTextureMatrix().isIdentity(true)) { + defines[key + "DIRECTUV"] = texture.coordinatesIndex + 1; + if (texture.coordinatesIndex === 0) { + defines["MAINUV1"] = true; + } + else { + defines["MAINUV2"] = true; + } + } + else { + defines[key + "DIRECTUV"] = 0; + } + }; + /** + * Binds a texture matrix value to its corrsponding uniform + * @param texture The texture to bind the matrix for + * @param uniformBuffer The uniform buffer receivin the data + * @param key The channel key "diffuse", "specular"... used in the shader + */ + MaterialHelper.BindTextureMatrix = function (texture, uniformBuffer, key) { + var matrix = texture.getTextureMatrix(); + if (!matrix.isIdentity(true)) { + uniformBuffer.updateMatrix(key + "Matrix", matrix); + } + }; + /** + * Helper used to prepare the list of defines associated with misc. values for shader compilation + * @param mesh defines the current mesh + * @param scene defines the current scene + * @param useLogarithmicDepth defines if logarithmic depth has to be turned on + * @param pointsCloud defines if point cloud rendering has to be turned on + * @param fogEnabled defines if fog has to be turned on + * @param alphaTest defines if alpha testing has to be turned on + * @param defines defines the current list of defines + */ + MaterialHelper.PrepareDefinesForMisc = function (mesh, scene, useLogarithmicDepth, pointsCloud, fogEnabled, alphaTest, defines) { + if (defines._areMiscDirty) { + defines["LOGARITHMICDEPTH"] = useLogarithmicDepth; + defines["POINTSIZE"] = pointsCloud; + defines["FOG"] = (scene.fogEnabled && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE && fogEnabled); + defines["NONUNIFORMSCALING"] = mesh.nonUniformScaling; + defines["ALPHATEST"] = alphaTest; + } + }; + /** + * Helper used to prepare the list of defines associated with frame values for shader compilation + * @param scene defines the current scene + * @param engine defines the current engine + * @param defines specifies the list of active defines + * @param useInstances defines if instances have to be turned on + * @param useClipPlane defines if clip plane have to be turned on + */ + MaterialHelper.PrepareDefinesForFrameBoundValues = function (scene, engine, defines, useInstances, useClipPlane) { + if (useClipPlane === void 0) { useClipPlane = null; } + var changed = false; + var useClipPlane1 = false; + var useClipPlane2 = false; + var useClipPlane3 = false; + var useClipPlane4 = false; + useClipPlane1 = useClipPlane == null ? (scene.clipPlane !== undefined && scene.clipPlane !== null) : useClipPlane; + useClipPlane2 = useClipPlane == null ? (scene.clipPlane2 !== undefined && scene.clipPlane2 !== null) : useClipPlane; + useClipPlane3 = useClipPlane == null ? (scene.clipPlane3 !== undefined && scene.clipPlane3 !== null) : useClipPlane; + useClipPlane4 = useClipPlane == null ? (scene.clipPlane4 !== undefined && scene.clipPlane4 !== null) : useClipPlane; + if (defines["CLIPPLANE"] !== useClipPlane1) { + defines["CLIPPLANE"] = useClipPlane1; + changed = true; + } + if (defines["CLIPPLANE2"] !== useClipPlane2) { + defines["CLIPPLANE2"] = useClipPlane2; + changed = true; + } + if (defines["CLIPPLANE3"] !== useClipPlane3) { + defines["CLIPPLANE3"] = useClipPlane3; + changed = true; + } + if (defines["CLIPPLANE4"] !== useClipPlane4) { + defines["CLIPPLANE4"] = useClipPlane4; + changed = true; + } + if (defines["DEPTHPREPASS"] !== !engine.getColorWrite()) { + defines["DEPTHPREPASS"] = !defines["DEPTHPREPASS"]; + changed = true; + } + if (defines["INSTANCES"] !== useInstances) { + defines["INSTANCES"] = useInstances; + changed = true; + } + if (changed) { + defines.markAsUnprocessed(); + } + }; + /** + * Prepares the defines used in the shader depending on the attributes data available in the mesh + * @param mesh The mesh containing the geometry data we will draw + * @param defines The defines to update + * @param useVertexColor Precise whether vertex colors should be used or not (override mesh info) + * @param useBones Precise whether bones should be used or not (override mesh info) + * @param useMorphTargets Precise whether morph targets should be used or not (override mesh info) + * @param useVertexAlpha Precise whether vertex alpha should be used or not (override mesh info) + * @returns false if defines are considered not dirty and have not been checked + */ + MaterialHelper.PrepareDefinesForAttributes = function (mesh, defines, useVertexColor, useBones, useMorphTargets, useVertexAlpha) { + if (useMorphTargets === void 0) { useMorphTargets = false; } + if (useVertexAlpha === void 0) { useVertexAlpha = true; } + if (!defines._areAttributesDirty && defines._needNormals === defines._normals && defines._needUVs === defines._uvs) { + return false; + } + defines._normals = defines._needNormals; + defines._uvs = defines._needUVs; + defines["NORMAL"] = (defines._needNormals && mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)); + if (defines._needNormals && mesh.isVerticesDataPresent(BABYLON.VertexBuffer.TangentKind)) { + defines["TANGENT"] = true; + } + if (defines._needUVs) { + defines["UV1"] = mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind); + defines["UV2"] = mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind); + } + else { + defines["UV1"] = false; + defines["UV2"] = false; + } + if (useVertexColor) { + var hasVertexColors = mesh.useVertexColors && mesh.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind); + defines["VERTEXCOLOR"] = hasVertexColors; + defines["VERTEXALPHA"] = mesh.hasVertexAlpha && hasVertexColors && useVertexAlpha; + } + if (useBones) { + if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) { + defines["NUM_BONE_INFLUENCERS"] = mesh.numBoneInfluencers; + defines["BonesPerMesh"] = (mesh.skeleton.bones.length + 1); + } + else { + defines["NUM_BONE_INFLUENCERS"] = 0; + defines["BonesPerMesh"] = 0; + } + } + if (useMorphTargets) { + var manager = mesh.morphTargetManager; + if (manager) { + defines["MORPHTARGETS_TANGENT"] = manager.supportsTangents && defines["TANGENT"]; + defines["MORPHTARGETS_NORMAL"] = manager.supportsNormals && defines["NORMAL"]; + defines["MORPHTARGETS"] = (manager.numInfluencers > 0); + defines["NUM_MORPH_INFLUENCERS"] = manager.numInfluencers; + } + else { + defines["MORPHTARGETS_TANGENT"] = false; + defines["MORPHTARGETS_NORMAL"] = false; + defines["MORPHTARGETS"] = false; + defines["NUM_MORPH_INFLUENCERS"] = 0; + } + } + return true; + }; + /** + * Prepares the defines related to the light information passed in parameter + * @param scene The scene we are intending to draw + * @param mesh The mesh the effect is compiling for + * @param defines The defines to update + * @param specularSupported Specifies whether specular is supported or not (override lights data) + * @param maxSimultaneousLights Specfies how manuy lights can be added to the effect at max + * @param disableLighting Specifies whether the lighting is disabled (override scene and light) + * @returns true if normals will be required for the rest of the effect + */ + MaterialHelper.PrepareDefinesForLights = function (scene, mesh, defines, specularSupported, maxSimultaneousLights, disableLighting) { + if (maxSimultaneousLights === void 0) { maxSimultaneousLights = 4; } + if (disableLighting === void 0) { disableLighting = false; } + if (!defines._areLightsDirty) { + return defines._needNormals; + } + var lightIndex = 0; + var needNormals = false; + var needRebuild = false; + var lightmapMode = false; + var shadowEnabled = false; + var specularEnabled = false; + if (scene.lightsEnabled && !disableLighting) { + for (var _i = 0, _a = mesh._lightSources; _i < _a.length; _i++) { + var light = _a[_i]; + needNormals = true; + if (defines["LIGHT" + lightIndex] === undefined) { + needRebuild = true; + } + defines["LIGHT" + lightIndex] = true; + defines["SPOTLIGHT" + lightIndex] = false; + defines["HEMILIGHT" + lightIndex] = false; + defines["POINTLIGHT" + lightIndex] = false; + defines["DIRLIGHT" + lightIndex] = false; + light.prepareLightSpecificDefines(defines, lightIndex); + // FallOff. + defines["LIGHT_FALLOFF_PHYSICAL" + lightIndex] = false; + defines["LIGHT_FALLOFF_GLTF" + lightIndex] = false; + defines["LIGHT_FALLOFF_STANDARD" + lightIndex] = false; + switch (light.falloffType) { + case BABYLON.Light.FALLOFF_GLTF: + defines["LIGHT_FALLOFF_GLTF" + lightIndex] = true; + break; + case BABYLON.Light.FALLOFF_PHYSICAL: + defines["LIGHT_FALLOFF_PHYSICAL" + lightIndex] = true; + break; + case BABYLON.Light.FALLOFF_STANDARD: + defines["LIGHT_FALLOFF_STANDARD" + lightIndex] = true; + break; + } + // Specular + if (specularSupported && !light.specular.equalsFloats(0, 0, 0)) { + specularEnabled = true; + } + // Shadows + defines["SHADOW" + lightIndex] = false; + defines["SHADOWPCF" + lightIndex] = false; + defines["SHADOWPCSS" + lightIndex] = false; + defines["SHADOWPOISSON" + lightIndex] = false; + defines["SHADOWESM" + lightIndex] = false; + defines["SHADOWCUBE" + lightIndex] = false; + defines["SHADOWLOWQUALITY" + lightIndex] = false; + defines["SHADOWMEDIUMQUALITY" + lightIndex] = false; + if (mesh && mesh.receiveShadows && scene.shadowsEnabled && light.shadowEnabled) { + var shadowGenerator = light.getShadowGenerator(); + if (shadowGenerator) { + var shadowMap = shadowGenerator.getShadowMap(); + if (shadowMap) { + if (shadowMap.renderList && shadowMap.renderList.length > 0) { + shadowEnabled = true; + shadowGenerator.prepareDefines(defines, lightIndex); + } + } + } + } + if (light.lightmapMode != BABYLON.Light.LIGHTMAP_DEFAULT) { + lightmapMode = true; + defines["LIGHTMAPEXCLUDED" + lightIndex] = true; + defines["LIGHTMAPNOSPECULAR" + lightIndex] = (light.lightmapMode == BABYLON.Light.LIGHTMAP_SHADOWSONLY); + } + else { + defines["LIGHTMAPEXCLUDED" + lightIndex] = false; + defines["LIGHTMAPNOSPECULAR" + lightIndex] = false; + } + lightIndex++; + if (lightIndex === maxSimultaneousLights) { + break; + } + } + } + defines["SPECULARTERM"] = specularEnabled; + defines["SHADOWS"] = shadowEnabled; + // Resetting all other lights if any + for (var index = lightIndex; index < maxSimultaneousLights; index++) { + if (defines["LIGHT" + index] !== undefined) { + defines["LIGHT" + index] = false; + defines["HEMILIGHT" + lightIndex] = false; + defines["POINTLIGHT" + lightIndex] = false; + defines["DIRLIGHT" + lightIndex] = false; + defines["SPOTLIGHT" + lightIndex] = false; + defines["SHADOW" + lightIndex] = false; + } + } + var caps = scene.getEngine().getCaps(); + if (defines["SHADOWFLOAT"] === undefined) { + needRebuild = true; + } + defines["SHADOWFLOAT"] = shadowEnabled && + ((caps.textureFloatRender && caps.textureFloatLinearFiltering) || + (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering)); + defines["LIGHTMAPEXCLUDED"] = lightmapMode; + if (needRebuild) { + defines.rebuild(); + } + return needNormals; + }; + /** + * Prepares the uniforms and samplers list to be used in the effect. This can automatically remove from the list uniforms + * that won t be acctive due to defines being turned off. + * @param uniformsListOrOptions The uniform names to prepare or an EffectCreationOptions containing the liist and extra information + * @param samplersList The samplers list + * @param defines The defines helping in the list generation + * @param maxSimultaneousLights The maximum number of simultanous light allowed in the effect + */ + MaterialHelper.PrepareUniformsAndSamplersList = function (uniformsListOrOptions, samplersList, defines, maxSimultaneousLights) { + if (maxSimultaneousLights === void 0) { maxSimultaneousLights = 4; } + var uniformsList; + var uniformBuffersList = null; + if (uniformsListOrOptions.uniformsNames) { + var options = uniformsListOrOptions; + uniformsList = options.uniformsNames; + uniformBuffersList = options.uniformBuffersNames; + samplersList = options.samplers; + defines = options.defines; + maxSimultaneousLights = options.maxSimultaneousLights; + } + else { + uniformsList = uniformsListOrOptions; + if (!samplersList) { + samplersList = []; + } + } + for (var lightIndex = 0; lightIndex < maxSimultaneousLights; lightIndex++) { + if (!defines["LIGHT" + lightIndex]) { + break; + } + uniformsList.push("vLightData" + lightIndex, "vLightDiffuse" + lightIndex, "vLightSpecular" + lightIndex, "vLightDirection" + lightIndex, "vLightFalloff" + lightIndex, "vLightGround" + lightIndex, "lightMatrix" + lightIndex, "shadowsInfo" + lightIndex, "depthValues" + lightIndex); + if (uniformBuffersList) { + uniformBuffersList.push("Light" + lightIndex); + } + samplersList.push("shadowSampler" + lightIndex); + samplersList.push("depthSampler" + lightIndex); + if (defines["PROJECTEDLIGHTTEXTURE" + lightIndex]) { + samplersList.push("projectionLightSampler" + lightIndex); + uniformsList.push("textureProjectionMatrix" + lightIndex); + } + } + if (defines["NUM_MORPH_INFLUENCERS"]) { + uniformsList.push("morphTargetInfluences"); + } + }; + /** + * This helps decreasing rank by rank the shadow quality (0 being the highest rank and quality) + * @param defines The defines to update while falling back + * @param fallbacks The authorized effect fallbacks + * @param maxSimultaneousLights The maximum number of lights allowed + * @param rank the current rank of the Effect + * @returns The newly affected rank + */ + MaterialHelper.HandleFallbacksForShadows = function (defines, fallbacks, maxSimultaneousLights, rank) { + if (maxSimultaneousLights === void 0) { maxSimultaneousLights = 4; } + if (rank === void 0) { rank = 0; } + var lightFallbackRank = 0; + for (var lightIndex = 0; lightIndex < maxSimultaneousLights; lightIndex++) { + if (!defines["LIGHT" + lightIndex]) { + break; + } + if (lightIndex > 0) { + lightFallbackRank = rank + lightIndex; + fallbacks.addFallback(lightFallbackRank, "LIGHT" + lightIndex); + } + if (!defines["SHADOWS"]) { + if (defines["SHADOW" + lightIndex]) { + fallbacks.addFallback(rank, "SHADOW" + lightIndex); + } + if (defines["SHADOWPCF" + lightIndex]) { + fallbacks.addFallback(rank, "SHADOWPCF" + lightIndex); + } + if (defines["SHADOWPCSS" + lightIndex]) { + fallbacks.addFallback(rank, "SHADOWPCSS" + lightIndex); + } + if (defines["SHADOWPOISSON" + lightIndex]) { + fallbacks.addFallback(rank, "SHADOWPOISSON" + lightIndex); + } + if (defines["SHADOWESM" + lightIndex]) { + fallbacks.addFallback(rank, "SHADOWESM" + lightIndex); + } + } + } + return lightFallbackRank++; + }; + /** + * Prepares the list of attributes required for morph targets according to the effect defines. + * @param attribs The current list of supported attribs + * @param mesh The mesh to prepare the morph targets attributes for + * @param defines The current Defines of the effect + */ + MaterialHelper.PrepareAttributesForMorphTargets = function (attribs, mesh, defines) { + var influencers = defines["NUM_MORPH_INFLUENCERS"]; + if (influencers > 0 && BABYLON.Engine.LastCreatedEngine) { + var maxAttributesCount = BABYLON.Engine.LastCreatedEngine.getCaps().maxVertexAttribs; + var manager = mesh.morphTargetManager; + var normal = manager && manager.supportsNormals && defines["NORMAL"]; + var tangent = manager && manager.supportsTangents && defines["TANGENT"]; + for (var index = 0; index < influencers; index++) { + attribs.push(BABYLON.VertexBuffer.PositionKind + index); + if (normal) { + attribs.push(BABYLON.VertexBuffer.NormalKind + index); + } + if (tangent) { + attribs.push(BABYLON.VertexBuffer.TangentKind + index); + } + if (attribs.length > maxAttributesCount) { + BABYLON.Tools.Error("Cannot add more vertex attributes for mesh " + mesh.name); + } + } + } + }; + /** + * Prepares the list of attributes required for bones according to the effect defines. + * @param attribs The current list of supported attribs + * @param mesh The mesh to prepare the bones attributes for + * @param defines The current Defines of the effect + * @param fallbacks The current efffect fallback strategy + */ + MaterialHelper.PrepareAttributesForBones = function (attribs, mesh, defines, fallbacks) { + if (defines["NUM_BONE_INFLUENCERS"] > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + attribs.push(BABYLON.VertexBuffer.MatricesIndicesKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsKind); + if (defines["NUM_BONE_INFLUENCERS"] > 4) { + attribs.push(BABYLON.VertexBuffer.MatricesIndicesExtraKind); + attribs.push(BABYLON.VertexBuffer.MatricesWeightsExtraKind); + } + } + }; + /** + * Prepares the list of attributes required for instances according to the effect defines. + * @param attribs The current list of supported attribs + * @param defines The current Defines of the effect + */ + MaterialHelper.PrepareAttributesForInstances = function (attribs, defines) { + if (defines["INSTANCES"]) { + attribs.push("world0"); + attribs.push("world1"); + attribs.push("world2"); + attribs.push("world3"); + } + }; + /** + * Binds the light shadow information to the effect for the given mesh. + * @param light The light containing the generator + * @param scene The scene the lights belongs to + * @param mesh The mesh we are binding the information to render + * @param lightIndex The light index in the effect used to render the mesh + * @param effect The effect we are binding the data to + */ + MaterialHelper.BindLightShadow = function (light, scene, mesh, lightIndex, effect) { + if (light.shadowEnabled && mesh.receiveShadows) { + var shadowGenerator = light.getShadowGenerator(); + if (shadowGenerator) { + shadowGenerator.bindShadowLight(lightIndex, effect); + } + } + }; + /** + * Binds the light information to the effect. + * @param light The light containing the generator + * @param effect The effect we are binding the data to + * @param lightIndex The light index in the effect used to render + */ + MaterialHelper.BindLightProperties = function (light, effect, lightIndex) { + light.transferToEffect(effect, lightIndex + ""); + }; + /** + * Binds the lights information from the scene to the effect for the given mesh. + * @param scene The scene the lights belongs to + * @param mesh The mesh we are binding the information to render + * @param effect The effect we are binding the data to + * @param defines The generated defines for the effect + * @param maxSimultaneousLights The maximum number of light that can be bound to the effect + * @param usePhysicalLightFalloff Specifies whether the light falloff is defined physically or not + */ + MaterialHelper.BindLights = function (scene, mesh, effect, defines, maxSimultaneousLights, usePhysicalLightFalloff) { + if (maxSimultaneousLights === void 0) { maxSimultaneousLights = 4; } + if (usePhysicalLightFalloff === void 0) { usePhysicalLightFalloff = false; } + var len = Math.min(mesh._lightSources.length, maxSimultaneousLights); + for (var i = 0; i < len; i++) { + var light = mesh._lightSources[i]; + var iAsString = i.toString(); + var scaledIntensity = light.getScaledIntensity(); + light._uniformBuffer.bindToEffect(effect, "Light" + i); + MaterialHelper.BindLightProperties(light, effect, i); + light.diffuse.scaleToRef(scaledIntensity, BABYLON.Tmp.Color3[0]); + light._uniformBuffer.updateColor4("vLightDiffuse", BABYLON.Tmp.Color3[0], usePhysicalLightFalloff ? light.radius : light.range, iAsString); + if (defines["SPECULARTERM"]) { + light.specular.scaleToRef(scaledIntensity, BABYLON.Tmp.Color3[1]); + light._uniformBuffer.updateColor3("vLightSpecular", BABYLON.Tmp.Color3[1], iAsString); + } + // Shadows + if (scene.shadowsEnabled) { + this.BindLightShadow(light, scene, mesh, iAsString, effect); + } + light._uniformBuffer.update(); + } + }; + /** + * Binds the fog information from the scene to the effect for the given mesh. + * @param scene The scene the lights belongs to + * @param mesh The mesh we are binding the information to render + * @param effect The effect we are binding the data to + * @param linearSpace Defines if the fog effect is applied in linear space + */ + MaterialHelper.BindFogParameters = function (scene, mesh, effect, linearSpace) { + if (linearSpace === void 0) { linearSpace = false; } + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE) { + effect.setFloat4("vFogInfos", scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity); + // Convert fog color to linear space if used in a linear space computed shader. + if (linearSpace) { + scene.fogColor.toLinearSpaceToRef(this._tempFogColor); + effect.setColor3("vFogColor", this._tempFogColor); + } + else { + effect.setColor3("vFogColor", scene.fogColor); + } + } + }; + /** + * Binds the bones information from the mesh to the effect. + * @param mesh The mesh we are binding the information to render + * @param effect The effect we are binding the data to + */ + MaterialHelper.BindBonesParameters = function (mesh, effect) { + if (!effect || !mesh) { + return; + } + if (mesh.computeBonesUsingShaders && effect._bonesComputationForcedToCPU) { + mesh.computeBonesUsingShaders = false; + } + if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) { + var matrices = mesh.skeleton.getTransformMatrices(mesh); + if (matrices) { + effect.setMatrices("mBones", matrices); + } + } + }; + /** + * Binds the morph targets information from the mesh to the effect. + * @param abstractMesh The mesh we are binding the information to render + * @param effect The effect we are binding the data to + */ + MaterialHelper.BindMorphTargetParameters = function (abstractMesh, effect) { + var manager = abstractMesh.morphTargetManager; + if (!abstractMesh || !manager) { + return; + } + effect.setFloatArray("morphTargetInfluences", manager.influences); + }; + /** + * Binds the logarithmic depth information from the scene to the effect for the given defines. + * @param defines The generated defines used in the effect + * @param effect The effect we are binding the data to + * @param scene The scene we are willing to render with logarithmic scale for + */ + MaterialHelper.BindLogDepth = function (defines, effect, scene) { + if (defines["LOGARITHMICDEPTH"]) { + effect.setFloat("logarithmicDepthConstant", 2.0 / (Math.log(scene.activeCamera.maxZ + 1.0) / Math.LN2)); + } + }; + /** + * Binds the clip plane information from the scene to the effect. + * @param scene The scene the clip plane information are extracted from + * @param effect The effect we are binding the data to + */ + MaterialHelper.BindClipPlane = function (effect, scene) { + if (scene.clipPlane) { + var clipPlane = scene.clipPlane; + effect.setFloat4("vClipPlane", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d); + } + if (scene.clipPlane2) { + var clipPlane = scene.clipPlane2; + effect.setFloat4("vClipPlane2", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d); + } + if (scene.clipPlane3) { + var clipPlane = scene.clipPlane3; + effect.setFloat4("vClipPlane3", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d); + } + if (scene.clipPlane4) { + var clipPlane = scene.clipPlane4; + effect.setFloat4("vClipPlane4", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d); + } + }; + MaterialHelper._tempFogColor = BABYLON.Color3.Black(); + return MaterialHelper; + }()); + BABYLON.MaterialHelper = MaterialHelper; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.materialHelper.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Base class of materials working in push mode in babylon JS + * @hidden + */ + var PushMaterial = /** @class */ (function (_super) { + __extends(PushMaterial, _super); + function PushMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this._normalMatrix = new BABYLON.Matrix(); + _this.storeEffectOnSubMeshes = true; + return _this; + } + PushMaterial.prototype.getEffect = function () { + return this._activeEffect; + }; + PushMaterial.prototype.isReady = function (mesh, useInstances) { + if (!mesh) { + return false; + } + if (!mesh.subMeshes || mesh.subMeshes.length === 0) { + return true; + } + return this.isReadyForSubMesh(mesh, mesh.subMeshes[0], useInstances); + }; + /** + * Binds the given world matrix to the active effect + * + * @param world the matrix to bind + */ + PushMaterial.prototype.bindOnlyWorldMatrix = function (world) { + this._activeEffect.setMatrix("world", world); + }; + /** + * Binds the given normal matrix to the active effect + * + * @param normalMatrix the matrix to bind + */ + PushMaterial.prototype.bindOnlyNormalMatrix = function (normalMatrix) { + this._activeEffect.setMatrix("normalMatrix", normalMatrix); + }; + PushMaterial.prototype.bind = function (world, mesh) { + if (!mesh) { + return; + } + this.bindForSubMesh(world, mesh, mesh.subMeshes[0]); + }; + PushMaterial.prototype._afterBind = function (mesh, effect) { + if (effect === void 0) { effect = null; } + _super.prototype._afterBind.call(this, mesh); + this.getScene()._cachedEffect = effect; + }; + PushMaterial.prototype._mustRebind = function (scene, effect, visibility) { + if (visibility === void 0) { visibility = 1; } + return scene.isCachedMaterialInvalid(this, effect, visibility); + }; + return PushMaterial; + }(BABYLON.Material)); + BABYLON.PushMaterial = PushMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pushMaterial.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** @hidden */ + var StandardMaterialDefines = /** @class */ (function (_super) { + __extends(StandardMaterialDefines, _super); + function StandardMaterialDefines() { + var _this = _super.call(this) || this; + _this.MAINUV1 = false; + _this.MAINUV2 = false; + _this.DIFFUSE = false; + _this.DIFFUSEDIRECTUV = 0; + _this.AMBIENT = false; + _this.AMBIENTDIRECTUV = 0; + _this.OPACITY = false; + _this.OPACITYDIRECTUV = 0; + _this.OPACITYRGB = false; + _this.REFLECTION = false; + _this.EMISSIVE = false; + _this.EMISSIVEDIRECTUV = 0; + _this.SPECULAR = false; + _this.SPECULARDIRECTUV = 0; + _this.BUMP = false; + _this.BUMPDIRECTUV = 0; + _this.PARALLAX = false; + _this.PARALLAXOCCLUSION = false; + _this.SPECULAROVERALPHA = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.ALPHAFROMDIFFUSE = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.SPECULARTERM = false; + _this.DIFFUSEFRESNEL = false; + _this.OPACITYFRESNEL = false; + _this.REFLECTIONFRESNEL = false; + _this.REFRACTIONFRESNEL = false; + _this.EMISSIVEFRESNEL = false; + _this.FRESNEL = false; + _this.NORMAL = false; + _this.UV1 = false; + _this.UV2 = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.GLOSSINESS = false; + _this.ROUGHNESS = false; + _this.EMISSIVEASILLUMINATION = false; + _this.LINKEMISSIVEWITHDIFFUSE = false; + _this.REFLECTIONFRESNELFROMSPECULAR = false; + _this.LIGHTMAP = false; + _this.LIGHTMAPDIRECTUV = 0; + _this.OBJECTSPACE_NORMALMAP = false; + _this.USELIGHTMAPASSHADOWMAP = false; + _this.REFLECTIONMAP_3D = false; + _this.REFLECTIONMAP_SPHERICAL = false; + _this.REFLECTIONMAP_PLANAR = false; + _this.REFLECTIONMAP_CUBIC = false; + _this.USE_LOCAL_REFLECTIONMAP_CUBIC = false; + _this.REFLECTIONMAP_PROJECTION = false; + _this.REFLECTIONMAP_SKYBOX = false; + _this.REFLECTIONMAP_SKYBOX_TRANSFORMED = false; + _this.REFLECTIONMAP_EXPLICIT = false; + _this.REFLECTIONMAP_EQUIRECTANGULAR = false; + _this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false; + _this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false; + _this.INVERTCUBICMAP = false; + _this.LOGARITHMICDEPTH = false; + _this.REFRACTION = false; + _this.REFRACTIONMAP_3D = false; + _this.REFLECTIONOVERALPHA = false; + _this.TWOSIDEDLIGHTING = false; + _this.SHADOWFLOAT = false; + _this.MORPHTARGETS = false; + _this.MORPHTARGETS_NORMAL = false; + _this.MORPHTARGETS_TANGENT = false; + _this.NUM_MORPH_INFLUENCERS = 0; + _this.NONUNIFORMSCALING = false; // https://playground.babylonjs.com#V6DWIH + _this.PREMULTIPLYALPHA = false; // https://playground.babylonjs.com#LNVJJ7 + _this.IMAGEPROCESSING = false; + _this.VIGNETTE = false; + _this.VIGNETTEBLENDMODEMULTIPLY = false; + _this.VIGNETTEBLENDMODEOPAQUE = false; + _this.TONEMAPPING = false; + _this.TONEMAPPING_ACES = false; + _this.CONTRAST = false; + _this.COLORCURVES = false; + _this.COLORGRADING = false; + _this.COLORGRADING3D = false; + _this.SAMPLER3DGREENDEPTH = false; + _this.SAMPLER3DBGRMAP = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + /** + * If the reflection texture on this material is in linear color space + * @hidden + */ + _this.IS_REFLECTION_LINEAR = false; + /** + * If the refraction texture on this material is in linear color space + * @hidden + */ + _this.IS_REFRACTION_LINEAR = false; + _this.EXPOSURE = false; + _this.rebuild(); + return _this; + } + StandardMaterialDefines.prototype.setReflectionMode = function (modeToEnable) { + var modes = [ + "REFLECTIONMAP_CUBIC", "REFLECTIONMAP_EXPLICIT", "REFLECTIONMAP_PLANAR", + "REFLECTIONMAP_PROJECTION", "REFLECTIONMAP_PROJECTION", "REFLECTIONMAP_SKYBOX", + "REFLECTIONMAP_SPHERICAL", "REFLECTIONMAP_EQUIRECTANGULAR", "REFLECTIONMAP_EQUIRECTANGULAR_FIXED", + "REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED" + ]; + for (var _i = 0, modes_1 = modes; _i < modes_1.length; _i++) { + var mode = modes_1[_i]; + this[mode] = (mode === modeToEnable); + } + }; + return StandardMaterialDefines; + }(BABYLON.MaterialDefines)); + BABYLON.StandardMaterialDefines = StandardMaterialDefines; + /** + * This is the default material used in Babylon. It is the best trade off between quality + * and performances. + * @see http://doc.babylonjs.com/babylon101/materials + */ + var StandardMaterial = /** @class */ (function (_super) { + __extends(StandardMaterial, _super); + /** + * Instantiates a new standard material. + * This is the default material used in Babylon. It is the best trade off between quality + * and performances. + * @see http://doc.babylonjs.com/babylon101/materials + * @param name Define the name of the material in the scene + * @param scene Define the scene the material belong to + */ + function StandardMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + /** + * The color of the material lit by the environmental background lighting. + * @see http://doc.babylonjs.com/babylon101/materials#ambient-color-example + */ + _this.ambientColor = new BABYLON.Color3(0, 0, 0); + /** + * The basic color of the material as viewed under a light. + */ + _this.diffuseColor = new BABYLON.Color3(1, 1, 1); + /** + * Define how the color and intensity of the highlight given by the light in the material. + */ + _this.specularColor = new BABYLON.Color3(1, 1, 1); + /** + * Define the color of the material as if self lit. + * This will be mixed in the final result even in the absence of light. + */ + _this.emissiveColor = new BABYLON.Color3(0, 0, 0); + /** + * Defines how sharp are the highlights in the material. + * The bigger the value the sharper giving a more glossy feeling to the result. + * Reversely, the smaller the value the blurrier giving a more rough feeling to the result. + */ + _this.specularPower = 64; + _this._useAlphaFromDiffuseTexture = false; + _this._useEmissiveAsIllumination = false; + _this._linkEmissiveWithDiffuse = false; + _this._useSpecularOverAlpha = false; + _this._useReflectionOverAlpha = false; + _this._disableLighting = false; + _this._useObjectSpaceNormalMap = false; + _this._useParallax = false; + _this._useParallaxOcclusion = false; + /** + * Apply a scaling factor that determine which "depth" the height map should reprensent. A value between 0.05 and 0.1 is reasonnable in Parallax, you can reach 0.2 using Parallax Occlusion. + */ + _this.parallaxScaleBias = 0.05; + _this._roughness = 0; + /** + * In case of refraction, define the value of the indice of refraction. + * @see http://doc.babylonjs.com/how_to/reflect#how-to-obtain-reflections-and-refractions + */ + _this.indexOfRefraction = 0.98; + /** + * Invert the refraction texture alongside the y axis. + * It can be usefull with procedural textures or probe for instance. + * @see http://doc.babylonjs.com/how_to/reflect#how-to-obtain-reflections-and-refractions + */ + _this.invertRefractionY = true; + /** + * Defines the alpha limits in alpha test mode. + */ + _this.alphaCutOff = 0.4; + _this._useLightmapAsShadowmap = false; + _this._useReflectionFresnelFromSpecular = false; + _this._useGlossinessFromSpecularMapAlpha = false; + _this._maxSimultaneousLights = 4; + _this._invertNormalMapX = false; + _this._invertNormalMapY = false; + _this._twoSidedLighting = false; + _this._renderTargets = new BABYLON.SmartArray(16); + _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero(); + _this._globalAmbientColor = new BABYLON.Color3(0, 0, 0); + // Setup the default processing configuration to the scene. + _this._attachImageProcessingConfiguration(null); + _this.getRenderTargetTextures = function () { + _this._renderTargets.reset(); + if (StandardMaterial.ReflectionTextureEnabled && _this._reflectionTexture && _this._reflectionTexture.isRenderTarget) { + _this._renderTargets.push(_this._reflectionTexture); + } + if (StandardMaterial.RefractionTextureEnabled && _this._refractionTexture && _this._refractionTexture.isRenderTarget) { + _this._renderTargets.push(_this._refractionTexture); + } + return _this._renderTargets; + }; + return _this; + } + Object.defineProperty(StandardMaterial.prototype, "imageProcessingConfiguration", { + /** + * Gets the image processing configuration used either in this material. + */ + get: function () { + return this._imageProcessingConfiguration; + }, + /** + * Sets the Default image processing configuration used either in the this material. + * + * If sets to null, the scene one is in use. + */ + set: function (value) { + this._attachImageProcessingConfiguration(value); + // Ensure the effect will be rebuilt. + this._markAllSubMeshesAsTexturesDirty(); + }, + enumerable: true, + configurable: true + }); + /** + * Attaches a new image processing configuration to the Standard Material. + * @param configuration + */ + StandardMaterial.prototype._attachImageProcessingConfiguration = function (configuration) { + var _this = this; + if (configuration === this._imageProcessingConfiguration) { + return; + } + // Detaches observer. + if (this._imageProcessingConfiguration && this._imageProcessingObserver) { + this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver); + } + // Pick the scene configuration if needed. + if (!configuration) { + this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration; + } + else { + this._imageProcessingConfiguration = configuration; + } + // Attaches observer. + if (this._imageProcessingConfiguration) { + this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function (conf) { + _this._markAllSubMeshesAsImageProcessingDirty(); + }); + } + }; + Object.defineProperty(StandardMaterial.prototype, "cameraColorCurvesEnabled", { + /** + * Gets wether the color curves effect is enabled. + */ + get: function () { + return this.imageProcessingConfiguration.colorCurvesEnabled; + }, + /** + * Sets wether the color curves effect is enabled. + */ + set: function (value) { + this.imageProcessingConfiguration.colorCurvesEnabled = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial.prototype, "cameraColorGradingEnabled", { + /** + * Gets wether the color grading effect is enabled. + */ + get: function () { + return this.imageProcessingConfiguration.colorGradingEnabled; + }, + /** + * Gets wether the color grading effect is enabled. + */ + set: function (value) { + this.imageProcessingConfiguration.colorGradingEnabled = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial.prototype, "cameraToneMappingEnabled", { + /** + * Gets wether tonemapping is enabled or not. + */ + get: function () { + return this._imageProcessingConfiguration.toneMappingEnabled; + }, + /** + * Sets wether tonemapping is enabled or not + */ + set: function (value) { + this._imageProcessingConfiguration.toneMappingEnabled = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial.prototype, "cameraExposure", { + /** + * The camera exposure used on this material. + * This property is here and not in the camera to allow controlling exposure without full screen post process. + * This corresponds to a photographic exposure. + */ + get: function () { + return this._imageProcessingConfiguration.exposure; + }, + /** + * The camera exposure used on this material. + * This property is here and not in the camera to allow controlling exposure without full screen post process. + * This corresponds to a photographic exposure. + */ + set: function (value) { + this._imageProcessingConfiguration.exposure = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial.prototype, "cameraContrast", { + /** + * Gets The camera contrast used on this material. + */ + get: function () { + return this._imageProcessingConfiguration.contrast; + }, + /** + * Sets The camera contrast used on this material. + */ + set: function (value) { + this._imageProcessingConfiguration.contrast = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial.prototype, "cameraColorGradingTexture", { + /** + * Gets the Color Grading 2D Lookup Texture. + */ + get: function () { + return this._imageProcessingConfiguration.colorGradingTexture; + }, + /** + * Sets the Color Grading 2D Lookup Texture. + */ + set: function (value) { + this._imageProcessingConfiguration.colorGradingTexture = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial.prototype, "cameraColorCurves", { + /** + * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT). + * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects. + * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image; + * corresponding to low luminance, medium luminance, and high luminance areas respectively. + */ + get: function () { + return this._imageProcessingConfiguration.colorCurves; + }, + /** + * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT). + * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects. + * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image; + * corresponding to low luminance, medium luminance, and high luminance areas respectively. + */ + set: function (value) { + this._imageProcessingConfiguration.colorCurves = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial.prototype, "hasRenderTargetTextures", { + /** + * Gets a boolean indicating that current material needs to register RTT + */ + get: function () { + if (StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) { + return true; + } + if (StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) { + return true; + } + return false; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the current class name of the material e.g. "StandardMaterial" + * Mainly use in serialization. + * @returns the class name + */ + StandardMaterial.prototype.getClassName = function () { + return "StandardMaterial"; + }; + Object.defineProperty(StandardMaterial.prototype, "useLogarithmicDepth", { + /** + * In case the depth buffer does not allow enough depth precision for your scene (might be the case in large scenes) + * You can try switching to logarithmic depth. + * @see http://doc.babylonjs.com/how_to/using_logarithmic_depth_buffer + */ + get: function () { + return this._useLogarithmicDepth; + }, + set: function (value) { + this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported; + this._markAllSubMeshesAsMiscDirty(); + }, + enumerable: true, + configurable: true + }); + /** + * Specifies if the material will require alpha blending + * @returns a boolean specifying if alpha blending is needed + */ + StandardMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0) || (this._opacityTexture != null) || this._shouldUseAlphaFromDiffuseTexture() || this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled; + }; + /** + * Specifies if this material should be rendered in alpha test mode + * @returns a boolean specifying if an alpha test is needed. + */ + StandardMaterial.prototype.needAlphaTesting = function () { + return this._diffuseTexture != null && this._diffuseTexture.hasAlpha; + }; + StandardMaterial.prototype._shouldUseAlphaFromDiffuseTexture = function () { + return this._diffuseTexture != null && this._diffuseTexture.hasAlpha && this._useAlphaFromDiffuseTexture; + }; + /** + * Get the texture used for alpha test purpose. + * @returns the diffuse texture in case of the standard material. + */ + StandardMaterial.prototype.getAlphaTestTexture = function () { + return this._diffuseTexture; + }; + /** + * Get if the submesh is ready to be used and all its information available. + * Child classes can use it to update shaders + * @param mesh defines the mesh to check + * @param subMesh defines which submesh to check + * @param useInstances specifies that instances should be used + * @returns a boolean indicating that the submesh is ready or not + */ + StandardMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (useInstances === void 0) { useInstances = false; } + if (subMesh.effect && this.isFrozen) { + if (this._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new StandardMaterialDefines(); + } + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!this.checkReadyOnEveryCall && subMesh.effect) { + if (defines._renderId === scene.getRenderId()) { + return true; + } + } + var engine = scene.getEngine(); + // Lights + defines._needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting); + // Textures + if (defines._areTexturesDirty) { + defines._needUVs = false; + defines.MAINUV1 = false; + defines.MAINUV2 = false; + if (scene.texturesEnabled) { + if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReadyOrNotBlocking()) { + return false; + } + else { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._diffuseTexture, defines, "DIFFUSE"); + } + } + else { + defines.DIFFUSE = false; + } + if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) { + if (!this._ambientTexture.isReadyOrNotBlocking()) { + return false; + } + else { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._ambientTexture, defines, "AMBIENT"); + } + } + else { + defines.AMBIENT = false; + } + if (this._opacityTexture && StandardMaterial.OpacityTextureEnabled) { + if (!this._opacityTexture.isReadyOrNotBlocking()) { + return false; + } + else { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._opacityTexture, defines, "OPACITY"); + defines.OPACITYRGB = this._opacityTexture.getAlphaFromRGB; + } + } + else { + defines.OPACITY = false; + } + if (this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled) { + if (!this._reflectionTexture.isReadyOrNotBlocking()) { + return false; + } + else { + defines._needNormals = true; + defines.REFLECTION = true; + defines.ROUGHNESS = (this._roughness > 0); + defines.REFLECTIONOVERALPHA = this._useReflectionOverAlpha; + defines.INVERTCUBICMAP = (this._reflectionTexture.coordinatesMode === BABYLON.Texture.INVCUBIC_MODE); + defines.REFLECTIONMAP_3D = this._reflectionTexture.isCube; + switch (this._reflectionTexture.coordinatesMode) { + case BABYLON.Texture.EXPLICIT_MODE: + defines.setReflectionMode("REFLECTIONMAP_EXPLICIT"); + break; + case BABYLON.Texture.PLANAR_MODE: + defines.setReflectionMode("REFLECTIONMAP_PLANAR"); + break; + case BABYLON.Texture.PROJECTION_MODE: + defines.setReflectionMode("REFLECTIONMAP_PROJECTION"); + break; + case BABYLON.Texture.SKYBOX_MODE: + defines.setReflectionMode("REFLECTIONMAP_SKYBOX"); + defines.REFLECTIONMAP_SKYBOX_TRANSFORMED = !this._reflectionTexture.getReflectionTextureMatrix().isIdentity(); + break; + case BABYLON.Texture.SPHERICAL_MODE: + defines.setReflectionMode("REFLECTIONMAP_SPHERICAL"); + break; + case BABYLON.Texture.EQUIRECTANGULAR_MODE: + defines.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR"); + break; + case BABYLON.Texture.FIXED_EQUIRECTANGULAR_MODE: + defines.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED"); + break; + case BABYLON.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE: + defines.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"); + break; + case BABYLON.Texture.CUBIC_MODE: + case BABYLON.Texture.INVCUBIC_MODE: + default: + defines.setReflectionMode("REFLECTIONMAP_CUBIC"); + break; + } + defines.USE_LOCAL_REFLECTIONMAP_CUBIC = this._reflectionTexture.boundingBoxSize ? true : false; + } + } + else { + defines.REFLECTION = false; + } + if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled) { + if (!this._emissiveTexture.isReadyOrNotBlocking()) { + return false; + } + else { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._emissiveTexture, defines, "EMISSIVE"); + } + } + else { + defines.EMISSIVE = false; + } + if (this._lightmapTexture && StandardMaterial.LightmapTextureEnabled) { + if (!this._lightmapTexture.isReadyOrNotBlocking()) { + return false; + } + else { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._lightmapTexture, defines, "LIGHTMAP"); + defines.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap; + } + } + else { + defines.LIGHTMAP = false; + } + if (this._specularTexture && StandardMaterial.SpecularTextureEnabled) { + if (!this._specularTexture.isReadyOrNotBlocking()) { + return false; + } + else { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._specularTexture, defines, "SPECULAR"); + defines.GLOSSINESS = this._useGlossinessFromSpecularMapAlpha; + } + } + else { + defines.SPECULAR = false; + } + if (scene.getEngine().getCaps().standardDerivatives && this._bumpTexture && StandardMaterial.BumpTextureEnabled) { + // Bump texure can not be not blocking. + if (!this._bumpTexture.isReady()) { + return false; + } + else { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture, defines, "BUMP"); + defines.PARALLAX = this._useParallax; + defines.PARALLAXOCCLUSION = this._useParallaxOcclusion; + } + defines.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap; + } + else { + defines.BUMP = false; + } + if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) { + if (!this._refractionTexture.isReadyOrNotBlocking()) { + return false; + } + else { + defines._needUVs = true; + defines.REFRACTION = true; + defines.REFRACTIONMAP_3D = this._refractionTexture.isCube; + } + } + else { + defines.REFRACTION = false; + } + defines.TWOSIDEDLIGHTING = !this._backFaceCulling && this._twoSidedLighting; + } + else { + defines.DIFFUSE = false; + defines.AMBIENT = false; + defines.OPACITY = false; + defines.REFLECTION = false; + defines.EMISSIVE = false; + defines.LIGHTMAP = false; + defines.BUMP = false; + defines.REFRACTION = false; + } + defines.ALPHAFROMDIFFUSE = this._shouldUseAlphaFromDiffuseTexture(); + defines.EMISSIVEASILLUMINATION = this._useEmissiveAsIllumination; + defines.LINKEMISSIVEWITHDIFFUSE = this._linkEmissiveWithDiffuse; + defines.SPECULAROVERALPHA = this._useSpecularOverAlpha; + defines.PREMULTIPLYALPHA = (this.alphaMode === BABYLON.Engine.ALPHA_PREMULTIPLIED || this.alphaMode === BABYLON.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF); + } + if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) { + if (!this._imageProcessingConfiguration.isReady()) { + return false; + } + this._imageProcessingConfiguration.prepareDefines(defines); + defines.IS_REFLECTION_LINEAR = (this.reflectionTexture != null && !this.reflectionTexture.gammaSpace); + defines.IS_REFRACTION_LINEAR = (this.refractionTexture != null && !this.refractionTexture.gammaSpace); + } + if (defines._areFresnelDirty) { + if (StandardMaterial.FresnelEnabled) { + // Fresnel + if (this._diffuseFresnelParameters || this._opacityFresnelParameters || + this._emissiveFresnelParameters || this._refractionFresnelParameters || + this._reflectionFresnelParameters) { + defines.DIFFUSEFRESNEL = (this._diffuseFresnelParameters && this._diffuseFresnelParameters.isEnabled); + defines.OPACITYFRESNEL = (this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled); + defines.REFLECTIONFRESNEL = (this._reflectionFresnelParameters && this._reflectionFresnelParameters.isEnabled); + defines.REFLECTIONFRESNELFROMSPECULAR = this._useReflectionFresnelFromSpecular; + defines.REFRACTIONFRESNEL = (this._refractionFresnelParameters && this._refractionFresnelParameters.isEnabled); + defines.EMISSIVEFRESNEL = (this._emissiveFresnelParameters && this._emissiveFresnelParameters.isEnabled); + defines._needNormals = true; + defines.FRESNEL = true; + } + } + else { + defines.FRESNEL = false; + } + } + // Misc. + BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + // Attribs + BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true, true); + // Values that need to be evaluated on every frame + BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new BABYLON.EffectFallbacks(); + if (defines.REFLECTION) { + fallbacks.addFallback(0, "REFLECTION"); + } + if (defines.SPECULAR) { + fallbacks.addFallback(0, "SPECULAR"); + } + if (defines.BUMP) { + fallbacks.addFallback(0, "BUMP"); + } + if (defines.PARALLAX) { + fallbacks.addFallback(1, "PARALLAX"); + } + if (defines.PARALLAXOCCLUSION) { + fallbacks.addFallback(0, "PARALLAXOCCLUSION"); + } + if (defines.SPECULAROVERALPHA) { + fallbacks.addFallback(0, "SPECULAROVERALPHA"); + } + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + if (defines.POINTSIZE) { + fallbacks.addFallback(0, "POINTSIZE"); + } + if (defines.LOGARITHMICDEPTH) { + fallbacks.addFallback(0, "LOGARITHMICDEPTH"); + } + BABYLON.MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this._maxSimultaneousLights); + if (defines.SPECULARTERM) { + fallbacks.addFallback(0, "SPECULARTERM"); + } + if (defines.DIFFUSEFRESNEL) { + fallbacks.addFallback(1, "DIFFUSEFRESNEL"); + } + if (defines.OPACITYFRESNEL) { + fallbacks.addFallback(2, "OPACITYFRESNEL"); + } + if (defines.REFLECTIONFRESNEL) { + fallbacks.addFallback(3, "REFLECTIONFRESNEL"); + } + if (defines.EMISSIVEFRESNEL) { + fallbacks.addFallback(4, "EMISSIVEFRESNEL"); + } + if (defines.FRESNEL) { + fallbacks.addFallback(4, "FRESNEL"); + } + //Attributes + var attribs = [BABYLON.VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(BABYLON.VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(BABYLON.VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(BABYLON.VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(BABYLON.VertexBuffer.ColorKind); + } + BABYLON.MaterialHelper.PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + BABYLON.MaterialHelper.PrepareAttributesForInstances(attribs, defines); + BABYLON.MaterialHelper.PrepareAttributesForMorphTargets(attribs, mesh, defines); + var shaderName = "default"; + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vAmbientColor", "vDiffuseColor", "vSpecularColor", "vEmissiveColor", + "vFogInfos", "vFogColor", "pointSize", + "vDiffuseInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vEmissiveInfos", "vSpecularInfos", "vBumpInfos", "vLightmapInfos", "vRefractionInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix", "normalMatrix", "lightmapMatrix", "refractionMatrix", + "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor", "refractionLeftColor", "refractionRightColor", + "vReflectionPosition", "vReflectionSize", + "logarithmicDepthConstant", "vTangentSpaceParams", "alphaCutOff" + ]; + var samplers = ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler", "refractionCubeSampler", "refraction2DSampler"]; + var uniformBuffers = ["Material", "Scene"]; + if (BABYLON.ImageProcessingConfiguration) { + BABYLON.ImageProcessingConfiguration.PrepareUniforms(uniforms, defines); + BABYLON.ImageProcessingConfiguration.PrepareSamplers(samplers, defines); + } + BABYLON.MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: this._maxSimultaneousLights + }); + if (this.customShaderNameResolve) { + shaderName = this.customShaderNameResolve(shaderName, uniforms, uniformBuffers, samplers, defines); + } + var join = defines.toString(); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS } + }, engine), defines); + this.buildUniformLayout(); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + this._wasPreviouslyReady = true; + return true; + }; + /** + * Builds the material UBO layouts. + * Used internally during the effect preparation. + */ + StandardMaterial.prototype.buildUniformLayout = function () { + // Order is important ! + this._uniformBuffer.addUniform("diffuseLeftColor", 4); + this._uniformBuffer.addUniform("diffuseRightColor", 4); + this._uniformBuffer.addUniform("opacityParts", 4); + this._uniformBuffer.addUniform("reflectionLeftColor", 4); + this._uniformBuffer.addUniform("reflectionRightColor", 4); + this._uniformBuffer.addUniform("refractionLeftColor", 4); + this._uniformBuffer.addUniform("refractionRightColor", 4); + this._uniformBuffer.addUniform("emissiveLeftColor", 4); + this._uniformBuffer.addUniform("emissiveRightColor", 4); + this._uniformBuffer.addUniform("vDiffuseInfos", 2); + this._uniformBuffer.addUniform("vAmbientInfos", 2); + this._uniformBuffer.addUniform("vOpacityInfos", 2); + this._uniformBuffer.addUniform("vReflectionInfos", 2); + this._uniformBuffer.addUniform("vReflectionPosition", 3); + this._uniformBuffer.addUniform("vReflectionSize", 3); + this._uniformBuffer.addUniform("vEmissiveInfos", 2); + this._uniformBuffer.addUniform("vLightmapInfos", 2); + this._uniformBuffer.addUniform("vSpecularInfos", 2); + this._uniformBuffer.addUniform("vBumpInfos", 3); + this._uniformBuffer.addUniform("diffuseMatrix", 16); + this._uniformBuffer.addUniform("ambientMatrix", 16); + this._uniformBuffer.addUniform("opacityMatrix", 16); + this._uniformBuffer.addUniform("reflectionMatrix", 16); + this._uniformBuffer.addUniform("emissiveMatrix", 16); + this._uniformBuffer.addUniform("lightmapMatrix", 16); + this._uniformBuffer.addUniform("specularMatrix", 16); + this._uniformBuffer.addUniform("bumpMatrix", 16); + this._uniformBuffer.addUniform("vTangentSpaceParams", 2); + this._uniformBuffer.addUniform("refractionMatrix", 16); + this._uniformBuffer.addUniform("vRefractionInfos", 4); + this._uniformBuffer.addUniform("vSpecularColor", 4); + this._uniformBuffer.addUniform("vEmissiveColor", 3); + this._uniformBuffer.addUniform("vDiffuseColor", 4); + this._uniformBuffer.addUniform("pointSize", 1); + this._uniformBuffer.create(); + }; + /** + * Unbinds the material from the mesh + */ + StandardMaterial.prototype.unbind = function () { + if (this._activeEffect) { + var needFlag = false; + if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) { + this._activeEffect.setTexture("reflection2DSampler", null); + needFlag = true; + } + if (this._refractionTexture && this._refractionTexture.isRenderTarget) { + this._activeEffect.setTexture("refraction2DSampler", null); + needFlag = true; + } + if (needFlag) { + this._markAllSubMeshesAsTexturesDirty(); + } + } + _super.prototype.unbind.call(this); + }; + /** + * Binds the submesh to this material by preparing the effect and shader to draw + * @param world defines the world transformation matrix + * @param mesh defines the mesh containing the submesh + * @param subMesh defines the submesh to bind the material to + */ + StandardMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + // Normal Matrix + if (defines.OBJECTSPACE_NORMALMAP) { + world.toNormalMatrix(this._normalMatrix); + this.bindOnlyNormalMatrix(this._normalMatrix); + } + var mustRebind = this._mustRebind(scene, effect, mesh.visibility); + // Bones + BABYLON.MaterialHelper.BindBonesParameters(mesh, effect); + if (mustRebind) { + this._uniformBuffer.bindToEffect(effect, "Material"); + this.bindViewProjection(effect); + if (!this._uniformBuffer.useUbo || !this.isFrozen || !this._uniformBuffer.isSync) { + if (StandardMaterial.FresnelEnabled && defines.FRESNEL) { + // Fresnel + if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled) { + this._uniformBuffer.updateColor4("diffuseLeftColor", this.diffuseFresnelParameters.leftColor, this.diffuseFresnelParameters.power); + this._uniformBuffer.updateColor4("diffuseRightColor", this.diffuseFresnelParameters.rightColor, this.diffuseFresnelParameters.bias); + } + if (this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled) { + this._uniformBuffer.updateColor4("opacityParts", new BABYLON.Color3(this.opacityFresnelParameters.leftColor.toLuminance(), this.opacityFresnelParameters.rightColor.toLuminance(), this.opacityFresnelParameters.bias), this.opacityFresnelParameters.power); + } + if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) { + this._uniformBuffer.updateColor4("reflectionLeftColor", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power); + this._uniformBuffer.updateColor4("reflectionRightColor", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias); + } + if (this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled) { + this._uniformBuffer.updateColor4("refractionLeftColor", this.refractionFresnelParameters.leftColor, this.refractionFresnelParameters.power); + this._uniformBuffer.updateColor4("refractionRightColor", this.refractionFresnelParameters.rightColor, this.refractionFresnelParameters.bias); + } + if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) { + this._uniformBuffer.updateColor4("emissiveLeftColor", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power); + this._uniformBuffer.updateColor4("emissiveRightColor", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias); + } + } + // Textures + if (scene.texturesEnabled) { + if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) { + this._uniformBuffer.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._diffuseTexture, this._uniformBuffer, "diffuse"); + if (this._diffuseTexture.hasAlpha) { + effect.setFloat("alphaCutOff", this.alphaCutOff); + } + } + if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) { + this._uniformBuffer.updateFloat2("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._ambientTexture, this._uniformBuffer, "ambient"); + } + if (this._opacityTexture && StandardMaterial.OpacityTextureEnabled) { + this._uniformBuffer.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._opacityTexture, this._uniformBuffer, "opacity"); + } + if (this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled) { + this._uniformBuffer.updateFloat2("vReflectionInfos", this._reflectionTexture.level, this.roughness); + this._uniformBuffer.updateMatrix("reflectionMatrix", this._reflectionTexture.getReflectionTextureMatrix()); + if (this._reflectionTexture.boundingBoxSize) { + var cubeTexture = this._reflectionTexture; + this._uniformBuffer.updateVector3("vReflectionPosition", cubeTexture.boundingBoxPosition); + this._uniformBuffer.updateVector3("vReflectionSize", cubeTexture.boundingBoxSize); + } + } + if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled) { + this._uniformBuffer.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._emissiveTexture, this._uniformBuffer, "emissive"); + } + if (this._lightmapTexture && StandardMaterial.LightmapTextureEnabled) { + this._uniformBuffer.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._lightmapTexture, this._uniformBuffer, "lightmap"); + } + if (this._specularTexture && StandardMaterial.SpecularTextureEnabled) { + this._uniformBuffer.updateFloat2("vSpecularInfos", this._specularTexture.coordinatesIndex, this._specularTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._specularTexture, this._uniformBuffer, "specular"); + } + if (this._bumpTexture && scene.getEngine().getCaps().standardDerivatives && StandardMaterial.BumpTextureEnabled) { + this._uniformBuffer.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, 1.0 / this._bumpTexture.level, this.parallaxScaleBias); + BABYLON.MaterialHelper.BindTextureMatrix(this._bumpTexture, this._uniformBuffer, "bump"); + if (scene._mirroredCameraPosition) { + this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 1.0 : -1.0); + } + else { + this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0); + } + } + if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) { + var depth = 1.0; + if (!this._refractionTexture.isCube) { + this._uniformBuffer.updateMatrix("refractionMatrix", this._refractionTexture.getReflectionTextureMatrix()); + if (this._refractionTexture.depth) { + depth = this._refractionTexture.depth; + } + } + this._uniformBuffer.updateFloat4("vRefractionInfos", this._refractionTexture.level, this.indexOfRefraction, depth, this.invertRefractionY ? -1 : 1); + } + } + // Point size + if (this.pointsCloud) { + this._uniformBuffer.updateFloat("pointSize", this.pointSize); + } + if (defines.SPECULARTERM) { + this._uniformBuffer.updateColor4("vSpecularColor", this.specularColor, this.specularPower); + } + this._uniformBuffer.updateColor3("vEmissiveColor", this.emissiveColor); + // Diffuse + this._uniformBuffer.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility); + } + // Textures + if (scene.texturesEnabled) { + if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) { + effect.setTexture("diffuseSampler", this._diffuseTexture); + } + if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) { + effect.setTexture("ambientSampler", this._ambientTexture); + } + if (this._opacityTexture && StandardMaterial.OpacityTextureEnabled) { + effect.setTexture("opacitySampler", this._opacityTexture); + } + if (this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled) { + if (this._reflectionTexture.isCube) { + effect.setTexture("reflectionCubeSampler", this._reflectionTexture); + } + else { + effect.setTexture("reflection2DSampler", this._reflectionTexture); + } + } + if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled) { + effect.setTexture("emissiveSampler", this._emissiveTexture); + } + if (this._lightmapTexture && StandardMaterial.LightmapTextureEnabled) { + effect.setTexture("lightmapSampler", this._lightmapTexture); + } + if (this._specularTexture && StandardMaterial.SpecularTextureEnabled) { + effect.setTexture("specularSampler", this._specularTexture); + } + if (this._bumpTexture && scene.getEngine().getCaps().standardDerivatives && StandardMaterial.BumpTextureEnabled) { + effect.setTexture("bumpSampler", this._bumpTexture); + } + if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) { + var depth = 1.0; + if (this._refractionTexture.isCube) { + effect.setTexture("refractionCubeSampler", this._refractionTexture); + } + else { + effect.setTexture("refraction2DSampler", this._refractionTexture); + } + } + } + // Clip plane + BABYLON.MaterialHelper.BindClipPlane(effect, scene); + // Colors + scene.ambientColor.multiplyToRef(this.ambientColor, this._globalAmbientColor); + BABYLON.MaterialHelper.BindEyePosition(effect, scene); + effect.setColor3("vAmbientColor", this._globalAmbientColor); + } + if (mustRebind || !this.isFrozen) { + // Lights + if (scene.lightsEnabled && !this._disableLighting) { + BABYLON.MaterialHelper.BindLights(scene, mesh, effect, defines, this._maxSimultaneousLights); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE || this._reflectionTexture || this._refractionTexture) { + this.bindView(effect); + } + // Fog + BABYLON.MaterialHelper.BindFogParameters(scene, mesh, effect); + // Morph targets + if (defines.NUM_MORPH_INFLUENCERS) { + BABYLON.MaterialHelper.BindMorphTargetParameters(mesh, effect); + } + // Log. depth + BABYLON.MaterialHelper.BindLogDepth(defines, effect, scene); + // image processing + if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) { + this._imageProcessingConfiguration.bind(this._activeEffect); + } + } + this._uniformBuffer.update(); + this._afterBind(mesh, this._activeEffect); + }; + /** + * Get the list of animatables in the material. + * @returns the list of animatables object used in the material + */ + StandardMaterial.prototype.getAnimatables = function () { + var results = []; + if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) { + results.push(this._diffuseTexture); + } + if (this._ambientTexture && this._ambientTexture.animations && this._ambientTexture.animations.length > 0) { + results.push(this._ambientTexture); + } + if (this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0) { + results.push(this._opacityTexture); + } + if (this._reflectionTexture && this._reflectionTexture.animations && this._reflectionTexture.animations.length > 0) { + results.push(this._reflectionTexture); + } + if (this._emissiveTexture && this._emissiveTexture.animations && this._emissiveTexture.animations.length > 0) { + results.push(this._emissiveTexture); + } + if (this._specularTexture && this._specularTexture.animations && this._specularTexture.animations.length > 0) { + results.push(this._specularTexture); + } + if (this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0) { + results.push(this._bumpTexture); + } + if (this._lightmapTexture && this._lightmapTexture.animations && this._lightmapTexture.animations.length > 0) { + results.push(this._lightmapTexture); + } + if (this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0) { + results.push(this._refractionTexture); + } + return results; + }; + /** + * Gets the active textures from the material + * @returns an array of textures + */ + StandardMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + if (this._ambientTexture) { + activeTextures.push(this._ambientTexture); + } + if (this._opacityTexture) { + activeTextures.push(this._opacityTexture); + } + if (this._reflectionTexture) { + activeTextures.push(this._reflectionTexture); + } + if (this._emissiveTexture) { + activeTextures.push(this._emissiveTexture); + } + if (this._specularTexture) { + activeTextures.push(this._specularTexture); + } + if (this._bumpTexture) { + activeTextures.push(this._bumpTexture); + } + if (this._lightmapTexture) { + activeTextures.push(this._lightmapTexture); + } + if (this._refractionTexture) { + activeTextures.push(this._refractionTexture); + } + return activeTextures; + }; + /** + * Specifies if the material uses a texture + * @param texture defines the texture to check against the material + * @returns a boolean specifying if the material uses the texture + */ + StandardMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this._diffuseTexture === texture) { + return true; + } + if (this._ambientTexture === texture) { + return true; + } + if (this._opacityTexture === texture) { + return true; + } + if (this._reflectionTexture === texture) { + return true; + } + if (this._emissiveTexture === texture) { + return true; + } + if (this._specularTexture === texture) { + return true; + } + if (this._bumpTexture === texture) { + return true; + } + if (this._lightmapTexture === texture) { + return true; + } + if (this._refractionTexture === texture) { + return true; + } + return false; + }; + /** + * Disposes the material + * @param forceDisposeEffect specifies if effects should be forcefully disposed + * @param forceDisposeTextures specifies if textures should be forcefully disposed + */ + StandardMaterial.prototype.dispose = function (forceDisposeEffect, forceDisposeTextures) { + if (forceDisposeTextures) { + if (this._diffuseTexture) { + this._diffuseTexture.dispose(); + } + if (this._ambientTexture) { + this._ambientTexture.dispose(); + } + if (this._opacityTexture) { + this._opacityTexture.dispose(); + } + if (this._reflectionTexture) { + this._reflectionTexture.dispose(); + } + if (this._emissiveTexture) { + this._emissiveTexture.dispose(); + } + if (this._specularTexture) { + this._specularTexture.dispose(); + } + if (this._bumpTexture) { + this._bumpTexture.dispose(); + } + if (this._lightmapTexture) { + this._lightmapTexture.dispose(); + } + if (this._refractionTexture) { + this._refractionTexture.dispose(); + } + } + if (this._imageProcessingConfiguration && this._imageProcessingObserver) { + this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver); + } + _super.prototype.dispose.call(this, forceDisposeEffect, forceDisposeTextures); + }; + /** + * Makes a duplicate of the material, and gives it a new name + * @param name defines the new name for the duplicated material + * @returns the cloned material + */ + StandardMaterial.prototype.clone = function (name) { + var _this = this; + var result = BABYLON.SerializationHelper.Clone(function () { return new StandardMaterial(name, _this.getScene()); }, this); + result.name = name; + result.id = name; + return result; + }; + /** + * Serializes this material in a JSON representation + * @returns the serialized material object + */ + StandardMaterial.prototype.serialize = function () { + return BABYLON.SerializationHelper.Serialize(this); + }; + /** + * Creates a standard material from parsed material data + * @param source defines the JSON represnetation of the material + * @param scene defines the hosting scene + * @param rootUrl defines the root URL to use to load textures and relative dependencies + * @returns a new material + */ + StandardMaterial.Parse = function (source, scene, rootUrl) { + return BABYLON.SerializationHelper.Parse(function () { return new StandardMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object.defineProperty(StandardMaterial, "DiffuseTextureEnabled", { + /** + * Are diffuse textures enabled in the application. + */ + get: function () { + return StandardMaterial._DiffuseTextureEnabled; + }, + set: function (value) { + if (StandardMaterial._DiffuseTextureEnabled === value) { + return; + } + StandardMaterial._DiffuseTextureEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial, "AmbientTextureEnabled", { + /** + * Are ambient textures enabled in the application. + */ + get: function () { + return StandardMaterial._AmbientTextureEnabled; + }, + set: function (value) { + if (StandardMaterial._AmbientTextureEnabled === value) { + return; + } + StandardMaterial._AmbientTextureEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial, "OpacityTextureEnabled", { + /** + * Are opacity textures enabled in the application. + */ + get: function () { + return StandardMaterial._OpacityTextureEnabled; + }, + set: function (value) { + if (StandardMaterial._OpacityTextureEnabled === value) { + return; + } + StandardMaterial._OpacityTextureEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial, "ReflectionTextureEnabled", { + /** + * Are reflection textures enabled in the application. + */ + get: function () { + return StandardMaterial._ReflectionTextureEnabled; + }, + set: function (value) { + if (StandardMaterial._ReflectionTextureEnabled === value) { + return; + } + StandardMaterial._ReflectionTextureEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial, "EmissiveTextureEnabled", { + /** + * Are emissive textures enabled in the application. + */ + get: function () { + return StandardMaterial._EmissiveTextureEnabled; + }, + set: function (value) { + if (StandardMaterial._EmissiveTextureEnabled === value) { + return; + } + StandardMaterial._EmissiveTextureEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial, "SpecularTextureEnabled", { + /** + * Are specular textures enabled in the application. + */ + get: function () { + return StandardMaterial._SpecularTextureEnabled; + }, + set: function (value) { + if (StandardMaterial._SpecularTextureEnabled === value) { + return; + } + StandardMaterial._SpecularTextureEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial, "BumpTextureEnabled", { + /** + * Are bump textures enabled in the application. + */ + get: function () { + return StandardMaterial._BumpTextureEnabled; + }, + set: function (value) { + if (StandardMaterial._BumpTextureEnabled === value) { + return; + } + StandardMaterial._BumpTextureEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial, "LightmapTextureEnabled", { + /** + * Are lightmap textures enabled in the application. + */ + get: function () { + return StandardMaterial._LightmapTextureEnabled; + }, + set: function (value) { + if (StandardMaterial._LightmapTextureEnabled === value) { + return; + } + StandardMaterial._LightmapTextureEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial, "RefractionTextureEnabled", { + /** + * Are refraction textures enabled in the application. + */ + get: function () { + return StandardMaterial._RefractionTextureEnabled; + }, + set: function (value) { + if (StandardMaterial._RefractionTextureEnabled === value) { + return; + } + StandardMaterial._RefractionTextureEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial, "ColorGradingTextureEnabled", { + /** + * Are color grading textures enabled in the application. + */ + get: function () { + return StandardMaterial._ColorGradingTextureEnabled; + }, + set: function (value) { + if (StandardMaterial._ColorGradingTextureEnabled === value) { + return; + } + StandardMaterial._ColorGradingTextureEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StandardMaterial, "FresnelEnabled", { + /** + * Are fresnels enabled in the application. + */ + get: function () { + return StandardMaterial._FresnelEnabled; + }, + set: function (value) { + if (StandardMaterial._FresnelEnabled === value) { + return; + } + StandardMaterial._FresnelEnabled = value; + BABYLON.Engine.MarkAllMaterialsAsDirty(BABYLON.Material.FresnelDirtyFlag); + }, + enumerable: true, + configurable: true + }); + // Flags used to enable or disable a type of texture for all Standard Materials + StandardMaterial._DiffuseTextureEnabled = true; + StandardMaterial._AmbientTextureEnabled = true; + StandardMaterial._OpacityTextureEnabled = true; + StandardMaterial._ReflectionTextureEnabled = true; + StandardMaterial._EmissiveTextureEnabled = true; + StandardMaterial._SpecularTextureEnabled = true; + StandardMaterial._BumpTextureEnabled = true; + StandardMaterial._LightmapTextureEnabled = true; + StandardMaterial._RefractionTextureEnabled = true; + StandardMaterial._ColorGradingTextureEnabled = true; + StandardMaterial._FresnelEnabled = true; + __decorate([ + BABYLON.serializeAsTexture("diffuseTexture") + ], StandardMaterial.prototype, "_diffuseTexture", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], StandardMaterial.prototype, "diffuseTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture("ambientTexture") + ], StandardMaterial.prototype, "_ambientTexture", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "ambientTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture("opacityTexture") + ], StandardMaterial.prototype, "_opacityTexture", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], StandardMaterial.prototype, "opacityTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture("reflectionTexture") + ], StandardMaterial.prototype, "_reflectionTexture", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "reflectionTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture("emissiveTexture") + ], StandardMaterial.prototype, "_emissiveTexture", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "emissiveTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture("specularTexture") + ], StandardMaterial.prototype, "_specularTexture", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "specularTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture("bumpTexture") + ], StandardMaterial.prototype, "_bumpTexture", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "bumpTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture("lightmapTexture") + ], StandardMaterial.prototype, "_lightmapTexture", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "lightmapTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture("refractionTexture") + ], StandardMaterial.prototype, "_refractionTexture", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "refractionTexture", void 0); + __decorate([ + BABYLON.serializeAsColor3("ambient") + ], StandardMaterial.prototype, "ambientColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("diffuse") + ], StandardMaterial.prototype, "diffuseColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("specular") + ], StandardMaterial.prototype, "specularColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("emissive") + ], StandardMaterial.prototype, "emissiveColor", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "specularPower", void 0); + __decorate([ + BABYLON.serialize("useAlphaFromDiffuseTexture") + ], StandardMaterial.prototype, "_useAlphaFromDiffuseTexture", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useAlphaFromDiffuseTexture", void 0); + __decorate([ + BABYLON.serialize("useEmissiveAsIllumination") + ], StandardMaterial.prototype, "_useEmissiveAsIllumination", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useEmissiveAsIllumination", void 0); + __decorate([ + BABYLON.serialize("linkEmissiveWithDiffuse") + ], StandardMaterial.prototype, "_linkEmissiveWithDiffuse", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "linkEmissiveWithDiffuse", void 0); + __decorate([ + BABYLON.serialize("useSpecularOverAlpha") + ], StandardMaterial.prototype, "_useSpecularOverAlpha", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useSpecularOverAlpha", void 0); + __decorate([ + BABYLON.serialize("useReflectionOverAlpha") + ], StandardMaterial.prototype, "_useReflectionOverAlpha", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useReflectionOverAlpha", void 0); + __decorate([ + BABYLON.serialize("disableLighting") + ], StandardMaterial.prototype, "_disableLighting", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsLightsDirty") + ], StandardMaterial.prototype, "disableLighting", void 0); + __decorate([ + BABYLON.serialize("useObjectSpaceNormalMap") + ], StandardMaterial.prototype, "_useObjectSpaceNormalMap", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useObjectSpaceNormalMap", void 0); + __decorate([ + BABYLON.serialize("useParallax") + ], StandardMaterial.prototype, "_useParallax", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useParallax", void 0); + __decorate([ + BABYLON.serialize("useParallaxOcclusion") + ], StandardMaterial.prototype, "_useParallaxOcclusion", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useParallaxOcclusion", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "parallaxScaleBias", void 0); + __decorate([ + BABYLON.serialize("roughness") + ], StandardMaterial.prototype, "_roughness", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "roughness", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "indexOfRefraction", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "invertRefractionY", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "alphaCutOff", void 0); + __decorate([ + BABYLON.serialize("useLightmapAsShadowmap") + ], StandardMaterial.prototype, "_useLightmapAsShadowmap", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useLightmapAsShadowmap", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters("diffuseFresnelParameters") + ], StandardMaterial.prototype, "_diffuseFresnelParameters", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsFresnelDirty") + ], StandardMaterial.prototype, "diffuseFresnelParameters", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters("opacityFresnelParameters") + ], StandardMaterial.prototype, "_opacityFresnelParameters", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsFresnelAndMiscDirty") + ], StandardMaterial.prototype, "opacityFresnelParameters", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters("reflectionFresnelParameters") + ], StandardMaterial.prototype, "_reflectionFresnelParameters", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsFresnelDirty") + ], StandardMaterial.prototype, "reflectionFresnelParameters", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters("refractionFresnelParameters") + ], StandardMaterial.prototype, "_refractionFresnelParameters", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsFresnelDirty") + ], StandardMaterial.prototype, "refractionFresnelParameters", void 0); + __decorate([ + BABYLON.serializeAsFresnelParameters("emissiveFresnelParameters") + ], StandardMaterial.prototype, "_emissiveFresnelParameters", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsFresnelDirty") + ], StandardMaterial.prototype, "emissiveFresnelParameters", void 0); + __decorate([ + BABYLON.serialize("useReflectionFresnelFromSpecular") + ], StandardMaterial.prototype, "_useReflectionFresnelFromSpecular", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsFresnelDirty") + ], StandardMaterial.prototype, "useReflectionFresnelFromSpecular", void 0); + __decorate([ + BABYLON.serialize("useGlossinessFromSpecularMapAlpha") + ], StandardMaterial.prototype, "_useGlossinessFromSpecularMapAlpha", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useGlossinessFromSpecularMapAlpha", void 0); + __decorate([ + BABYLON.serialize("maxSimultaneousLights") + ], StandardMaterial.prototype, "_maxSimultaneousLights", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsLightsDirty") + ], StandardMaterial.prototype, "maxSimultaneousLights", void 0); + __decorate([ + BABYLON.serialize("invertNormalMapX") + ], StandardMaterial.prototype, "_invertNormalMapX", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "invertNormalMapX", void 0); + __decorate([ + BABYLON.serialize("invertNormalMapY") + ], StandardMaterial.prototype, "_invertNormalMapY", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "invertNormalMapY", void 0); + __decorate([ + BABYLON.serialize("twoSidedLighting") + ], StandardMaterial.prototype, "_twoSidedLighting", void 0); + __decorate([ + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "twoSidedLighting", void 0); + __decorate([ + BABYLON.serialize() + ], StandardMaterial.prototype, "useLogarithmicDepth", null); + return StandardMaterial; + }(BABYLON.PushMaterial)); + BABYLON.StandardMaterial = StandardMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.standardMaterial.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Class representing spherical polynomial coefficients to the 3rd degree + */ + var SphericalPolynomial = /** @class */ (function () { + function SphericalPolynomial() { + /** + * The x coefficients of the spherical polynomial + */ + this.x = BABYLON.Vector3.Zero(); + /** + * The y coefficients of the spherical polynomial + */ + this.y = BABYLON.Vector3.Zero(); + /** + * The z coefficients of the spherical polynomial + */ + this.z = BABYLON.Vector3.Zero(); + /** + * The xx coefficients of the spherical polynomial + */ + this.xx = BABYLON.Vector3.Zero(); + /** + * The yy coefficients of the spherical polynomial + */ + this.yy = BABYLON.Vector3.Zero(); + /** + * The zz coefficients of the spherical polynomial + */ + this.zz = BABYLON.Vector3.Zero(); + /** + * The xy coefficients of the spherical polynomial + */ + this.xy = BABYLON.Vector3.Zero(); + /** + * The yz coefficients of the spherical polynomial + */ + this.yz = BABYLON.Vector3.Zero(); + /** + * The zx coefficients of the spherical polynomial + */ + this.zx = BABYLON.Vector3.Zero(); + } + /** + * Adds an ambient color to the spherical polynomial + * @param color the color to add + */ + SphericalPolynomial.prototype.addAmbient = function (color) { + var colorVector = new BABYLON.Vector3(color.r, color.g, color.b); + this.xx = this.xx.add(colorVector); + this.yy = this.yy.add(colorVector); + this.zz = this.zz.add(colorVector); + }; + /** + * Scales the spherical polynomial by the given amount + * @param scale the amount to scale + */ + SphericalPolynomial.prototype.scale = function (scale) { + this.x = this.x.scale(scale); + this.y = this.y.scale(scale); + this.z = this.z.scale(scale); + this.xx = this.xx.scale(scale); + this.yy = this.yy.scale(scale); + this.zz = this.zz.scale(scale); + this.yz = this.yz.scale(scale); + this.zx = this.zx.scale(scale); + this.xy = this.xy.scale(scale); + }; + /** + * Gets the spherical polynomial from harmonics + * @param harmonics the spherical harmonics + * @returns the spherical polynomial + */ + SphericalPolynomial.FromHarmonics = function (harmonics) { + var result = new SphericalPolynomial(); + result.x = harmonics.l11.scale(1.02333); + result.y = harmonics.l1_1.scale(1.02333); + result.z = harmonics.l10.scale(1.02333); + result.xx = harmonics.l00.scale(0.886277).subtract(harmonics.l20.scale(0.247708)).add(harmonics.lL22.scale(0.429043)); + result.yy = harmonics.l00.scale(0.886277).subtract(harmonics.l20.scale(0.247708)).subtract(harmonics.lL22.scale(0.429043)); + result.zz = harmonics.l00.scale(0.886277).add(harmonics.l20.scale(0.495417)); + result.yz = harmonics.l2_1.scale(0.858086); + result.zx = harmonics.l21.scale(0.858086); + result.xy = harmonics.l2_2.scale(0.858086); + result.scale(1.0 / Math.PI); + return result; + }; + /** + * Constructs a spherical polynomial from an array. + * @param data defines the 9x3 coefficients (x, y, z, xx, yy, zz, yz, zx, xy) + * @returns the spherical polynomial + */ + SphericalPolynomial.FromArray = function (data) { + var sp = new SphericalPolynomial(); + BABYLON.Vector3.FromArrayToRef(data[0], 0, sp.x); + BABYLON.Vector3.FromArrayToRef(data[1], 0, sp.y); + BABYLON.Vector3.FromArrayToRef(data[2], 0, sp.z); + BABYLON.Vector3.FromArrayToRef(data[3], 0, sp.xx); + BABYLON.Vector3.FromArrayToRef(data[4], 0, sp.yy); + BABYLON.Vector3.FromArrayToRef(data[5], 0, sp.zz); + BABYLON.Vector3.FromArrayToRef(data[6], 0, sp.yz); + BABYLON.Vector3.FromArrayToRef(data[7], 0, sp.zx); + BABYLON.Vector3.FromArrayToRef(data[8], 0, sp.xy); + return sp; + }; + return SphericalPolynomial; + }()); + BABYLON.SphericalPolynomial = SphericalPolynomial; + /** + * Class representing spherical harmonics coefficients to the 3rd degree + */ + var SphericalHarmonics = /** @class */ (function () { + function SphericalHarmonics() { + /** + * The l0,0 coefficients of the spherical harmonics + */ + this.l00 = BABYLON.Vector3.Zero(); + /** + * The l1,-1 coefficients of the spherical harmonics + */ + this.l1_1 = BABYLON.Vector3.Zero(); + /** + * The l1,0 coefficients of the spherical harmonics + */ + this.l10 = BABYLON.Vector3.Zero(); + /** + * The l1,1 coefficients of the spherical harmonics + */ + this.l11 = BABYLON.Vector3.Zero(); + /** + * The l2,-2 coefficients of the spherical harmonics + */ + this.l2_2 = BABYLON.Vector3.Zero(); + /** + * The l2,-1 coefficients of the spherical harmonics + */ + this.l2_1 = BABYLON.Vector3.Zero(); + /** + * The l2,0 coefficients of the spherical harmonics + */ + this.l20 = BABYLON.Vector3.Zero(); + /** + * The l2,1 coefficients of the spherical harmonics + */ + this.l21 = BABYLON.Vector3.Zero(); + /** + * The l2,2 coefficients of the spherical harmonics + */ + this.lL22 = BABYLON.Vector3.Zero(); + } + /** + * Adds a light to the spherical harmonics + * @param direction the direction of the light + * @param color the color of the light + * @param deltaSolidAngle the delta solid angle of the light + */ + SphericalHarmonics.prototype.addLight = function (direction, color, deltaSolidAngle) { + var colorVector = new BABYLON.Vector3(color.r, color.g, color.b); + var c = colorVector.scale(deltaSolidAngle); + this.l00 = this.l00.add(c.scale(0.282095)); + this.l1_1 = this.l1_1.add(c.scale(0.488603 * direction.y)); + this.l10 = this.l10.add(c.scale(0.488603 * direction.z)); + this.l11 = this.l11.add(c.scale(0.488603 * direction.x)); + this.l2_2 = this.l2_2.add(c.scale(1.092548 * direction.x * direction.y)); + this.l2_1 = this.l2_1.add(c.scale(1.092548 * direction.y * direction.z)); + this.l21 = this.l21.add(c.scale(1.092548 * direction.x * direction.z)); + this.l20 = this.l20.add(c.scale(0.315392 * (3.0 * direction.z * direction.z - 1.0))); + this.lL22 = this.lL22.add(c.scale(0.546274 * (direction.x * direction.x - direction.y * direction.y))); + }; + /** + * Scales the spherical harmonics by the given amount + * @param scale the amount to scale + */ + SphericalHarmonics.prototype.scale = function (scale) { + this.l00 = this.l00.scale(scale); + this.l1_1 = this.l1_1.scale(scale); + this.l10 = this.l10.scale(scale); + this.l11 = this.l11.scale(scale); + this.l2_2 = this.l2_2.scale(scale); + this.l2_1 = this.l2_1.scale(scale); + this.l20 = this.l20.scale(scale); + this.l21 = this.l21.scale(scale); + this.lL22 = this.lL22.scale(scale); + }; + /** + * Convert from incident radiance (Li) to irradiance (E) by applying convolution with the cosine-weighted hemisphere. + * + * ``` + * E_lm = A_l * L_lm + * ``` + * + * In spherical harmonics this convolution amounts to scaling factors for each frequency band. + * This corresponds to equation 5 in "An Efficient Representation for Irradiance Environment Maps", where + * the scaling factors are given in equation 9. + */ + SphericalHarmonics.prototype.convertIncidentRadianceToIrradiance = function () { + // Constant (Band 0) + this.l00 = this.l00.scale(3.141593); + // Linear (Band 1) + this.l1_1 = this.l1_1.scale(2.094395); + this.l10 = this.l10.scale(2.094395); + this.l11 = this.l11.scale(2.094395); + // Quadratic (Band 2) + this.l2_2 = this.l2_2.scale(0.785398); + this.l2_1 = this.l2_1.scale(0.785398); + this.l20 = this.l20.scale(0.785398); + this.l21 = this.l21.scale(0.785398); + this.lL22 = this.lL22.scale(0.785398); + }; + /** + * Convert from irradiance to outgoing radiance for Lambertian BDRF, suitable for efficient shader evaluation. + * + * ``` + * L = (1/pi) * E * rho + * ``` + * + * This is done by an additional scale by 1/pi, so is a fairly trivial operation but important conceptually. + */ + SphericalHarmonics.prototype.convertIrradianceToLambertianRadiance = function () { + this.scale(1.0 / Math.PI); + // The resultant SH now represents outgoing radiance, so includes the Lambert 1/pi normalisation factor but without albedo (rho) applied + // (The pixel shader must apply albedo after texture fetches, etc). + }; + /** + * Gets the spherical harmonics from polynomial + * @param polynomial the spherical polynomial + * @returns the spherical harmonics + */ + SphericalHarmonics.FromPolynomial = function (polynomial) { + var result = new SphericalHarmonics(); + result.l00 = polynomial.xx.scale(0.376127).add(polynomial.yy.scale(0.376127)).add(polynomial.zz.scale(0.376126)); + result.l1_1 = polynomial.y.scale(0.977204); + result.l10 = polynomial.z.scale(0.977204); + result.l11 = polynomial.x.scale(0.977204); + result.l2_2 = polynomial.xy.scale(1.16538); + result.l2_1 = polynomial.yz.scale(1.16538); + result.l20 = polynomial.zz.scale(1.34567).subtract(polynomial.xx.scale(0.672834)).subtract(polynomial.yy.scale(0.672834)); + result.l21 = polynomial.zx.scale(1.16538); + result.lL22 = polynomial.xx.scale(1.16538).subtract(polynomial.yy.scale(1.16538)); + result.scale(Math.PI); + return result; + }; + /** + * Constructs a spherical harmonics from an array. + * @param data defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22) + * @returns the spherical harmonics + */ + SphericalHarmonics.FromArray = function (data) { + var sh = new SphericalHarmonics(); + BABYLON.Vector3.FromArrayToRef(data[0], 0, sh.l00); + BABYLON.Vector3.FromArrayToRef(data[1], 0, sh.l1_1); + BABYLON.Vector3.FromArrayToRef(data[2], 0, sh.l10); + BABYLON.Vector3.FromArrayToRef(data[3], 0, sh.l11); + BABYLON.Vector3.FromArrayToRef(data[4], 0, sh.l2_2); + BABYLON.Vector3.FromArrayToRef(data[5], 0, sh.l2_1); + BABYLON.Vector3.FromArrayToRef(data[6], 0, sh.l20); + BABYLON.Vector3.FromArrayToRef(data[7], 0, sh.l21); + BABYLON.Vector3.FromArrayToRef(data[8], 0, sh.lL22); + return sh; + }; + return SphericalHarmonics; + }()); + BABYLON.SphericalHarmonics = SphericalHarmonics; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.sphericalPolynomial.js.map + +var BABYLON; +(function (BABYLON) { + var FileFaceOrientation = /** @class */ (function () { + function FileFaceOrientation(name, worldAxisForNormal, worldAxisForFileX, worldAxisForFileY) { + this.name = name; + this.worldAxisForNormal = worldAxisForNormal; + this.worldAxisForFileX = worldAxisForFileX; + this.worldAxisForFileY = worldAxisForFileY; + } + return FileFaceOrientation; + }()); + /** + * Helper class dealing with the extraction of spherical polynomial dataArray + * from a cube map. + */ + var CubeMapToSphericalPolynomialTools = /** @class */ (function () { + function CubeMapToSphericalPolynomialTools() { + } + /** + * Converts a texture to the according Spherical Polynomial data. + * This extracts the first 3 orders only as they are the only one used in the lighting. + * + * @param texture The texture to extract the information from. + * @return The Spherical Polynomial data. + */ + CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial = function (texture) { + if (!texture.isCube) { + // Only supports cube Textures currently. + return null; + } + var size = texture.getSize().width; + var right = texture.readPixels(0); + var left = texture.readPixels(1); + var up; + var down; + if (texture.isRenderTarget) { + up = texture.readPixels(3); + down = texture.readPixels(2); + } + else { + up = texture.readPixels(2); + down = texture.readPixels(3); + } + var front = texture.readPixels(4); + var back = texture.readPixels(5); + var gammaSpace = texture.gammaSpace; + // Always read as RGBA. + var format = BABYLON.Engine.TEXTUREFORMAT_RGBA; + var type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; + if (texture.textureType && texture.textureType !== BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT) { + type = BABYLON.Engine.TEXTURETYPE_FLOAT; + } + var cubeInfo = { + size: size, + right: right, + left: left, + up: up, + down: down, + front: front, + back: back, + format: format, + type: type, + gammaSpace: gammaSpace, + }; + return this.ConvertCubeMapToSphericalPolynomial(cubeInfo); + }; + /** + * Converts a cubemap to the according Spherical Polynomial data. + * This extracts the first 3 orders only as they are the only one used in the lighting. + * + * @param cubeInfo The Cube map to extract the information from. + * @return The Spherical Polynomial data. + */ + CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial = function (cubeInfo) { + var sphericalHarmonics = new BABYLON.SphericalHarmonics(); + var totalSolidAngle = 0.0; + // The (u,v) range is [-1,+1], so the distance between each texel is 2/Size. + var du = 2.0 / cubeInfo.size; + var dv = du; + // The (u,v) of the first texel is half a texel from the corner (-1,-1). + var minUV = du * 0.5 - 1.0; + for (var faceIndex = 0; faceIndex < 6; faceIndex++) { + var fileFace = this.FileFaces[faceIndex]; + var dataArray = cubeInfo[fileFace.name]; + var v = minUV; + // TODO: we could perform the summation directly into a SphericalPolynomial (SP), which is more efficient than SphericalHarmonic (SH). + // This is possible because during the summation we do not need the SH-specific properties, e.g. orthogonality. + // Because SP is still linear, so summation is fine in that basis. + var stride = cubeInfo.format === BABYLON.Engine.TEXTUREFORMAT_RGBA ? 4 : 3; + for (var y = 0; y < cubeInfo.size; y++) { + var u = minUV; + for (var x = 0; x < cubeInfo.size; x++) { + // World direction (not normalised) + var worldDirection = fileFace.worldAxisForFileX.scale(u).add(fileFace.worldAxisForFileY.scale(v)).add(fileFace.worldAxisForNormal); + worldDirection.normalize(); + var deltaSolidAngle = Math.pow(1.0 + u * u + v * v, -3.0 / 2.0); + var r = dataArray[(y * cubeInfo.size * stride) + (x * stride) + 0]; + var g = dataArray[(y * cubeInfo.size * stride) + (x * stride) + 1]; + var b = dataArray[(y * cubeInfo.size * stride) + (x * stride) + 2]; + // Handle Integer types. + if (cubeInfo.type === BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT) { + r /= 255; + g /= 255; + b /= 255; + } + // Handle Gamma space textures. + if (cubeInfo.gammaSpace) { + r = Math.pow(BABYLON.Scalar.Clamp(r), BABYLON.ToLinearSpace); + g = Math.pow(BABYLON.Scalar.Clamp(g), BABYLON.ToLinearSpace); + b = Math.pow(BABYLON.Scalar.Clamp(b), BABYLON.ToLinearSpace); + } + var color = new BABYLON.Color3(r, g, b); + sphericalHarmonics.addLight(worldDirection, color, deltaSolidAngle); + totalSolidAngle += deltaSolidAngle; + u += du; + } + v += dv; + } + } + // Solid angle for entire sphere is 4*pi + var sphereSolidAngle = 4.0 * Math.PI; + // Adjust the solid angle to allow for how many faces we processed. + var facesProcessed = 6.0; + var expectedSolidAngle = sphereSolidAngle * facesProcessed / 6.0; + // Adjust the harmonics so that the accumulated solid angle matches the expected solid angle. + // This is needed because the numerical integration over the cube uses a + // small angle approximation of solid angle for each texel (see deltaSolidAngle), + // and also to compensate for accumulative error due to float precision in the summation. + var correctionFactor = expectedSolidAngle / totalSolidAngle; + sphericalHarmonics.scale(correctionFactor); + sphericalHarmonics.convertIncidentRadianceToIrradiance(); + sphericalHarmonics.convertIrradianceToLambertianRadiance(); + return BABYLON.SphericalPolynomial.FromHarmonics(sphericalHarmonics); + }; + CubeMapToSphericalPolynomialTools.FileFaces = [ + new FileFaceOrientation("right", new BABYLON.Vector3(1, 0, 0), new BABYLON.Vector3(0, 0, -1), new BABYLON.Vector3(0, -1, 0)), + new FileFaceOrientation("left", new BABYLON.Vector3(-1, 0, 0), new BABYLON.Vector3(0, 0, 1), new BABYLON.Vector3(0, -1, 0)), + new FileFaceOrientation("up", new BABYLON.Vector3(0, 1, 0), new BABYLON.Vector3(1, 0, 0), new BABYLON.Vector3(0, 0, 1)), + new FileFaceOrientation("down", new BABYLON.Vector3(0, -1, 0), new BABYLON.Vector3(1, 0, 0), new BABYLON.Vector3(0, 0, -1)), + new FileFaceOrientation("front", new BABYLON.Vector3(0, 0, 1), new BABYLON.Vector3(1, 0, 0), new BABYLON.Vector3(0, -1, 0)), + new FileFaceOrientation("back", new BABYLON.Vector3(0, 0, -1), new BABYLON.Vector3(-1, 0, 0), new BABYLON.Vector3(0, -1, 0)) // -Z bottom + ]; + return CubeMapToSphericalPolynomialTools; + }()); + BABYLON.CubeMapToSphericalPolynomialTools = CubeMapToSphericalPolynomialTools; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.cubemapToSphericalPolynomial.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * Manages the defines for the PBR Material. + * @hiddenChildren + */ + var PBRMaterialDefines = /** @class */ (function (_super) { + __extends(PBRMaterialDefines, _super); + /** + * Initializes the PBR Material defines. + */ + function PBRMaterialDefines() { + var _this = _super.call(this) || this; + _this.PBR = true; + _this.MAINUV1 = false; + _this.MAINUV2 = false; + _this.UV1 = false; + _this.UV2 = false; + _this.ALBEDO = false; + _this.ALBEDODIRECTUV = 0; + _this.VERTEXCOLOR = false; + _this.AMBIENT = false; + _this.AMBIENTDIRECTUV = 0; + _this.AMBIENTINGRAYSCALE = false; + _this.OPACITY = false; + _this.VERTEXALPHA = false; + _this.OPACITYDIRECTUV = 0; + _this.OPACITYRGB = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.ALPHABLEND = false; + _this.ALPHAFROMALBEDO = false; + _this.ALPHATESTVALUE = "0.5"; + _this.SPECULAROVERALPHA = false; + _this.RADIANCEOVERALPHA = false; + _this.ALPHAFRESNEL = false; + _this.LINEARALPHAFRESNEL = false; + _this.PREMULTIPLYALPHA = false; + _this.EMISSIVE = false; + _this.EMISSIVEDIRECTUV = 0; + _this.REFLECTIVITY = false; + _this.REFLECTIVITYDIRECTUV = 0; + _this.SPECULARTERM = false; + _this.MICROSURFACEFROMREFLECTIVITYMAP = false; + _this.MICROSURFACEAUTOMATIC = false; + _this.LODBASEDMICROSFURACE = false; + _this.MICROSURFACEMAP = false; + _this.MICROSURFACEMAPDIRECTUV = 0; + _this.METALLICWORKFLOW = false; + _this.ROUGHNESSSTOREINMETALMAPALPHA = false; + _this.ROUGHNESSSTOREINMETALMAPGREEN = false; + _this.METALLNESSSTOREINMETALMAPBLUE = false; + _this.AOSTOREINMETALMAPRED = false; + _this.ENVIRONMENTBRDF = false; + _this.NORMAL = false; + _this.TANGENT = false; + _this.BUMP = false; + _this.BUMPDIRECTUV = 0; + _this.OBJECTSPACE_NORMALMAP = false; + _this.PARALLAX = false; + _this.PARALLAXOCCLUSION = false; + _this.NORMALXYSCALE = true; + _this.LIGHTMAP = false; + _this.LIGHTMAPDIRECTUV = 0; + _this.USELIGHTMAPASSHADOWMAP = false; + _this.GAMMALIGHTMAP = false; + _this.REFLECTION = false; + _this.REFLECTIONMAP_3D = false; + _this.REFLECTIONMAP_SPHERICAL = false; + _this.REFLECTIONMAP_PLANAR = false; + _this.REFLECTIONMAP_CUBIC = false; + _this.USE_LOCAL_REFLECTIONMAP_CUBIC = false; + _this.REFLECTIONMAP_PROJECTION = false; + _this.REFLECTIONMAP_SKYBOX = false; + _this.REFLECTIONMAP_SKYBOX_TRANSFORMED = false; + _this.REFLECTIONMAP_EXPLICIT = false; + _this.REFLECTIONMAP_EQUIRECTANGULAR = false; + _this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false; + _this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false; + _this.INVERTCUBICMAP = false; + _this.USESPHERICALFROMREFLECTIONMAP = false; + _this.USESPHERICALINVERTEX = false; + _this.REFLECTIONMAP_OPPOSITEZ = false; + _this.LODINREFLECTIONALPHA = false; + _this.GAMMAREFLECTION = false; + _this.RGBDREFLECTION = false; + _this.RADIANCEOCCLUSION = false; + _this.HORIZONOCCLUSION = false; + _this.REFRACTION = false; + _this.REFRACTIONMAP_3D = false; + _this.REFRACTIONMAP_OPPOSITEZ = false; + _this.LODINREFRACTIONALPHA = false; + _this.GAMMAREFRACTION = false; + _this.RGBDREFRACTION = false; + _this.LINKREFRACTIONTOTRANSPARENCY = false; + _this.INSTANCES = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.NONUNIFORMSCALING = false; + _this.MORPHTARGETS = false; + _this.MORPHTARGETS_NORMAL = false; + _this.MORPHTARGETS_TANGENT = false; + _this.NUM_MORPH_INFLUENCERS = 0; + _this.IMAGEPROCESSING = false; + _this.VIGNETTE = false; + _this.VIGNETTEBLENDMODEMULTIPLY = false; + _this.VIGNETTEBLENDMODEOPAQUE = false; + _this.TONEMAPPING = false; + _this.TONEMAPPING_ACES = false; + _this.CONTRAST = false; + _this.COLORCURVES = false; + _this.COLORGRADING = false; + _this.COLORGRADING3D = false; + _this.SAMPLER3DGREENDEPTH = false; + _this.SAMPLER3DBGRMAP = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.EXPOSURE = false; + _this.USEPHYSICALLIGHTFALLOFF = false; + _this.USEGLTFLIGHTFALLOFF = false; + _this.TWOSIDEDLIGHTING = false; + _this.SHADOWFLOAT = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.LOGARITHMICDEPTH = false; + _this.FORCENORMALFORWARD = false; + _this.SPECULARAA = false; + _this.UNLIT = false; + _this.rebuild(); + return _this; + } + /** + * Resets the PBR Material defines. + */ + PBRMaterialDefines.prototype.reset = function () { + _super.prototype.reset.call(this); + this.ALPHATESTVALUE = "0.5"; + this.PBR = true; + }; + return PBRMaterialDefines; + }(BABYLON.MaterialDefines)); + /** + * The Physically based material base class of BJS. + * + * This offers the main features of a standard PBR material. + * For more information, please refer to the documentation : + * http://doc.babylonjs.com/extensions/Physically_Based_Rendering + */ + var PBRBaseMaterial = /** @class */ (function (_super) { + __extends(PBRBaseMaterial, _super); + /** + * Instantiates a new PBRMaterial instance. + * + * @param name The material name + * @param scene The scene the material will be use in. + */ + function PBRBaseMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + /** + * Intensity of the direct lights e.g. the four lights available in your scene. + * This impacts both the direct diffuse and specular highlights. + */ + _this._directIntensity = 1.0; + /** + * Intensity of the emissive part of the material. + * This helps controlling the emissive effect without modifying the emissive color. + */ + _this._emissiveIntensity = 1.0; + /** + * Intensity of the environment e.g. how much the environment will light the object + * either through harmonics for rough material or through the refelction for shiny ones. + */ + _this._environmentIntensity = 1.0; + /** + * This is a special control allowing the reduction of the specular highlights coming from the + * four lights of the scene. Those highlights may not be needed in full environment lighting. + */ + _this._specularIntensity = 1.0; + /** + * This stores the direct, emissive, environment, and specular light intensities into a Vector4. + */ + _this._lightingInfos = new BABYLON.Vector4(_this._directIntensity, _this._emissiveIntensity, _this._environmentIntensity, _this._specularIntensity); + /** + * Debug Control allowing disabling the bump map on this material. + */ + _this._disableBumpMap = false; + /** + * AKA Occlusion Texture Intensity in other nomenclature. + */ + _this._ambientTextureStrength = 1.0; + /** + * Defines how much the AO map is occluding the analytical lights (point spot...). + * 1 means it completely occludes it + * 0 mean it has no impact + */ + _this._ambientTextureImpactOnAnalyticalLights = BABYLON.PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS; + /** + * The color of a material in ambient lighting. + */ + _this._ambientColor = new BABYLON.Color3(0, 0, 0); + /** + * AKA Diffuse Color in other nomenclature. + */ + _this._albedoColor = new BABYLON.Color3(1, 1, 1); + /** + * AKA Specular Color in other nomenclature. + */ + _this._reflectivityColor = new BABYLON.Color3(1, 1, 1); + /** + * The color applied when light is reflected from a material. + */ + _this._reflectionColor = new BABYLON.Color3(1, 1, 1); + /** + * The color applied when light is emitted from a material. + */ + _this._emissiveColor = new BABYLON.Color3(0, 0, 0); + /** + * AKA Glossiness in other nomenclature. + */ + _this._microSurface = 0.9; + /** + * source material index of refraction (IOR)' / 'destination material IOR. + */ + _this._indexOfRefraction = 0.66; + /** + * Controls if refraction needs to be inverted on Y. This could be usefull for procedural texture. + */ + _this._invertRefractionY = false; + /** + * This parameters will make the material used its opacity to control how much it is refracting aginst not. + * Materials half opaque for instance using refraction could benefit from this control. + */ + _this._linkRefractionWithTransparency = false; + /** + * Specifies that the material will use the light map as a show map. + */ + _this._useLightmapAsShadowmap = false; + /** + * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal + * makes the reflect vector face the model (under horizon). + */ + _this._useHorizonOcclusion = true; + /** + * This parameters will enable/disable radiance occlusion by preventing the radiance to lit + * too much the area relying on ambient texture to define their ambient occlusion. + */ + _this._useRadianceOcclusion = true; + /** + * Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending. + */ + _this._useAlphaFromAlbedoTexture = false; + /** + * Specifies that the material will keeps the specular highlights over a transparent surface (only the most limunous ones). + * A car glass is a good exemple of that. When sun reflects on it you can not see what is behind. + */ + _this._useSpecularOverAlpha = true; + /** + * Specifies if the reflectivity texture contains the glossiness information in its alpha channel. + */ + _this._useMicroSurfaceFromReflectivityMapAlpha = false; + /** + * Specifies if the metallic texture contains the roughness information in its alpha channel. + */ + _this._useRoughnessFromMetallicTextureAlpha = true; + /** + * Specifies if the metallic texture contains the roughness information in its green channel. + */ + _this._useRoughnessFromMetallicTextureGreen = false; + /** + * Specifies if the metallic texture contains the metallness information in its blue channel. + */ + _this._useMetallnessFromMetallicTextureBlue = false; + /** + * Specifies if the metallic texture contains the ambient occlusion information in its red channel. + */ + _this._useAmbientOcclusionFromMetallicTextureRed = false; + /** + * Specifies if the ambient texture contains the ambient occlusion information in its red channel only. + */ + _this._useAmbientInGrayScale = false; + /** + * In case the reflectivity map does not contain the microsurface information in its alpha channel, + * The material will try to infer what glossiness each pixel should be. + */ + _this._useAutoMicroSurfaceFromReflectivityMap = false; + /** + * Defines the falloff type used in this material. + * It by default is Physical. + */ + _this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL; + /** + * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most limunous ones). + * A car glass is a good exemple of that. When the street lights reflects on it you can not see what is behind. + */ + _this._useRadianceOverAlpha = true; + /** + * Allows using an object space normal map (instead of tangent space). + */ + _this._useObjectSpaceNormalMap = false; + /** + * Allows using the bump map in parallax mode. + */ + _this._useParallax = false; + /** + * Allows using the bump map in parallax occlusion mode. + */ + _this._useParallaxOcclusion = false; + /** + * Controls the scale bias of the parallax mode. + */ + _this._parallaxScaleBias = 0.05; + /** + * If sets to true, disables all the lights affecting the material. + */ + _this._disableLighting = false; + /** + * Number of Simultaneous lights allowed on the material. + */ + _this._maxSimultaneousLights = 4; + /** + * If sets to true, x component of normal map value will be inverted (x = 1.0 - x). + */ + _this._invertNormalMapX = false; + /** + * If sets to true, y component of normal map value will be inverted (y = 1.0 - y). + */ + _this._invertNormalMapY = false; + /** + * If sets to true and backfaceCulling is false, normals will be flipped on the backside. + */ + _this._twoSidedLighting = false; + /** + * Defines the alpha limits in alpha test mode. + */ + _this._alphaCutOff = 0.4; + /** + * Enforces alpha test in opaque or blend mode in order to improve the performances of some situations. + */ + _this._forceAlphaTest = false; + /** + * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested. + * And/Or occlude the blended part. (alpha is converted to gamma to compute the fresnel) + */ + _this._useAlphaFresnel = false; + /** + * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested. + * And/Or occlude the blended part. (alpha stays linear to compute the fresnel) + */ + _this._useLinearAlphaFresnel = false; + /** + * The transparency mode of the material. + */ + _this._transparencyMode = null; + /** + * Specifies the environment BRDF texture used to comput the scale and offset roughness values + * from cos thetav and roughness: + * http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf + */ + _this._environmentBRDFTexture = null; + /** + * Force the shader to compute irradiance in the fragment shader in order to take bump in account. + */ + _this._forceIrradianceInFragment = false; + /** + * Force normal to face away from face. + */ + _this._forceNormalForward = false; + /** + * Enables specular anti aliasing in the PBR shader. + * It will both interacts on the Geometry for analytical and IBL lighting. + * It also prefilter the roughness map based on the bump values. + */ + _this._enableSpecularAntiAliasing = false; + /** + * Stores the available render targets. + */ + _this._renderTargets = new BABYLON.SmartArray(16); + /** + * Sets the global ambient color for the material used in lighting calculations. + */ + _this._globalAmbientColor = new BABYLON.Color3(0, 0, 0); + /** + * If set to true, no lighting calculations will be applied. + */ + _this._unlit = false; + // Setup the default processing configuration to the scene. + _this._attachImageProcessingConfiguration(null); + _this.getRenderTargetTextures = function () { + _this._renderTargets.reset(); + if (BABYLON.StandardMaterial.ReflectionTextureEnabled && _this._reflectionTexture && _this._reflectionTexture.isRenderTarget) { + _this._renderTargets.push(_this._reflectionTexture); + } + if (BABYLON.StandardMaterial.RefractionTextureEnabled && _this._refractionTexture && _this._refractionTexture.isRenderTarget) { + _this._renderTargets.push(_this._refractionTexture); + } + return _this._renderTargets; + }; + _this._environmentBRDFTexture = BABYLON.TextureTools.GetEnvironmentBRDFTexture(scene); + return _this; + } + /** + * Attaches a new image processing configuration to the PBR Material. + * @param configuration + */ + PBRBaseMaterial.prototype._attachImageProcessingConfiguration = function (configuration) { + var _this = this; + if (configuration === this._imageProcessingConfiguration) { + return; + } + // Detaches observer. + if (this._imageProcessingConfiguration && this._imageProcessingObserver) { + this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver); + } + // Pick the scene configuration if needed. + if (!configuration) { + this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration; + } + else { + this._imageProcessingConfiguration = configuration; + } + // Attaches observer. + if (this._imageProcessingConfiguration) { + this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function (conf) { + _this._markAllSubMeshesAsImageProcessingDirty(); + }); + } + }; + Object.defineProperty(PBRBaseMaterial.prototype, "hasRenderTargetTextures", { + /** + * Gets a boolean indicating that current material needs to register RTT + */ + get: function () { + if (BABYLON.StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) { + return true; + } + if (BABYLON.StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) { + return true; + } + return false; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the name of the material class. + */ + PBRBaseMaterial.prototype.getClassName = function () { + return "PBRBaseMaterial"; + }; + Object.defineProperty(PBRBaseMaterial.prototype, "useLogarithmicDepth", { + /** + * Enabled the use of logarithmic depth buffers, which is good for wide depth buffers. + */ + get: function () { + return this._useLogarithmicDepth; + }, + /** + * Enabled the use of logarithmic depth buffers, which is good for wide depth buffers. + */ + set: function (value) { + this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRBaseMaterial.prototype, "transparencyMode", { + /** + * Gets the current transparency mode. + */ + get: function () { + return this._transparencyMode; + }, + /** + * Sets the transparency mode of the material. + * + * | Value | Type | Description | + * | ----- | ----------------------------------- | ----------- | + * | 0 | OPAQUE | | + * | 1 | ALPHATEST | | + * | 2 | ALPHABLEND | | + * | 3 | ALPHATESTANDBLEND | | + * + */ + set: function (value) { + if (this._transparencyMode === value) { + return; + } + this._transparencyMode = value; + this._forceAlphaTest = (value === BABYLON.PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND); + this._markAllSubMeshesAsTexturesAndMiscDirty(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRBaseMaterial.prototype, "_disableAlphaBlending", { + /** + * Returns true if alpha blending should be disabled. + */ + get: function () { + return (this._linkRefractionWithTransparency || + this._transparencyMode === BABYLON.PBRMaterial.PBRMATERIAL_OPAQUE || + this._transparencyMode === BABYLON.PBRMaterial.PBRMATERIAL_ALPHATEST); + }, + enumerable: true, + configurable: true + }); + /** + * Specifies whether or not this material should be rendered in alpha blend mode. + */ + PBRBaseMaterial.prototype.needAlphaBlending = function () { + if (this._disableAlphaBlending) { + return false; + } + return (this.alpha < 1.0) || (this._opacityTexture != null) || this._shouldUseAlphaFromAlbedoTexture(); + }; + /** + * Specifies if the mesh will require alpha blending. + * @param mesh - BJS mesh. + */ + PBRBaseMaterial.prototype.needAlphaBlendingForMesh = function (mesh) { + if (this._disableAlphaBlending) { + return false; + } + return _super.prototype.needAlphaBlendingForMesh.call(this, mesh); + }; + /** + * Specifies whether or not this material should be rendered in alpha test mode. + */ + PBRBaseMaterial.prototype.needAlphaTesting = function () { + if (this._forceAlphaTest) { + return true; + } + if (this._linkRefractionWithTransparency) { + return false; + } + return this._albedoTexture != null && this._albedoTexture.hasAlpha && (this._transparencyMode == null || this._transparencyMode === BABYLON.PBRMaterial.PBRMATERIAL_ALPHATEST); + }; + /** + * Specifies whether or not the alpha value of the albedo texture should be used for alpha blending. + */ + PBRBaseMaterial.prototype._shouldUseAlphaFromAlbedoTexture = function () { + return this._albedoTexture != null && this._albedoTexture.hasAlpha && this._useAlphaFromAlbedoTexture && this._transparencyMode !== BABYLON.PBRMaterial.PBRMATERIAL_OPAQUE; + }; + /** + * Gets the texture used for the alpha test. + */ + PBRBaseMaterial.prototype.getAlphaTestTexture = function () { + return this._albedoTexture; + }; + /** + * Specifies that the submesh is ready to be used. + * @param mesh - BJS mesh. + * @param subMesh - A submesh of the BJS mesh. Used to check if it is ready. + * @param useInstances - Specifies that instances should be used. + * @returns - boolean indicating that the submesh is ready or not. + */ + PBRBaseMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (subMesh.effect && this.isFrozen) { + if (this._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new PBRMaterialDefines(); + } + var defines = subMesh._materialDefines; + if (!this.checkReadyOnEveryCall && subMesh.effect) { + if (defines._renderId === this.getScene().getRenderId()) { + return true; + } + } + var scene = this.getScene(); + var engine = scene.getEngine(); + if (defines._areTexturesDirty) { + if (scene.texturesEnabled) { + if (this._albedoTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) { + if (!this._albedoTexture.isReadyOrNotBlocking()) { + return false; + } + } + if (this._ambientTexture && BABYLON.StandardMaterial.AmbientTextureEnabled) { + if (!this._ambientTexture.isReadyOrNotBlocking()) { + return false; + } + } + if (this._opacityTexture && BABYLON.StandardMaterial.OpacityTextureEnabled) { + if (!this._opacityTexture.isReadyOrNotBlocking()) { + return false; + } + } + var reflectionTexture = this._getReflectionTexture(); + if (reflectionTexture && BABYLON.StandardMaterial.ReflectionTextureEnabled) { + if (!reflectionTexture.isReadyOrNotBlocking()) { + return false; + } + } + if (this._lightmapTexture && BABYLON.StandardMaterial.LightmapTextureEnabled) { + if (!this._lightmapTexture.isReadyOrNotBlocking()) { + return false; + } + } + if (this._emissiveTexture && BABYLON.StandardMaterial.EmissiveTextureEnabled) { + if (!this._emissiveTexture.isReadyOrNotBlocking()) { + return false; + } + } + if (BABYLON.StandardMaterial.SpecularTextureEnabled) { + if (this._metallicTexture) { + if (!this._metallicTexture.isReadyOrNotBlocking()) { + return false; + } + } + else if (this._reflectivityTexture) { + if (!this._reflectivityTexture.isReadyOrNotBlocking()) { + return false; + } + } + if (this._microSurfaceTexture) { + if (!this._microSurfaceTexture.isReadyOrNotBlocking()) { + return false; + } + } + } + if (engine.getCaps().standardDerivatives && this._bumpTexture && BABYLON.StandardMaterial.BumpTextureEnabled && !this._disableBumpMap) { + // Bump texture cannot be not blocking. + if (!this._bumpTexture.isReady()) { + return false; + } + } + var refractionTexture = this._getRefractionTexture(); + if (refractionTexture && BABYLON.StandardMaterial.RefractionTextureEnabled) { + if (!refractionTexture.isReadyOrNotBlocking()) { + return false; + } + } + if (this._environmentBRDFTexture && BABYLON.StandardMaterial.ReflectionTextureEnabled) { + // This is blocking. + if (!this._environmentBRDFTexture.isReady()) { + return false; + } + } + } + } + if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) { + if (!this._imageProcessingConfiguration.isReady()) { + return false; + } + } + if (!engine.getCaps().standardDerivatives && !mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + mesh.createNormals(true); + BABYLON.Tools.Warn("PBRMaterial: Normals have been created for the mesh: " + mesh.name); + } + var effect = this._prepareEffect(mesh, defines, this.onCompiled, this.onError, useInstances); + if (effect) { + scene.resetCachedMaterial(); + subMesh.setEffect(effect, defines); + this.buildUniformLayout(); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + this._wasPreviouslyReady = true; + return true; + }; + /** + * Specifies if the material uses metallic roughness workflow. + * @returns boolean specifiying if the material uses metallic roughness workflow. + */ + PBRBaseMaterial.prototype.isMetallicWorkflow = function () { + if (this._metallic != null || this._roughness != null || this._metallicTexture) { + return true; + } + return false; + }; + PBRBaseMaterial.prototype._prepareEffect = function (mesh, defines, onCompiled, onError, useInstances, useClipPlane) { + if (onCompiled === void 0) { onCompiled = null; } + if (onError === void 0) { onError = null; } + if (useInstances === void 0) { useInstances = null; } + if (useClipPlane === void 0) { useClipPlane = null; } + this._prepareDefines(mesh, defines, useInstances, useClipPlane); + if (!defines.isDirty) { + return null; + } + defines.markAsProcessed(); + var scene = this.getScene(); + var engine = scene.getEngine(); + // Fallbacks + var fallbacks = new BABYLON.EffectFallbacks(); + var fallbackRank = 0; + if (defines.USESPHERICALINVERTEX) { + fallbacks.addFallback(fallbackRank++, "USESPHERICALINVERTEX"); + } + if (defines.FOG) { + fallbacks.addFallback(fallbackRank, "FOG"); + } + if (defines.SPECULARAA) { + fallbacks.addFallback(fallbackRank, "SPECULARAA"); + } + if (defines.POINTSIZE) { + fallbacks.addFallback(fallbackRank, "POINTSIZE"); + } + if (defines.LOGARITHMICDEPTH) { + fallbacks.addFallback(fallbackRank, "LOGARITHMICDEPTH"); + } + if (defines.PARALLAX) { + fallbacks.addFallback(fallbackRank, "PARALLAX"); + } + if (defines.PARALLAXOCCLUSION) { + fallbacks.addFallback(fallbackRank++, "PARALLAXOCCLUSION"); + } + if (defines.ENVIRONMENTBRDF) { + fallbacks.addFallback(fallbackRank++, "ENVIRONMENTBRDF"); + } + if (defines.TANGENT) { + fallbacks.addFallback(fallbackRank++, "TANGENT"); + } + if (defines.BUMP) { + fallbacks.addFallback(fallbackRank++, "BUMP"); + } + fallbackRank = BABYLON.MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this._maxSimultaneousLights, fallbackRank++); + if (defines.SPECULARTERM) { + fallbacks.addFallback(fallbackRank++, "SPECULARTERM"); + } + if (defines.USESPHERICALFROMREFLECTIONMAP) { + fallbacks.addFallback(fallbackRank++, "USESPHERICALFROMREFLECTIONMAP"); + } + if (defines.LIGHTMAP) { + fallbacks.addFallback(fallbackRank++, "LIGHTMAP"); + } + if (defines.NORMAL) { + fallbacks.addFallback(fallbackRank++, "NORMAL"); + } + if (defines.AMBIENT) { + fallbacks.addFallback(fallbackRank++, "AMBIENT"); + } + if (defines.EMISSIVE) { + fallbacks.addFallback(fallbackRank++, "EMISSIVE"); + } + if (defines.VERTEXCOLOR) { + fallbacks.addFallback(fallbackRank++, "VERTEXCOLOR"); + } + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(fallbackRank++, mesh); + } + if (defines.MORPHTARGETS) { + fallbacks.addFallback(fallbackRank++, "MORPHTARGETS"); + } + //Attributes + var attribs = [BABYLON.VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(BABYLON.VertexBuffer.NormalKind); + } + if (defines.TANGENT) { + attribs.push(BABYLON.VertexBuffer.TangentKind); + } + if (defines.UV1) { + attribs.push(BABYLON.VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(BABYLON.VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(BABYLON.VertexBuffer.ColorKind); + } + BABYLON.MaterialHelper.PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + BABYLON.MaterialHelper.PrepareAttributesForInstances(attribs, defines); + BABYLON.MaterialHelper.PrepareAttributesForMorphTargets(attribs, mesh, defines); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vAmbientColor", "vAlbedoColor", "vReflectivityColor", "vEmissiveColor", "vReflectionColor", + "vFogInfos", "vFogColor", "pointSize", + "vAlbedoInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vReflectionPosition", "vReflectionSize", "vEmissiveInfos", "vReflectivityInfos", + "vMicroSurfaceSamplerInfos", "vBumpInfos", "vLightmapInfos", "vRefractionInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "albedoMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "reflectivityMatrix", "normalMatrix", "microSurfaceSamplerMatrix", "bumpMatrix", "lightmapMatrix", "refractionMatrix", + "vLightingIntensity", + "logarithmicDepthConstant", + "vSphericalX", "vSphericalY", "vSphericalZ", + "vSphericalXX", "vSphericalYY", "vSphericalZZ", + "vSphericalXY", "vSphericalYZ", "vSphericalZX", + "vReflectionMicrosurfaceInfos", "vRefractionMicrosurfaceInfos", + "vTangentSpaceParams" + ]; + var samplers = ["albedoSampler", "reflectivitySampler", "ambientSampler", "emissiveSampler", + "bumpSampler", "lightmapSampler", "opacitySampler", + "refractionSampler", "refractionSamplerLow", "refractionSamplerHigh", + "reflectionSampler", "reflectionSamplerLow", "reflectionSamplerHigh", + "microSurfaceSampler", "environmentBrdfSampler"]; + var uniformBuffers = ["Material", "Scene"]; + if (BABYLON.ImageProcessingConfiguration) { + BABYLON.ImageProcessingConfiguration.PrepareUniforms(uniforms, defines); + BABYLON.ImageProcessingConfiguration.PrepareSamplers(samplers, defines); + } + BABYLON.MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: this._maxSimultaneousLights + }); + var join = defines.toString(); + return engine.createEffect("pbr", { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: onCompiled, + onError: onError, + indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS } + }, engine); + }; + PBRBaseMaterial.prototype._prepareDefines = function (mesh, defines, useInstances, useClipPlane) { + if (useInstances === void 0) { useInstances = null; } + if (useClipPlane === void 0) { useClipPlane = null; } + var scene = this.getScene(); + var engine = scene.getEngine(); + // Lights + BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting); + defines._needNormals = true; + // Textures + defines.METALLICWORKFLOW = this.isMetallicWorkflow(); + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene.texturesEnabled) { + if (scene.getEngine().getCaps().textureLOD) { + defines.LODBASEDMICROSFURACE = true; + } + if (this._albedoTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._albedoTexture, defines, "ALBEDO"); + } + else { + defines.ALBEDO = false; + } + if (this._ambientTexture && BABYLON.StandardMaterial.AmbientTextureEnabled) { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._ambientTexture, defines, "AMBIENT"); + defines.AMBIENTINGRAYSCALE = this._useAmbientInGrayScale; + } + else { + defines.AMBIENT = false; + } + if (this._opacityTexture && BABYLON.StandardMaterial.OpacityTextureEnabled) { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._opacityTexture, defines, "OPACITY"); + defines.OPACITYRGB = this._opacityTexture.getAlphaFromRGB; + } + else { + defines.OPACITY = false; + } + var reflectionTexture = this._getReflectionTexture(); + if (reflectionTexture && BABYLON.StandardMaterial.ReflectionTextureEnabled) { + defines.REFLECTION = true; + defines.GAMMAREFLECTION = reflectionTexture.gammaSpace; + defines.RGBDREFLECTION = reflectionTexture.isRGBD; + defines.REFLECTIONMAP_OPPOSITEZ = this.getScene().useRightHandedSystem ? !reflectionTexture.invertZ : reflectionTexture.invertZ; + defines.LODINREFLECTIONALPHA = reflectionTexture.lodLevelInAlpha; + if (reflectionTexture.coordinatesMode === BABYLON.Texture.INVCUBIC_MODE) { + defines.INVERTCUBICMAP = true; + } + defines.REFLECTIONMAP_3D = reflectionTexture.isCube; + switch (reflectionTexture.coordinatesMode) { + case BABYLON.Texture.EXPLICIT_MODE: + defines.REFLECTIONMAP_EXPLICIT = true; + break; + case BABYLON.Texture.PLANAR_MODE: + defines.REFLECTIONMAP_PLANAR = true; + break; + case BABYLON.Texture.PROJECTION_MODE: + defines.REFLECTIONMAP_PROJECTION = true; + break; + case BABYLON.Texture.SKYBOX_MODE: + defines.REFLECTIONMAP_SKYBOX = true; + break; + case BABYLON.Texture.SPHERICAL_MODE: + defines.REFLECTIONMAP_SPHERICAL = true; + break; + case BABYLON.Texture.EQUIRECTANGULAR_MODE: + defines.REFLECTIONMAP_EQUIRECTANGULAR = true; + break; + case BABYLON.Texture.FIXED_EQUIRECTANGULAR_MODE: + defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = true; + break; + case BABYLON.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE: + defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = true; + break; + case BABYLON.Texture.CUBIC_MODE: + case BABYLON.Texture.INVCUBIC_MODE: + default: + defines.REFLECTIONMAP_CUBIC = true; + defines.USE_LOCAL_REFLECTIONMAP_CUBIC = reflectionTexture.boundingBoxSize ? true : false; + break; + } + if (reflectionTexture.coordinatesMode !== BABYLON.Texture.SKYBOX_MODE) { + if (reflectionTexture.sphericalPolynomial) { + defines.USESPHERICALFROMREFLECTIONMAP = true; + if (this._forceIrradianceInFragment || scene.getEngine().getCaps().maxVaryingVectors <= 8) { + defines.USESPHERICALINVERTEX = false; + } + else { + defines.USESPHERICALINVERTEX = true; + } + } + } + else { + defines.REFLECTIONMAP_SKYBOX_TRANSFORMED = !reflectionTexture.getReflectionTextureMatrix().isIdentity(); + } + } + else { + defines.REFLECTION = false; + defines.REFLECTIONMAP_3D = false; + defines.REFLECTIONMAP_SPHERICAL = false; + defines.REFLECTIONMAP_PLANAR = false; + defines.REFLECTIONMAP_CUBIC = false; + defines.USE_LOCAL_REFLECTIONMAP_CUBIC = false; + defines.REFLECTIONMAP_PROJECTION = false; + defines.REFLECTIONMAP_SKYBOX = false; + defines.REFLECTIONMAP_SKYBOX_TRANSFORMED = false; + defines.REFLECTIONMAP_EXPLICIT = false; + defines.REFLECTIONMAP_EQUIRECTANGULAR = false; + defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false; + defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false; + defines.INVERTCUBICMAP = false; + defines.USESPHERICALFROMREFLECTIONMAP = false; + defines.USESPHERICALINVERTEX = false; + defines.REFLECTIONMAP_OPPOSITEZ = false; + defines.LODINREFLECTIONALPHA = false; + defines.GAMMAREFLECTION = false; + defines.RGBDREFLECTION = false; + } + if (this._lightmapTexture && BABYLON.StandardMaterial.LightmapTextureEnabled) { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._lightmapTexture, defines, "LIGHTMAP"); + defines.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap; + defines.GAMMALIGHTMAP = this._lightmapTexture.gammaSpace; + } + else { + defines.LIGHTMAP = false; + } + if (this._emissiveTexture && BABYLON.StandardMaterial.EmissiveTextureEnabled) { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._emissiveTexture, defines, "EMISSIVE"); + } + else { + defines.EMISSIVE = false; + } + if (BABYLON.StandardMaterial.SpecularTextureEnabled) { + if (this._metallicTexture) { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._metallicTexture, defines, "REFLECTIVITY"); + defines.ROUGHNESSSTOREINMETALMAPALPHA = this._useRoughnessFromMetallicTextureAlpha; + defines.ROUGHNESSSTOREINMETALMAPGREEN = !this._useRoughnessFromMetallicTextureAlpha && this._useRoughnessFromMetallicTextureGreen; + defines.METALLNESSSTOREINMETALMAPBLUE = this._useMetallnessFromMetallicTextureBlue; + defines.AOSTOREINMETALMAPRED = this._useAmbientOcclusionFromMetallicTextureRed; + } + else if (this._reflectivityTexture) { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._reflectivityTexture, defines, "REFLECTIVITY"); + defines.MICROSURFACEFROMREFLECTIVITYMAP = this._useMicroSurfaceFromReflectivityMapAlpha; + defines.MICROSURFACEAUTOMATIC = this._useAutoMicroSurfaceFromReflectivityMap; + } + else { + defines.REFLECTIVITY = false; + } + if (this._microSurfaceTexture) { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._microSurfaceTexture, defines, "MICROSURFACEMAP"); + } + else { + defines.MICROSURFACEMAP = false; + } + } + else { + defines.REFLECTIVITY = false; + defines.MICROSURFACEMAP = false; + } + if (scene.getEngine().getCaps().standardDerivatives && this._bumpTexture && BABYLON.StandardMaterial.BumpTextureEnabled && !this._disableBumpMap) { + BABYLON.MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture, defines, "BUMP"); + if (this._useParallax && this._albedoTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) { + defines.PARALLAX = true; + defines.PARALLAXOCCLUSION = !!this._useParallaxOcclusion; + } + else { + defines.PARALLAX = false; + } + defines.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap; + } + else { + defines.BUMP = false; + } + var refractionTexture = this._getRefractionTexture(); + if (refractionTexture && BABYLON.StandardMaterial.RefractionTextureEnabled) { + defines.REFRACTION = true; + defines.REFRACTIONMAP_3D = refractionTexture.isCube; + defines.GAMMAREFRACTION = refractionTexture.gammaSpace; + defines.RGBDREFRACTION = refractionTexture.isRGBD; + defines.REFRACTIONMAP_OPPOSITEZ = refractionTexture.invertZ; + defines.LODINREFRACTIONALPHA = refractionTexture.lodLevelInAlpha; + if (this._linkRefractionWithTransparency) { + defines.LINKREFRACTIONTOTRANSPARENCY = true; + } + } + else { + defines.REFRACTION = false; + } + if (this._environmentBRDFTexture && BABYLON.StandardMaterial.ReflectionTextureEnabled) { + defines.ENVIRONMENTBRDF = true; + } + else { + defines.ENVIRONMENTBRDF = false; + } + if (this._shouldUseAlphaFromAlbedoTexture()) { + defines.ALPHAFROMALBEDO = true; + } + else { + defines.ALPHAFROMALBEDO = false; + } + } + defines.SPECULAROVERALPHA = this._useSpecularOverAlpha; + if (this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_STANDARD) { + defines.USEPHYSICALLIGHTFALLOFF = false; + defines.USEGLTFLIGHTFALLOFF = false; + } + else if (this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_GLTF) { + defines.USEPHYSICALLIGHTFALLOFF = false; + defines.USEGLTFLIGHTFALLOFF = true; + } + else { + defines.USEPHYSICALLIGHTFALLOFF = true; + defines.USEGLTFLIGHTFALLOFF = false; + } + defines.RADIANCEOVERALPHA = this._useRadianceOverAlpha; + if (!this.backFaceCulling && this._twoSidedLighting) { + defines.TWOSIDEDLIGHTING = true; + } + else { + defines.TWOSIDEDLIGHTING = false; + } + defines.ALPHATESTVALUE = "" + this._alphaCutOff + (this._alphaCutOff % 1 === 0 ? "." : ""); + defines.PREMULTIPLYALPHA = (this.alphaMode === BABYLON.Engine.ALPHA_PREMULTIPLIED || this.alphaMode === BABYLON.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF); + defines.ALPHABLEND = this.needAlphaBlendingForMesh(mesh); + defines.ALPHAFRESNEL = this._useAlphaFresnel || this._useLinearAlphaFresnel; + defines.LINEARALPHAFRESNEL = this._useLinearAlphaFresnel; + defines.SPECULARAA = scene.getEngine().getCaps().standardDerivatives && this._enableSpecularAntiAliasing; + } + if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) { + this._imageProcessingConfiguration.prepareDefines(defines); + } + defines.FORCENORMALFORWARD = this._forceNormalForward; + defines.RADIANCEOCCLUSION = this._useRadianceOcclusion; + defines.HORIZONOCCLUSION = this._useHorizonOcclusion; + // Misc. + if (defines._areMiscDirty) { + BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh) || this._forceAlphaTest, defines); + defines.UNLIT = this._unlit || ((this.pointsCloud || this.wireframe) && !mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)); + } + // Values that need to be evaluated on every frame + BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false, useClipPlane); + // Attribs + BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true, true, this._transparencyMode !== BABYLON.PBRMaterial.PBRMATERIAL_OPAQUE); + }; + /** + * Force shader compilation + */ + PBRBaseMaterial.prototype.forceCompilation = function (mesh, onCompiled, options) { + var _this = this; + var localOptions = __assign({ clipPlane: false }, options); + var defines = new PBRMaterialDefines(); + var effect = this._prepareEffect(mesh, defines, undefined, undefined, undefined, localOptions.clipPlane); + if (effect.isReady()) { + if (onCompiled) { + onCompiled(this); + } + } + else { + effect.onCompileObservable.add(function () { + if (onCompiled) { + onCompiled(_this); + } + }); + } + }; + /** + * Initializes the uniform buffer layout for the shader. + */ + PBRBaseMaterial.prototype.buildUniformLayout = function () { + // Order is important ! + this._uniformBuffer.addUniform("vAlbedoInfos", 2); + this._uniformBuffer.addUniform("vAmbientInfos", 4); + this._uniformBuffer.addUniform("vOpacityInfos", 2); + this._uniformBuffer.addUniform("vEmissiveInfos", 2); + this._uniformBuffer.addUniform("vLightmapInfos", 2); + this._uniformBuffer.addUniform("vReflectivityInfos", 3); + this._uniformBuffer.addUniform("vMicroSurfaceSamplerInfos", 2); + this._uniformBuffer.addUniform("vRefractionInfos", 4); + this._uniformBuffer.addUniform("vReflectionInfos", 2); + this._uniformBuffer.addUniform("vReflectionPosition", 3); + this._uniformBuffer.addUniform("vReflectionSize", 3); + this._uniformBuffer.addUniform("vBumpInfos", 3); + this._uniformBuffer.addUniform("albedoMatrix", 16); + this._uniformBuffer.addUniform("ambientMatrix", 16); + this._uniformBuffer.addUniform("opacityMatrix", 16); + this._uniformBuffer.addUniform("emissiveMatrix", 16); + this._uniformBuffer.addUniform("lightmapMatrix", 16); + this._uniformBuffer.addUniform("reflectivityMatrix", 16); + this._uniformBuffer.addUniform("microSurfaceSamplerMatrix", 16); + this._uniformBuffer.addUniform("bumpMatrix", 16); + this._uniformBuffer.addUniform("vTangentSpaceParams", 2); + this._uniformBuffer.addUniform("refractionMatrix", 16); + this._uniformBuffer.addUniform("reflectionMatrix", 16); + this._uniformBuffer.addUniform("vReflectionColor", 3); + this._uniformBuffer.addUniform("vAlbedoColor", 4); + this._uniformBuffer.addUniform("vLightingIntensity", 4); + this._uniformBuffer.addUniform("vRefractionMicrosurfaceInfos", 3); + this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos", 3); + this._uniformBuffer.addUniform("vReflectivityColor", 4); + this._uniformBuffer.addUniform("vEmissiveColor", 3); + this._uniformBuffer.addUniform("pointSize", 1); + this._uniformBuffer.create(); + }; + /** + * Unbinds the textures. + */ + PBRBaseMaterial.prototype.unbind = function () { + if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) { + this._uniformBuffer.setTexture("reflectionSampler", null); + } + if (this._refractionTexture && this._refractionTexture.isRenderTarget) { + this._uniformBuffer.setTexture("refractionSampler", null); + } + _super.prototype.unbind.call(this); + }; + /** + * Binds the submesh data. + * @param world - The world matrix. + * @param mesh - The BJS mesh. + * @param subMesh - A submesh of the BJS mesh. + */ + PBRBaseMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + // Normal Matrix + if (defines.OBJECTSPACE_NORMALMAP) { + world.toNormalMatrix(this._normalMatrix); + this.bindOnlyNormalMatrix(this._normalMatrix); + } + var mustRebind = this._mustRebind(scene, effect, mesh.visibility); + // Bones + BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect); + var reflectionTexture = null; + if (mustRebind) { + this._uniformBuffer.bindToEffect(effect, "Material"); + this.bindViewProjection(effect); + reflectionTexture = this._getReflectionTexture(); + var refractionTexture = this._getRefractionTexture(); + if (!this._uniformBuffer.useUbo || !this.isFrozen || !this._uniformBuffer.isSync) { + // Texture uniforms + if (scene.texturesEnabled) { + if (this._albedoTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) { + this._uniformBuffer.updateFloat2("vAlbedoInfos", this._albedoTexture.coordinatesIndex, this._albedoTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._albedoTexture, this._uniformBuffer, "albedo"); + } + if (this._ambientTexture && BABYLON.StandardMaterial.AmbientTextureEnabled) { + this._uniformBuffer.updateFloat4("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level, this._ambientTextureStrength, this._ambientTextureImpactOnAnalyticalLights); + BABYLON.MaterialHelper.BindTextureMatrix(this._ambientTexture, this._uniformBuffer, "ambient"); + } + if (this._opacityTexture && BABYLON.StandardMaterial.OpacityTextureEnabled) { + this._uniformBuffer.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._opacityTexture, this._uniformBuffer, "opacity"); + } + if (reflectionTexture && BABYLON.StandardMaterial.ReflectionTextureEnabled) { + this._uniformBuffer.updateMatrix("reflectionMatrix", reflectionTexture.getReflectionTextureMatrix()); + this._uniformBuffer.updateFloat2("vReflectionInfos", reflectionTexture.level, 0); + if (reflectionTexture.boundingBoxSize) { + var cubeTexture = reflectionTexture; + this._uniformBuffer.updateVector3("vReflectionPosition", cubeTexture.boundingBoxPosition); + this._uniformBuffer.updateVector3("vReflectionSize", cubeTexture.boundingBoxSize); + } + var polynomials = reflectionTexture.sphericalPolynomial; + if (defines.USESPHERICALFROMREFLECTIONMAP && polynomials) { + this._activeEffect.setFloat3("vSphericalX", polynomials.x.x, polynomials.x.y, polynomials.x.z); + this._activeEffect.setFloat3("vSphericalY", polynomials.y.x, polynomials.y.y, polynomials.y.z); + this._activeEffect.setFloat3("vSphericalZ", polynomials.z.x, polynomials.z.y, polynomials.z.z); + this._activeEffect.setFloat3("vSphericalXX_ZZ", polynomials.xx.x - polynomials.zz.x, polynomials.xx.y - polynomials.zz.y, polynomials.xx.z - polynomials.zz.z); + this._activeEffect.setFloat3("vSphericalYY_ZZ", polynomials.yy.x - polynomials.zz.x, polynomials.yy.y - polynomials.zz.y, polynomials.yy.z - polynomials.zz.z); + this._activeEffect.setFloat3("vSphericalZZ", polynomials.zz.x, polynomials.zz.y, polynomials.zz.z); + this._activeEffect.setFloat3("vSphericalXY", polynomials.xy.x, polynomials.xy.y, polynomials.xy.z); + this._activeEffect.setFloat3("vSphericalYZ", polynomials.yz.x, polynomials.yz.y, polynomials.yz.z); + this._activeEffect.setFloat3("vSphericalZX", polynomials.zx.x, polynomials.zx.y, polynomials.zx.z); + } + this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos", reflectionTexture.getSize().width, reflectionTexture.lodGenerationScale, reflectionTexture.lodGenerationOffset); + } + if (this._emissiveTexture && BABYLON.StandardMaterial.EmissiveTextureEnabled) { + this._uniformBuffer.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._emissiveTexture, this._uniformBuffer, "emissive"); + } + if (this._lightmapTexture && BABYLON.StandardMaterial.LightmapTextureEnabled) { + this._uniformBuffer.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._lightmapTexture, this._uniformBuffer, "lightmap"); + } + if (BABYLON.StandardMaterial.SpecularTextureEnabled) { + if (this._metallicTexture) { + this._uniformBuffer.updateFloat3("vReflectivityInfos", this._metallicTexture.coordinatesIndex, this._metallicTexture.level, this._ambientTextureStrength); + BABYLON.MaterialHelper.BindTextureMatrix(this._metallicTexture, this._uniformBuffer, "reflectivity"); + } + else if (this._reflectivityTexture) { + this._uniformBuffer.updateFloat3("vReflectivityInfos", this._reflectivityTexture.coordinatesIndex, this._reflectivityTexture.level, 1.0); + BABYLON.MaterialHelper.BindTextureMatrix(this._reflectivityTexture, this._uniformBuffer, "reflectivity"); + } + if (this._microSurfaceTexture) { + this._uniformBuffer.updateFloat2("vMicroSurfaceSamplerInfos", this._microSurfaceTexture.coordinatesIndex, this._microSurfaceTexture.level); + BABYLON.MaterialHelper.BindTextureMatrix(this._microSurfaceTexture, this._uniformBuffer, "microSurfaceSampler"); + } + } + if (this._bumpTexture && scene.getEngine().getCaps().standardDerivatives && BABYLON.StandardMaterial.BumpTextureEnabled && !this._disableBumpMap) { + this._uniformBuffer.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, this._bumpTexture.level, this._parallaxScaleBias); + BABYLON.MaterialHelper.BindTextureMatrix(this._bumpTexture, this._uniformBuffer, "bump"); + if (scene._mirroredCameraPosition) { + this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 1.0 : -1.0); + } + else { + this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0); + } + } + if (refractionTexture && BABYLON.StandardMaterial.RefractionTextureEnabled) { + this._uniformBuffer.updateMatrix("refractionMatrix", refractionTexture.getReflectionTextureMatrix()); + var depth = 1.0; + if (!refractionTexture.isCube) { + if (refractionTexture.depth) { + depth = refractionTexture.depth; + } + } + this._uniformBuffer.updateFloat4("vRefractionInfos", refractionTexture.level, this._indexOfRefraction, depth, this._invertRefractionY ? -1 : 1); + this._uniformBuffer.updateFloat3("vRefractionMicrosurfaceInfos", refractionTexture.getSize().width, refractionTexture.lodGenerationScale, refractionTexture.lodGenerationOffset); + } + } + // Point size + if (this.pointsCloud) { + this._uniformBuffer.updateFloat("pointSize", this.pointSize); + } + // Colors + if (defines.METALLICWORKFLOW) { + BABYLON.PBRMaterial._scaledReflectivity.r = (this._metallic === undefined || this._metallic === null) ? 1 : this._metallic; + BABYLON.PBRMaterial._scaledReflectivity.g = (this._roughness === undefined || this._roughness === null) ? 1 : this._roughness; + this._uniformBuffer.updateColor4("vReflectivityColor", BABYLON.PBRMaterial._scaledReflectivity, 0); + } + else { + this._uniformBuffer.updateColor4("vReflectivityColor", this._reflectivityColor, this._microSurface); + } + this._uniformBuffer.updateColor3("vEmissiveColor", this._emissiveColor); + this._uniformBuffer.updateColor3("vReflectionColor", this._reflectionColor); + this._uniformBuffer.updateColor4("vAlbedoColor", this._albedoColor, this.alpha * mesh.visibility); + // Misc + this._lightingInfos.x = this._directIntensity; + this._lightingInfos.y = this._emissiveIntensity; + this._lightingInfos.z = this._environmentIntensity; + this._lightingInfos.w = this._specularIntensity; + this._uniformBuffer.updateVector4("vLightingIntensity", this._lightingInfos); + } + // Textures + if (scene.texturesEnabled) { + if (this._albedoTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) { + this._uniformBuffer.setTexture("albedoSampler", this._albedoTexture); + } + if (this._ambientTexture && BABYLON.StandardMaterial.AmbientTextureEnabled) { + this._uniformBuffer.setTexture("ambientSampler", this._ambientTexture); + } + if (this._opacityTexture && BABYLON.StandardMaterial.OpacityTextureEnabled) { + this._uniformBuffer.setTexture("opacitySampler", this._opacityTexture); + } + if (reflectionTexture && BABYLON.StandardMaterial.ReflectionTextureEnabled) { + if (defines.LODBASEDMICROSFURACE) { + this._uniformBuffer.setTexture("reflectionSampler", reflectionTexture); + } + else { + this._uniformBuffer.setTexture("reflectionSampler", reflectionTexture._lodTextureMid || reflectionTexture); + this._uniformBuffer.setTexture("reflectionSamplerLow", reflectionTexture._lodTextureLow || reflectionTexture); + this._uniformBuffer.setTexture("reflectionSamplerHigh", reflectionTexture._lodTextureHigh || reflectionTexture); + } + } + if (defines.ENVIRONMENTBRDF) { + this._uniformBuffer.setTexture("environmentBrdfSampler", this._environmentBRDFTexture); + } + if (refractionTexture && BABYLON.StandardMaterial.RefractionTextureEnabled) { + if (defines.LODBASEDMICROSFURACE) { + this._uniformBuffer.setTexture("refractionSampler", refractionTexture); + } + else { + this._uniformBuffer.setTexture("refractionSampler", refractionTexture._lodTextureMid || refractionTexture); + this._uniformBuffer.setTexture("refractionSamplerLow", refractionTexture._lodTextureLow || refractionTexture); + this._uniformBuffer.setTexture("refractionSamplerHigh", refractionTexture._lodTextureHigh || refractionTexture); + } + } + if (this._emissiveTexture && BABYLON.StandardMaterial.EmissiveTextureEnabled) { + this._uniformBuffer.setTexture("emissiveSampler", this._emissiveTexture); + } + if (this._lightmapTexture && BABYLON.StandardMaterial.LightmapTextureEnabled) { + this._uniformBuffer.setTexture("lightmapSampler", this._lightmapTexture); + } + if (BABYLON.StandardMaterial.SpecularTextureEnabled) { + if (this._metallicTexture) { + this._uniformBuffer.setTexture("reflectivitySampler", this._metallicTexture); + } + else if (this._reflectivityTexture) { + this._uniformBuffer.setTexture("reflectivitySampler", this._reflectivityTexture); + } + if (this._microSurfaceTexture) { + this._uniformBuffer.setTexture("microSurfaceSampler", this._microSurfaceTexture); + } + } + if (this._bumpTexture && scene.getEngine().getCaps().standardDerivatives && BABYLON.StandardMaterial.BumpTextureEnabled && !this._disableBumpMap) { + this._uniformBuffer.setTexture("bumpSampler", this._bumpTexture); + } + } + // Clip plane + BABYLON.MaterialHelper.BindClipPlane(this._activeEffect, scene); + // Colors + scene.ambientColor.multiplyToRef(this._ambientColor, this._globalAmbientColor); + var eyePosition = scene._forcedViewPosition ? scene._forcedViewPosition : (scene._mirroredCameraPosition ? scene._mirroredCameraPosition : scene.activeCamera.globalPosition); + var invertNormal = (scene.useRightHandedSystem === (scene._mirroredCameraPosition != null)); + effect.setFloat4("vEyePosition", eyePosition.x, eyePosition.y, eyePosition.z, invertNormal ? -1 : 1); + effect.setColor3("vAmbientColor", this._globalAmbientColor); + } + if (mustRebind || !this.isFrozen) { + // Lights + if (scene.lightsEnabled && !this._disableLighting) { + BABYLON.MaterialHelper.BindLights(scene, mesh, this._activeEffect, defines, this._maxSimultaneousLights, this._lightFalloff !== PBRBaseMaterial.LIGHTFALLOFF_STANDARD); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE || reflectionTexture) { + this.bindView(effect); + } + // Fog + BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect, true); + // Morph targets + if (defines.NUM_MORPH_INFLUENCERS) { + BABYLON.MaterialHelper.BindMorphTargetParameters(mesh, this._activeEffect); + } + // image processing + this._imageProcessingConfiguration.bind(this._activeEffect); + // Log. depth + BABYLON.MaterialHelper.BindLogDepth(defines, this._activeEffect, scene); + } + this._uniformBuffer.update(); + this._afterBind(mesh, this._activeEffect); + }; + /** + * Returns the animatable textures. + * @returns - Array of animatable textures. + */ + PBRBaseMaterial.prototype.getAnimatables = function () { + var results = []; + if (this._albedoTexture && this._albedoTexture.animations && this._albedoTexture.animations.length > 0) { + results.push(this._albedoTexture); + } + if (this._ambientTexture && this._ambientTexture.animations && this._ambientTexture.animations.length > 0) { + results.push(this._ambientTexture); + } + if (this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0) { + results.push(this._opacityTexture); + } + if (this._reflectionTexture && this._reflectionTexture.animations && this._reflectionTexture.animations.length > 0) { + results.push(this._reflectionTexture); + } + if (this._emissiveTexture && this._emissiveTexture.animations && this._emissiveTexture.animations.length > 0) { + results.push(this._emissiveTexture); + } + if (this._metallicTexture && this._metallicTexture.animations && this._metallicTexture.animations.length > 0) { + results.push(this._metallicTexture); + } + else if (this._reflectivityTexture && this._reflectivityTexture.animations && this._reflectivityTexture.animations.length > 0) { + results.push(this._reflectivityTexture); + } + if (this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0) { + results.push(this._bumpTexture); + } + if (this._lightmapTexture && this._lightmapTexture.animations && this._lightmapTexture.animations.length > 0) { + results.push(this._lightmapTexture); + } + if (this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0) { + results.push(this._refractionTexture); + } + return results; + }; + /** + * Returns the texture used for reflections. + * @returns - Reflection texture if present. Otherwise, returns the environment texture. + */ + PBRBaseMaterial.prototype._getReflectionTexture = function () { + if (this._reflectionTexture) { + return this._reflectionTexture; + } + return this.getScene().environmentTexture; + }; + /** + * Returns the texture used for refraction or null if none is used. + * @returns - Refection texture if present. If no refraction texture and refraction + * is linked with transparency, returns environment texture. Otherwise, returns null. + */ + PBRBaseMaterial.prototype._getRefractionTexture = function () { + if (this._refractionTexture) { + return this._refractionTexture; + } + if (this._linkRefractionWithTransparency) { + return this.getScene().environmentTexture; + } + return null; + }; + /** + * Disposes the resources of the material. + * @param forceDisposeEffect - Forces the disposal of effects. + * @param forceDisposeTextures - Forces the disposal of all textures. + */ + PBRBaseMaterial.prototype.dispose = function (forceDisposeEffect, forceDisposeTextures) { + if (forceDisposeTextures) { + if (this._albedoTexture) { + this._albedoTexture.dispose(); + } + if (this._ambientTexture) { + this._ambientTexture.dispose(); + } + if (this._opacityTexture) { + this._opacityTexture.dispose(); + } + if (this._reflectionTexture) { + this._reflectionTexture.dispose(); + } + if (this._environmentBRDFTexture && this.getScene()._environmentBRDFTexture !== this._environmentBRDFTexture) { + this._environmentBRDFTexture.dispose(); + } + if (this._emissiveTexture) { + this._emissiveTexture.dispose(); + } + if (this._metallicTexture) { + this._metallicTexture.dispose(); + } + if (this._reflectivityTexture) { + this._reflectivityTexture.dispose(); + } + if (this._bumpTexture) { + this._bumpTexture.dispose(); + } + if (this._lightmapTexture) { + this._lightmapTexture.dispose(); + } + if (this._refractionTexture) { + this._refractionTexture.dispose(); + } + } + this._renderTargets.dispose(); + if (this._imageProcessingConfiguration && this._imageProcessingObserver) { + this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver); + } + _super.prototype.dispose.call(this, forceDisposeEffect, forceDisposeTextures); + }; + /** + * PBRMaterialLightFalloff Physical: light is falling off following the inverse squared distance law. + */ + PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL = 0; + /** + * PBRMaterialLightFalloff gltf: light is falling off as described in the gltf moving to PBR document + * to enhance interoperability with other engines. + */ + PBRBaseMaterial.LIGHTFALLOFF_GLTF = 1; + /** + * PBRMaterialLightFalloff Standard: light is falling off like in the standard material + * to enhance interoperability with other materials. + */ + PBRBaseMaterial.LIGHTFALLOFF_STANDARD = 2; + /** + * Stores the reflectivity values based on metallic roughness workflow. + */ + PBRBaseMaterial._scaledReflectivity = new BABYLON.Color3(); + __decorate([ + BABYLON.serializeAsImageProcessingConfiguration() + ], PBRBaseMaterial.prototype, "_imageProcessingConfiguration", void 0); + __decorate([ + BABYLON.serialize() + ], PBRBaseMaterial.prototype, "useLogarithmicDepth", null); + __decorate([ + BABYLON.serialize() + ], PBRBaseMaterial.prototype, "transparencyMode", null); + return PBRBaseMaterial; + }(BABYLON.PushMaterial)); + BABYLON.PBRBaseMaterial = PBRBaseMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pbrBaseMaterial.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * The Physically based simple base material of BJS. + * + * This enables better naming and convention enforcements on top of the pbrMaterial. + * It is used as the base class for both the specGloss and metalRough conventions. + */ + var PBRBaseSimpleMaterial = /** @class */ (function (_super) { + __extends(PBRBaseSimpleMaterial, _super); + /** + * Instantiates a new PBRMaterial instance. + * + * @param name The material name + * @param scene The scene the material will be use in. + */ + function PBRBaseSimpleMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + /** + * Number of Simultaneous lights allowed on the material. + */ + _this.maxSimultaneousLights = 4; + /** + * If sets to true, disables all the lights affecting the material. + */ + _this.disableLighting = false; + /** + * If sets to true, x component of normal map value will invert (x = 1.0 - x). + */ + _this.invertNormalMapX = false; + /** + * If sets to true, y component of normal map value will invert (y = 1.0 - y). + */ + _this.invertNormalMapY = false; + /** + * Emissivie color used to self-illuminate the model. + */ + _this.emissiveColor = new BABYLON.Color3(0, 0, 0); + /** + * Occlusion Channel Strenght. + */ + _this.occlusionStrength = 1.0; + /** + * If true, the light map contains occlusion information instead of lighting info. + */ + _this.useLightmapAsShadowmap = false; + _this._useAlphaFromAlbedoTexture = true; + _this._useAmbientInGrayScale = true; + return _this; + } + Object.defineProperty(PBRBaseSimpleMaterial.prototype, "doubleSided", { + /** + * Gets the current double sided mode. + */ + get: function () { + return this._twoSidedLighting; + }, + /** + * If sets to true and backfaceCulling is false, normals will be flipped on the backside. + */ + set: function (value) { + if (this._twoSidedLighting === value) { + return; + } + this._twoSidedLighting = value; + this.backFaceCulling = !value; + this._markAllSubMeshesAsTexturesDirty(); + }, + enumerable: true, + configurable: true + }); + /** + * Return the active textures of the material. + */ + PBRBaseSimpleMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this.environmentTexture) { + activeTextures.push(this.environmentTexture); + } + if (this.normalTexture) { + activeTextures.push(this.normalTexture); + } + if (this.emissiveTexture) { + activeTextures.push(this.emissiveTexture); + } + if (this.occlusionTexture) { + activeTextures.push(this.occlusionTexture); + } + if (this.lightmapTexture) { + activeTextures.push(this.lightmapTexture); + } + return activeTextures; + }; + PBRBaseSimpleMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this.lightmapTexture === texture) { + return true; + } + return false; + }; + PBRBaseSimpleMaterial.prototype.getClassName = function () { + return "PBRBaseSimpleMaterial"; + }; + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsLightsDirty") + ], PBRBaseSimpleMaterial.prototype, "maxSimultaneousLights", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsLightsDirty") + ], PBRBaseSimpleMaterial.prototype, "disableLighting", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectionTexture") + ], PBRBaseSimpleMaterial.prototype, "environmentTexture", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRBaseSimpleMaterial.prototype, "invertNormalMapX", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRBaseSimpleMaterial.prototype, "invertNormalMapY", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_bumpTexture") + ], PBRBaseSimpleMaterial.prototype, "normalTexture", void 0); + __decorate([ + BABYLON.serializeAsColor3("emissive"), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRBaseSimpleMaterial.prototype, "emissiveColor", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRBaseSimpleMaterial.prototype, "emissiveTexture", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_ambientTextureStrength") + ], PBRBaseSimpleMaterial.prototype, "occlusionStrength", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_ambientTexture") + ], PBRBaseSimpleMaterial.prototype, "occlusionTexture", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_alphaCutOff") + ], PBRBaseSimpleMaterial.prototype, "alphaCutOff", void 0); + __decorate([ + BABYLON.serialize() + ], PBRBaseSimpleMaterial.prototype, "doubleSided", null); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", null) + ], PBRBaseSimpleMaterial.prototype, "lightmapTexture", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRBaseSimpleMaterial.prototype, "useLightmapAsShadowmap", void 0); + return PBRBaseSimpleMaterial; + }(BABYLON.PBRBaseMaterial)); + BABYLON.PBRBaseSimpleMaterial = PBRBaseSimpleMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pbrBaseSimpleMaterial.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * The Physically based material of BJS. + * + * This offers the main features of a standard PBR material. + * For more information, please refer to the documentation : + * http://doc.babylonjs.com/extensions/Physically_Based_Rendering + */ + var PBRMaterial = /** @class */ (function (_super) { + __extends(PBRMaterial, _super); + /** + * Instantiates a new PBRMaterial instance. + * + * @param name The material name + * @param scene The scene the material will be use in. + */ + function PBRMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + /** + * Intensity of the direct lights e.g. the four lights available in your scene. + * This impacts both the direct diffuse and specular highlights. + */ + _this.directIntensity = 1.0; + /** + * Intensity of the emissive part of the material. + * This helps controlling the emissive effect without modifying the emissive color. + */ + _this.emissiveIntensity = 1.0; + /** + * Intensity of the environment e.g. how much the environment will light the object + * either through harmonics for rough material or through the refelction for shiny ones. + */ + _this.environmentIntensity = 1.0; + /** + * This is a special control allowing the reduction of the specular highlights coming from the + * four lights of the scene. Those highlights may not be needed in full environment lighting. + */ + _this.specularIntensity = 1.0; + /** + * Debug Control allowing disabling the bump map on this material. + */ + _this.disableBumpMap = false; + /** + * AKA Occlusion Texture Intensity in other nomenclature. + */ + _this.ambientTextureStrength = 1.0; + /** + * Defines how much the AO map is occluding the analytical lights (point spot...). + * 1 means it completely occludes it + * 0 mean it has no impact + */ + _this.ambientTextureImpactOnAnalyticalLights = PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS; + /** + * The color of a material in ambient lighting. + */ + _this.ambientColor = new BABYLON.Color3(0, 0, 0); + /** + * AKA Diffuse Color in other nomenclature. + */ + _this.albedoColor = new BABYLON.Color3(1, 1, 1); + /** + * AKA Specular Color in other nomenclature. + */ + _this.reflectivityColor = new BABYLON.Color3(1, 1, 1); + /** + * The color reflected from the material. + */ + _this.reflectionColor = new BABYLON.Color3(1.0, 1.0, 1.0); + /** + * The color emitted from the material. + */ + _this.emissiveColor = new BABYLON.Color3(0, 0, 0); + /** + * AKA Glossiness in other nomenclature. + */ + _this.microSurface = 1.0; + /** + * source material index of refraction (IOR)' / 'destination material IOR. + */ + _this.indexOfRefraction = 0.66; + /** + * Controls if refraction needs to be inverted on Y. This could be usefull for procedural texture. + */ + _this.invertRefractionY = false; + /** + * This parameters will make the material used its opacity to control how much it is refracting aginst not. + * Materials half opaque for instance using refraction could benefit from this control. + */ + _this.linkRefractionWithTransparency = false; + /** + * If true, the light map contains occlusion information instead of lighting info. + */ + _this.useLightmapAsShadowmap = false; + /** + * Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending. + */ + _this.useAlphaFromAlbedoTexture = false; + /** + * Enforces alpha test in opaque or blend mode in order to improve the performances of some situations. + */ + _this.forceAlphaTest = false; + /** + * Defines the alpha limits in alpha test mode. + */ + _this.alphaCutOff = 0.4; + /** + * Specifies that the material will keep the specular highlights over a transparent surface (only the most limunous ones). + * A car glass is a good exemple of that. When sun reflects on it you can not see what is behind. + */ + _this.useSpecularOverAlpha = true; + /** + * Specifies if the reflectivity texture contains the glossiness information in its alpha channel. + */ + _this.useMicroSurfaceFromReflectivityMapAlpha = false; + /** + * Specifies if the metallic texture contains the roughness information in its alpha channel. + */ + _this.useRoughnessFromMetallicTextureAlpha = true; + /** + * Specifies if the metallic texture contains the roughness information in its green channel. + */ + _this.useRoughnessFromMetallicTextureGreen = false; + /** + * Specifies if the metallic texture contains the metallness information in its blue channel. + */ + _this.useMetallnessFromMetallicTextureBlue = false; + /** + * Specifies if the metallic texture contains the ambient occlusion information in its red channel. + */ + _this.useAmbientOcclusionFromMetallicTextureRed = false; + /** + * Specifies if the ambient texture contains the ambient occlusion information in its red channel only. + */ + _this.useAmbientInGrayScale = false; + /** + * In case the reflectivity map does not contain the microsurface information in its alpha channel, + * The material will try to infer what glossiness each pixel should be. + */ + _this.useAutoMicroSurfaceFromReflectivityMap = false; + /** + * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most limunous ones). + * A car glass is a good exemple of that. When the street lights reflects on it you can not see what is behind. + */ + _this.useRadianceOverAlpha = true; + /** + * Allows using an object space normal map (instead of tangent space). + */ + _this.useObjectSpaceNormalMap = false; + /** + * Allows using the bump map in parallax mode. + */ + _this.useParallax = false; + /** + * Allows using the bump map in parallax occlusion mode. + */ + _this.useParallaxOcclusion = false; + /** + * Controls the scale bias of the parallax mode. + */ + _this.parallaxScaleBias = 0.05; + /** + * If sets to true, disables all the lights affecting the material. + */ + _this.disableLighting = false; + /** + * Force the shader to compute irradiance in the fragment shader in order to take bump in account. + */ + _this.forceIrradianceInFragment = false; + /** + * Number of Simultaneous lights allowed on the material. + */ + _this.maxSimultaneousLights = 4; + /** + * If sets to true, x component of normal map value will invert (x = 1.0 - x). + */ + _this.invertNormalMapX = false; + /** + * If sets to true, y component of normal map value will invert (y = 1.0 - y). + */ + _this.invertNormalMapY = false; + /** + * If sets to true and backfaceCulling is false, normals will be flipped on the backside. + */ + _this.twoSidedLighting = false; + /** + * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested. + * And/Or occlude the blended part. (alpha is converted to gamma to compute the fresnel) + */ + _this.useAlphaFresnel = false; + /** + * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested. + * And/Or occlude the blended part. (alpha stays linear to compute the fresnel) + */ + _this.useLinearAlphaFresnel = false; + /** + * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested. + * And/Or occlude the blended part. + */ + _this.environmentBRDFTexture = null; + /** + * Force normal to face away from face. + */ + _this.forceNormalForward = false; + /** + * Enables specular anti aliasing in the PBR shader. + * It will both interacts on the Geometry for analytical and IBL lighting. + * It also prefilter the roughness map based on the bump values. + */ + _this.enableSpecularAntiAliasing = false; + /** + * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal + * makes the reflect vector face the model (under horizon). + */ + _this.useHorizonOcclusion = true; + /** + * This parameters will enable/disable radiance occlusion by preventing the radiance to lit + * too much the area relying on ambient texture to define their ambient occlusion. + */ + _this.useRadianceOcclusion = true; + /** + * If set to true, no lighting calculations will be applied. + */ + _this.unlit = false; + _this._environmentBRDFTexture = BABYLON.TextureTools.GetEnvironmentBRDFTexture(scene); + return _this; + } + Object.defineProperty(PBRMaterial.prototype, "usePhysicalLightFalloff", { + /** + * BJS is using an harcoded light falloff based on a manually sets up range. + * In PBR, one way to represents the fallof is to use the inverse squared root algorythm. + * This parameter can help you switch back to the BJS mode in order to create scenes using both materials. + */ + get: function () { + return this._lightFalloff === BABYLON.PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL; + }, + /** + * BJS is using an harcoded light falloff based on a manually sets up range. + * In PBR, one way to represents the fallof is to use the inverse squared root algorythm. + * This parameter can help you switch back to the BJS mode in order to create scenes using both materials. + */ + set: function (value) { + if (value !== this.usePhysicalLightFalloff) { + // Ensure the effect will be rebuilt. + this._markAllSubMeshesAsTexturesDirty(); + if (value) { + this._lightFalloff = BABYLON.PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL; + } + else { + this._lightFalloff = BABYLON.PBRBaseMaterial.LIGHTFALLOFF_STANDARD; + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRMaterial.prototype, "useGLTFLightFalloff", { + /** + * In order to support the falloff compatibility with gltf, a special mode has been added + * to reproduce the gltf light falloff. + */ + get: function () { + return this._lightFalloff === BABYLON.PBRBaseMaterial.LIGHTFALLOFF_GLTF; + }, + /** + * In order to support the falloff compatibility with gltf, a special mode has been added + * to reproduce the gltf light falloff. + */ + set: function (value) { + if (value !== this.useGLTFLightFalloff) { + // Ensure the effect will be rebuilt. + this._markAllSubMeshesAsTexturesDirty(); + if (value) { + this._lightFalloff = BABYLON.PBRBaseMaterial.LIGHTFALLOFF_GLTF; + } + else { + this._lightFalloff = BABYLON.PBRBaseMaterial.LIGHTFALLOFF_STANDARD; + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRMaterial.prototype, "imageProcessingConfiguration", { + /** + * Gets the image processing configuration used either in this material. + */ + get: function () { + return this._imageProcessingConfiguration; + }, + /** + * Sets the Default image processing configuration used either in the this material. + * + * If sets to null, the scene one is in use. + */ + set: function (value) { + this._attachImageProcessingConfiguration(value); + // Ensure the effect will be rebuilt. + this._markAllSubMeshesAsTexturesDirty(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRMaterial.prototype, "cameraColorCurvesEnabled", { + /** + * Gets wether the color curves effect is enabled. + */ + get: function () { + return this.imageProcessingConfiguration.colorCurvesEnabled; + }, + /** + * Sets wether the color curves effect is enabled. + */ + set: function (value) { + this.imageProcessingConfiguration.colorCurvesEnabled = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRMaterial.prototype, "cameraColorGradingEnabled", { + /** + * Gets wether the color grading effect is enabled. + */ + get: function () { + return this.imageProcessingConfiguration.colorGradingEnabled; + }, + /** + * Gets wether the color grading effect is enabled. + */ + set: function (value) { + this.imageProcessingConfiguration.colorGradingEnabled = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRMaterial.prototype, "cameraToneMappingEnabled", { + /** + * Gets wether tonemapping is enabled or not. + */ + get: function () { + return this._imageProcessingConfiguration.toneMappingEnabled; + }, + /** + * Sets wether tonemapping is enabled or not + */ + set: function (value) { + this._imageProcessingConfiguration.toneMappingEnabled = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRMaterial.prototype, "cameraExposure", { + /** + * The camera exposure used on this material. + * This property is here and not in the camera to allow controlling exposure without full screen post process. + * This corresponds to a photographic exposure. + */ + get: function () { + return this._imageProcessingConfiguration.exposure; + }, + /** + * The camera exposure used on this material. + * This property is here and not in the camera to allow controlling exposure without full screen post process. + * This corresponds to a photographic exposure. + */ + set: function (value) { + this._imageProcessingConfiguration.exposure = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRMaterial.prototype, "cameraContrast", { + /** + * Gets The camera contrast used on this material. + */ + get: function () { + return this._imageProcessingConfiguration.contrast; + }, + /** + * Sets The camera contrast used on this material. + */ + set: function (value) { + this._imageProcessingConfiguration.contrast = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRMaterial.prototype, "cameraColorGradingTexture", { + /** + * Gets the Color Grading 2D Lookup Texture. + */ + get: function () { + return this._imageProcessingConfiguration.colorGradingTexture; + }, + /** + * Sets the Color Grading 2D Lookup Texture. + */ + set: function (value) { + this._imageProcessingConfiguration.colorGradingTexture = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PBRMaterial.prototype, "cameraColorCurves", { + /** + * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT). + * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects. + * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image; + * corresponding to low luminance, medium luminance, and high luminance areas respectively. + */ + get: function () { + return this._imageProcessingConfiguration.colorCurves; + }, + /** + * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT). + * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects. + * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image; + * corresponding to low luminance, medium luminance, and high luminance areas respectively. + */ + set: function (value) { + this._imageProcessingConfiguration.colorCurves = value; + }, + enumerable: true, + configurable: true + }); + /** + * Returns the name of this material class. + */ + PBRMaterial.prototype.getClassName = function () { + return "PBRMaterial"; + }; + /** + * Returns an array of the actively used textures. + * @returns - Array of BaseTextures + */ + PBRMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._albedoTexture) { + activeTextures.push(this._albedoTexture); + } + if (this._ambientTexture) { + activeTextures.push(this._ambientTexture); + } + if (this._opacityTexture) { + activeTextures.push(this._opacityTexture); + } + if (this._reflectionTexture) { + activeTextures.push(this._reflectionTexture); + } + if (this._emissiveTexture) { + activeTextures.push(this._emissiveTexture); + } + if (this._reflectivityTexture) { + activeTextures.push(this._reflectivityTexture); + } + if (this._metallicTexture) { + activeTextures.push(this._metallicTexture); + } + if (this._microSurfaceTexture) { + activeTextures.push(this._microSurfaceTexture); + } + if (this._bumpTexture) { + activeTextures.push(this._bumpTexture); + } + if (this._lightmapTexture) { + activeTextures.push(this._lightmapTexture); + } + if (this._refractionTexture) { + activeTextures.push(this._refractionTexture); + } + return activeTextures; + }; + /** + * Checks to see if a texture is used in the material. + * @param texture - Base texture to use. + * @returns - Boolean specifying if a texture is used in the material. + */ + PBRMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this._albedoTexture === texture) { + return true; + } + if (this._ambientTexture === texture) { + return true; + } + if (this._opacityTexture === texture) { + return true; + } + if (this._reflectionTexture === texture) { + return true; + } + if (this._reflectivityTexture === texture) { + return true; + } + if (this._metallicTexture === texture) { + return true; + } + if (this._microSurfaceTexture === texture) { + return true; + } + if (this._bumpTexture === texture) { + return true; + } + if (this._lightmapTexture === texture) { + return true; + } + if (this._refractionTexture === texture) { + return true; + } + return false; + }; + /** + * Makes a duplicate of the current material. + * @param name - name to use for the new material. + */ + PBRMaterial.prototype.clone = function (name) { + var _this = this; + var clone = BABYLON.SerializationHelper.Clone(function () { return new PBRMaterial(name, _this.getScene()); }, this); + clone.id = name; + clone.name = name; + return clone; + }; + /** + * Serializes this PBR Material. + * @returns - An object with the serialized material. + */ + PBRMaterial.prototype.serialize = function () { + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.PBRMaterial"; + return serializationObject; + }; + // Statics + /** + * Parses a PBR Material from a serialized object. + * @param source - Serialized object. + * @param scene - BJS scene instance. + * @param rootUrl - url for the scene object + * @returns - PBRMaterial + */ + PBRMaterial.Parse = function (source, scene, rootUrl) { + return BABYLON.SerializationHelper.Parse(function () { return new PBRMaterial(source.name, scene); }, source, scene, rootUrl); + }; + /** + * PBRMaterialTransparencyMode: No transparency mode, Alpha channel is not use. + */ + PBRMaterial.PBRMATERIAL_OPAQUE = 0; + /** + * PBRMaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value. + */ + PBRMaterial.PBRMATERIAL_ALPHATEST = 1; + /** + * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer. + */ + PBRMaterial.PBRMATERIAL_ALPHABLEND = 2; + /** + * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer. + * They are also discarded below the alpha cutoff threshold to improve performances. + */ + PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND = 3; + /** + * Defines the default value of how much AO map is occluding the analytical lights + * (point spot...). + */ + PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 1; + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "directIntensity", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "emissiveIntensity", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "environmentIntensity", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "specularIntensity", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "disableBumpMap", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "albedoTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "ambientTexture", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "ambientTextureStrength", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "ambientTextureImpactOnAnalyticalLights", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], PBRMaterial.prototype, "opacityTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "reflectionTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "emissiveTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "reflectivityTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "metallicTexture", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "metallic", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "roughness", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "microSurfaceTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "bumpTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", null) + ], PBRMaterial.prototype, "lightmapTexture", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "refractionTexture", void 0); + __decorate([ + BABYLON.serializeAsColor3("ambient"), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "ambientColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("albedo"), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "albedoColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("reflectivity"), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "reflectivityColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("reflection"), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "reflectionColor", void 0); + __decorate([ + BABYLON.serializeAsColor3("emissive"), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "emissiveColor", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "microSurface", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "indexOfRefraction", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "invertRefractionY", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "linkRefractionWithTransparency", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useLightmapAsShadowmap", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], PBRMaterial.prototype, "useAlphaFromAlbedoTexture", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], PBRMaterial.prototype, "forceAlphaTest", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], PBRMaterial.prototype, "alphaCutOff", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useSpecularOverAlpha", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useMicroSurfaceFromReflectivityMapAlpha", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useRoughnessFromMetallicTextureAlpha", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useRoughnessFromMetallicTextureGreen", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useMetallnessFromMetallicTextureBlue", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useAmbientOcclusionFromMetallicTextureRed", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useAmbientInGrayScale", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useAutoMicroSurfaceFromReflectivityMap", void 0); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "usePhysicalLightFalloff", null); + __decorate([ + BABYLON.serialize() + ], PBRMaterial.prototype, "useGLTFLightFalloff", null); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useRadianceOverAlpha", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useObjectSpaceNormalMap", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useParallax", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useParallaxOcclusion", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "parallaxScaleBias", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsLightsDirty") + ], PBRMaterial.prototype, "disableLighting", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "forceIrradianceInFragment", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsLightsDirty") + ], PBRMaterial.prototype, "maxSimultaneousLights", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "invertNormalMapX", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "invertNormalMapY", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "twoSidedLighting", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useAlphaFresnel", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useLinearAlphaFresnel", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "environmentBRDFTexture", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "forceNormalForward", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "enableSpecularAntiAliasing", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useHorizonOcclusion", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useRadianceOcclusion", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsMiscDirty") + ], PBRMaterial.prototype, "unlit", void 0); + return PBRMaterial; + }(BABYLON.PBRBaseMaterial)); + BABYLON.PBRMaterial = PBRMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pbrMaterial.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * The PBR material of BJS following the metal roughness convention. + * + * This fits to the PBR convention in the GLTF definition: + * https://github.com/KhronosGroup/glTF/tree/2.0/specification/2.0 + */ + var PBRMetallicRoughnessMaterial = /** @class */ (function (_super) { + __extends(PBRMetallicRoughnessMaterial, _super); + /** + * Instantiates a new PBRMetalRoughnessMaterial instance. + * + * @param name The material name + * @param scene The scene the material will be use in. + */ + function PBRMetallicRoughnessMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this._useRoughnessFromMetallicTextureAlpha = false; + _this._useRoughnessFromMetallicTextureGreen = true; + _this._useMetallnessFromMetallicTextureBlue = true; + _this.metallic = 1.0; + _this.roughness = 1.0; + return _this; + } + /** + * Return the currrent class name of the material. + */ + PBRMetallicRoughnessMaterial.prototype.getClassName = function () { + return "PBRMetallicRoughnessMaterial"; + }; + /** + * Return the active textures of the material. + */ + PBRMetallicRoughnessMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this.baseTexture) { + activeTextures.push(this.baseTexture); + } + if (this.metallicRoughnessTexture) { + activeTextures.push(this.metallicRoughnessTexture); + } + return activeTextures; + }; + /** + * Checks to see if a texture is used in the material. + * @param texture - Base texture to use. + * @returns - Boolean specifying if a texture is used in the material. + */ + PBRMetallicRoughnessMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this.baseTexture === texture) { + return true; + } + if (this.metallicRoughnessTexture === texture) { + return true; + } + return false; + }; + /** + * Makes a duplicate of the current material. + * @param name - name to use for the new material. + */ + PBRMetallicRoughnessMaterial.prototype.clone = function (name) { + var _this = this; + var clone = BABYLON.SerializationHelper.Clone(function () { return new PBRMetallicRoughnessMaterial(name, _this.getScene()); }, this); + clone.id = name; + clone.name = name; + return clone; + }; + /** + * Serialize the material to a parsable JSON object. + */ + PBRMetallicRoughnessMaterial.prototype.serialize = function () { + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.PBRMetallicRoughnessMaterial"; + return serializationObject; + }; + /** + * Parses a JSON object correponding to the serialize function. + */ + PBRMetallicRoughnessMaterial.Parse = function (source, scene, rootUrl) { + return BABYLON.SerializationHelper.Parse(function () { return new PBRMetallicRoughnessMaterial(source.name, scene); }, source, scene, rootUrl); + }; + __decorate([ + BABYLON.serializeAsColor3(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoColor") + ], PBRMetallicRoughnessMaterial.prototype, "baseColor", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoTexture") + ], PBRMetallicRoughnessMaterial.prototype, "baseTexture", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMetallicRoughnessMaterial.prototype, "metallic", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMetallicRoughnessMaterial.prototype, "roughness", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_metallicTexture") + ], PBRMetallicRoughnessMaterial.prototype, "metallicRoughnessTexture", void 0); + return PBRMetallicRoughnessMaterial; + }(BABYLON.PBRBaseSimpleMaterial)); + BABYLON.PBRMetallicRoughnessMaterial = PBRMetallicRoughnessMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pbrMetallicRoughnessMaterial.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * The PBR material of BJS following the specular glossiness convention. + * + * This fits to the PBR convention in the GLTF definition: + * https://github.com/KhronosGroup/glTF/tree/2.0/extensions/Khronos/KHR_materials_pbrSpecularGlossiness + */ + var PBRSpecularGlossinessMaterial = /** @class */ (function (_super) { + __extends(PBRSpecularGlossinessMaterial, _super); + /** + * Instantiates a new PBRSpecularGlossinessMaterial instance. + * + * @param name The material name + * @param scene The scene the material will be use in. + */ + function PBRSpecularGlossinessMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this._useMicroSurfaceFromReflectivityMapAlpha = true; + return _this; + } + /** + * Return the currrent class name of the material. + */ + PBRSpecularGlossinessMaterial.prototype.getClassName = function () { + return "PBRSpecularGlossinessMaterial"; + }; + /** + * Return the active textures of the material. + */ + PBRSpecularGlossinessMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this.diffuseTexture) { + activeTextures.push(this.diffuseTexture); + } + if (this.specularGlossinessTexture) { + activeTextures.push(this.specularGlossinessTexture); + } + return activeTextures; + }; + /** + * Checks to see if a texture is used in the material. + * @param texture - Base texture to use. + * @returns - Boolean specifying if a texture is used in the material. + */ + PBRSpecularGlossinessMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this.diffuseTexture === texture) { + return true; + } + if (this.specularGlossinessTexture === texture) { + return true; + } + return false; + }; + /** + * Makes a duplicate of the current material. + * @param name - name to use for the new material. + */ + PBRSpecularGlossinessMaterial.prototype.clone = function (name) { + var _this = this; + var clone = BABYLON.SerializationHelper.Clone(function () { return new PBRSpecularGlossinessMaterial(name, _this.getScene()); }, this); + clone.id = name; + clone.name = name; + return clone; + }; + /** + * Serialize the material to a parsable JSON object. + */ + PBRSpecularGlossinessMaterial.prototype.serialize = function () { + var serializationObject = BABYLON.SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.PBRSpecularGlossinessMaterial"; + return serializationObject; + }; + /** + * Parses a JSON object correponding to the serialize function. + */ + PBRSpecularGlossinessMaterial.Parse = function (source, scene, rootUrl) { + return BABYLON.SerializationHelper.Parse(function () { return new PBRSpecularGlossinessMaterial(source.name, scene); }, source, scene, rootUrl); + }; + __decorate([ + BABYLON.serializeAsColor3("diffuse"), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoColor") + ], PBRSpecularGlossinessMaterial.prototype, "diffuseColor", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoTexture") + ], PBRSpecularGlossinessMaterial.prototype, "diffuseTexture", void 0); + __decorate([ + BABYLON.serializeAsColor3("specular"), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectivityColor") + ], PBRSpecularGlossinessMaterial.prototype, "specularColor", void 0); + __decorate([ + BABYLON.serialize(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_microSurface") + ], PBRSpecularGlossinessMaterial.prototype, "glossiness", void 0); + __decorate([ + BABYLON.serializeAsTexture(), + BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectivityTexture") + ], PBRSpecularGlossinessMaterial.prototype, "specularGlossinessTexture", void 0); + return PBRSpecularGlossinessMaterial; + }(BABYLON.PBRBaseSimpleMaterial)); + BABYLON.PBRSpecularGlossinessMaterial = PBRSpecularGlossinessMaterial; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pbrSpecularGlossinessMaterial.js.map + +var BABYLON; +(function (BABYLON) { + /** + * @ignore + * This is a list of all the different input types that are available in the application. + * Fo instance: ArcRotateCameraGamepadInput... + */ + BABYLON.CameraInputTypes = {}; + /** + * This represents the input manager used within a camera. + * It helps dealing with all the different kind of input attached to a camera. + * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs + */ + var CameraInputsManager = /** @class */ (function () { + /** + * Instantiate a new Camera Input Manager. + * @param camera Defines the camera the input manager blongs to + */ + function CameraInputsManager(camera) { + this.attached = {}; + this.camera = camera; + this.checkInputs = function () { }; + } + /** + * Add an input method to a camera + * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs + * @param input camera input method + */ + CameraInputsManager.prototype.add = function (input) { + var type = input.getSimpleName(); + if (this.attached[type]) { + BABYLON.Tools.Warn("camera input of type " + type + " already exists on camera"); + return; + } + this.attached[type] = input; + input.camera = this.camera; + //for checkInputs, we are dynamically creating a function + //the goal is to avoid the performance penalty of looping for inputs in the render loop + if (input.checkInputs) { + this.checkInputs = this._addCheckInputs(input.checkInputs.bind(input)); + } + if (this.attachedElement) { + input.attachControl(this.attachedElement); + } + }; + /** + * Remove a specific input method from a camera + * example: camera.inputs.remove(camera.inputs.attached.mouse); + * @param inputToRemove camera input method + */ + CameraInputsManager.prototype.remove = function (inputToRemove) { + for (var cam in this.attached) { + var input = this.attached[cam]; + if (input === inputToRemove) { + input.detachControl(this.attachedElement); + input.camera = null; + delete this.attached[cam]; + this.rebuildInputCheck(); + } + } + }; + /** + * Remove a specific input type from a camera + * example: camera.inputs.remove("ArcRotateCameraGamepadInput"); + * @param inputType the type of the input to remove + */ + CameraInputsManager.prototype.removeByType = function (inputType) { + for (var cam in this.attached) { + var input = this.attached[cam]; + if (input.getClassName() === inputType) { + input.detachControl(this.attachedElement); + input.camera = null; + delete this.attached[cam]; + this.rebuildInputCheck(); + } + } + }; + CameraInputsManager.prototype._addCheckInputs = function (fn) { + var current = this.checkInputs; + return function () { + current(); + fn(); + }; + }; + /** + * Attach the input controls to the currently attached dom element to listen the events from. + * @param input Defines the input to attach + */ + CameraInputsManager.prototype.attachInput = function (input) { + if (this.attachedElement) { + input.attachControl(this.attachedElement, this.noPreventDefault); + } + }; + /** + * Attach the current manager inputs controls to a specific dom element to listen the events from. + * @param element Defines the dom element to collect the events from + * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) + */ + CameraInputsManager.prototype.attachElement = function (element, noPreventDefault) { + if (noPreventDefault === void 0) { noPreventDefault = false; } + if (this.attachedElement) { + return; + } + noPreventDefault = BABYLON.Camera.ForceAttachControlToAlwaysPreventDefault ? false : noPreventDefault; + this.attachedElement = element; + this.noPreventDefault = noPreventDefault; + for (var cam in this.attached) { + this.attached[cam].attachControl(element, noPreventDefault); + } + }; + /** + * Detach the current manager inputs controls from a specific dom element. + * @param element Defines the dom element to collect the events from + * @param disconnect Defines whether the input should be removed from the current list of attached inputs + */ + CameraInputsManager.prototype.detachElement = function (element, disconnect) { + if (disconnect === void 0) { disconnect = false; } + if (this.attachedElement !== element) { + return; + } + for (var cam in this.attached) { + this.attached[cam].detachControl(element); + if (disconnect) { + this.attached[cam].camera = null; + } + } + this.attachedElement = null; + }; + /** + * Rebuild the dynamic inputCheck function from the current list of + * defined inputs in the manager. + */ + CameraInputsManager.prototype.rebuildInputCheck = function () { + this.checkInputs = function () { }; + for (var cam in this.attached) { + var input = this.attached[cam]; + if (input.checkInputs) { + this.checkInputs = this._addCheckInputs(input.checkInputs.bind(input)); + } + } + }; + /** + * Remove all attached input methods from a camera + */ + CameraInputsManager.prototype.clear = function () { + if (this.attachedElement) { + this.detachElement(this.attachedElement, true); + } + this.attached = {}; + this.attachedElement = null; + this.checkInputs = function () { }; + }; + /** + * Serialize the current input manager attached to a camera. + * This ensures than once parsed, + * the input associated to the camera will be identical to the current ones + * @param serializedCamera Defines the camera serialization JSON the input serialization should write to + */ + CameraInputsManager.prototype.serialize = function (serializedCamera) { + var inputs = {}; + for (var cam in this.attached) { + var input = this.attached[cam]; + var res = BABYLON.SerializationHelper.Serialize(input); + inputs[input.getClassName()] = res; + } + serializedCamera.inputsmgr = inputs; + }; + /** + * Parses an input manager serialized JSON to restore the previous list of inputs + * and states associated to a camera. + * @param parsedCamera Defines the JSON to parse + */ + CameraInputsManager.prototype.parse = function (parsedCamera) { + var parsedInputs = parsedCamera.inputsmgr; + if (parsedInputs) { + this.clear(); + for (var n in parsedInputs) { + var construct = BABYLON.CameraInputTypes[n]; + if (construct) { + var parsedinput = parsedInputs[n]; + var input = BABYLON.SerializationHelper.Parse(function () { return new construct(); }, parsedinput, null); + this.add(input); + } + } + } + else { + //2016-03-08 this part is for managing backward compatibility + for (var n in this.attached) { + var construct = BABYLON.CameraInputTypes[this.attached[n].getClassName()]; + if (construct) { + var input = BABYLON.SerializationHelper.Parse(function () { return new construct(); }, parsedCamera, null); + this.remove(this.attached[n]); + this.add(input); + } + } + } + }; + return CameraInputsManager; + }()); + BABYLON.CameraInputsManager = CameraInputsManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.cameraInputsManager.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * A target camera takes a mesh or position as a target and continues to look at it while it moves. + * This is the base of the follow, arc rotate cameras and Free camera + * @see http://doc.babylonjs.com/features/cameras + */ + var TargetCamera = /** @class */ (function (_super) { + __extends(TargetCamera, _super); + /** + * Instantiates a target camera that takes a meshor position as a target and continues to look at it while it moves. + * This is the base of the follow, arc rotate cameras and Free camera + * @see http://doc.babylonjs.com/features/cameras + * @param name Defines the name of the camera in the scene + * @param position Defines the start position of the camera in the scene + * @param scene Defines the scene the camera belongs to + * @param setActiveOnSceneIfNoneActive Defines wheter the camera should be marked as active if not other active cameras have been defined + */ + function TargetCamera(name, position, scene, setActiveOnSceneIfNoneActive) { + if (setActiveOnSceneIfNoneActive === void 0) { setActiveOnSceneIfNoneActive = true; } + var _this = _super.call(this, name, position, scene, setActiveOnSceneIfNoneActive) || this; + /** + * Define the current direction the camera is moving to + */ + _this.cameraDirection = new BABYLON.Vector3(0, 0, 0); + /** + * Define the current rotation the camera is rotating to + */ + _this.cameraRotation = new BABYLON.Vector2(0, 0); + /** + * Define the current rotation of the camera + */ + _this.rotation = new BABYLON.Vector3(0, 0, 0); + /** + * Define the current speed of the camera + */ + _this.speed = 2.0; + /** + * Add cconstraint to the camera to prevent it to move freely in all directions and + * around all axis. + */ + _this.noRotationConstraint = false; + /** + * Define the current target of the camera as an object or a position. + */ + _this.lockedTarget = null; + /** @hidden */ + _this._currentTarget = BABYLON.Vector3.Zero(); + /** @hidden */ + _this._viewMatrix = BABYLON.Matrix.Zero(); + /** @hidden */ + _this._camMatrix = BABYLON.Matrix.Zero(); + /** @hidden */ + _this._cameraTransformMatrix = BABYLON.Matrix.Zero(); + /** @hidden */ + _this._cameraRotationMatrix = BABYLON.Matrix.Zero(); + /** @hidden */ + _this._referencePoint = new BABYLON.Vector3(0, 0, 1); + /** @hidden */ + _this._transformedReferencePoint = BABYLON.Vector3.Zero(); + _this._globalCurrentTarget = BABYLON.Vector3.Zero(); + _this._globalCurrentUpVector = BABYLON.Vector3.Zero(); + _this._defaultUp = BABYLON.Vector3.Up(); + _this._cachedRotationZ = 0; + _this._cachedQuaternionRotationZ = 0; + return _this; + } + /** + * Gets the position in front of the camera at a given distance. + * @param distance The distance from the camera we want the position to be + * @returns the position + */ + TargetCamera.prototype.getFrontPosition = function (distance) { + this.getWorldMatrix(); + var direction = this.getTarget().subtract(this.position); + direction.normalize(); + direction.scaleInPlace(distance); + return this.globalPosition.add(direction); + }; + /** @hidden */ + TargetCamera.prototype._getLockedTargetPosition = function () { + if (!this.lockedTarget) { + return null; + } + if (this.lockedTarget.absolutePosition) { + this.lockedTarget.computeWorldMatrix(); + } + return this.lockedTarget.absolutePosition || this.lockedTarget; + }; + /** + * Store current camera state of the camera (fov, position, rotation, etc..) + * @returns the camera + */ + TargetCamera.prototype.storeState = function () { + this._storedPosition = this.position.clone(); + this._storedRotation = this.rotation.clone(); + if (this.rotationQuaternion) { + this._storedRotationQuaternion = this.rotationQuaternion.clone(); + } + return _super.prototype.storeState.call(this); + }; + /** + * Restored camera state. You must call storeState() first + * @returns whether it was successful or not + * @hidden + */ + TargetCamera.prototype._restoreStateValues = function () { + if (!_super.prototype._restoreStateValues.call(this)) { + return false; + } + this.position = this._storedPosition.clone(); + this.rotation = this._storedRotation.clone(); + if (this.rotationQuaternion) { + this.rotationQuaternion = this._storedRotationQuaternion.clone(); + } + this.cameraDirection.copyFromFloats(0, 0, 0); + this.cameraRotation.copyFromFloats(0, 0); + return true; + }; + /** @hidden */ + TargetCamera.prototype._initCache = function () { + _super.prototype._initCache.call(this); + this._cache.lockedTarget = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + this._cache.rotation = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + this._cache.rotationQuaternion = new BABYLON.Quaternion(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + }; + /** @hidden */ + TargetCamera.prototype._updateCache = function (ignoreParentClass) { + if (!ignoreParentClass) { + _super.prototype._updateCache.call(this); + } + var lockedTargetPosition = this._getLockedTargetPosition(); + if (!lockedTargetPosition) { + this._cache.lockedTarget = null; + } + else { + if (!this._cache.lockedTarget) { + this._cache.lockedTarget = lockedTargetPosition.clone(); + } + else { + this._cache.lockedTarget.copyFrom(lockedTargetPosition); + } + } + this._cache.rotation.copyFrom(this.rotation); + if (this.rotationQuaternion) { + this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion); + } + }; + // Synchronized + /** @hidden */ + TargetCamera.prototype._isSynchronizedViewMatrix = function () { + if (!_super.prototype._isSynchronizedViewMatrix.call(this)) { + return false; + } + var lockedTargetPosition = this._getLockedTargetPosition(); + return (this._cache.lockedTarget ? this._cache.lockedTarget.equals(lockedTargetPosition) : !lockedTargetPosition) + && (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation)); + }; + // Methods + /** @hidden */ + TargetCamera.prototype._computeLocalCameraSpeed = function () { + var engine = this.getEngine(); + return this.speed * Math.sqrt((engine.getDeltaTime() / (engine.getFps() * 100.0))); + }; + // Target + /** @hidden */ + TargetCamera.prototype.setTarget = function (target) { + this.upVector.normalize(); + if (this.position.z === target.z) { + this.position.z += BABYLON.Epsilon; + } + BABYLON.Matrix.LookAtLHToRef(this.position, target, this._defaultUp, this._camMatrix); + this._camMatrix.invert(); + this.rotation.x = Math.atan(this._camMatrix.m[6] / this._camMatrix.m[10]); + var vDir = target.subtract(this.position); + if (vDir.x >= 0.0) { + this.rotation.y = (-Math.atan(vDir.z / vDir.x) + Math.PI / 2.0); + } + else { + this.rotation.y = (-Math.atan(vDir.z / vDir.x) - Math.PI / 2.0); + } + this.rotation.z = 0; + if (isNaN(this.rotation.x)) { + this.rotation.x = 0; + } + if (isNaN(this.rotation.y)) { + this.rotation.y = 0; + } + if (isNaN(this.rotation.z)) { + this.rotation.z = 0; + } + if (this.rotationQuaternion) { + BABYLON.Quaternion.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion); + } + }; + /** + * Return the current target position of the camera. This value is expressed in local space. + * @returns the target position + */ + TargetCamera.prototype.getTarget = function () { + return this._currentTarget; + }; + /** @hidden */ + TargetCamera.prototype._decideIfNeedsToMove = function () { + return Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0; + }; + /** @hidden */ + TargetCamera.prototype._updatePosition = function () { + if (this.parent) { + this.parent.getWorldMatrix().invertToRef(BABYLON.Tmp.Matrix[0]); + BABYLON.Vector3.TransformNormalToRef(this.cameraDirection, BABYLON.Tmp.Matrix[0], BABYLON.Tmp.Vector3[0]); + this.position.addInPlace(BABYLON.Tmp.Vector3[0]); + return; + } + this.position.addInPlace(this.cameraDirection); + }; + /** @hidden */ + TargetCamera.prototype._checkInputs = function () { + var needToMove = this._decideIfNeedsToMove(); + var needToRotate = Math.abs(this.cameraRotation.x) > 0 || Math.abs(this.cameraRotation.y) > 0; + // Move + if (needToMove) { + this._updatePosition(); + } + // Rotate + if (needToRotate) { + this.rotation.x += this.cameraRotation.x; + this.rotation.y += this.cameraRotation.y; + //rotate, if quaternion is set and rotation was used + if (this.rotationQuaternion) { + var len = this.rotation.lengthSquared(); + if (len) { + BABYLON.Quaternion.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion); + } + } + if (!this.noRotationConstraint) { + var limit = (Math.PI / 2) * 0.95; + if (this.rotation.x > limit) { + this.rotation.x = limit; + } + if (this.rotation.x < -limit) { + this.rotation.x = -limit; + } + } + } + // Inertia + if (needToMove) { + if (Math.abs(this.cameraDirection.x) < this.speed * BABYLON.Epsilon) { + this.cameraDirection.x = 0; + } + if (Math.abs(this.cameraDirection.y) < this.speed * BABYLON.Epsilon) { + this.cameraDirection.y = 0; + } + if (Math.abs(this.cameraDirection.z) < this.speed * BABYLON.Epsilon) { + this.cameraDirection.z = 0; + } + this.cameraDirection.scaleInPlace(this.inertia); + } + if (needToRotate) { + if (Math.abs(this.cameraRotation.x) < this.speed * BABYLON.Epsilon) { + this.cameraRotation.x = 0; + } + if (Math.abs(this.cameraRotation.y) < this.speed * BABYLON.Epsilon) { + this.cameraRotation.y = 0; + } + this.cameraRotation.scaleInPlace(this.inertia); + } + _super.prototype._checkInputs.call(this); + }; + TargetCamera.prototype._updateCameraRotationMatrix = function () { + if (this.rotationQuaternion) { + this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix); + } + else { + BABYLON.Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix); + } + }; + /** + * Update the up vector to apply the rotation of the camera (So if you changed the camera rotation.z this will let you update the up vector as well) + * @returns the current camera + */ + TargetCamera.prototype._rotateUpVectorWithCameraRotationMatrix = function () { + BABYLON.Vector3.TransformNormalToRef(this._defaultUp, this._cameraRotationMatrix, this.upVector); + return this; + }; + /** @hidden */ + TargetCamera.prototype._getViewMatrix = function () { + if (this.lockedTarget) { + this.setTarget(this._getLockedTargetPosition()); + } + // Compute + this._updateCameraRotationMatrix(); + // Apply the changed rotation to the upVector + if (this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z) { + this._rotateUpVectorWithCameraRotationMatrix(); + this._cachedQuaternionRotationZ = this.rotationQuaternion.z; + } + else if (this._cachedRotationZ != this.rotation.z) { + this._rotateUpVectorWithCameraRotationMatrix(); + this._cachedRotationZ = this.rotation.z; + } + BABYLON.Vector3.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint); + // Computing target and final matrix + this.position.addToRef(this._transformedReferencePoint, this._currentTarget); + this._computeViewMatrix(this.position, this._currentTarget, this.upVector); + return this._viewMatrix; + }; + TargetCamera.prototype._computeViewMatrix = function (position, target, up) { + if (this.parent) { + var parentWorldMatrix = this.parent.getWorldMatrix(); + BABYLON.Vector3.TransformCoordinatesToRef(position, parentWorldMatrix, this._globalPosition); + BABYLON.Vector3.TransformCoordinatesToRef(target, parentWorldMatrix, this._globalCurrentTarget); + BABYLON.Vector3.TransformNormalToRef(up, parentWorldMatrix, this._globalCurrentUpVector); + this._markSyncedWithParent(); + } + else { + this._globalPosition.copyFrom(position); + this._globalCurrentTarget.copyFrom(target); + this._globalCurrentUpVector.copyFrom(up); + } + if (this.getScene().useRightHandedSystem) { + BABYLON.Matrix.LookAtRHToRef(this._globalPosition, this._globalCurrentTarget, this._globalCurrentUpVector, this._viewMatrix); + } + else { + BABYLON.Matrix.LookAtLHToRef(this._globalPosition, this._globalCurrentTarget, this._globalCurrentUpVector, this._viewMatrix); + } + }; + /** + * @hidden + */ + TargetCamera.prototype.createRigCamera = function (name, cameraIndex) { + if (this.cameraRigMode !== BABYLON.Camera.RIG_MODE_NONE) { + var rigCamera = new TargetCamera(name, this.position.clone(), this.getScene()); + if (this.cameraRigMode === BABYLON.Camera.RIG_MODE_VR || this.cameraRigMode === BABYLON.Camera.RIG_MODE_WEBVR) { + if (!this.rotationQuaternion) { + this.rotationQuaternion = new BABYLON.Quaternion(); + } + rigCamera._cameraRigParams = {}; + rigCamera.rotationQuaternion = new BABYLON.Quaternion(); + } + return rigCamera; + } + return null; + }; + /** + * @hidden + */ + TargetCamera.prototype._updateRigCameras = function () { + var camLeft = this._rigCameras[0]; + var camRight = this._rigCameras[1]; + switch (this.cameraRigMode) { + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER: + //provisionnaly using _cameraRigParams.stereoHalfAngle instead of calculations based on _cameraRigParams.interaxialDistance: + var leftSign = (this.cameraRigMode === BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED) ? 1 : -1; + var rightSign = (this.cameraRigMode === BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED) ? -1 : 1; + this._getRigCamPosition(this._cameraRigParams.stereoHalfAngle * leftSign, camLeft.position); + this._getRigCamPosition(this._cameraRigParams.stereoHalfAngle * rightSign, camRight.position); + camLeft.setTarget(this.getTarget()); + camRight.setTarget(this.getTarget()); + break; + case BABYLON.Camera.RIG_MODE_VR: + if (camLeft.rotationQuaternion) { + camLeft.rotationQuaternion.copyFrom(this.rotationQuaternion); + camRight.rotationQuaternion.copyFrom(this.rotationQuaternion); + } + else { + camLeft.rotation.copyFrom(this.rotation); + camRight.rotation.copyFrom(this.rotation); + } + camLeft.position.copyFrom(this.position); + camRight.position.copyFrom(this.position); + break; + } + _super.prototype._updateRigCameras.call(this); + }; + TargetCamera.prototype._getRigCamPosition = function (halfSpace, result) { + if (!this._rigCamTransformMatrix) { + this._rigCamTransformMatrix = new BABYLON.Matrix(); + } + var target = this.getTarget(); + BABYLON.Matrix.Translation(-target.x, -target.y, -target.z).multiplyToRef(BABYLON.Matrix.RotationY(halfSpace), this._rigCamTransformMatrix); + this._rigCamTransformMatrix = this._rigCamTransformMatrix.multiply(BABYLON.Matrix.Translation(target.x, target.y, target.z)); + BABYLON.Vector3.TransformCoordinatesToRef(this.position, this._rigCamTransformMatrix, result); + }; + /** + * Gets the current object class name. + * @return the class name + */ + TargetCamera.prototype.getClassName = function () { + return "TargetCamera"; + }; + __decorate([ + BABYLON.serializeAsVector3() + ], TargetCamera.prototype, "rotation", void 0); + __decorate([ + BABYLON.serialize() + ], TargetCamera.prototype, "speed", void 0); + __decorate([ + BABYLON.serializeAsMeshReference("lockedTargetId") + ], TargetCamera.prototype, "lockedTarget", void 0); + return TargetCamera; + }(BABYLON.Camera)); + BABYLON.TargetCamera = TargetCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.targetCamera.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Manage the mouse inputs to control the movement of a free camera. + * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs + */ + var FreeCameraMouseInput = /** @class */ (function () { + /** + * Manage the mouse inputs to control the movement of a free camera. + * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs + * @param touchEnabled Defines if touch is enabled or not + */ + function FreeCameraMouseInput( + /** + * Define if touch is enabled in the mouse input + */ + touchEnabled) { + if (touchEnabled === void 0) { touchEnabled = true; } + this.touchEnabled = touchEnabled; + /** + * Defines the buttons associated with the input to handle camera move. + */ + this.buttons = [0, 1, 2]; + /** + * Defines the pointer angular sensibility along the X and Y axis or how fast is the camera rotating. + */ + this.angularSensibility = 2000.0; + this.previousPosition = null; + } + /** + * Attach the input controls to a specific dom element to get the input from. + * @param element Defines the element the controls should be listened from + * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) + */ + FreeCameraMouseInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + var engine = this.camera.getEngine(); + if (!this._pointerInput) { + this._pointerInput = function (p, s) { + var evt = p.event; + if (engine.isInVRExclusivePointerMode) { + return; + } + if (!_this.touchEnabled && evt.pointerType === "touch") { + return; + } + if (p.type !== BABYLON.PointerEventTypes.POINTERMOVE && _this.buttons.indexOf(evt.button) === -1) { + return; + } + var srcElement = (evt.srcElement || evt.target); + if (p.type === BABYLON.PointerEventTypes.POINTERDOWN && srcElement) { + try { + srcElement.setPointerCapture(evt.pointerId); + } + catch (e) { + //Nothing to do with the error. Execution will continue. + } + _this.previousPosition = { + x: evt.clientX, + y: evt.clientY + }; + if (!noPreventDefault) { + evt.preventDefault(); + element.focus(); + } + } + else if (p.type === BABYLON.PointerEventTypes.POINTERUP && srcElement) { + try { + srcElement.releasePointerCapture(evt.pointerId); + } + catch (e) { + //Nothing to do with the error. + } + _this.previousPosition = null; + if (!noPreventDefault) { + evt.preventDefault(); + } + } + else if (p.type === BABYLON.PointerEventTypes.POINTERMOVE) { + if (!_this.previousPosition || engine.isPointerLock) { + return; + } + var offsetX = evt.clientX - _this.previousPosition.x; + if (_this.camera.getScene().useRightHandedSystem) { + offsetX *= -1; + } + if (_this.camera.parent && _this.camera.parent._getWorldMatrixDeterminant() < 0) { + offsetX *= -1; + } + _this.camera.cameraRotation.y += offsetX / _this.angularSensibility; + var offsetY = evt.clientY - _this.previousPosition.y; + _this.camera.cameraRotation.x += offsetY / _this.angularSensibility; + _this.previousPosition = { + x: evt.clientX, + y: evt.clientY + }; + if (!noPreventDefault) { + evt.preventDefault(); + } + } + }; + } + this._onMouseMove = function (evt) { + if (!engine.isPointerLock) { + return; + } + if (engine.isInVRExclusivePointerMode) { + return; + } + var offsetX = evt.movementX || evt.mozMovementX || evt.webkitMovementX || evt.msMovementX || 0; + if (_this.camera.getScene().useRightHandedSystem) { + offsetX *= -1; + } + if (_this.camera.parent && _this.camera.parent._getWorldMatrixDeterminant() < 0) { + offsetX *= -1; + } + _this.camera.cameraRotation.y += offsetX / _this.angularSensibility; + var offsetY = evt.movementY || evt.mozMovementY || evt.webkitMovementY || evt.msMovementY || 0; + _this.camera.cameraRotation.x += offsetY / _this.angularSensibility; + _this.previousPosition = null; + if (!noPreventDefault) { + evt.preventDefault(); + } + }; + this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, BABYLON.PointerEventTypes.POINTERDOWN | BABYLON.PointerEventTypes.POINTERUP | BABYLON.PointerEventTypes.POINTERMOVE); + element.addEventListener("mousemove", this._onMouseMove, false); + }; + /** + * Detach the current controls from the specified dom element. + * @param element Defines the element to stop listening the inputs from + */ + FreeCameraMouseInput.prototype.detachControl = function (element) { + if (this._observer && element) { + this.camera.getScene().onPointerObservable.remove(this._observer); + if (this._onMouseMove) { + element.removeEventListener("mousemove", this._onMouseMove); + } + this._observer = null; + this._onMouseMove = null; + this.previousPosition = null; + } + }; + /** + * Gets the class name of the current intput. + * @returns the class name + */ + FreeCameraMouseInput.prototype.getClassName = function () { + return "FreeCameraMouseInput"; + }; + /** + * Get the friendly name associated with the input class. + * @returns the input friendly name + */ + FreeCameraMouseInput.prototype.getSimpleName = function () { + return "mouse"; + }; + __decorate([ + BABYLON.serialize() + ], FreeCameraMouseInput.prototype, "buttons", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCameraMouseInput.prototype, "angularSensibility", void 0); + return FreeCameraMouseInput; + }()); + BABYLON.FreeCameraMouseInput = FreeCameraMouseInput; + BABYLON.CameraInputTypes["FreeCameraMouseInput"] = FreeCameraMouseInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freeCameraMouseInput.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Manage the keyboard inputs to control the movement of a free camera. + * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs + */ + var FreeCameraKeyboardMoveInput = /** @class */ (function () { + function FreeCameraKeyboardMoveInput() { + /** + * Gets or Set the list of keyboard keys used to control the forward move of the camera. + */ + this.keysUp = [38]; + /** + * Gets or Set the list of keyboard keys used to control the backward move of the camera. + */ + this.keysDown = [40]; + /** + * Gets or Set the list of keyboard keys used to control the left strafe move of the camera. + */ + this.keysLeft = [37]; + /** + * Gets or Set the list of keyboard keys used to control the right strafe move of the camera. + */ + this.keysRight = [39]; + this._keys = new Array(); + } + /** + * Attach the input controls to a specific dom element to get the input from. + * @param element Defines the element the controls should be listened from + * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) + */ + FreeCameraKeyboardMoveInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + if (this._onCanvasBlurObserver) { + return; + } + this._scene = this.camera.getScene(); + this._engine = this._scene.getEngine(); + this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function () { + _this._keys = []; + }); + this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function (info) { + var evt = info.event; + if (info.type === BABYLON.KeyboardEventTypes.KEYDOWN) { + if (_this.keysUp.indexOf(evt.keyCode) !== -1 || + _this.keysDown.indexOf(evt.keyCode) !== -1 || + _this.keysLeft.indexOf(evt.keyCode) !== -1 || + _this.keysRight.indexOf(evt.keyCode) !== -1) { + var index = _this._keys.indexOf(evt.keyCode); + if (index === -1) { + _this._keys.push(evt.keyCode); + } + if (!noPreventDefault) { + evt.preventDefault(); + } + } + } + else { + if (_this.keysUp.indexOf(evt.keyCode) !== -1 || + _this.keysDown.indexOf(evt.keyCode) !== -1 || + _this.keysLeft.indexOf(evt.keyCode) !== -1 || + _this.keysRight.indexOf(evt.keyCode) !== -1) { + var index = _this._keys.indexOf(evt.keyCode); + if (index >= 0) { + _this._keys.splice(index, 1); + } + if (!noPreventDefault) { + evt.preventDefault(); + } + } + } + }); + }; + /** + * Detach the current controls from the specified dom element. + * @param element Defines the element to stop listening the inputs from + */ + FreeCameraKeyboardMoveInput.prototype.detachControl = function (element) { + if (this._scene) { + if (this._onKeyboardObserver) { + this._scene.onKeyboardObservable.remove(this._onKeyboardObserver); + } + if (this._onCanvasBlurObserver) { + this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver); + } + this._onKeyboardObserver = null; + this._onCanvasBlurObserver = null; + } + this._keys = []; + }; + /** + * Update the current camera state depending on the inputs that have been used this frame. + * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop. + */ + FreeCameraKeyboardMoveInput.prototype.checkInputs = function () { + if (this._onKeyboardObserver) { + var camera = this.camera; + // Keyboard + for (var index = 0; index < this._keys.length; index++) { + var keyCode = this._keys[index]; + var speed = camera._computeLocalCameraSpeed(); + if (this.keysLeft.indexOf(keyCode) !== -1) { + camera._localDirection.copyFromFloats(-speed, 0, 0); + } + else if (this.keysUp.indexOf(keyCode) !== -1) { + camera._localDirection.copyFromFloats(0, 0, speed); + } + else if (this.keysRight.indexOf(keyCode) !== -1) { + camera._localDirection.copyFromFloats(speed, 0, 0); + } + else if (this.keysDown.indexOf(keyCode) !== -1) { + camera._localDirection.copyFromFloats(0, 0, -speed); + } + if (camera.getScene().useRightHandedSystem) { + camera._localDirection.z *= -1; + } + camera.getViewMatrix().invertToRef(camera._cameraTransformMatrix); + BABYLON.Vector3.TransformNormalToRef(camera._localDirection, camera._cameraTransformMatrix, camera._transformedDirection); + camera.cameraDirection.addInPlace(camera._transformedDirection); + } + } + }; + /** + * Gets the class name of the current intput. + * @returns the class name + */ + FreeCameraKeyboardMoveInput.prototype.getClassName = function () { + return "FreeCameraKeyboardMoveInput"; + }; + /** @hidden */ + FreeCameraKeyboardMoveInput.prototype._onLostFocus = function (e) { + this._keys = []; + }; + /** + * Get the friendly name associated with the input class. + * @returns the input friendly name + */ + FreeCameraKeyboardMoveInput.prototype.getSimpleName = function () { + return "keyboard"; + }; + __decorate([ + BABYLON.serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysUp", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysDown", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysLeft", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysRight", void 0); + return FreeCameraKeyboardMoveInput; + }()); + BABYLON.FreeCameraKeyboardMoveInput = FreeCameraKeyboardMoveInput; + BABYLON.CameraInputTypes["FreeCameraKeyboardMoveInput"] = FreeCameraKeyboardMoveInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freeCameraKeyboardMoveInput.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Default Inputs manager for the FreeCamera. + * It groups all the default supported inputs for ease of use. + * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs + */ + var FreeCameraInputsManager = /** @class */ (function (_super) { + __extends(FreeCameraInputsManager, _super); + /** + * Instantiates a new FreeCameraInputsManager. + * @param camera Defines the camera the inputs belong to + */ + function FreeCameraInputsManager(camera) { + return _super.call(this, camera) || this; + } + /** + * Add keyboard input support to the input manager. + * @returns the current input manager + */ + FreeCameraInputsManager.prototype.addKeyboard = function () { + this.add(new BABYLON.FreeCameraKeyboardMoveInput()); + return this; + }; + /** + * Add mouse input support to the input manager. + * @param touchEnabled if the FreeCameraMouseInput should support touch (default: true) + * @returns the current input manager + */ + FreeCameraInputsManager.prototype.addMouse = function (touchEnabled) { + if (touchEnabled === void 0) { touchEnabled = true; } + this.add(new BABYLON.FreeCameraMouseInput(touchEnabled)); + return this; + }; + /** + * Add orientation input support to the input manager. + * @returns the current input manager + */ + FreeCameraInputsManager.prototype.addDeviceOrientation = function () { + this.add(new BABYLON.FreeCameraDeviceOrientationInput()); + return this; + }; + /** + * Add touch input support to the input manager. + * @returns the current input manager + */ + FreeCameraInputsManager.prototype.addTouch = function () { + this.add(new BABYLON.FreeCameraTouchInput()); + return this; + }; + /** + * Add virtual joystick input support to the input manager. + * @returns the current input manager + */ + FreeCameraInputsManager.prototype.addVirtualJoystick = function () { + this.add(new BABYLON.FreeCameraVirtualJoystickInput()); + return this; + }; + return FreeCameraInputsManager; + }(BABYLON.CameraInputsManager)); + BABYLON.FreeCameraInputsManager = FreeCameraInputsManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freeCameraInputsManager.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + BABYLON.Node.AddNodeConstructor("FreeCamera", function (name, scene) { + // Forcing to use the Universal camera + return function () { return new BABYLON.UniversalCamera(name, BABYLON.Vector3.Zero(), scene); }; + }); + /** + * This represents a free type of camera. It can be usefull in First Person Shooter game for instance. + * Please consider using the new UniversalCamera instead as it adds more functionality like the gamepad. + * @see http://doc.babylonjs.com/features/cameras#universal-camera + */ + var FreeCamera = /** @class */ (function (_super) { + __extends(FreeCamera, _super); + /** + * Instantiates a Free Camera. + * This represents a free type of camera. It can be usefull in First Person Shooter game for instance. + * Please consider using the new UniversalCamera instead as it adds more functionality like touch to this camera. + * @see http://doc.babylonjs.com/features/cameras#universal-camera + * @param name Define the name of the camera in the scene + * @param position Define the start position of the camera in the scene + * @param scene Define the scene the camera belongs to + * @param setActiveOnSceneIfNoneActive Defines wheter the camera should be marked as active if not other active cameras have been defined + */ + function FreeCamera(name, position, scene, setActiveOnSceneIfNoneActive) { + if (setActiveOnSceneIfNoneActive === void 0) { setActiveOnSceneIfNoneActive = true; } + var _this = _super.call(this, name, position, scene, setActiveOnSceneIfNoneActive) || this; + /** + * Define the collision ellipsoid of the camera. + * This is helpful to simulate a camera body like the player body around the camera + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#arcrotatecamera + */ + _this.ellipsoid = new BABYLON.Vector3(0.5, 1, 0.5); + /** + * Define an offset for the position of the ellipsoid around the camera. + * This can be helpful to determine the center of the body near the gravity center of the body + * instead of its head. + */ + _this.ellipsoidOffset = new BABYLON.Vector3(0, 0, 0); + /** + * Enable or disable collisions of the camera with the rest of the scene objects. + */ + _this.checkCollisions = false; + /** + * Enable or disable gravity on the camera. + */ + _this.applyGravity = false; + _this._needMoveForGravity = false; + _this._oldPosition = BABYLON.Vector3.Zero(); + _this._diffPosition = BABYLON.Vector3.Zero(); + _this._newPosition = BABYLON.Vector3.Zero(); + // Collisions + _this._collisionMask = -1; + _this._onCollisionPositionChange = function (collisionId, newPosition, collidedMesh) { + if (collidedMesh === void 0) { collidedMesh = null; } + //TODO move this to the collision coordinator! + if (_this.getScene().workerCollisions) { + newPosition.multiplyInPlace(_this._collider._radius); + } + var updatePosition = function (newPos) { + _this._newPosition.copyFrom(newPos); + _this._newPosition.subtractToRef(_this._oldPosition, _this._diffPosition); + if (_this._diffPosition.length() > BABYLON.Engine.CollisionsEpsilon) { + _this.position.addInPlace(_this._diffPosition); + if (_this.onCollide && collidedMesh) { + _this.onCollide(collidedMesh); + } + } + }; + updatePosition(newPosition); + }; + _this.inputs = new BABYLON.FreeCameraInputsManager(_this); + _this.inputs.addKeyboard().addMouse(); + return _this; + } + Object.defineProperty(FreeCamera.prototype, "angularSensibility", { + /** + * Gets the input sensibility for a mouse input. (default is 2000.0) + * Higher values reduce sensitivity. + */ + get: function () { + var mouse = this.inputs.attached["mouse"]; + if (mouse) { + return mouse.angularSensibility; + } + return 0; + }, + /** + * Sets the input sensibility for a mouse input. (default is 2000.0) + * Higher values reduce sensitivity. + */ + set: function (value) { + var mouse = this.inputs.attached["mouse"]; + if (mouse) { + mouse.angularSensibility = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FreeCamera.prototype, "keysUp", { + /** + * Gets or Set the list of keyboard keys used to control the forward move of the camera. + */ + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + return keyboard.keysUp; + } + return []; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + keyboard.keysUp = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FreeCamera.prototype, "keysDown", { + /** + * Gets or Set the list of keyboard keys used to control the backward move of the camera. + */ + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + return keyboard.keysDown; + } + return []; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + keyboard.keysDown = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FreeCamera.prototype, "keysLeft", { + /** + * Gets or Set the list of keyboard keys used to control the left strafe move of the camera. + */ + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + return keyboard.keysLeft; + } + return []; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + keyboard.keysLeft = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FreeCamera.prototype, "keysRight", { + /** + * Gets or Set the list of keyboard keys used to control the right strafe move of the camera. + */ + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + return keyboard.keysRight; + } + return []; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + keyboard.keysRight = value; + } + }, + enumerable: true, + configurable: true + }); + /** + * Attached controls to the current camera. + * @param element Defines the element the controls should be listened from + * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) + */ + FreeCamera.prototype.attachControl = function (element, noPreventDefault) { + this.inputs.attachElement(element, noPreventDefault); + }; + /** + * Detach the current controls from the camera. + * The camera will stop reacting to inputs. + * @param element Defines the element to stop listening the inputs from + */ + FreeCamera.prototype.detachControl = function (element) { + this.inputs.detachElement(element); + this.cameraDirection = new BABYLON.Vector3(0, 0, 0); + this.cameraRotation = new BABYLON.Vector2(0, 0); + }; + Object.defineProperty(FreeCamera.prototype, "collisionMask", { + /** + * Define a collision mask to limit the list of object the camera can collide with + */ + get: function () { + return this._collisionMask; + }, + set: function (mask) { + this._collisionMask = !isNaN(mask) ? mask : -1; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + FreeCamera.prototype._collideWithWorld = function (displacement) { + var globalPosition; + if (this.parent) { + globalPosition = BABYLON.Vector3.TransformCoordinates(this.position, this.parent.getWorldMatrix()); + } + else { + globalPosition = this.position; + } + globalPosition.subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition); + this._oldPosition.addInPlace(this.ellipsoidOffset); + if (!this._collider) { + this._collider = new BABYLON.Collider(); + } + this._collider._radius = this.ellipsoid; + this._collider.collisionMask = this._collisionMask; + //no need for clone, as long as gravity is not on. + var actualDisplacement = displacement; + //add gravity to the direction to prevent the dual-collision checking + if (this.applyGravity) { + //this prevents mending with cameraDirection, a global variable of the free camera class. + actualDisplacement = displacement.add(this.getScene().gravity); + } + this.getScene().collisionCoordinator.getNewPosition(this._oldPosition, actualDisplacement, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId); + }; + /** @hidden */ + FreeCamera.prototype._checkInputs = function () { + if (!this._localDirection) { + this._localDirection = BABYLON.Vector3.Zero(); + this._transformedDirection = BABYLON.Vector3.Zero(); + } + this.inputs.checkInputs(); + _super.prototype._checkInputs.call(this); + }; + /** @hidden */ + FreeCamera.prototype._decideIfNeedsToMove = function () { + return this._needMoveForGravity || Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0; + }; + /** @hidden */ + FreeCamera.prototype._updatePosition = function () { + if (this.checkCollisions && this.getScene().collisionsEnabled) { + this._collideWithWorld(this.cameraDirection); + } + else { + _super.prototype._updatePosition.call(this); + } + }; + /** + * Destroy the camera and release the current resources hold by it. + */ + FreeCamera.prototype.dispose = function () { + this.inputs.clear(); + _super.prototype.dispose.call(this); + }; + /** + * Gets the current object class name. + * @return the class name + */ + FreeCamera.prototype.getClassName = function () { + return "FreeCamera"; + }; + __decorate([ + BABYLON.serializeAsVector3() + ], FreeCamera.prototype, "ellipsoid", void 0); + __decorate([ + BABYLON.serializeAsVector3() + ], FreeCamera.prototype, "ellipsoidOffset", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCamera.prototype, "checkCollisions", void 0); + __decorate([ + BABYLON.serialize() + ], FreeCamera.prototype, "applyGravity", void 0); + return FreeCamera; + }(BABYLON.TargetCamera)); + BABYLON.FreeCamera = FreeCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.freeCamera.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Manage the keyboard inputs to control the movement of an arc rotate camera. + * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs + */ + var ArcRotateCameraKeyboardMoveInput = /** @class */ (function () { + function ArcRotateCameraKeyboardMoveInput() { + /** + * Defines the list of key codes associated with the up action (increase alpha) + */ + this.keysUp = [38]; + /** + * Defines the list of key codes associated with the down action (decrease alpha) + */ + this.keysDown = [40]; + /** + * Defines the list of key codes associated with the left action (increase beta) + */ + this.keysLeft = [37]; + /** + * Defines the list of key codes associated with the right action (decrease beta) + */ + this.keysRight = [39]; + /** + * Defines the list of key codes associated with the reset action. + * Those keys reset the camera to its last stored state (with the method camera.storeState()) + */ + this.keysReset = [220]; + /** + * Defines the panning sensibility of the inputs. + * (How fast is the camera paning) + */ + this.panningSensibility = 50.0; + /** + * Defines the zooming sensibility of the inputs. + * (How fast is the camera zooming) + */ + this.zoomingSensibility = 25.0; + /** + * Defines wether maintaining the alt key down switch the movement mode from + * orientation to zoom. + */ + this.useAltToZoom = true; + /** + * Rotation speed of the camera + */ + this.angularSpeed = 0.01; + this._keys = new Array(); + } + /** + * Attach the input controls to a specific dom element to get the input from. + * @param element Defines the element the controls should be listened from + * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) + */ + ArcRotateCameraKeyboardMoveInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + if (this._onCanvasBlurObserver) { + return; + } + this._scene = this.camera.getScene(); + this._engine = this._scene.getEngine(); + this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function () { + _this._keys = []; + }); + this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function (info) { + var evt = info.event; + if (info.type === BABYLON.KeyboardEventTypes.KEYDOWN) { + _this._ctrlPressed = evt.ctrlKey; + _this._altPressed = evt.altKey; + if (_this.keysUp.indexOf(evt.keyCode) !== -1 || + _this.keysDown.indexOf(evt.keyCode) !== -1 || + _this.keysLeft.indexOf(evt.keyCode) !== -1 || + _this.keysRight.indexOf(evt.keyCode) !== -1 || + _this.keysReset.indexOf(evt.keyCode) !== -1) { + var index = _this._keys.indexOf(evt.keyCode); + if (index === -1) { + _this._keys.push(evt.keyCode); + } + if (evt.preventDefault) { + if (!noPreventDefault) { + evt.preventDefault(); + } + } + } + } + else { + if (_this.keysUp.indexOf(evt.keyCode) !== -1 || + _this.keysDown.indexOf(evt.keyCode) !== -1 || + _this.keysLeft.indexOf(evt.keyCode) !== -1 || + _this.keysRight.indexOf(evt.keyCode) !== -1 || + _this.keysReset.indexOf(evt.keyCode) !== -1) { + var index = _this._keys.indexOf(evt.keyCode); + if (index >= 0) { + _this._keys.splice(index, 1); + } + if (evt.preventDefault) { + if (!noPreventDefault) { + evt.preventDefault(); + } + } + } + } + }); + }; + /** + * Detach the current controls from the specified dom element. + * @param element Defines the element to stop listening the inputs from + */ + ArcRotateCameraKeyboardMoveInput.prototype.detachControl = function (element) { + if (this._scene) { + if (this._onKeyboardObserver) { + this._scene.onKeyboardObservable.remove(this._onKeyboardObserver); + } + if (this._onCanvasBlurObserver) { + this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver); + } + this._onKeyboardObserver = null; + this._onCanvasBlurObserver = null; + } + this._keys = []; + }; + /** + * Update the current camera state depending on the inputs that have been used this frame. + * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop. + */ + ArcRotateCameraKeyboardMoveInput.prototype.checkInputs = function () { + if (this._onKeyboardObserver) { + var camera = this.camera; + for (var index = 0; index < this._keys.length; index++) { + var keyCode = this._keys[index]; + if (this.keysLeft.indexOf(keyCode) !== -1) { + if (this._ctrlPressed && this.camera._useCtrlForPanning) { + camera.inertialPanningX -= 1 / this.panningSensibility; + } + else { + camera.inertialAlphaOffset -= this.angularSpeed; + } + } + else if (this.keysUp.indexOf(keyCode) !== -1) { + if (this._ctrlPressed && this.camera._useCtrlForPanning) { + camera.inertialPanningY += 1 / this.panningSensibility; + } + else if (this._altPressed && this.useAltToZoom) { + camera.inertialRadiusOffset += 1 / this.zoomingSensibility; + } + else { + camera.inertialBetaOffset -= this.angularSpeed; + } + } + else if (this.keysRight.indexOf(keyCode) !== -1) { + if (this._ctrlPressed && this.camera._useCtrlForPanning) { + camera.inertialPanningX += 1 / this.panningSensibility; + } + else { + camera.inertialAlphaOffset += this.angularSpeed; + } + } + else if (this.keysDown.indexOf(keyCode) !== -1) { + if (this._ctrlPressed && this.camera._useCtrlForPanning) { + camera.inertialPanningY -= 1 / this.panningSensibility; + } + else if (this._altPressed && this.useAltToZoom) { + camera.inertialRadiusOffset -= 1 / this.zoomingSensibility; + } + else { + camera.inertialBetaOffset += this.angularSpeed; + } + } + else if (this.keysReset.indexOf(keyCode) !== -1) { + if (camera.useInputToRestoreState) { + camera.restoreState(); + } + } + } + } + }; + /** + * Gets the class name of the current intput. + * @returns the class name + */ + ArcRotateCameraKeyboardMoveInput.prototype.getClassName = function () { + return "ArcRotateCameraKeyboardMoveInput"; + }; + /** + * Get the friendly name associated with the input class. + * @returns the input friendly name + */ + ArcRotateCameraKeyboardMoveInput.prototype.getSimpleName = function () { + return "keyboard"; + }; + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysUp", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysDown", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysLeft", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysRight", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysReset", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "panningSensibility", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "zoomingSensibility", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "useAltToZoom", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "angularSpeed", void 0); + return ArcRotateCameraKeyboardMoveInput; + }()); + BABYLON.ArcRotateCameraKeyboardMoveInput = ArcRotateCameraKeyboardMoveInput; + BABYLON.CameraInputTypes["ArcRotateCameraKeyboardMoveInput"] = ArcRotateCameraKeyboardMoveInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcRotateCameraKeyboardMoveInput.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Manage the mouse wheel inputs to control an arc rotate camera. + * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs + */ + var ArcRotateCameraMouseWheelInput = /** @class */ (function () { + function ArcRotateCameraMouseWheelInput() { + /** + * Gets or Set the mouse wheel precision or how fast is the camera zooming. + */ + this.wheelPrecision = 3.0; + /** + * wheelDeltaPercentage will be used instead of wheelPrecision if different from 0. + * It defines the percentage of current camera.radius to use as delta when wheel is used. + */ + this.wheelDeltaPercentage = 0; + } + /** + * Attach the input controls to a specific dom element to get the input from. + * @param element Defines the element the controls should be listened from + * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) + */ + ArcRotateCameraMouseWheelInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + this._wheel = function (p, s) { + //sanity check - this should be a PointerWheel event. + if (p.type !== BABYLON.PointerEventTypes.POINTERWHEEL) { + return; + } + var event = p.event; + var delta = 0; + if (event.wheelDelta) { + if (_this.wheelDeltaPercentage) { + var wheelDelta = (event.wheelDelta * 0.01 * _this.wheelDeltaPercentage) * _this.camera.radius; + if (event.wheelDelta > 0) { + delta = wheelDelta / (1.0 + _this.wheelDeltaPercentage); + } + else { + delta = wheelDelta * (1.0 + _this.wheelDeltaPercentage); + } + } + else { + delta = event.wheelDelta / (_this.wheelPrecision * 40); + } + } + else if (event.detail) { + delta = -event.detail / _this.wheelPrecision; + } + if (delta) { + _this.camera.inertialRadiusOffset += delta; + } + if (event.preventDefault) { + if (!noPreventDefault) { + event.preventDefault(); + } + } + }; + this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, BABYLON.PointerEventTypes.POINTERWHEEL); + }; + /** + * Detach the current controls from the specified dom element. + * @param element Defines the element to stop listening the inputs from + */ + ArcRotateCameraMouseWheelInput.prototype.detachControl = function (element) { + if (this._observer && element) { + this.camera.getScene().onPointerObservable.remove(this._observer); + this._observer = null; + this._wheel = null; + } + }; + /** + * Gets the class name of the current intput. + * @returns the class name + */ + ArcRotateCameraMouseWheelInput.prototype.getClassName = function () { + return "ArcRotateCameraMouseWheelInput"; + }; + /** + * Get the friendly name associated with the input class. + * @returns the input friendly name + */ + ArcRotateCameraMouseWheelInput.prototype.getSimpleName = function () { + return "mousewheel"; + }; + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraMouseWheelInput.prototype, "wheelPrecision", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraMouseWheelInput.prototype, "wheelDeltaPercentage", void 0); + return ArcRotateCameraMouseWheelInput; + }()); + BABYLON.ArcRotateCameraMouseWheelInput = ArcRotateCameraMouseWheelInput; + BABYLON.CameraInputTypes["ArcRotateCameraMouseWheelInput"] = ArcRotateCameraMouseWheelInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcRotateCameraMouseWheelInput.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Manage the pointers inputs to control an arc rotate camera. + * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs + */ + var ArcRotateCameraPointersInput = /** @class */ (function () { + function ArcRotateCameraPointersInput() { + /** + * Defines the buttons associated with the input to handle camera move. + */ + this.buttons = [0, 1, 2]; + /** + * Defines the pointer angular sensibility along the X axis or how fast is the camera rotating. + */ + this.angularSensibilityX = 1000.0; + /** + * Defines the pointer angular sensibility along the Y axis or how fast is the camera rotating. + */ + this.angularSensibilityY = 1000.0; + /** + * Defines the pointer pinch precision or how fast is the camera zooming. + */ + this.pinchPrecision = 12.0; + /** + * pinchDeltaPercentage will be used instead of pinchPrecision if different from 0. + * It defines the percentage of current camera.radius to use as delta when pinch zoom is used. + */ + this.pinchDeltaPercentage = 0; + /** + * Defines the pointer panning sensibility or how fast is the camera moving. + */ + this.panningSensibility = 1000.0; + /** + * Defines whether panning (2 fingers swipe) is enabled through multitouch. + */ + this.multiTouchPanning = true; + /** + * Defines whether panning is enabled for both pan (2 fingers swipe) and zoom (pinch) through multitouch. + */ + this.multiTouchPanAndZoom = true; + /** + * Revers pinch action direction. + */ + this.pinchInwards = true; + this._isPanClick = false; + } + /** + * Attach the input controls to a specific dom element to get the input from. + * @param element Defines the element the controls should be listened from + * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) + */ + ArcRotateCameraPointersInput.prototype.attachControl = function (element, noPreventDefault) { + var _this = this; + var engine = this.camera.getEngine(); + var cacheSoloPointer; // cache pointer object for better perf on camera rotation + var pointA = null; + var pointB = null; + var previousPinchSquaredDistance = 0; + var initialDistance = 0; + var twoFingerActivityCount = 0; + var previousMultiTouchPanPosition = { x: 0, y: 0, isPaning: false, isPinching: false }; + this._pointerInput = function (p, s) { + var evt = p.event; + var isTouch = p.event.pointerType === "touch"; + if (engine.isInVRExclusivePointerMode) { + return; + } + if (p.type !== BABYLON.PointerEventTypes.POINTERMOVE && _this.buttons.indexOf(evt.button) === -1) { + return; + } + var srcElement = (evt.srcElement || evt.target); + if (p.type === BABYLON.PointerEventTypes.POINTERDOWN && srcElement) { + try { + srcElement.setPointerCapture(evt.pointerId); + } + catch (e) { + //Nothing to do with the error. Execution will continue. + } + // Manage panning with pan button click + _this._isPanClick = evt.button === _this.camera._panningMouseButton; + // manage pointers + cacheSoloPointer = { x: evt.clientX, y: evt.clientY, pointerId: evt.pointerId, type: evt.pointerType }; + if (pointA === null) { + pointA = cacheSoloPointer; + } + else if (pointB === null) { + pointB = cacheSoloPointer; + } + if (!noPreventDefault) { + evt.preventDefault(); + element.focus(); + } + } + else if (p.type === BABYLON.PointerEventTypes.POINTERDOUBLETAP) { + if (_this.camera.useInputToRestoreState) { + _this.camera.restoreState(); + } + } + else if (p.type === BABYLON.PointerEventTypes.POINTERUP && srcElement) { + try { + srcElement.releasePointerCapture(evt.pointerId); + } + catch (e) { + //Nothing to do with the error. + } + cacheSoloPointer = null; + previousPinchSquaredDistance = 0; + previousMultiTouchPanPosition.isPaning = false; + previousMultiTouchPanPosition.isPinching = false; + twoFingerActivityCount = 0; + initialDistance = 0; + if (!isTouch) { + pointB = null; // Mouse and pen are mono pointer + } + //would be better to use pointers.remove(evt.pointerId) for multitouch gestures, + //but emptying completly pointers collection is required to fix a bug on iPhone : + //when changing orientation while pinching camera, one pointer stay pressed forever if we don't release all pointers + //will be ok to put back pointers.remove(evt.pointerId); when iPhone bug corrected + if (engine._badOS) { + pointA = pointB = null; + } + else { + //only remove the impacted pointer in case of multitouch allowing on most + //platforms switching from rotate to zoom and pan seamlessly. + if (pointB && pointA && pointA.pointerId == evt.pointerId) { + pointA = pointB; + pointB = null; + cacheSoloPointer = { x: pointA.x, y: pointA.y, pointerId: pointA.pointerId, type: evt.pointerType }; + } + else if (pointA && pointB && pointB.pointerId == evt.pointerId) { + pointB = null; + cacheSoloPointer = { x: pointA.x, y: pointA.y, pointerId: pointA.pointerId, type: evt.pointerType }; + } + else { + pointA = pointB = null; + } + } + if (!noPreventDefault) { + evt.preventDefault(); + } + } + else if (p.type === BABYLON.PointerEventTypes.POINTERMOVE) { + if (!noPreventDefault) { + evt.preventDefault(); + } + // One button down + if (pointA && pointB === null && cacheSoloPointer) { + if (_this.panningSensibility !== 0 && + ((evt.ctrlKey && _this.camera._useCtrlForPanning) || _this._isPanClick)) { + _this.camera.inertialPanningX += -(evt.clientX - cacheSoloPointer.x) / _this.panningSensibility; + _this.camera.inertialPanningY += (evt.clientY - cacheSoloPointer.y) / _this.panningSensibility; + } + else { + var offsetX = evt.clientX - cacheSoloPointer.x; + var offsetY = evt.clientY - cacheSoloPointer.y; + _this.camera.inertialAlphaOffset -= offsetX / _this.angularSensibilityX; + _this.camera.inertialBetaOffset -= offsetY / _this.angularSensibilityY; + } + cacheSoloPointer.x = evt.clientX; + cacheSoloPointer.y = evt.clientY; + } + // Two buttons down: pinch/pan + else if (pointA && pointB) { + //if (noPreventDefault) { evt.preventDefault(); } //if pinch gesture, could be useful to force preventDefault to avoid html page scroll/zoom in some mobile browsers + var ed = (pointA.pointerId === evt.pointerId) ? pointA : pointB; + ed.x = evt.clientX; + ed.y = evt.clientY; + var direction = _this.pinchInwards ? 1 : -1; + var distX = pointA.x - pointB.x; + var distY = pointA.y - pointB.y; + var pinchSquaredDistance = (distX * distX) + (distY * distY); + var pinchDistance = Math.sqrt(pinchSquaredDistance); + if (previousPinchSquaredDistance === 0) { + initialDistance = pinchDistance; + previousPinchSquaredDistance = pinchSquaredDistance; + previousMultiTouchPanPosition.x = (pointA.x + pointB.x) / 2; + previousMultiTouchPanPosition.y = (pointA.y + pointB.y) / 2; + return; + } + if (_this.multiTouchPanAndZoom) { + if (_this.pinchDeltaPercentage) { + _this.camera.inertialRadiusOffset += ((pinchSquaredDistance - previousPinchSquaredDistance) * 0.001) * _this.camera.radius * _this.pinchDeltaPercentage; + } + else { + _this.camera.inertialRadiusOffset += (pinchSquaredDistance - previousPinchSquaredDistance) / + (_this.pinchPrecision * + ((_this.angularSensibilityX + _this.angularSensibilityY) / 2) * + direction); + } + if (_this.panningSensibility !== 0) { + var pointersCenterX = (pointA.x + pointB.x) / 2; + var pointersCenterY = (pointA.y + pointB.y) / 2; + var pointersCenterDistX = pointersCenterX - previousMultiTouchPanPosition.x; + var pointersCenterDistY = pointersCenterY - previousMultiTouchPanPosition.y; + previousMultiTouchPanPosition.x = pointersCenterX; + previousMultiTouchPanPosition.y = pointersCenterY; + _this.camera.inertialPanningX += -(pointersCenterDistX) / (_this.panningSensibility); + _this.camera.inertialPanningY += (pointersCenterDistY) / (_this.panningSensibility); + } + } + else { + twoFingerActivityCount++; + if (previousMultiTouchPanPosition.isPinching || (twoFingerActivityCount < 20 && Math.abs(pinchDistance - initialDistance) > _this.camera.pinchToPanMaxDistance)) { + if (_this.pinchDeltaPercentage) { + _this.camera.inertialRadiusOffset += ((pinchSquaredDistance - previousPinchSquaredDistance) * 0.001) * _this.camera.radius * _this.pinchDeltaPercentage; + } + else { + _this.camera.inertialRadiusOffset += (pinchSquaredDistance - previousPinchSquaredDistance) / + (_this.pinchPrecision * + ((_this.angularSensibilityX + _this.angularSensibilityY) / 2) * + direction); + } + previousMultiTouchPanPosition.isPaning = false; + previousMultiTouchPanPosition.isPinching = true; + } + else { + if (cacheSoloPointer && cacheSoloPointer.pointerId === ed.pointerId && _this.panningSensibility !== 0 && _this.multiTouchPanning) { + if (!previousMultiTouchPanPosition.isPaning) { + previousMultiTouchPanPosition.isPaning = true; + previousMultiTouchPanPosition.isPinching = false; + previousMultiTouchPanPosition.x = ed.x; + previousMultiTouchPanPosition.y = ed.y; + return; + } + _this.camera.inertialPanningX += -(ed.x - previousMultiTouchPanPosition.x) / (_this.panningSensibility); + _this.camera.inertialPanningY += (ed.y - previousMultiTouchPanPosition.y) / (_this.panningSensibility); + } + } + if (cacheSoloPointer && cacheSoloPointer.pointerId === evt.pointerId) { + previousMultiTouchPanPosition.x = ed.x; + previousMultiTouchPanPosition.y = ed.y; + } + } + previousPinchSquaredDistance = pinchSquaredDistance; + } + } + }; + this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, BABYLON.PointerEventTypes.POINTERDOWN | BABYLON.PointerEventTypes.POINTERUP | BABYLON.PointerEventTypes.POINTERMOVE | BABYLON.PointerEventTypes.POINTERDOUBLETAP); + this._onContextMenu = function (evt) { + evt.preventDefault(); + }; + if (!this.camera._useCtrlForPanning) { + element.addEventListener("contextmenu", this._onContextMenu, false); + } + this._onLostFocus = function () { + //this._keys = []; + pointA = pointB = null; + previousPinchSquaredDistance = 0; + previousMultiTouchPanPosition.isPaning = false; + previousMultiTouchPanPosition.isPinching = false; + twoFingerActivityCount = 0; + cacheSoloPointer = null; + initialDistance = 0; + }; + this._onMouseMove = function (evt) { + if (!engine.isPointerLock) { + return; + } + var offsetX = evt.movementX || evt.mozMovementX || evt.webkitMovementX || evt.msMovementX || 0; + var offsetY = evt.movementY || evt.mozMovementY || evt.webkitMovementY || evt.msMovementY || 0; + _this.camera.inertialAlphaOffset -= offsetX / _this.angularSensibilityX; + _this.camera.inertialBetaOffset -= offsetY / _this.angularSensibilityY; + if (!noPreventDefault) { + evt.preventDefault(); + } + }; + this._onGestureStart = function (e) { + if (window.MSGesture === undefined) { + return; + } + if (!_this._MSGestureHandler) { + _this._MSGestureHandler = new MSGesture(); + _this._MSGestureHandler.target = element; + } + _this._MSGestureHandler.addPointer(e.pointerId); + }; + this._onGesture = function (e) { + _this.camera.radius *= e.scale; + if (e.preventDefault) { + if (!noPreventDefault) { + e.stopPropagation(); + e.preventDefault(); + } + } + }; + element.addEventListener("mousemove", this._onMouseMove, false); + element.addEventListener("MSPointerDown", this._onGestureStart, false); + element.addEventListener("MSGestureChange", this._onGesture, false); + BABYLON.Tools.RegisterTopRootEvents([ + { name: "blur", handler: this._onLostFocus } + ]); + }; + /** + * Detach the current controls from the specified dom element. + * @param element Defines the element to stop listening the inputs from + */ + ArcRotateCameraPointersInput.prototype.detachControl = function (element) { + if (this._onLostFocus) { + BABYLON.Tools.UnregisterTopRootEvents([ + { name: "blur", handler: this._onLostFocus } + ]); + } + if (element && this._observer) { + this.camera.getScene().onPointerObservable.remove(this._observer); + this._observer = null; + if (this._onContextMenu) { + element.removeEventListener("contextmenu", this._onContextMenu); + } + if (this._onMouseMove) { + element.removeEventListener("mousemove", this._onMouseMove); + } + if (this._onGestureStart) { + element.removeEventListener("MSPointerDown", this._onGestureStart); + } + if (this._onGesture) { + element.removeEventListener("MSGestureChange", this._onGesture); + } + this._isPanClick = false; + this.pinchInwards = true; + this._onMouseMove = null; + this._onGestureStart = null; + this._onGesture = null; + this._MSGestureHandler = null; + this._onLostFocus = null; + this._onContextMenu = null; + } + }; + /** + * Gets the class name of the current intput. + * @returns the class name + */ + ArcRotateCameraPointersInput.prototype.getClassName = function () { + return "ArcRotateCameraPointersInput"; + }; + /** + * Get the friendly name associated with the input class. + * @returns the input friendly name + */ + ArcRotateCameraPointersInput.prototype.getSimpleName = function () { + return "pointers"; + }; + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "buttons", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "angularSensibilityX", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "angularSensibilityY", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "pinchPrecision", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "pinchDeltaPercentage", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "panningSensibility", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "multiTouchPanning", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCameraPointersInput.prototype, "multiTouchPanAndZoom", void 0); + return ArcRotateCameraPointersInput; + }()); + BABYLON.ArcRotateCameraPointersInput = ArcRotateCameraPointersInput; + BABYLON.CameraInputTypes["ArcRotateCameraPointersInput"] = ArcRotateCameraPointersInput; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcRotateCameraPointersInput.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Default Inputs manager for the ArcRotateCamera. + * It groups all the default supported inputs for ease of use. + * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs + */ + var ArcRotateCameraInputsManager = /** @class */ (function (_super) { + __extends(ArcRotateCameraInputsManager, _super); + /** + * Instantiates a new ArcRotateCameraInputsManager. + * @param camera Defines the camera the inputs belong to + */ + function ArcRotateCameraInputsManager(camera) { + return _super.call(this, camera) || this; + } + /** + * Add mouse wheel input support to the input manager. + * @returns the current input manager + */ + ArcRotateCameraInputsManager.prototype.addMouseWheel = function () { + this.add(new BABYLON.ArcRotateCameraMouseWheelInput()); + return this; + }; + /** + * Add pointers input support to the input manager. + * @returns the current input manager + */ + ArcRotateCameraInputsManager.prototype.addPointers = function () { + this.add(new BABYLON.ArcRotateCameraPointersInput()); + return this; + }; + /** + * Add keyboard input support to the input manager. + * @returns the current input manager + */ + ArcRotateCameraInputsManager.prototype.addKeyboard = function () { + this.add(new BABYLON.ArcRotateCameraKeyboardMoveInput()); + return this; + }; + /** + * Add orientation input support to the input manager. + * @returns the current input manager + */ + ArcRotateCameraInputsManager.prototype.addVRDeviceOrientation = function () { + this.add(new BABYLON.ArcRotateCameraVRDeviceOrientationInput()); + return this; + }; + return ArcRotateCameraInputsManager; + }(BABYLON.CameraInputsManager)); + BABYLON.ArcRotateCameraInputsManager = ArcRotateCameraInputsManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcRotateCameraInputsManager.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + BABYLON.Node.AddNodeConstructor("ArcRotateCamera", function (name, scene) { + return function () { return new ArcRotateCamera(name, 0, 0, 1.0, BABYLON.Vector3.Zero(), scene); }; + }); + /** + * This represents an orbital type of camera. + * + * This camera always points towards a given target position and can be rotated around that target with the target as the centre of rotation. It can be controlled with cursors and mouse, or with touch events. + * Think of this camera as one orbiting its target position, or more imaginatively as a spy satellite orbiting the earth. Its position relative to the target (earth) can be set by three parameters, alpha (radians) the longitudinal rotation, beta (radians) the latitudinal rotation and radius the distance from the target position. + * @see http://doc.babylonjs.com/babylon101/cameras#arc-rotate-camera + */ + var ArcRotateCamera = /** @class */ (function (_super) { + __extends(ArcRotateCamera, _super); + /** + * Instantiates a new ArcRotateCamera in a given scene + * @param name Defines the name of the camera + * @param alpha Defines the camera rotation along the logitudinal axis + * @param beta Defines the camera rotation along the latitudinal axis + * @param radius Defines the camera distance from its target + * @param target Defines the camera target + * @param scene Defines the scene the camera belongs to + * @param setActiveOnSceneIfNoneActive Defines wheter the camera should be marked as active if not other active cameras have been defined + */ + function ArcRotateCamera(name, alpha, beta, radius, target, scene, setActiveOnSceneIfNoneActive) { + if (setActiveOnSceneIfNoneActive === void 0) { setActiveOnSceneIfNoneActive = true; } + var _this = _super.call(this, name, BABYLON.Vector3.Zero(), scene, setActiveOnSceneIfNoneActive) || this; + /** + * Current inertia value on the longitudinal axis. + * The bigger this number the longer it will take for the camera to stop. + */ + _this.inertialAlphaOffset = 0; + /** + * Current inertia value on the latitudinal axis. + * The bigger this number the longer it will take for the camera to stop. + */ + _this.inertialBetaOffset = 0; + /** + * Current inertia value on the radius axis. + * The bigger this number the longer it will take for the camera to stop. + */ + _this.inertialRadiusOffset = 0; + /** + * Minimum allowed angle on the longitudinal axis. + * This can help limiting how the Camera is able to move in the scene. + */ + _this.lowerAlphaLimit = null; + /** + * Maximum allowed angle on the longitudinal axis. + * This can help limiting how the Camera is able to move in the scene. + */ + _this.upperAlphaLimit = null; + /** + * Minimum allowed angle on the latitudinal axis. + * This can help limiting how the Camera is able to move in the scene. + */ + _this.lowerBetaLimit = 0.01; + /** + * Maximum allowed angle on the latitudinal axis. + * This can help limiting how the Camera is able to move in the scene. + */ + _this.upperBetaLimit = Math.PI; + /** + * Minimum allowed distance of the camera to the target (The camera can not get closer). + * This can help limiting how the Camera is able to move in the scene. + */ + _this.lowerRadiusLimit = null; + /** + * Maximum allowed distance of the camera to the target (The camera can not get further). + * This can help limiting how the Camera is able to move in the scene. + */ + _this.upperRadiusLimit = null; + /** + * Defines the current inertia value used during panning of the camera along the X axis. + */ + _this.inertialPanningX = 0; + /** + * Defines the current inertia value used during panning of the camera along the Y axis. + */ + _this.inertialPanningY = 0; + /** + * Defines the distance used to consider the camera in pan mode vs pinch/zoom. + * Basically if your fingers moves away from more than this distance you will be considered + * in pinch mode. + */ + _this.pinchToPanMaxDistance = 20; + /** + * Defines the maximum distance the camera can pan. + * This could help keeping the cammera always in your scene. + */ + _this.panningDistanceLimit = null; + /** + * Defines the target of the camera before paning. + */ + _this.panningOriginTarget = BABYLON.Vector3.Zero(); + /** + * Defines the value of the inertia used during panning. + * 0 would mean stop inertia and one would mean no decelleration at all. + */ + _this.panningInertia = 0.9; + //-- end properties for backward compatibility for inputs + /** + * Defines how much the radius should be scaled while zomming on a particular mesh (through the zoomOn function) + */ + _this.zoomOnFactor = 1; + /** + * Defines a screen offset for the camera position. + */ + _this.targetScreenOffset = BABYLON.Vector2.Zero(); + /** + * Allows the camera to be completely reversed. + * If false the camera can not arrive upside down. + */ + _this.allowUpsideDown = true; + /** + * Define if double tap/click is used to restore the previously saved state of the camera. + */ + _this.useInputToRestoreState = true; + /** @hidden */ + _this._viewMatrix = new BABYLON.Matrix(); + /** + * Defines the allowed panning axis. + */ + _this.panningAxis = new BABYLON.Vector3(1, 1, 0); + /** + * Observable triggered when the mesh target has been changed on the camera. + */ + _this.onMeshTargetChangedObservable = new BABYLON.Observable(); + /** + * Defines whether the camera should check collision with the objects oh the scene. + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#how-can-i-do-this + */ + _this.checkCollisions = false; + /** + * Defines the collision radius of the camera. + * This simulates a sphere around the camera. + * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#arcrotatecamera + */ + _this.collisionRadius = new BABYLON.Vector3(0.5, 0.5, 0.5); + _this._previousPosition = BABYLON.Vector3.Zero(); + _this._collisionVelocity = BABYLON.Vector3.Zero(); + _this._newPosition = BABYLON.Vector3.Zero(); + _this._computationVector = BABYLON.Vector3.Zero(); + _this._onCollisionPositionChange = function (collisionId, newPosition, collidedMesh) { + if (collidedMesh === void 0) { collidedMesh = null; } + if (_this.getScene().workerCollisions && _this.checkCollisions) { + newPosition.multiplyInPlace(_this._collider._radius); + } + if (!collidedMesh) { + _this._previousPosition.copyFrom(_this.position); + } + else { + _this.setPosition(newPosition); + if (_this.onCollide) { + _this.onCollide(collidedMesh); + } + } + // Recompute because of constraints + var cosa = Math.cos(_this.alpha); + var sina = Math.sin(_this.alpha); + var cosb = Math.cos(_this.beta); + var sinb = Math.sin(_this.beta); + if (sinb === 0) { + sinb = 0.0001; + } + var target = _this._getTargetPosition(); + _this._computationVector.copyFromFloats(_this.radius * cosa * sinb, _this.radius * cosb, _this.radius * sina * sinb); + target.addToRef(_this._computationVector, _this._newPosition); + _this.position.copyFrom(_this._newPosition); + var up = _this.upVector; + if (_this.allowUpsideDown && _this.beta < 0) { + up = up.clone(); + up = up.negate(); + } + _this._computeViewMatrix(_this.position, target, up); + _this._viewMatrix.m[12] += _this.targetScreenOffset.x; + _this._viewMatrix.m[13] += _this.targetScreenOffset.y; + _this._collisionTriggered = false; + }; + _this._target = BABYLON.Vector3.Zero(); + if (target) { + _this.setTarget(target); + } + _this.alpha = alpha; + _this.beta = beta; + _this.radius = radius; + _this.getViewMatrix(); + _this.inputs = new BABYLON.ArcRotateCameraInputsManager(_this); + _this.inputs.addKeyboard().addMouseWheel().addPointers(); + return _this; + } + Object.defineProperty(ArcRotateCamera.prototype, "target", { + /** + * Defines the target point of the camera. + * The camera looks towards it form the radius distance. + */ + get: function () { + return this._target; + }, + set: function (value) { + this.setTarget(value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "angularSensibilityX", { + //-- begin properties for backward compatibility for inputs + /** + * Gets or Set the pointer angular sensibility along the X axis or how fast is the camera rotating. + */ + get: function () { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + return pointers.angularSensibilityX; + } + return 0; + }, + set: function (value) { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + pointers.angularSensibilityX = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "angularSensibilityY", { + /** + * Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating. + */ + get: function () { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + return pointers.angularSensibilityY; + } + return 0; + }, + set: function (value) { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + pointers.angularSensibilityY = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "pinchPrecision", { + /** + * Gets or Set the pointer pinch precision or how fast is the camera zooming. + */ + get: function () { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + return pointers.pinchPrecision; + } + return 0; + }, + set: function (value) { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + pointers.pinchPrecision = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "pinchDeltaPercentage", { + /** + * Gets or Set the pointer pinch delta percentage or how fast is the camera zooming. + * It will be used instead of pinchDeltaPrecision if different from 0. + * It defines the percentage of current camera.radius to use as delta when pinch zoom is used. + */ + get: function () { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + return pointers.pinchDeltaPercentage; + } + return 0; + }, + set: function (value) { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + pointers.pinchDeltaPercentage = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "panningSensibility", { + /** + * Gets or Set the pointer panning sensibility or how fast is the camera moving. + */ + get: function () { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + return pointers.panningSensibility; + } + return 0; + }, + set: function (value) { + var pointers = this.inputs.attached["pointers"]; + if (pointers) { + pointers.panningSensibility = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "keysUp", { + /** + * Gets or Set the list of keyboard keys used to control beta angle in a positive direction. + */ + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + return keyboard.keysUp; + } + return []; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + keyboard.keysUp = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "keysDown", { + /** + * Gets or Set the list of keyboard keys used to control beta angle in a negative direction. + */ + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + return keyboard.keysDown; + } + return []; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + keyboard.keysDown = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "keysLeft", { + /** + * Gets or Set the list of keyboard keys used to control alpha angle in a negative direction. + */ + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + return keyboard.keysLeft; + } + return []; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + keyboard.keysLeft = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "keysRight", { + /** + * Gets or Set the list of keyboard keys used to control alpha angle in a positive direction. + */ + get: function () { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + return keyboard.keysRight; + } + return []; + }, + set: function (value) { + var keyboard = this.inputs.attached["keyboard"]; + if (keyboard) { + keyboard.keysRight = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "wheelPrecision", { + /** + * Gets or Set the mouse wheel precision or how fast is the camera zooming. + */ + get: function () { + var mousewheel = this.inputs.attached["mousewheel"]; + if (mousewheel) { + return mousewheel.wheelPrecision; + } + return 0; + }, + set: function (value) { + var mousewheel = this.inputs.attached["mousewheel"]; + if (mousewheel) { + mousewheel.wheelPrecision = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "wheelDeltaPercentage", { + /** + * Gets or Set the mouse wheel delta percentage or how fast is the camera zooming. + * It will be used instead of pinchDeltaPrecision if different from 0. + * It defines the percentage of current camera.radius to use as delta when pinch zoom is used. + */ + get: function () { + var mousewheel = this.inputs.attached["mousewheel"]; + if (mousewheel) { + return mousewheel.wheelDeltaPercentage; + } + return 0; + }, + set: function (value) { + var mousewheel = this.inputs.attached["mousewheel"]; + if (mousewheel) { + mousewheel.wheelDeltaPercentage = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "bouncingBehavior", { + /** + * Gets the bouncing behavior of the camera if it has been enabled. + * @see http://doc.babylonjs.com/how_to/camera_behaviors#bouncing-behavior + */ + get: function () { + return this._bouncingBehavior; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "useBouncingBehavior", { + /** + * Defines if the bouncing behavior of the camera is enabled on the camera. + * @see http://doc.babylonjs.com/how_to/camera_behaviors#bouncing-behavior + */ + get: function () { + return this._bouncingBehavior != null; + }, + set: function (value) { + if (value === this.useBouncingBehavior) { + return; + } + if (value) { + this._bouncingBehavior = new BABYLON.BouncingBehavior(); + this.addBehavior(this._bouncingBehavior); + } + else if (this._bouncingBehavior) { + this.removeBehavior(this._bouncingBehavior); + this._bouncingBehavior = null; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "framingBehavior", { + /** + * Gets the framing behavior of the camera if it has been enabled. + * @see http://doc.babylonjs.com/how_to/camera_behaviors#framing-behavior + */ + get: function () { + return this._framingBehavior; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "useFramingBehavior", { + /** + * Defines if the framing behavior of the camera is enabled on the camera. + * @see http://doc.babylonjs.com/how_to/camera_behaviors#framing-behavior + */ + get: function () { + return this._framingBehavior != null; + }, + set: function (value) { + if (value === this.useFramingBehavior) { + return; + } + if (value) { + this._framingBehavior = new BABYLON.FramingBehavior(); + this.addBehavior(this._framingBehavior); + } + else if (this._framingBehavior) { + this.removeBehavior(this._framingBehavior); + this._framingBehavior = null; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "autoRotationBehavior", { + /** + * Gets the auto rotation behavior of the camera if it has been enabled. + * @see http://doc.babylonjs.com/how_to/camera_behaviors#autorotation-behavior + */ + get: function () { + return this._autoRotationBehavior; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArcRotateCamera.prototype, "useAutoRotationBehavior", { + /** + * Defines if the auto rotation behavior of the camera is enabled on the camera. + * @see http://doc.babylonjs.com/how_to/camera_behaviors#autorotation-behavior + */ + get: function () { + return this._autoRotationBehavior != null; + }, + set: function (value) { + if (value === this.useAutoRotationBehavior) { + return; + } + if (value) { + this._autoRotationBehavior = new BABYLON.AutoRotationBehavior(); + this.addBehavior(this._autoRotationBehavior); + } + else if (this._autoRotationBehavior) { + this.removeBehavior(this._autoRotationBehavior); + this._autoRotationBehavior = null; + } + }, + enumerable: true, + configurable: true + }); + // Cache + /** @hidden */ + ArcRotateCamera.prototype._initCache = function () { + _super.prototype._initCache.call(this); + this._cache._target = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + this._cache.alpha = undefined; + this._cache.beta = undefined; + this._cache.radius = undefined; + this._cache.targetScreenOffset = BABYLON.Vector2.Zero(); + }; + /** @hidden */ + ArcRotateCamera.prototype._updateCache = function (ignoreParentClass) { + if (!ignoreParentClass) { + _super.prototype._updateCache.call(this); + } + this._cache._target.copyFrom(this._getTargetPosition()); + this._cache.alpha = this.alpha; + this._cache.beta = this.beta; + this._cache.radius = this.radius; + this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset); + }; + ArcRotateCamera.prototype._getTargetPosition = function () { + if (this._targetHost && this._targetHost.getAbsolutePosition) { + var pos = this._targetHost.getAbsolutePosition(); + if (this._targetBoundingCenter) { + pos.addToRef(this._targetBoundingCenter, this._target); + } + else { + this._target.copyFrom(pos); + } + } + var lockedTargetPosition = this._getLockedTargetPosition(); + if (lockedTargetPosition) { + return lockedTargetPosition; + } + return this._target; + }; + /** + * Stores the current state of the camera (alpha, beta, radius and target) + * @returns the camera itself + */ + ArcRotateCamera.prototype.storeState = function () { + this._storedAlpha = this.alpha; + this._storedBeta = this.beta; + this._storedRadius = this.radius; + this._storedTarget = this._getTargetPosition().clone(); + return _super.prototype.storeState.call(this); + }; + /** + * @hidden + * Restored camera state. You must call storeState() first + */ + ArcRotateCamera.prototype._restoreStateValues = function () { + if (!_super.prototype._restoreStateValues.call(this)) { + return false; + } + this.alpha = this._storedAlpha; + this.beta = this._storedBeta; + this.radius = this._storedRadius; + this.setTarget(this._storedTarget.clone()); + this.inertialAlphaOffset = 0; + this.inertialBetaOffset = 0; + this.inertialRadiusOffset = 0; + this.inertialPanningX = 0; + this.inertialPanningY = 0; + return true; + }; + // Synchronized + /** @hidden */ + ArcRotateCamera.prototype._isSynchronizedViewMatrix = function () { + if (!_super.prototype._isSynchronizedViewMatrix.call(this)) { + return false; + } + return this._cache._target.equals(this._getTargetPosition()) + && this._cache.alpha === this.alpha + && this._cache.beta === this.beta + && this._cache.radius === this.radius + && this._cache.targetScreenOffset.equals(this.targetScreenOffset); + }; + /** + * Attached controls to the current camera. + * @param element Defines the element the controls should be listened from + * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) + * @param useCtrlForPanning Defines whether ctrl is used for paning within the controls + * @param panningMouseButton Defines whether panning is allowed through mouse click button + */ + ArcRotateCamera.prototype.attachControl = function (element, noPreventDefault, useCtrlForPanning, panningMouseButton) { + var _this = this; + if (useCtrlForPanning === void 0) { useCtrlForPanning = true; } + if (panningMouseButton === void 0) { panningMouseButton = 2; } + this._useCtrlForPanning = useCtrlForPanning; + this._panningMouseButton = panningMouseButton; + this.inputs.attachElement(element, noPreventDefault); + this._reset = function () { + _this.inertialAlphaOffset = 0; + _this.inertialBetaOffset = 0; + _this.inertialRadiusOffset = 0; + _this.inertialPanningX = 0; + _this.inertialPanningY = 0; + }; + }; + /** + * Detach the current controls from the camera. + * The camera will stop reacting to inputs. + * @param element Defines the element to stop listening the inputs from + */ + ArcRotateCamera.prototype.detachControl = function (element) { + this.inputs.detachElement(element); + if (this._reset) { + this._reset(); + } + }; + /** @hidden */ + ArcRotateCamera.prototype._checkInputs = function () { + //if (async) collision inspection was triggered, don't update the camera's position - until the collision callback was called. + if (this._collisionTriggered) { + return; + } + this.inputs.checkInputs(); + // Inertia + if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) { + var inertialAlphaOffset = this.inertialAlphaOffset; + if (this.beta <= 0) { + inertialAlphaOffset *= -1; + } + if (this.getScene().useRightHandedSystem) { + inertialAlphaOffset *= -1; + } + if (this.parent && this.parent._getWorldMatrixDeterminant() < 0) { + inertialAlphaOffset *= -1; + } + this.alpha += inertialAlphaOffset; + this.beta += this.inertialBetaOffset; + this.radius -= this.inertialRadiusOffset; + this.inertialAlphaOffset *= this.inertia; + this.inertialBetaOffset *= this.inertia; + this.inertialRadiusOffset *= this.inertia; + if (Math.abs(this.inertialAlphaOffset) < BABYLON.Epsilon) { + this.inertialAlphaOffset = 0; + } + if (Math.abs(this.inertialBetaOffset) < BABYLON.Epsilon) { + this.inertialBetaOffset = 0; + } + if (Math.abs(this.inertialRadiusOffset) < this.speed * BABYLON.Epsilon) { + this.inertialRadiusOffset = 0; + } + } + // Panning inertia + if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) { + if (!this._localDirection) { + this._localDirection = BABYLON.Vector3.Zero(); + this._transformedDirection = BABYLON.Vector3.Zero(); + } + this._localDirection.copyFromFloats(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY); + this._localDirection.multiplyInPlace(this.panningAxis); + this._viewMatrix.invertToRef(this._cameraTransformMatrix); + BABYLON.Vector3.TransformNormalToRef(this._localDirection, this._cameraTransformMatrix, this._transformedDirection); + //Eliminate y if map panning is enabled (panningAxis == 1,0,1) + if (!this.panningAxis.y) { + this._transformedDirection.y = 0; + } + if (!this._targetHost) { + if (this.panningDistanceLimit) { + this._transformedDirection.addInPlace(this._target); + var distanceSquared = BABYLON.Vector3.DistanceSquared(this._transformedDirection, this.panningOriginTarget); + if (distanceSquared <= (this.panningDistanceLimit * this.panningDistanceLimit)) { + this._target.copyFrom(this._transformedDirection); + } + } + else { + this._target.addInPlace(this._transformedDirection); + } + } + this.inertialPanningX *= this.panningInertia; + this.inertialPanningY *= this.panningInertia; + if (Math.abs(this.inertialPanningX) < this.speed * BABYLON.Epsilon) { + this.inertialPanningX = 0; + } + if (Math.abs(this.inertialPanningY) < this.speed * BABYLON.Epsilon) { + this.inertialPanningY = 0; + } + } + // Limits + this._checkLimits(); + _super.prototype._checkInputs.call(this); + }; + ArcRotateCamera.prototype._checkLimits = function () { + if (this.lowerBetaLimit === null || this.lowerBetaLimit === undefined) { + if (this.allowUpsideDown && this.beta > Math.PI) { + this.beta = this.beta - (2 * Math.PI); + } + } + else { + if (this.beta < this.lowerBetaLimit) { + this.beta = this.lowerBetaLimit; + } + } + if (this.upperBetaLimit === null || this.upperBetaLimit === undefined) { + if (this.allowUpsideDown && this.beta < -Math.PI) { + this.beta = this.beta + (2 * Math.PI); + } + } + else { + if (this.beta > this.upperBetaLimit) { + this.beta = this.upperBetaLimit; + } + } + if (this.lowerAlphaLimit !== null && this.alpha < this.lowerAlphaLimit) { + this.alpha = this.lowerAlphaLimit; + } + if (this.upperAlphaLimit !== null && this.alpha > this.upperAlphaLimit) { + this.alpha = this.upperAlphaLimit; + } + if (this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit) { + this.radius = this.lowerRadiusLimit; + } + if (this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit) { + this.radius = this.upperRadiusLimit; + } + }; + /** + * Rebuilds angles (alpha, beta) and radius from the give position and target. + */ + ArcRotateCamera.prototype.rebuildAnglesAndRadius = function () { + this.position.subtractToRef(this._getTargetPosition(), this._computationVector); + this.radius = this._computationVector.length(); + if (this.radius === 0) { + this.radius = 0.0001; // Just to avoid division by zero + } + // Alpha + this.alpha = Math.acos(this._computationVector.x / Math.sqrt(Math.pow(this._computationVector.x, 2) + Math.pow(this._computationVector.z, 2))); + if (this._computationVector.z < 0) { + this.alpha = 2 * Math.PI - this.alpha; + } + // Beta + this.beta = Math.acos(this._computationVector.y / this.radius); + this._checkLimits(); + }; + /** + * Use a position to define the current camera related information like aplha, beta and radius + * @param position Defines the position to set the camera at + */ + ArcRotateCamera.prototype.setPosition = function (position) { + if (this.position.equals(position)) { + return; + } + this.position.copyFrom(position); + this.rebuildAnglesAndRadius(); + }; + /** + * Defines the target the camera should look at. + * This will automatically adapt alpha beta and radius to fit within the new target. + * @param target Defines the new target as a Vector or a mesh + * @param toBoundingCenter In case of a mesh target, defines wether to target the mesh position or its bounding information center + * @param allowSamePosition If false, prevents reapplying the new computed position if it is identical to the current one (optim) + */ + ArcRotateCamera.prototype.setTarget = function (target, toBoundingCenter, allowSamePosition) { + if (toBoundingCenter === void 0) { toBoundingCenter = false; } + if (allowSamePosition === void 0) { allowSamePosition = false; } + if (target.getBoundingInfo) { + if (toBoundingCenter) { + this._targetBoundingCenter = target.getBoundingInfo().boundingBox.centerWorld.clone(); + } + else { + this._targetBoundingCenter = null; + } + this._targetHost = target; + this._target = this._getTargetPosition(); + this.onMeshTargetChangedObservable.notifyObservers(this._targetHost); + } + else { + var newTarget = target; + var currentTarget = this._getTargetPosition(); + if (currentTarget && !allowSamePosition && currentTarget.equals(newTarget)) { + return; + } + this._targetHost = null; + this._target = newTarget; + this._targetBoundingCenter = null; + this.onMeshTargetChangedObservable.notifyObservers(null); + } + this.rebuildAnglesAndRadius(); + }; + /** @hidden */ + ArcRotateCamera.prototype._getViewMatrix = function () { + // Compute + var cosa = Math.cos(this.alpha); + var sina = Math.sin(this.alpha); + var cosb = Math.cos(this.beta); + var sinb = Math.sin(this.beta); + if (sinb === 0) { + sinb = 0.0001; + } + var target = this._getTargetPosition(); + this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb); + target.addToRef(this._computationVector, this._newPosition); + if (this.getScene().collisionsEnabled && this.checkCollisions) { + if (!this._collider) { + this._collider = new BABYLON.Collider(); + } + this._collider._radius = this.collisionRadius; + this._newPosition.subtractToRef(this.position, this._collisionVelocity); + this._collisionTriggered = true; + this.getScene().collisionCoordinator.getNewPosition(this.position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId); + } + else { + this.position.copyFrom(this._newPosition); + var up = this.upVector; + if (this.allowUpsideDown && sinb < 0) { + up = up.clone(); + up = up.negate(); + } + this._computeViewMatrix(this.position, target, up); + this._viewMatrix.m[12] += this.targetScreenOffset.x; + this._viewMatrix.m[13] += this.targetScreenOffset.y; + } + this._currentTarget = target; + return this._viewMatrix; + }; + /** + * Zooms on a mesh to be at the min distance where we could see it fully in the current viewport. + * @param meshes Defines the mesh to zoom on + * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance) + */ + ArcRotateCamera.prototype.zoomOn = function (meshes, doNotUpdateMaxZ) { + if (doNotUpdateMaxZ === void 0) { doNotUpdateMaxZ = false; } + meshes = meshes || this.getScene().meshes; + var minMaxVector = BABYLON.Mesh.MinMax(meshes); + var distance = BABYLON.Vector3.Distance(minMaxVector.min, minMaxVector.max); + this.radius = distance * this.zoomOnFactor; + this.focusOn({ min: minMaxVector.min, max: minMaxVector.max, distance: distance }, doNotUpdateMaxZ); + }; + /** + * Focus on a mesh or a bounding box. This adapts the target and maxRadius if necessary but does not update the current radius. + * The target will be changed but the radius + * @param meshesOrMinMaxVectorAndDistance Defines the mesh or bounding info to focus on + * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance) + */ + ArcRotateCamera.prototype.focusOn = function (meshesOrMinMaxVectorAndDistance, doNotUpdateMaxZ) { + if (doNotUpdateMaxZ === void 0) { doNotUpdateMaxZ = false; } + var meshesOrMinMaxVector; + var distance; + if (meshesOrMinMaxVectorAndDistance.min === undefined) { // meshes + var meshes = meshesOrMinMaxVectorAndDistance || this.getScene().meshes; + meshesOrMinMaxVector = BABYLON.Mesh.MinMax(meshes); + distance = BABYLON.Vector3.Distance(meshesOrMinMaxVector.min, meshesOrMinMaxVector.max); + } + else { //minMaxVector and distance + var minMaxVectorAndDistance = meshesOrMinMaxVectorAndDistance; + meshesOrMinMaxVector = minMaxVectorAndDistance; + distance = minMaxVectorAndDistance.distance; + } + this._target = BABYLON.Mesh.Center(meshesOrMinMaxVector); + if (!doNotUpdateMaxZ) { + this.maxZ = distance * 2; + } + }; + /** + * @override + * Override Camera.createRigCamera + */ + ArcRotateCamera.prototype.createRigCamera = function (name, cameraIndex) { + var alphaShift = 0; + switch (this.cameraRigMode) { + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER: + case BABYLON.Camera.RIG_MODE_VR: + alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? 1 : -1); + break; + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: + alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? -1 : 1); + break; + } + var rigCam = new ArcRotateCamera(name, this.alpha + alphaShift, this.beta, this.radius, this._target, this.getScene()); + rigCam._cameraRigParams = {}; + return rigCam; + }; + /** + * @hidden + * @override + * Override Camera._updateRigCameras + */ + ArcRotateCamera.prototype._updateRigCameras = function () { + var camLeft = this._rigCameras[0]; + var camRight = this._rigCameras[1]; + camLeft.beta = camRight.beta = this.beta; + camLeft.radius = camRight.radius = this.radius; + switch (this.cameraRigMode) { + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER: + case BABYLON.Camera.RIG_MODE_VR: + camLeft.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle; + camRight.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle; + break; + case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: + camLeft.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle; + camRight.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle; + break; + } + _super.prototype._updateRigCameras.call(this); + }; + /** + * Destroy the camera and release the current resources hold by it. + */ + ArcRotateCamera.prototype.dispose = function () { + this.inputs.clear(); + _super.prototype.dispose.call(this); + }; + /** + * Gets the current object class name. + * @return the class name + */ + ArcRotateCamera.prototype.getClassName = function () { + return "ArcRotateCamera"; + }; + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "alpha", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "beta", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "radius", void 0); + __decorate([ + BABYLON.serializeAsVector3("target") + ], ArcRotateCamera.prototype, "_target", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "inertialAlphaOffset", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "inertialBetaOffset", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "inertialRadiusOffset", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "lowerAlphaLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "upperAlphaLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "lowerBetaLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "upperBetaLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "lowerRadiusLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "upperRadiusLimit", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "inertialPanningX", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "inertialPanningY", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "pinchToPanMaxDistance", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "panningDistanceLimit", void 0); + __decorate([ + BABYLON.serializeAsVector3() + ], ArcRotateCamera.prototype, "panningOriginTarget", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "panningInertia", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "zoomOnFactor", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "targetScreenOffset", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "allowUpsideDown", void 0); + __decorate([ + BABYLON.serialize() + ], ArcRotateCamera.prototype, "useInputToRestoreState", void 0); + return ArcRotateCamera; + }(BABYLON.TargetCamera)); + BABYLON.ArcRotateCamera = ArcRotateCamera; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.arcRotateCamera.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + BABYLON.Node.AddNodeConstructor("Light_Type_3", function (name, scene) { + return function () { return new HemisphericLight(name, BABYLON.Vector3.Zero(), scene); }; + }); + /** + * The HemisphericLight simulates the ambient environment light, + * so the passed direction is the light reflection direction, not the incoming direction. + */ + var HemisphericLight = /** @class */ (function (_super) { + __extends(HemisphericLight, _super); + /** + * Creates a HemisphericLight object in the scene according to the passed direction (Vector3). + * The HemisphericLight simulates the ambient environment light, so the passed direction is the light reflection direction, not the incoming direction. + * The HemisphericLight can't cast shadows. + * Documentation : http://doc.babylonjs.com/tutorials/lights + * @param name The friendly name of the light + * @param direction The direction of the light reflection + * @param scene The scene the light belongs to + */ + function HemisphericLight(name, direction, scene) { + var _this = _super.call(this, name, scene) || this; + /** + * The groundColor is the light in the opposite direction to the one specified during creation. + * You can think of the diffuse and specular light as coming from the centre of the object in the given direction and the groundColor light in the opposite direction. + */ + _this.groundColor = new BABYLON.Color3(0.0, 0.0, 0.0); + _this.direction = direction || BABYLON.Vector3.Up(); + return _this; + } + HemisphericLight.prototype._buildUniformLayout = function () { + this._uniformBuffer.addUniform("vLightData", 4); + this._uniformBuffer.addUniform("vLightDiffuse", 4); + this._uniformBuffer.addUniform("vLightSpecular", 3); + this._uniformBuffer.addUniform("vLightGround", 3); + this._uniformBuffer.addUniform("shadowsInfo", 3); + this._uniformBuffer.addUniform("depthValues", 2); + this._uniformBuffer.create(); + }; + /** + * Returns the string "HemisphericLight". + * @return The class name + */ + HemisphericLight.prototype.getClassName = function () { + return "HemisphericLight"; + }; + /** + * Sets the HemisphericLight direction towards the passed target (Vector3). + * Returns the updated direction. + * @param target The target the direction should point to + * @return The computed direction + */ + HemisphericLight.prototype.setDirectionToTarget = function (target) { + this.direction = BABYLON.Vector3.Normalize(target.subtract(BABYLON.Vector3.Zero())); + return this.direction; + }; + /** + * Returns the shadow generator associated to the light. + * @returns Always null for hemispheric lights because it does not support shadows. + */ + HemisphericLight.prototype.getShadowGenerator = function () { + return null; + }; + /** + * Sets the passed Effect object with the HemisphericLight normalized direction and color and the passed name (string). + * @param effect The effect to update + * @param lightIndex The index of the light in the effect to update + * @returns The hemispheric light + */ + HemisphericLight.prototype.transferToEffect = function (effect, lightIndex) { + var normalizeDirection = BABYLON.Vector3.Normalize(this.direction); + this._uniformBuffer.updateFloat4("vLightData", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, 0.0, lightIndex); + this._uniformBuffer.updateColor3("vLightGround", this.groundColor.scale(this.intensity), lightIndex); + return this; + }; + /** + * Computes the world matrix of the node + * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch + * @param useWasUpdatedFlag defines a reserved property + * @returns the world matrix + */ + HemisphericLight.prototype.computeWorldMatrix = function (force, useWasUpdatedFlag) { + if (!this._worldMatrix) { + this._worldMatrix = BABYLON.Matrix.Identity(); + } + return this._worldMatrix; + }; + /** + * Returns the integer 3. + * @return The light Type id as a constant defines in Light.LIGHTTYPEID_x + */ + HemisphericLight.prototype.getTypeID = function () { + return BABYLON.Light.LIGHTTYPEID_HEMISPHERICLIGHT; + }; + /** + * Prepares the list of defines specific to the light type. + * @param defines the list of defines + * @param lightIndex defines the index of the light for the effect + */ + HemisphericLight.prototype.prepareLightSpecificDefines = function (defines, lightIndex) { + defines["HEMILIGHT" + lightIndex] = true; + }; + __decorate([ + BABYLON.serializeAsColor3() + ], HemisphericLight.prototype, "groundColor", void 0); + __decorate([ + BABYLON.serializeAsVector3() + ], HemisphericLight.prototype, "direction", void 0); + return HemisphericLight; + }(BABYLON.Light)); + BABYLON.HemisphericLight = HemisphericLight; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.hemisphericLight.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * Base implementation IShadowLight + * It groups all the common behaviour in order to reduce dupplication and better follow the DRY pattern. + */ + var ShadowLight = /** @class */ (function (_super) { + __extends(ShadowLight, _super); + function ShadowLight() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._needProjectionMatrixCompute = true; + return _this; + } + ShadowLight.prototype._setPosition = function (value) { + this._position = value; + }; + Object.defineProperty(ShadowLight.prototype, "position", { + /** + * Sets the position the shadow will be casted from. Also use as the light position for both + * point and spot lights. + */ + get: function () { + return this._position; + }, + /** + * Sets the position the shadow will be casted from. Also use as the light position for both + * point and spot lights. + */ + set: function (value) { + this._setPosition(value); + }, + enumerable: true, + configurable: true + }); + ShadowLight.prototype._setDirection = function (value) { + this._direction = value; + }; + Object.defineProperty(ShadowLight.prototype, "direction", { + /** + * In 2d mode (needCube being false), gets the direction used to cast the shadow. + * Also use as the light direction on spot and directional lights. + */ + get: function () { + return this._direction; + }, + /** + * In 2d mode (needCube being false), sets the direction used to cast the shadow. + * Also use as the light direction on spot and directional lights. + */ + set: function (value) { + this._setDirection(value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowLight.prototype, "shadowMinZ", { + /** + * Gets the shadow projection clipping minimum z value. + */ + get: function () { + return this._shadowMinZ; + }, + /** + * Sets the shadow projection clipping minimum z value. + */ + set: function (value) { + this._shadowMinZ = value; + this.forceProjectionMatrixCompute(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowLight.prototype, "shadowMaxZ", { + /** + * Sets the shadow projection clipping maximum z value. + */ + get: function () { + return this._shadowMaxZ; + }, + /** + * Gets the shadow projection clipping maximum z value. + */ + set: function (value) { + this._shadowMaxZ = value; + this.forceProjectionMatrixCompute(); + }, + enumerable: true, + configurable: true + }); + /** + * Computes the transformed information (transformedPosition and transformedDirection in World space) of the current light + * @returns true if the information has been computed, false if it does not need to (no parenting) + */ + ShadowLight.prototype.computeTransformedInformation = function () { + if (this.parent && this.parent.getWorldMatrix) { + if (!this.transformedPosition) { + this.transformedPosition = BABYLON.Vector3.Zero(); + } + BABYLON.Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition); + // In case the direction is present. + if (this.direction) { + if (!this.transformedDirection) { + this.transformedDirection = BABYLON.Vector3.Zero(); + } + BABYLON.Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection); + } + return true; + } + return false; + }; + /** + * Return the depth scale used for the shadow map. + * @returns the depth scale. + */ + ShadowLight.prototype.getDepthScale = function () { + return 50.0; + }; + /** + * Get the direction to use to render the shadow map. In case of cube texture, the face index can be passed. + * @param faceIndex The index of the face we are computed the direction to generate shadow + * @returns The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true + */ + ShadowLight.prototype.getShadowDirection = function (faceIndex) { + return this.transformedDirection ? this.transformedDirection : this.direction; + }; + /** + * Returns the ShadowLight absolute position in the World. + * @returns the position vector in world space + */ + ShadowLight.prototype.getAbsolutePosition = function () { + return this.transformedPosition ? this.transformedPosition : this.position; + }; + /** + * Sets the ShadowLight direction toward the passed target. + * @param target The point tot target in local space + * @returns the updated ShadowLight direction + */ + ShadowLight.prototype.setDirectionToTarget = function (target) { + this.direction = BABYLON.Vector3.Normalize(target.subtract(this.position)); + return this.direction; + }; + /** + * Returns the light rotation in euler definition. + * @returns the x y z rotation in local space. + */ + ShadowLight.prototype.getRotation = function () { + this.direction.normalize(); + var xaxis = BABYLON.Vector3.Cross(this.direction, BABYLON.Axis.Y); + var yaxis = BABYLON.Vector3.Cross(xaxis, this.direction); + return BABYLON.Vector3.RotationFromAxis(xaxis, yaxis, this.direction); + }; + /** + * Returns whether or not the shadow generation require a cube texture or a 2d texture. + * @returns true if a cube texture needs to be use + */ + ShadowLight.prototype.needCube = function () { + return false; + }; + /** + * Detects if the projection matrix requires to be recomputed this frame. + * @returns true if it requires to be recomputed otherwise, false. + */ + ShadowLight.prototype.needProjectionMatrixCompute = function () { + return this._needProjectionMatrixCompute; + }; + /** + * Forces the shadow generator to recompute the projection matrix even if position and direction did not changed. + */ + ShadowLight.prototype.forceProjectionMatrixCompute = function () { + this._needProjectionMatrixCompute = true; + }; + /** @hidden */ + ShadowLight.prototype._initCache = function () { + _super.prototype._initCache.call(this); + this._cache.position = BABYLON.Vector3.Zero(); + }; + /** @hidden */ + ShadowLight.prototype._isSynchronized = function () { + if (!this._cache.position.equals(this.position)) { + return false; + } + return true; + }; + /** + * Computes the world matrix of the node + * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch + * @returns the world matrix + */ + ShadowLight.prototype.computeWorldMatrix = function (force) { + if (!force && this.isSynchronized()) { + this._currentRenderId = this.getScene().getRenderId(); + return this._worldMatrix; + } + this._updateCache(); + this._cache.position.copyFrom(this.position); + if (!this._worldMatrix) { + this._worldMatrix = BABYLON.Matrix.Identity(); + } + BABYLON.Matrix.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix); + if (this.parent && this.parent.getWorldMatrix) { + this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix); + this._markSyncedWithParent(); + } + // Cache the determinant + this._worldMatrixDeterminant = this._worldMatrix.determinant(); + return this._worldMatrix; + }; + /** + * Gets the minZ used for shadow according to both the scene and the light. + * @param activeCamera The camera we are returning the min for + * @returns the depth min z + */ + ShadowLight.prototype.getDepthMinZ = function (activeCamera) { + return this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ; + }; + /** + * Gets the maxZ used for shadow according to both the scene and the light. + * @param activeCamera The camera we are returning the max for + * @returns the depth max z + */ + ShadowLight.prototype.getDepthMaxZ = function (activeCamera) { + return this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ; + }; + /** + * Sets the shadow projection matrix in parameter to the generated projection matrix. + * @param matrix The materix to updated with the projection information + * @param viewMatrix The transform matrix of the light + * @param renderList The list of mesh to render in the map + * @returns The current light + */ + ShadowLight.prototype.setShadowProjectionMatrix = function (matrix, viewMatrix, renderList) { + if (this.customProjectionMatrixBuilder) { + this.customProjectionMatrixBuilder(viewMatrix, renderList, matrix); + } + else { + this._setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList); + } + return this; + }; + __decorate([ + BABYLON.serializeAsVector3() + ], ShadowLight.prototype, "position", null); + __decorate([ + BABYLON.serializeAsVector3() + ], ShadowLight.prototype, "direction", null); + __decorate([ + BABYLON.serialize() + ], ShadowLight.prototype, "shadowMinZ", null); + __decorate([ + BABYLON.serialize() + ], ShadowLight.prototype, "shadowMaxZ", null); + return ShadowLight; + }(BABYLON.Light)); + BABYLON.ShadowLight = ShadowLight; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.shadowLight.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + BABYLON.Node.AddNodeConstructor("Light_Type_0", function (name, scene) { + return function () { return new PointLight(name, BABYLON.Vector3.Zero(), scene); }; + }); + /** + * A point light is a light defined by an unique point in world space. + * The light is emitted in every direction from this point. + * A good example of a point light is a standard light bulb. + * Documentation: https://doc.babylonjs.com/babylon101/lights + */ + var PointLight = /** @class */ (function (_super) { + __extends(PointLight, _super); + /** + * Creates a PointLight object from the passed name and position (Vector3) and adds it in the scene. + * A PointLight emits the light in every direction. + * It can cast shadows. + * If the scene camera is already defined and you want to set your PointLight at the camera position, just set it : + * ```javascript + * var pointLight = new BABYLON.PointLight("pl", camera.position, scene); + * ``` + * Documentation : http://doc.babylonjs.com/tutorials/lights + * @param name The light friendly name + * @param position The position of the point light in the scene + * @param scene The scene the lights belongs to + */ + function PointLight(name, position, scene) { + var _this = _super.call(this, name, scene) || this; + _this._shadowAngle = Math.PI / 2; + _this.position = position; + return _this; + } + Object.defineProperty(PointLight.prototype, "shadowAngle", { + /** + * Getter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback + * This specifies what angle the shadow will use to be created. + * + * It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps. + */ + get: function () { + return this._shadowAngle; + }, + /** + * Setter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback + * This specifies what angle the shadow will use to be created. + * + * It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps. + */ + set: function (value) { + this._shadowAngle = value; + this.forceProjectionMatrixCompute(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PointLight.prototype, "direction", { + /** + * Gets the direction if it has been set. + * In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback + */ + get: function () { + return this._direction; + }, + /** + * In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback + */ + set: function (value) { + var previousNeedCube = this.needCube(); + this._direction = value; + if (this.needCube() !== previousNeedCube && this._shadowGenerator) { + this._shadowGenerator.recreateShadowMap(); + } + }, + enumerable: true, + configurable: true + }); + /** + * Returns the string "PointLight" + * @returns the class name + */ + PointLight.prototype.getClassName = function () { + return "PointLight"; + }; + /** + * Returns the integer 0. + * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x + */ + PointLight.prototype.getTypeID = function () { + return BABYLON.Light.LIGHTTYPEID_POINTLIGHT; + }; + /** + * Specifies wether or not the shadowmap should be a cube texture. + * @returns true if the shadowmap needs to be a cube texture. + */ + PointLight.prototype.needCube = function () { + return !this.direction; + }; + /** + * Returns a new Vector3 aligned with the PointLight cube system according to the passed cube face index (integer). + * @param faceIndex The index of the face we are computed the direction to generate shadow + * @returns The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true + */ + PointLight.prototype.getShadowDirection = function (faceIndex) { + if (this.direction) { + return _super.prototype.getShadowDirection.call(this, faceIndex); + } + else { + switch (faceIndex) { + case 0: + return new BABYLON.Vector3(1.0, 0.0, 0.0); + case 1: + return new BABYLON.Vector3(-1.0, 0.0, 0.0); + case 2: + return new BABYLON.Vector3(0.0, -1.0, 0.0); + case 3: + return new BABYLON.Vector3(0.0, 1.0, 0.0); + case 4: + return new BABYLON.Vector3(0.0, 0.0, 1.0); + case 5: + return new BABYLON.Vector3(0.0, 0.0, -1.0); + } + } + return BABYLON.Vector3.Zero(); + }; + /** + * Sets the passed matrix "matrix" as a left-handed perspective projection matrix with the following settings : + * - fov = PI / 2 + * - aspect ratio : 1.0 + * - z-near and far equal to the active camera minZ and maxZ. + * Returns the PointLight. + */ + PointLight.prototype._setDefaultShadowProjectionMatrix = function (matrix, viewMatrix, renderList) { + var activeCamera = this.getScene().activeCamera; + if (!activeCamera) { + return; + } + BABYLON.Matrix.PerspectiveFovLHToRef(this.shadowAngle, 1.0, this.getDepthMinZ(activeCamera), this.getDepthMaxZ(activeCamera), matrix); + }; + PointLight.prototype._buildUniformLayout = function () { + this._uniformBuffer.addUniform("vLightData", 4); + this._uniformBuffer.addUniform("vLightDiffuse", 4); + this._uniformBuffer.addUniform("vLightSpecular", 3); + this._uniformBuffer.addUniform("vLightFalloff", 4); + this._uniformBuffer.addUniform("shadowsInfo", 3); + this._uniformBuffer.addUniform("depthValues", 2); + this._uniformBuffer.create(); + }; + /** + * Sets the passed Effect "effect" with the PointLight transformed position (or position, if none) and passed name (string). + * @param effect The effect to update + * @param lightIndex The index of the light in the effect to update + * @returns The point light + */ + PointLight.prototype.transferToEffect = function (effect, lightIndex) { + if (this.computeTransformedInformation()) { + this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0.0, lightIndex); + } + else { + this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, 0, lightIndex); + } + this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, 0, 0, lightIndex); + return this; + }; + /** + * Prepares the list of defines specific to the light type. + * @param defines the list of defines + * @param lightIndex defines the index of the light for the effect + */ + PointLight.prototype.prepareLightSpecificDefines = function (defines, lightIndex) { + defines["POINTLIGHT" + lightIndex] = true; + }; + __decorate([ + BABYLON.serialize() + ], PointLight.prototype, "shadowAngle", null); + return PointLight; + }(BABYLON.ShadowLight)); + BABYLON.PointLight = PointLight; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pointLight.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + BABYLON.Node.AddNodeConstructor("Light_Type_1", function (name, scene) { + return function () { return new DirectionalLight(name, BABYLON.Vector3.Zero(), scene); }; + }); + /** + * A directional light is defined by a direction (what a surprise!). + * The light is emitted from everywhere in the specified direction, and has an infinite range. + * An example of a directional light is when a distance planet is lit by the apparently parallel lines of light from its sun. Light in a downward direction will light the top of an object. + * Documentation: https://doc.babylonjs.com/babylon101/lights + */ + var DirectionalLight = /** @class */ (function (_super) { + __extends(DirectionalLight, _super); + /** + * Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3). + * The directional light is emitted from everywhere in the given direction. + * It can cast shadows. + * Documentation : http://doc.babylonjs.com/tutorials/lights + * @param name The friendly name of the light + * @param direction The direction of the light + * @param scene The scene the light belongs to + */ + function DirectionalLight(name, direction, scene) { + var _this = _super.call(this, name, scene) || this; + _this._shadowFrustumSize = 0; + _this._shadowOrthoScale = 0.1; + /** + * Automatically compute the projection matrix to best fit (including all the casters) + * on each frame. + */ + _this.autoUpdateExtends = true; + // Cache + _this._orthoLeft = Number.MAX_VALUE; + _this._orthoRight = Number.MIN_VALUE; + _this._orthoTop = Number.MIN_VALUE; + _this._orthoBottom = Number.MAX_VALUE; + _this.position = direction.scale(-1.0); + _this.direction = direction; + return _this; + } + Object.defineProperty(DirectionalLight.prototype, "shadowFrustumSize", { + /** + * Fix frustum size for the shadow generation. This is disabled if the value is 0. + */ + get: function () { + return this._shadowFrustumSize; + }, + /** + * Specifies a fix frustum size for the shadow generation. + */ + set: function (value) { + this._shadowFrustumSize = value; + this.forceProjectionMatrixCompute(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DirectionalLight.prototype, "shadowOrthoScale", { + /** + * Gets the shadow projection scale against the optimal computed one. + * 0.1 by default which means that the projection window is increase by 10% from the optimal size. + * This does not impact in fixed frustum size (shadowFrustumSize being set) + */ + get: function () { + return this._shadowOrthoScale; + }, + /** + * Sets the shadow projection scale against the optimal computed one. + * 0.1 by default which means that the projection window is increase by 10% from the optimal size. + * This does not impact in fixed frustum size (shadowFrustumSize being set) + */ + set: function (value) { + this._shadowOrthoScale = value; + this.forceProjectionMatrixCompute(); + }, + enumerable: true, + configurable: true + }); + /** + * Returns the string "DirectionalLight". + * @return The class name + */ + DirectionalLight.prototype.getClassName = function () { + return "DirectionalLight"; + }; + /** + * Returns the integer 1. + * @return The light Type id as a constant defines in Light.LIGHTTYPEID_x + */ + DirectionalLight.prototype.getTypeID = function () { + return BABYLON.Light.LIGHTTYPEID_DIRECTIONALLIGHT; + }; + /** + * Sets the passed matrix "matrix" as projection matrix for the shadows cast by the light according to the passed view matrix. + * Returns the DirectionalLight Shadow projection matrix. + */ + DirectionalLight.prototype._setDefaultShadowProjectionMatrix = function (matrix, viewMatrix, renderList) { + if (this.shadowFrustumSize > 0) { + this._setDefaultFixedFrustumShadowProjectionMatrix(matrix, viewMatrix); + } + else { + this._setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList); + } + }; + /** + * Sets the passed matrix "matrix" as fixed frustum projection matrix for the shadows cast by the light according to the passed view matrix. + * Returns the DirectionalLight Shadow projection matrix. + */ + DirectionalLight.prototype._setDefaultFixedFrustumShadowProjectionMatrix = function (matrix, viewMatrix) { + var activeCamera = this.getScene().activeCamera; + if (!activeCamera) { + return; + } + BABYLON.Matrix.OrthoLHToRef(this.shadowFrustumSize, this.shadowFrustumSize, this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ, this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ, matrix); + }; + /** + * Sets the passed matrix "matrix" as auto extend projection matrix for the shadows cast by the light according to the passed view matrix. + * Returns the DirectionalLight Shadow projection matrix. + */ + DirectionalLight.prototype._setDefaultAutoExtendShadowProjectionMatrix = function (matrix, viewMatrix, renderList) { + var activeCamera = this.getScene().activeCamera; + if (!activeCamera) { + return; + } + // Check extends + if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) { + var tempVector3 = BABYLON.Vector3.Zero(); + this._orthoLeft = Number.MAX_VALUE; + this._orthoRight = Number.MIN_VALUE; + this._orthoTop = Number.MIN_VALUE; + this._orthoBottom = Number.MAX_VALUE; + for (var meshIndex = 0; meshIndex < renderList.length; meshIndex++) { + var mesh = renderList[meshIndex]; + if (!mesh) { + continue; + } + var boundingInfo = mesh.getBoundingInfo(); + var boundingBox = boundingInfo.boundingBox; + for (var index = 0; index < boundingBox.vectorsWorld.length; index++) { + BABYLON.Vector3.TransformCoordinatesToRef(boundingBox.vectorsWorld[index], viewMatrix, tempVector3); + if (tempVector3.x < this._orthoLeft) { + this._orthoLeft = tempVector3.x; + } + if (tempVector3.y < this._orthoBottom) { + this._orthoBottom = tempVector3.y; + } + if (tempVector3.x > this._orthoRight) { + this._orthoRight = tempVector3.x; + } + if (tempVector3.y > this._orthoTop) { + this._orthoTop = tempVector3.y; + } + } + } + } + var xOffset = this._orthoRight - this._orthoLeft; + var yOffset = this._orthoTop - this._orthoBottom; + BABYLON.Matrix.OrthoOffCenterLHToRef(this._orthoLeft - xOffset * this.shadowOrthoScale, this._orthoRight + xOffset * this.shadowOrthoScale, this._orthoBottom - yOffset * this.shadowOrthoScale, this._orthoTop + yOffset * this.shadowOrthoScale, this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ, this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ, matrix); + }; + DirectionalLight.prototype._buildUniformLayout = function () { + this._uniformBuffer.addUniform("vLightData", 4); + this._uniformBuffer.addUniform("vLightDiffuse", 4); + this._uniformBuffer.addUniform("vLightSpecular", 3); + this._uniformBuffer.addUniform("shadowsInfo", 3); + this._uniformBuffer.addUniform("depthValues", 2); + this._uniformBuffer.create(); + }; + /** + * Sets the passed Effect object with the DirectionalLight transformed position (or position if not parented) and the passed name. + * @param effect The effect to update + * @param lightIndex The index of the light in the effect to update + * @returns The directional light + */ + DirectionalLight.prototype.transferToEffect = function (effect, lightIndex) { + if (this.computeTransformedInformation()) { + this._uniformBuffer.updateFloat4("vLightData", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, lightIndex); + return this; + } + this._uniformBuffer.updateFloat4("vLightData", this.direction.x, this.direction.y, this.direction.z, 1, lightIndex); + return this; + }; + /** + * Gets the minZ used for shadow according to both the scene and the light. + * + * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being + * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5. + * @param activeCamera The camera we are returning the min for + * @returns the depth min z + */ + DirectionalLight.prototype.getDepthMinZ = function (activeCamera) { + return 1; + }; + /** + * Gets the maxZ used for shadow according to both the scene and the light. + * + * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being + * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5. + * @param activeCamera The camera we are returning the max for + * @returns the depth max z + */ + DirectionalLight.prototype.getDepthMaxZ = function (activeCamera) { + return 1; + }; + /** + * Prepares the list of defines specific to the light type. + * @param defines the list of defines + * @param lightIndex defines the index of the light for the effect + */ + DirectionalLight.prototype.prepareLightSpecificDefines = function (defines, lightIndex) { + defines["DIRLIGHT" + lightIndex] = true; + }; + __decorate([ + BABYLON.serialize() + ], DirectionalLight.prototype, "shadowFrustumSize", null); + __decorate([ + BABYLON.serialize() + ], DirectionalLight.prototype, "shadowOrthoScale", null); + __decorate([ + BABYLON.serialize() + ], DirectionalLight.prototype, "autoUpdateExtends", void 0); + return DirectionalLight; + }(BABYLON.ShadowLight)); + BABYLON.DirectionalLight = DirectionalLight; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.directionalLight.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + BABYLON.Node.AddNodeConstructor("Light_Type_2", function (name, scene) { + return function () { return new SpotLight(name, BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), 0, 0, scene); }; + }); + /** + * A spot light is defined by a position, a direction, an angle, and an exponent. + * These values define a cone of light starting from the position, emitting toward the direction. + * The angle, in radians, defines the size (field of illumination) of the spotlight's conical beam, + * and the exponent defines the speed of the decay of the light with distance (reach). + * Documentation: https://doc.babylonjs.com/babylon101/lights + */ + var SpotLight = /** @class */ (function (_super) { + __extends(SpotLight, _super); + /** + * Creates a SpotLight object in the scene. A spot light is a simply light oriented cone. + * It can cast shadows. + * Documentation : http://doc.babylonjs.com/tutorials/lights + * @param name The light friendly name + * @param position The position of the spot light in the scene + * @param direction The direction of the light in the scene + * @param angle The cone angle of the light in Radians + * @param exponent The light decay speed with the distance from the emission spot + * @param scene The scene the lights belongs to + */ + function SpotLight(name, position, direction, angle, exponent, scene) { + var _this = _super.call(this, name, scene) || this; + _this._innerAngle = 0; + _this._projectionTextureMatrix = BABYLON.Matrix.Zero(); + _this._projectionTextureLightNear = 1e-6; + _this._projectionTextureLightFar = 1000.0; + _this._projectionTextureUpDirection = BABYLON.Vector3.Up(); + _this._projectionTextureViewLightDirty = true; + _this._projectionTextureProjectionLightDirty = true; + _this._projectionTextureDirty = true; + _this._projectionTextureViewTargetVector = BABYLON.Vector3.Zero(); + _this._projectionTextureViewLightMatrix = BABYLON.Matrix.Zero(); + _this._projectionTextureProjectionLightMatrix = BABYLON.Matrix.Zero(); + _this._projectionTextureScalingMatrix = BABYLON.Matrix.FromValues(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0); + _this.position = position; + _this.direction = direction; + _this.angle = angle; + _this.exponent = exponent; + return _this; + } + Object.defineProperty(SpotLight.prototype, "angle", { + /** + * Gets the cone angle of the spot light in Radians. + */ + get: function () { + return this._angle; + }, + /** + * Sets the cone angle of the spot light in Radians. + */ + set: function (value) { + this._angle = value; + this._cosHalfAngle = Math.cos(value * 0.5); + this._projectionTextureProjectionLightDirty = true; + this.forceProjectionMatrixCompute(); + this._computeAngleValues(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpotLight.prototype, "innerAngle", { + /** + * Only used in gltf falloff mode, this defines the angle where + * the directional falloff will start before cutting at angle which could be seen + * as outer angle. + */ + get: function () { + return this._innerAngle; + }, + /** + * Only used in gltf falloff mode, this defines the angle where + * the directional falloff will start before cutting at angle which could be seen + * as outer angle. + */ + set: function (value) { + this._innerAngle = value; + this._computeAngleValues(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpotLight.prototype, "shadowAngleScale", { + /** + * Allows scaling the angle of the light for shadow generation only. + */ + get: function () { + return this._shadowAngleScale; + }, + /** + * Allows scaling the angle of the light for shadow generation only. + */ + set: function (value) { + this._shadowAngleScale = value; + this.forceProjectionMatrixCompute(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpotLight.prototype, "projectionTextureMatrix", { + /** + * Allows reading the projecton texture + */ + get: function () { + return this._projectionTextureMatrix; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpotLight.prototype, "projectionTextureLightNear", { + /** + * Gets the near clip of the Spotlight for texture projection. + */ + get: function () { + return this._projectionTextureLightNear; + }, + /** + * Sets the near clip of the Spotlight for texture projection. + */ + set: function (value) { + this._projectionTextureLightNear = value; + this._projectionTextureProjectionLightDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpotLight.prototype, "projectionTextureLightFar", { + /** + * Gets the far clip of the Spotlight for texture projection. + */ + get: function () { + return this._projectionTextureLightFar; + }, + /** + * Sets the far clip of the Spotlight for texture projection. + */ + set: function (value) { + this._projectionTextureLightFar = value; + this._projectionTextureProjectionLightDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpotLight.prototype, "projectionTextureUpDirection", { + /** + * Gets the Up vector of the Spotlight for texture projection. + */ + get: function () { + return this._projectionTextureUpDirection; + }, + /** + * Sets the Up vector of the Spotlight for texture projection. + */ + set: function (value) { + this._projectionTextureUpDirection = value; + this._projectionTextureProjectionLightDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpotLight.prototype, "projectionTexture", { + /** + * Gets the projection texture of the light. + */ + get: function () { + return this._projectionTexture; + }, + /** + * Sets the projection texture of the light. + */ + set: function (value) { + this._projectionTexture = value; + this._projectionTextureDirty = true; + }, + enumerable: true, + configurable: true + }); + /** + * Returns the string "SpotLight". + * @returns the class name + */ + SpotLight.prototype.getClassName = function () { + return "SpotLight"; + }; + /** + * Returns the integer 2. + * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x + */ + SpotLight.prototype.getTypeID = function () { + return BABYLON.Light.LIGHTTYPEID_SPOTLIGHT; + }; + /** + * Overrides the direction setter to recompute the projection texture view light Matrix. + */ + SpotLight.prototype._setDirection = function (value) { + _super.prototype._setDirection.call(this, value); + this._projectionTextureViewLightDirty = true; + }; + /** + * Overrides the position setter to recompute the projection texture view light Matrix. + */ + SpotLight.prototype._setPosition = function (value) { + _super.prototype._setPosition.call(this, value); + this._projectionTextureViewLightDirty = true; + }; + /** + * Sets the passed matrix "matrix" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0. + * Returns the SpotLight. + */ + SpotLight.prototype._setDefaultShadowProjectionMatrix = function (matrix, viewMatrix, renderList) { + var activeCamera = this.getScene().activeCamera; + if (!activeCamera) { + return; + } + this._shadowAngleScale = this._shadowAngleScale || 1; + var angle = this._shadowAngleScale * this._angle; + BABYLON.Matrix.PerspectiveFovLHToRef(angle, 1.0, this.getDepthMinZ(activeCamera), this.getDepthMaxZ(activeCamera), matrix); + }; + SpotLight.prototype._computeProjectionTextureViewLightMatrix = function () { + this._projectionTextureViewLightDirty = false; + this._projectionTextureDirty = true; + this.position.addToRef(this.direction, this._projectionTextureViewTargetVector); + BABYLON.Matrix.LookAtLHToRef(this.position, this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix); + }; + SpotLight.prototype._computeProjectionTextureProjectionLightMatrix = function () { + this._projectionTextureProjectionLightDirty = false; + this._projectionTextureDirty = true; + var light_far = this.projectionTextureLightFar; + var light_near = this.projectionTextureLightNear; + var P = light_far / (light_far - light_near); + var Q = -P * light_near; + var S = 1.0 / Math.tan(this._angle / 2.0); + var A = 1.0; + BABYLON.Matrix.FromValuesToRef(S / A, 0.0, 0.0, 0.0, 0.0, S, 0.0, 0.0, 0.0, 0.0, P, 1.0, 0.0, 0.0, Q, 0.0, this._projectionTextureProjectionLightMatrix); + }; + /** + * Main function for light texture projection matrix computing. + */ + SpotLight.prototype._computeProjectionTextureMatrix = function () { + this._projectionTextureDirty = false; + this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix); + this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix); + }; + SpotLight.prototype._buildUniformLayout = function () { + this._uniformBuffer.addUniform("vLightData", 4); + this._uniformBuffer.addUniform("vLightDiffuse", 4); + this._uniformBuffer.addUniform("vLightSpecular", 3); + this._uniformBuffer.addUniform("vLightDirection", 3); + this._uniformBuffer.addUniform("vLightFalloff", 4); + this._uniformBuffer.addUniform("shadowsInfo", 3); + this._uniformBuffer.addUniform("depthValues", 2); + this._uniformBuffer.create(); + }; + SpotLight.prototype._computeAngleValues = function () { + this._lightAngleScale = 1.0 / Math.max(0.001, (Math.cos(this._innerAngle * 0.5) - this._cosHalfAngle)); + this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale; + }; + /** + * Sets the passed Effect object with the SpotLight transfomed position (or position if not parented) and normalized direction. + * @param effect The effect to update + * @param lightIndex The index of the light in the effect to update + * @returns The spot light + */ + SpotLight.prototype.transferToEffect = function (effect, lightIndex) { + var normalizeDirection; + if (this.computeTransformedInformation()) { + this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, lightIndex); + normalizeDirection = BABYLON.Vector3.Normalize(this.transformedDirection); + } + else { + this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, this.exponent, lightIndex); + normalizeDirection = BABYLON.Vector3.Normalize(this.direction); + } + this._uniformBuffer.updateFloat4("vLightDirection", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, this._cosHalfAngle, lightIndex); + this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, lightIndex); + if (this.projectionTexture && this.projectionTexture.isReady()) { + if (this._projectionTextureViewLightDirty) { + this._computeProjectionTextureViewLightMatrix(); + } + if (this._projectionTextureProjectionLightDirty) { + this._computeProjectionTextureProjectionLightMatrix(); + } + if (this._projectionTextureDirty) { + this._computeProjectionTextureMatrix(); + } + effect.setMatrix("textureProjectionMatrix" + lightIndex, this._projectionTextureMatrix); + effect.setTexture("projectionLightSampler" + lightIndex, this.projectionTexture); + } + return this; + }; + /** + * Disposes the light and the associated resources. + */ + SpotLight.prototype.dispose = function () { + _super.prototype.dispose.call(this); + if (this._projectionTexture) { + this._projectionTexture.dispose(); + } + }; + /** + * Prepares the list of defines specific to the light type. + * @param defines the list of defines + * @param lightIndex defines the index of the light for the effect + */ + SpotLight.prototype.prepareLightSpecificDefines = function (defines, lightIndex) { + defines["SPOTLIGHT" + lightIndex] = true; + defines["PROJECTEDLIGHTTEXTURE" + lightIndex] = this.projectionTexture ? true : false; + }; + __decorate([ + BABYLON.serialize() + ], SpotLight.prototype, "angle", null); + __decorate([ + BABYLON.serialize() + ], SpotLight.prototype, "innerAngle", null); + __decorate([ + BABYLON.serialize() + ], SpotLight.prototype, "shadowAngleScale", null); + __decorate([ + BABYLON.serialize() + ], SpotLight.prototype, "exponent", void 0); + __decorate([ + BABYLON.serialize() + ], SpotLight.prototype, "projectionTextureLightNear", null); + __decorate([ + BABYLON.serialize() + ], SpotLight.prototype, "projectionTextureLightFar", null); + __decorate([ + BABYLON.serialize() + ], SpotLight.prototype, "projectionTextureUpDirection", null); + __decorate([ + BABYLON.serializeAsTexture("projectedLightTexture") + ], SpotLight.prototype, "_projectionTexture", void 0); + return SpotLight; + }(BABYLON.ShadowLight)); + BABYLON.SpotLight = SpotLight; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.spotLight.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Class used to override all child animations of a given target + */ + var AnimationPropertiesOverride = /** @class */ (function () { + function AnimationPropertiesOverride() { + /** + * Gets or sets a value indicating if animation blending must be used + */ + this.enableBlending = false; + /** + * Gets or sets the blending speed to use when enableBlending is true + */ + this.blendingSpeed = 0.01; + /** + * Gets or sets the default loop mode to use + */ + this.loopMode = BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE; + } + return AnimationPropertiesOverride; + }()); + BABYLON.AnimationPropertiesOverride = AnimationPropertiesOverride; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.animationPropertiesOverride.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Represents the range of an animation + */ + var AnimationRange = /** @class */ (function () { + /** + * Initializes the range of an animation + * @param name The name of the animation range + * @param from The starting frame of the animation + * @param to The ending frame of the animation + */ + function AnimationRange( + /**The name of the animation range**/ + name, + /**The starting frame of the animation */ + from, + /**The ending frame of the animation*/ + to) { + this.name = name; + this.from = from; + this.to = to; + } + /** + * Makes a copy of the animation range + * @returns A copy of the animation range + */ + AnimationRange.prototype.clone = function () { + return new AnimationRange(this.name, this.from, this.to); + }; + return AnimationRange; + }()); + BABYLON.AnimationRange = AnimationRange; + /** + * Composed of a frame, and an action function + */ + var AnimationEvent = /** @class */ (function () { + /** + * Initializes the animation event + * @param frame The frame for which the event is triggered + * @param action The event to perform when triggered + * @param onlyOnce Specifies if the event should be triggered only once + */ + function AnimationEvent( + /** The frame for which the event is triggered **/ + frame, + /** The event to perform when triggered **/ + action, + /** Specifies if the event should be triggered only once**/ + onlyOnce) { + this.frame = frame; + this.action = action; + this.onlyOnce = onlyOnce; + /** + * Specifies if the animation event is done + */ + this.isDone = false; + } + /** @hidden */ + AnimationEvent.prototype._clone = function () { + return new AnimationEvent(this.frame, this.action, this.onlyOnce); + }; + return AnimationEvent; + }()); + BABYLON.AnimationEvent = AnimationEvent; + /** + * A cursor which tracks a point on a path + */ + var PathCursor = /** @class */ (function () { + /** + * Initializes the path cursor + * @param path The path to track + */ + function PathCursor(path) { + this.path = path; + /** + * Stores path cursor callbacks for when an onchange event is triggered + */ + this._onchange = new Array(); + /** + * The value of the path cursor + */ + this.value = 0; + /** + * The animation array of the path cursor + */ + this.animations = new Array(); + } + /** + * Gets the cursor point on the path + * @returns A point on the path cursor at the cursor location + */ + PathCursor.prototype.getPoint = function () { + var point = this.path.getPointAtLengthPosition(this.value); + return new BABYLON.Vector3(point.x, 0, point.y); + }; + /** + * Moves the cursor ahead by the step amount + * @param step The amount to move the cursor forward + * @returns This path cursor + */ + PathCursor.prototype.moveAhead = function (step) { + if (step === void 0) { step = 0.002; } + this.move(step); + return this; + }; + /** + * Moves the cursor behind by the step amount + * @param step The amount to move the cursor back + * @returns This path cursor + */ + PathCursor.prototype.moveBack = function (step) { + if (step === void 0) { step = 0.002; } + this.move(-step); + return this; + }; + /** + * Moves the cursor by the step amount + * If the step amount is greater than one, an exception is thrown + * @param step The amount to move the cursor + * @returns This path cursor + */ + PathCursor.prototype.move = function (step) { + if (Math.abs(step) > 1) { + throw "step size should be less than 1."; + } + this.value += step; + this.ensureLimits(); + this.raiseOnChange(); + return this; + }; + /** + * Ensures that the value is limited between zero and one + * @returns This path cursor + */ + PathCursor.prototype.ensureLimits = function () { + while (this.value > 1) { + this.value -= 1; + } + while (this.value < 0) { + this.value += 1; + } + return this; + }; + /** + * Runs onchange callbacks on change (used by the animation engine) + * @returns This path cursor + */ + PathCursor.prototype.raiseOnChange = function () { + var _this = this; + this._onchange.forEach(function (f) { return f(_this); }); + return this; + }; + /** + * Executes a function on change + * @param f A path cursor onchange callback + * @returns This path cursor + */ + PathCursor.prototype.onchange = function (f) { + this._onchange.push(f); + return this; + }; + return PathCursor; + }()); + BABYLON.PathCursor = PathCursor; + /** + * Enum for the animation key frame interpolation type + */ + var AnimationKeyInterpolation; + (function (AnimationKeyInterpolation) { + /** + * Do not interpolate between keys and use the start key value only. Tangents are ignored + */ + AnimationKeyInterpolation[AnimationKeyInterpolation["STEP"] = 1] = "STEP"; + })(AnimationKeyInterpolation = BABYLON.AnimationKeyInterpolation || (BABYLON.AnimationKeyInterpolation = {})); + /** + * Class used to store any kind of animation + */ + var Animation = /** @class */ (function () { + /** + * Initializes the animation + * @param name Name of the animation + * @param targetProperty Property to animate + * @param framePerSecond The frames per second of the animation + * @param dataType The data type of the animation + * @param loopMode The loop mode of the animation + * @param enableBlendings Specifies if blending should be enabled + */ + function Animation( + /**Name of the animation */ + name, + /**Property to animate */ + targetProperty, + /**The frames per second of the animation */ + framePerSecond, + /**The data type of the animation */ + dataType, + /**The loop mode of the animation */ + loopMode, + /**Specifies if blending should be enabled */ + enableBlending) { + this.name = name; + this.targetProperty = targetProperty; + this.framePerSecond = framePerSecond; + this.dataType = dataType; + this.loopMode = loopMode; + this.enableBlending = enableBlending; + /** + * @hidden Internal use only + */ + this._runtimeAnimations = new Array(); + /** + * The set of event that will be linked to this animation + */ + this._events = new Array(); + /** + * Stores the blending speed of the animation + */ + this.blendingSpeed = 0.01; + /** + * Stores the animation ranges for the animation + */ + this._ranges = {}; + this.targetPropertyPath = targetProperty.split("."); + this.dataType = dataType; + this.loopMode = loopMode === undefined ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode; + } + /** + * @hidden Internal use + */ + Animation._PrepareAnimation = function (name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction) { + var dataType = undefined; + if (!isNaN(parseFloat(from)) && isFinite(from)) { + dataType = Animation.ANIMATIONTYPE_FLOAT; + } + else if (from instanceof BABYLON.Quaternion) { + dataType = Animation.ANIMATIONTYPE_QUATERNION; + } + else if (from instanceof BABYLON.Vector3) { + dataType = Animation.ANIMATIONTYPE_VECTOR3; + } + else if (from instanceof BABYLON.Vector2) { + dataType = Animation.ANIMATIONTYPE_VECTOR2; + } + else if (from instanceof BABYLON.Color3) { + dataType = Animation.ANIMATIONTYPE_COLOR3; + } + else if (from instanceof BABYLON.Size) { + dataType = Animation.ANIMATIONTYPE_SIZE; + } + if (dataType == undefined) { + return null; + } + var animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode); + var keys = [{ frame: 0, value: from }, { frame: totalFrame, value: to }]; + animation.setKeys(keys); + if (easingFunction !== undefined) { + animation.setEasingFunction(easingFunction); + } + return animation; + }; + /** + * Sets up an animation + * @param property The property to animate + * @param animationType The animation type to apply + * @param framePerSecond The frames per second of the animation + * @param easingFunction The easing function used in the animation + * @returns The created animation + */ + Animation.CreateAnimation = function (property, animationType, framePerSecond, easingFunction) { + var animation = new Animation(property + "Animation", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT); + animation.setEasingFunction(easingFunction); + return animation; + }; + /** + * Create and start an animation on a node + * @param name defines the name of the global animation that will be run on all nodes + * @param node defines the root node where the animation will take place + * @param targetProperty defines property to animate + * @param framePerSecond defines the number of frame per second yo use + * @param totalFrame defines the number of frames in total + * @param from defines the initial value + * @param to defines the final value + * @param loopMode defines which loop mode you want to use (off by default) + * @param easingFunction defines the easing function to use (linear by default) + * @param onAnimationEnd defines the callback to call when animation end + * @returns the animatable created for this animation + */ + Animation.CreateAndStartAnimation = function (name, node, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) { + var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); + if (!animation) { + return null; + } + return node.getScene().beginDirectAnimation(node, [animation], 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd); + }; + /** + * Create and start an animation on a node and its descendants + * @param name defines the name of the global animation that will be run on all nodes + * @param node defines the root node where the animation will take place + * @param directDescendantsOnly if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used + * @param targetProperty defines property to animate + * @param framePerSecond defines the number of frame per second to use + * @param totalFrame defines the number of frames in total + * @param from defines the initial value + * @param to defines the final value + * @param loopMode defines which loop mode you want to use (off by default) + * @param easingFunction defines the easing function to use (linear by default) + * @param onAnimationEnd defines the callback to call when an animation ends (will be called once per node) + * @returns the list of animatables created for all nodes + * @example https://www.babylonjs-playground.com/#MH0VLI + */ + Animation.CreateAndStartHierarchyAnimation = function (name, node, directDescendantsOnly, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) { + var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); + if (!animation) { + return null; + } + var scene = node.getScene(); + return scene.beginDirectHierarchyAnimation(node, directDescendantsOnly, [animation], 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd); + }; + /** + * Creates a new animation, merges it with the existing animations and starts it + * @param name Name of the animation + * @param node Node which contains the scene that begins the animations + * @param targetProperty Specifies which property to animate + * @param framePerSecond The frames per second of the animation + * @param totalFrame The total number of frames + * @param from The frame at the beginning of the animation + * @param to The frame at the end of the animation + * @param loopMode Specifies the loop mode of the animation + * @param easingFunction (Optional) The easing function of the animation, which allow custom mathematical formulas for animations + * @param onAnimationEnd Callback to run once the animation is complete + * @returns Nullable animation + */ + Animation.CreateMergeAndStartAnimation = function (name, node, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) { + var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); + if (!animation) { + return null; + } + node.animations.push(animation); + return node.getScene().beginAnimation(node, 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd); + }; + /** + * Transition property of an host to the target Value + * @param property The property to transition + * @param targetValue The target Value of the property + * @param host The object where the property to animate belongs + * @param scene Scene used to run the animation + * @param frameRate Framerate (in frame/s) to use + * @param transition The transition type we want to use + * @param duration The duration of the animation, in milliseconds + * @param onAnimationEnd Callback trigger at the end of the animation + * @returns Nullable animation + */ + Animation.TransitionTo = function (property, targetValue, host, scene, frameRate, transition, duration, onAnimationEnd) { + if (onAnimationEnd === void 0) { onAnimationEnd = null; } + if (duration <= 0) { + host[property] = targetValue; + if (onAnimationEnd) { + onAnimationEnd(); + } + return null; + } + var endFrame = frameRate * (duration / 1000); + transition.setKeys([{ + frame: 0, + value: host[property].clone ? host[property].clone() : host[property] + }, + { + frame: endFrame, + value: targetValue + }]); + if (!host.animations) { + host.animations = []; + } + host.animations.push(transition); + var animation = scene.beginAnimation(host, 0, endFrame, false); + animation.onAnimationEnd = onAnimationEnd; + return animation; + }; + Object.defineProperty(Animation.prototype, "runtimeAnimations", { + /** + * Return the array of runtime animations currently using this animation + */ + get: function () { + return this._runtimeAnimations; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "hasRunningRuntimeAnimations", { + /** + * Specifies if any of the runtime animations are currently running + */ + get: function () { + for (var _i = 0, _a = this._runtimeAnimations; _i < _a.length; _i++) { + var runtimeAnimation = _a[_i]; + if (!runtimeAnimation.isStopped) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + // Methods + /** + * Converts the animation to a string + * @param fullDetails support for multiple levels of logging within scene loading + * @returns String form of the animation + */ + Animation.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name + ", property: " + this.targetProperty; + ret += ", datatype: " + (["Float", "Vector3", "Quaternion", "Matrix", "Color3", "Vector2"])[this.dataType]; + ret += ", nKeys: " + (this._keys ? this._keys.length : "none"); + ret += ", nRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none"); + if (fullDetails) { + ret += ", Ranges: {"; + var first = true; + for (var name in this._ranges) { + if (first) { + ret += ", "; + first = false; + } + ret += name; + } + ret += "}"; + } + return ret; + }; + /** + * Add an event to this animation + * @param event Event to add + */ + Animation.prototype.addEvent = function (event) { + this._events.push(event); + }; + /** + * Remove all events found at the given frame + * @param frame The frame to remove events from + */ + Animation.prototype.removeEvents = function (frame) { + for (var index = 0; index < this._events.length; index++) { + if (this._events[index].frame === frame) { + this._events.splice(index, 1); + index--; + } + } + }; + /** + * Retrieves all the events from the animation + * @returns Events from the animation + */ + Animation.prototype.getEvents = function () { + return this._events; + }; + /** + * Creates an animation range + * @param name Name of the animation range + * @param from Starting frame of the animation range + * @param to Ending frame of the animation + */ + Animation.prototype.createRange = function (name, from, to) { + // check name not already in use; could happen for bones after serialized + if (!this._ranges[name]) { + this._ranges[name] = new AnimationRange(name, from, to); + } + }; + /** + * Deletes an animation range by name + * @param name Name of the animation range to delete + * @param deleteFrames Specifies if the key frames for the range should also be deleted (true) or not (false) + */ + Animation.prototype.deleteRange = function (name, deleteFrames) { + if (deleteFrames === void 0) { deleteFrames = true; } + var range = this._ranges[name]; + if (!range) { + return; + } + if (deleteFrames) { + var from = range.from; + var to = range.to; + // this loop MUST go high to low for multiple splices to work + for (var key = this._keys.length - 1; key >= 0; key--) { + if (this._keys[key].frame >= from && this._keys[key].frame <= to) { + this._keys.splice(key, 1); + } + } + } + this._ranges[name] = null; // said much faster than 'delete this._range[name]' + }; + /** + * Gets the animation range by name, or null if not defined + * @param name Name of the animation range + * @returns Nullable animation range + */ + Animation.prototype.getRange = function (name) { + return this._ranges[name]; + }; + /** + * Gets the key frames from the animation + * @returns The key frames of the animation + */ + Animation.prototype.getKeys = function () { + return this._keys; + }; + /** + * Gets the highest frame rate of the animation + * @returns Highest frame rate of the animation + */ + Animation.prototype.getHighestFrame = function () { + var ret = 0; + for (var key = 0, nKeys = this._keys.length; key < nKeys; key++) { + if (ret < this._keys[key].frame) { + ret = this._keys[key].frame; + } + } + return ret; + }; + /** + * Gets the easing function of the animation + * @returns Easing function of the animation + */ + Animation.prototype.getEasingFunction = function () { + return this._easingFunction; + }; + /** + * Sets the easing function of the animation + * @param easingFunction A custom mathematical formula for animation + */ + Animation.prototype.setEasingFunction = function (easingFunction) { + this._easingFunction = easingFunction; + }; + /** + * Interpolates a scalar linearly + * @param startValue Start value of the animation curve + * @param endValue End value of the animation curve + * @param gradient Scalar amount to interpolate + * @returns Interpolated scalar value + */ + Animation.prototype.floatInterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Scalar.Lerp(startValue, endValue, gradient); + }; + /** + * Interpolates a scalar cubically + * @param startValue Start value of the animation curve + * @param outTangent End tangent of the animation + * @param endValue End value of the animation curve + * @param inTangent Start tangent of the animation curve + * @param gradient Scalar amount to interpolate + * @returns Interpolated scalar value + */ + Animation.prototype.floatInterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) { + return BABYLON.Scalar.Hermite(startValue, outTangent, endValue, inTangent, gradient); + }; + /** + * Interpolates a quaternion using a spherical linear interpolation + * @param startValue Start value of the animation curve + * @param endValue End value of the animation curve + * @param gradient Scalar amount to interpolate + * @returns Interpolated quaternion value + */ + Animation.prototype.quaternionInterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Quaternion.Slerp(startValue, endValue, gradient); + }; + /** + * Interpolates a quaternion cubically + * @param startValue Start value of the animation curve + * @param outTangent End tangent of the animation curve + * @param endValue End value of the animation curve + * @param inTangent Start tangent of the animation curve + * @param gradient Scalar amount to interpolate + * @returns Interpolated quaternion value + */ + Animation.prototype.quaternionInterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) { + return BABYLON.Quaternion.Hermite(startValue, outTangent, endValue, inTangent, gradient).normalize(); + }; + /** + * Interpolates a Vector3 linearl + * @param startValue Start value of the animation curve + * @param endValue End value of the animation curve + * @param gradient Scalar amount to interpolate + * @returns Interpolated scalar value + */ + Animation.prototype.vector3InterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Vector3.Lerp(startValue, endValue, gradient); + }; + /** + * Interpolates a Vector3 cubically + * @param startValue Start value of the animation curve + * @param outTangent End tangent of the animation + * @param endValue End value of the animation curve + * @param inTangent Start tangent of the animation curve + * @param gradient Scalar amount to interpolate + * @returns InterpolatedVector3 value + */ + Animation.prototype.vector3InterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) { + return BABYLON.Vector3.Hermite(startValue, outTangent, endValue, inTangent, gradient); + }; + /** + * Interpolates a Vector2 linearly + * @param startValue Start value of the animation curve + * @param endValue End value of the animation curve + * @param gradient Scalar amount to interpolate + * @returns Interpolated Vector2 value + */ + Animation.prototype.vector2InterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Vector2.Lerp(startValue, endValue, gradient); + }; + /** + * Interpolates a Vector2 cubically + * @param startValue Start value of the animation curve + * @param outTangent End tangent of the animation + * @param endValue End value of the animation curve + * @param inTangent Start tangent of the animation curve + * @param gradient Scalar amount to interpolate + * @returns Interpolated Vector2 value + */ + Animation.prototype.vector2InterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) { + return BABYLON.Vector2.Hermite(startValue, outTangent, endValue, inTangent, gradient); + }; + /** + * Interpolates a size linearly + * @param startValue Start value of the animation curve + * @param endValue End value of the animation curve + * @param gradient Scalar amount to interpolate + * @returns Interpolated Size value + */ + Animation.prototype.sizeInterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Size.Lerp(startValue, endValue, gradient); + }; + /** + * Interpolates a Color3 linearly + * @param startValue Start value of the animation curve + * @param endValue End value of the animation curve + * @param gradient Scalar amount to interpolate + * @returns Interpolated Color3 value + */ + Animation.prototype.color3InterpolateFunction = function (startValue, endValue, gradient) { + return BABYLON.Color3.Lerp(startValue, endValue, gradient); + }; + /** + * @hidden Internal use only + */ + Animation.prototype._getKeyValue = function (value) { + if (typeof value === "function") { + return value(); + } + return value; + }; + /** + * @hidden Internal use only + */ + Animation.prototype._interpolate = function (currentFrame, repeatCount, workValue, loopMode, offsetValue, highLimitValue) { + if (loopMode === Animation.ANIMATIONLOOPMODE_CONSTANT && repeatCount > 0) { + return highLimitValue.clone ? highLimitValue.clone() : highLimitValue; + } + var keys = this.getKeys(); + // Try to get a hash to find the right key + var startKeyIndex = Math.max(0, Math.min(keys.length - 1, Math.floor(keys.length * (currentFrame - keys[0].frame) / (keys[keys.length - 1].frame - keys[0].frame)) - 1)); + if (keys[startKeyIndex].frame >= currentFrame) { + while (startKeyIndex - 1 >= 0 && keys[startKeyIndex].frame >= currentFrame) { + startKeyIndex--; + } + } + for (var key = startKeyIndex; key < keys.length; key++) { + var endKey = keys[key + 1]; + if (endKey.frame >= currentFrame) { + var startKey = keys[key]; + var startValue = this._getKeyValue(startKey.value); + if (startKey.interpolation === AnimationKeyInterpolation.STEP) { + return startValue; + } + var endValue = this._getKeyValue(endKey.value); + var useTangent = startKey.outTangent !== undefined && endKey.inTangent !== undefined; + var frameDelta = endKey.frame - startKey.frame; + // gradient : percent of currentFrame between the frame inf and the frame sup + var gradient = (currentFrame - startKey.frame) / frameDelta; + // check for easingFunction and correction of gradient + var easingFunction = this.getEasingFunction(); + if (easingFunction != null) { + gradient = easingFunction.ease(gradient); + } + switch (this.dataType) { + // Float + case Animation.ANIMATIONTYPE_FLOAT: + var floatValue = useTangent ? this.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient) : this.floatInterpolateFunction(startValue, endValue, gradient); + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return floatValue; + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return offsetValue * repeatCount + floatValue; + } + break; + // Quaternion + case Animation.ANIMATIONTYPE_QUATERNION: + var quatValue = useTangent ? this.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.quaternionInterpolateFunction(startValue, endValue, gradient); + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return quatValue; + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return quatValue.addInPlace(offsetValue.scale(repeatCount)); + } + return quatValue; + // Vector3 + case Animation.ANIMATIONTYPE_VECTOR3: + var vec3Value = useTangent ? this.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.vector3InterpolateFunction(startValue, endValue, gradient); + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return vec3Value; + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return vec3Value.add(offsetValue.scale(repeatCount)); + } + // Vector2 + case Animation.ANIMATIONTYPE_VECTOR2: + var vec2Value = useTangent ? this.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.vector2InterpolateFunction(startValue, endValue, gradient); + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return vec2Value; + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return vec2Value.add(offsetValue.scale(repeatCount)); + } + // Size + case Animation.ANIMATIONTYPE_SIZE: + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return this.sizeInterpolateFunction(startValue, endValue, gradient); + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return this.sizeInterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount)); + } + // Color3 + case Animation.ANIMATIONTYPE_COLOR3: + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + return this.color3InterpolateFunction(startValue, endValue, gradient); + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return this.color3InterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount)); + } + // Matrix + case Animation.ANIMATIONTYPE_MATRIX: + switch (loopMode) { + case Animation.ANIMATIONLOOPMODE_CYCLE: + case Animation.ANIMATIONLOOPMODE_CONSTANT: + if (Animation.AllowMatricesInterpolation) { + return this.matrixInterpolateFunction(startValue, endValue, gradient, workValue); + } + case Animation.ANIMATIONLOOPMODE_RELATIVE: + return startValue; + } + default: + break; + } + break; + } + } + return this._getKeyValue(keys[keys.length - 1].value); + }; + /** + * Defines the function to use to interpolate matrices + * @param startValue defines the start matrix + * @param endValue defines the end matrix + * @param gradient defines the gradient between both matrices + * @param result defines an optional target matrix where to store the interpolation + * @returns the interpolated matrix + */ + Animation.prototype.matrixInterpolateFunction = function (startValue, endValue, gradient, result) { + if (Animation.AllowMatrixDecomposeForInterpolation) { + if (result) { + BABYLON.Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result); + return result; + } + return BABYLON.Matrix.DecomposeLerp(startValue, endValue, gradient); + } + if (result) { + BABYLON.Matrix.LerpToRef(startValue, endValue, gradient, result); + return result; + } + return BABYLON.Matrix.Lerp(startValue, endValue, gradient); + }; + /** + * Makes a copy of the animation + * @returns Cloned animation + */ + Animation.prototype.clone = function () { + var clone = new Animation(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode); + clone.enableBlending = this.enableBlending; + clone.blendingSpeed = this.blendingSpeed; + if (this._keys) { + clone.setKeys(this._keys); + } + if (this._ranges) { + clone._ranges = {}; + for (var name in this._ranges) { + var range = this._ranges[name]; + if (!range) { + continue; + } + clone._ranges[name] = range.clone(); + } + } + return clone; + }; + /** + * Sets the key frames of the animation + * @param values The animation key frames to set + */ + Animation.prototype.setKeys = function (values) { + this._keys = values.slice(0); + }; + /** + * Serializes the animation to an object + * @returns Serialized object + */ + Animation.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.name = this.name; + serializationObject.property = this.targetProperty; + serializationObject.framePerSecond = this.framePerSecond; + serializationObject.dataType = this.dataType; + serializationObject.loopBehavior = this.loopMode; + serializationObject.enableBlending = this.enableBlending; + serializationObject.blendingSpeed = this.blendingSpeed; + var dataType = this.dataType; + serializationObject.keys = []; + var keys = this.getKeys(); + for (var index = 0; index < keys.length; index++) { + var animationKey = keys[index]; + var key = {}; + key.frame = animationKey.frame; + switch (dataType) { + case Animation.ANIMATIONTYPE_FLOAT: + key.values = [animationKey.value]; + break; + case Animation.ANIMATIONTYPE_QUATERNION: + case Animation.ANIMATIONTYPE_MATRIX: + case Animation.ANIMATIONTYPE_VECTOR3: + case Animation.ANIMATIONTYPE_COLOR3: + key.values = animationKey.value.asArray(); + break; + } + serializationObject.keys.push(key); + } + serializationObject.ranges = []; + for (var name in this._ranges) { + var source = this._ranges[name]; + if (!source) { + continue; + } + var range = {}; + range.name = name; + range.from = source.from; + range.to = source.to; + serializationObject.ranges.push(range); + } + return serializationObject; + }; + Object.defineProperty(Animation, "ANIMATIONTYPE_FLOAT", { + /** + * Get the float animation type + */ + get: function () { + return Animation._ANIMATIONTYPE_FLOAT; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_VECTOR3", { + /** + * Get the Vector3 animation type + */ + get: function () { + return Animation._ANIMATIONTYPE_VECTOR3; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_VECTOR2", { + /** + * Get the Vector2 animation type + */ + get: function () { + return Animation._ANIMATIONTYPE_VECTOR2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_SIZE", { + /** + * Get the Size animation type + */ + get: function () { + return Animation._ANIMATIONTYPE_SIZE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_QUATERNION", { + /** + * Get the Quaternion animation type + */ + get: function () { + return Animation._ANIMATIONTYPE_QUATERNION; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_MATRIX", { + /** + * Get the Matrix animation type + */ + get: function () { + return Animation._ANIMATIONTYPE_MATRIX; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONTYPE_COLOR3", { + /** + * Get the Color3 animation type + */ + get: function () { + return Animation._ANIMATIONTYPE_COLOR3; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONLOOPMODE_RELATIVE", { + /** + * Get the Relative Loop Mode + */ + get: function () { + return Animation._ANIMATIONLOOPMODE_RELATIVE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONLOOPMODE_CYCLE", { + /** + * Get the Cycle Loop Mode + */ + get: function () { + return Animation._ANIMATIONLOOPMODE_CYCLE; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation, "ANIMATIONLOOPMODE_CONSTANT", { + /** + * Get the Constant Loop Mode + */ + get: function () { + return Animation._ANIMATIONLOOPMODE_CONSTANT; + }, + enumerable: true, + configurable: true + }); + /** @hidden */ + Animation._UniversalLerp = function (left, right, amount) { + var constructor = left.constructor; + if (constructor.Lerp) { // Lerp supported + return constructor.Lerp(left, right, amount); + } + else if (constructor.Slerp) { // Slerp supported + return constructor.Slerp(left, right, amount); + } + else if (left.toFixed) { // Number + return left * (1.0 - amount) + amount * right; + } + else { // Blending not supported + return right; + } + }; + /** + * Parses an animation object and creates an animation + * @param parsedAnimation Parsed animation object + * @returns Animation object + */ + Animation.Parse = function (parsedAnimation) { + var animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior); + var dataType = parsedAnimation.dataType; + var keys = []; + var data; + var index; + if (parsedAnimation.enableBlending) { + animation.enableBlending = parsedAnimation.enableBlending; + } + if (parsedAnimation.blendingSpeed) { + animation.blendingSpeed = parsedAnimation.blendingSpeed; + } + for (index = 0; index < parsedAnimation.keys.length; index++) { + var key = parsedAnimation.keys[index]; + var inTangent; + var outTangent; + switch (dataType) { + case Animation.ANIMATIONTYPE_FLOAT: + data = key.values[0]; + if (key.values.length >= 1) { + inTangent = key.values[1]; + } + if (key.values.length >= 2) { + outTangent = key.values[2]; + } + break; + case Animation.ANIMATIONTYPE_QUATERNION: + data = BABYLON.Quaternion.FromArray(key.values); + if (key.values.length >= 8) { + var _inTangent = BABYLON.Quaternion.FromArray(key.values.slice(4, 8)); + if (!_inTangent.equals(BABYLON.Quaternion.Zero())) { + inTangent = _inTangent; + } + } + if (key.values.length >= 12) { + var _outTangent = BABYLON.Quaternion.FromArray(key.values.slice(8, 12)); + if (!_outTangent.equals(BABYLON.Quaternion.Zero())) { + outTangent = _outTangent; + } + } + break; + case Animation.ANIMATIONTYPE_MATRIX: + data = BABYLON.Matrix.FromArray(key.values); + break; + case Animation.ANIMATIONTYPE_COLOR3: + data = BABYLON.Color3.FromArray(key.values); + break; + case Animation.ANIMATIONTYPE_VECTOR3: + default: + data = BABYLON.Vector3.FromArray(key.values); + break; + } + var keyData = {}; + keyData.frame = key.frame; + keyData.value = data; + if (inTangent != undefined) { + keyData.inTangent = inTangent; + } + if (outTangent != undefined) { + keyData.outTangent = outTangent; + } + keys.push(keyData); + } + animation.setKeys(keys); + if (parsedAnimation.ranges) { + for (index = 0; index < parsedAnimation.ranges.length; index++) { + data = parsedAnimation.ranges[index]; + animation.createRange(data.name, data.from, data.to); + } + } + return animation; + }; + /** + * Appends the serialized animations from the source animations + * @param source Source containing the animations + * @param destination Target to store the animations + */ + Animation.AppendSerializedAnimations = function (source, destination) { + if (source.animations) { + destination.animations = []; + for (var animationIndex = 0; animationIndex < source.animations.length; animationIndex++) { + var animation = source.animations[animationIndex]; + destination.animations.push(animation.serialize()); + } + } + }; + /** + * Use matrix interpolation instead of using direct key value when animating matrices + */ + Animation.AllowMatricesInterpolation = false; + /** + * When matrix interpolation is enabled, this boolean forces the system to use Matrix.DecomposeLerp instead of Matrix.Lerp. Interpolation is more precise but slower + */ + Animation.AllowMatrixDecomposeForInterpolation = true; + // Statics + /** + * Float animation type + */ + Animation._ANIMATIONTYPE_FLOAT = 0; + /** + * Vector3 animation type + */ + Animation._ANIMATIONTYPE_VECTOR3 = 1; + /** + * Quaternion animation type + */ + Animation._ANIMATIONTYPE_QUATERNION = 2; + /** + * Matrix animation type + */ + Animation._ANIMATIONTYPE_MATRIX = 3; + /** + * Color3 animation type + */ + Animation._ANIMATIONTYPE_COLOR3 = 4; + /** + * Vector2 animation type + */ + Animation._ANIMATIONTYPE_VECTOR2 = 5; + /** + * Size animation type + */ + Animation._ANIMATIONTYPE_SIZE = 6; + /** + * Relative Loop Mode + */ + Animation._ANIMATIONLOOPMODE_RELATIVE = 0; + /** + * Cycle Loop Mode + */ + Animation._ANIMATIONLOOPMODE_CYCLE = 1; + /** + * Constant Loop Mode + */ + Animation._ANIMATIONLOOPMODE_CONSTANT = 2; + return Animation; + }()); + BABYLON.Animation = Animation; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.animation.js.map + +var BABYLON; +(function (BABYLON) { + /** + * This class defines the direct association between an animation and a target + */ + var TargetedAnimation = /** @class */ (function () { + function TargetedAnimation() { + } + return TargetedAnimation; + }()); + BABYLON.TargetedAnimation = TargetedAnimation; + /** + * Use this class to create coordinated animations on multiple targets + */ + var AnimationGroup = /** @class */ (function () { + /** + * Instantiates a new Animation Group. + * This helps managing several animations at once. + * @see http://doc.babylonjs.com/how_to/group + * @param name Defines the name of the group + * @param scene Defines the scene the group belongs to + */ + function AnimationGroup( + /** The name of the animation group */ + name, scene) { + if (scene === void 0) { scene = null; } + this.name = name; + this._targetedAnimations = new Array(); + this._animatables = new Array(); + this._from = Number.MAX_VALUE; + this._to = -Number.MAX_VALUE; + this._speedRatio = 1; + /** + * This observable will notify when one animation have ended. + */ + this.onAnimationEndObservable = new BABYLON.Observable(); + /** + * This observable will notify when all animations have ended. + */ + this.onAnimationGroupEndObservable = new BABYLON.Observable(); + /** + * This observable will notify when all animations have paused. + */ + this.onAnimationGroupPauseObservable = new BABYLON.Observable(); + this._scene = scene || BABYLON.Engine.LastCreatedScene; + this._scene.animationGroups.push(this); + } + Object.defineProperty(AnimationGroup.prototype, "from", { + /** + * Gets the first frame + */ + get: function () { + return this._from; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationGroup.prototype, "to", { + /** + * Gets the last frame + */ + get: function () { + return this._to; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationGroup.prototype, "isStarted", { + /** + * Define if the animations are started + */ + get: function () { + return this._isStarted; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationGroup.prototype, "speedRatio", { + /** + * Gets or sets the speed ratio to use for all animations + */ + get: function () { + return this._speedRatio; + }, + /** + * Gets or sets the speed ratio to use for all animations + */ + set: function (value) { + if (this._speedRatio === value) { + return; + } + this._speedRatio = value; + for (var index = 0; index < this._animatables.length; index++) { + var animatable = this._animatables[index]; + animatable.speedRatio = this._speedRatio; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationGroup.prototype, "targetedAnimations", { + /** + * Gets the targeted animations for this animation group + */ + get: function () { + return this._targetedAnimations; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationGroup.prototype, "animatables", { + /** + * returning the list of animatables controlled by this animation group. + */ + get: function () { + return this._animatables; + }, + enumerable: true, + configurable: true + }); + /** + * Add an animation (with its target) in the group + * @param animation defines the animation we want to add + * @param target defines the target of the animation + * @returns the TargetedAnimation object + */ + AnimationGroup.prototype.addTargetedAnimation = function (animation, target) { + var targetedAnimation = { + animation: animation, + target: target + }; + var keys = animation.getKeys(); + if (this._from > keys[0].frame) { + this._from = keys[0].frame; + } + if (this._to < keys[keys.length - 1].frame) { + this._to = keys[keys.length - 1].frame; + } + this._targetedAnimations.push(targetedAnimation); + return targetedAnimation; + }; + /** + * This function will normalize every animation in the group to make sure they all go from beginFrame to endFrame + * It can add constant keys at begin or end + * @param beginFrame defines the new begin frame for all animations or the smallest begin frame of all animations if null (defaults to null) + * @param endFrame defines the new end frame for all animations or the largest end frame of all animations if null (defaults to null) + * @returns the animation group + */ + AnimationGroup.prototype.normalize = function (beginFrame, endFrame) { + if (beginFrame === void 0) { beginFrame = null; } + if (endFrame === void 0) { endFrame = null; } + if (beginFrame == null) { + beginFrame = this._from; + } + if (endFrame == null) { + endFrame = this._to; + } + for (var index = 0; index < this._targetedAnimations.length; index++) { + var targetedAnimation = this._targetedAnimations[index]; + var keys = targetedAnimation.animation.getKeys(); + var startKey = keys[0]; + var endKey = keys[keys.length - 1]; + if (startKey.frame > beginFrame) { + var newKey = { + frame: beginFrame, + value: startKey.value, + inTangent: startKey.inTangent, + outTangent: startKey.outTangent, + interpolation: startKey.interpolation + }; + keys.splice(0, 0, newKey); + } + if (endKey.frame < endFrame) { + var newKey = { + frame: endFrame, + value: endKey.value, + inTangent: endKey.outTangent, + outTangent: endKey.outTangent, + interpolation: endKey.interpolation + }; + keys.push(newKey); + } + } + this._from = beginFrame; + this._to = endFrame; + return this; + }; + /** + * Start all animations on given targets + * @param loop defines if animations must loop + * @param speedRatio defines the ratio to apply to animation speed (1 by default) + * @param from defines the from key (optional) + * @param to defines the to key (optional) + * @returns the current animation group + */ + AnimationGroup.prototype.start = function (loop, speedRatio, from, to) { + var _this = this; + if (loop === void 0) { loop = false; } + if (speedRatio === void 0) { speedRatio = 1; } + if (this._isStarted || this._targetedAnimations.length === 0) { + return this; + } + var _loop_1 = function (targetedAnimation) { + var animatable = this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], from !== undefined ? from : this_1._from, to !== undefined ? to : this_1._to, loop, speedRatio); + animatable.onAnimationEnd = function () { + _this.onAnimationEndObservable.notifyObservers(targetedAnimation); + _this._checkAnimationGroupEnded(animatable); + }; + this_1._animatables.push(animatable); + }; + var this_1 = this; + for (var _i = 0, _a = this._targetedAnimations; _i < _a.length; _i++) { + var targetedAnimation = _a[_i]; + _loop_1(targetedAnimation); + } + this._speedRatio = speedRatio; + this._isStarted = true; + return this; + }; + /** + * Pause all animations + * @returns the animation group + */ + AnimationGroup.prototype.pause = function () { + if (!this._isStarted) { + return this; + } + for (var index = 0; index < this._animatables.length; index++) { + var animatable = this._animatables[index]; + animatable.pause(); + } + this.onAnimationGroupPauseObservable.notifyObservers(this); + return this; + }; + /** + * Play all animations to initial state + * This function will start() the animations if they were not started or will restart() them if they were paused + * @param loop defines if animations must loop + * @returns the animation group + */ + AnimationGroup.prototype.play = function (loop) { + // only if all animatables are ready and exist + if (this.isStarted && this._animatables.length === this._targetedAnimations.length) { + if (loop !== undefined) { + for (var index = 0; index < this._animatables.length; index++) { + var animatable = this._animatables[index]; + animatable.loopAnimation = loop; + } + } + this.restart(); + } + else { + this.stop(); + this.start(loop, this._speedRatio); + } + return this; + }; + /** + * Reset all animations to initial state + * @returns the animation group + */ + AnimationGroup.prototype.reset = function () { + if (!this._isStarted) { + return this; + } + for (var index = 0; index < this._animatables.length; index++) { + var animatable = this._animatables[index]; + animatable.reset(); + } + return this; + }; + /** + * Restart animations from key 0 + * @returns the animation group + */ + AnimationGroup.prototype.restart = function () { + if (!this._isStarted) { + return this; + } + for (var index = 0; index < this._animatables.length; index++) { + var animatable = this._animatables[index]; + animatable.restart(); + } + return this; + }; + /** + * Stop all animations + * @returns the animation group + */ + AnimationGroup.prototype.stop = function () { + if (!this._isStarted) { + return this; + } + var list = this._animatables.slice(); + for (var index = 0; index < list.length; index++) { + list[index].stop(); + } + this._isStarted = false; + return this; + }; + /** + * Set animation weight for all animatables + * @param weight defines the weight to use + * @return the animationGroup + * @see http://doc.babylonjs.com/babylon101/animations#animation-weights + */ + AnimationGroup.prototype.setWeightForAllAnimatables = function (weight) { + for (var index = 0; index < this._animatables.length; index++) { + var animatable = this._animatables[index]; + animatable.weight = weight; + } + return this; + }; + /** + * Synchronize and normalize all animatables with a source animatable + * @param root defines the root animatable to synchronize with + * @return the animationGroup + * @see http://doc.babylonjs.com/babylon101/animations#animation-weights + */ + AnimationGroup.prototype.syncAllAnimationsWith = function (root) { + for (var index = 0; index < this._animatables.length; index++) { + var animatable = this._animatables[index]; + animatable.syncWith(root); + } + return this; + }; + /** + * Goes to a specific frame in this animation group + * @param frame the frame number to go to + * @return the animationGroup + */ + AnimationGroup.prototype.goToFrame = function (frame) { + if (!this._isStarted) { + return this; + } + for (var index = 0; index < this._animatables.length; index++) { + var animatable = this._animatables[index]; + animatable.goToFrame(frame); + } + return this; + }; + /** + * Dispose all associated resources + */ + AnimationGroup.prototype.dispose = function () { + this._targetedAnimations = []; + this._animatables = []; + var index = this._scene.animationGroups.indexOf(this); + if (index > -1) { + this._scene.animationGroups.splice(index, 1); + } + }; + AnimationGroup.prototype._checkAnimationGroupEnded = function (animatable) { + // animatable should be taken out of the array + var idx = this._animatables.indexOf(animatable); + if (idx > -1) { + this._animatables.splice(idx, 1); + } + // all animatables were removed? animation group ended! + if (this._animatables.length === 0) { + this._isStarted = false; + this.onAnimationGroupEndObservable.notifyObservers(this); + } + }; + // Statics + /** + * Returns a new AnimationGroup object parsed from the source provided. + * @param parsedAnimationGroup defines the source + * @param scene defines the scene that will receive the animationGroup + * @returns a new AnimationGroup + */ + AnimationGroup.Parse = function (parsedAnimationGroup, scene) { + var animationGroup = new BABYLON.AnimationGroup(parsedAnimationGroup.name, scene); + for (var i = 0; i < parsedAnimationGroup.targetedAnimations.length; i++) { + var targetedAnimation = parsedAnimationGroup.targetedAnimations[i]; + var animation = BABYLON.Animation.Parse(targetedAnimation.animation); + var id = targetedAnimation.targetId; + var targetNode = scene.getNodeByID(id); + if (targetNode != null) { + animationGroup.addTargetedAnimation(animation, targetNode); + } + } + if (parsedAnimationGroup.from !== null && parsedAnimationGroup.from !== null) { + animationGroup.normalize(parsedAnimationGroup.from, parsedAnimationGroup.to); + } + return animationGroup; + }; + /** + * Returns the string "AnimationGroup" + * @returns "AnimationGroup" + */ + AnimationGroup.prototype.getClassName = function () { + return "AnimationGroup"; + }; + /** + * Creates a detailled string about the object + * @param fullDetails defines if the output string will support multiple levels of logging within scene loading + * @returns a string representing the object + */ + AnimationGroup.prototype.toString = function (fullDetails) { + var ret = "Name: " + this.name; + ret += ", type: " + this.getClassName(); + if (fullDetails) { + ret += ", from: " + this._from; + ret += ", to: " + this._to; + ret += ", isStarted: " + this._isStarted; + ret += ", speedRatio: " + this._speedRatio; + ret += ", targetedAnimations length: " + this._targetedAnimations.length; + ret += ", animatables length: " + this._animatables; + } + return ret; + }; + return AnimationGroup; + }()); + BABYLON.AnimationGroup = AnimationGroup; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.animationGroup.js.map + +var BABYLON; +(function (BABYLON) { + // Static values to help the garbage collector + // Quaternion + var _staticOffsetValueQuaternion = Object.freeze(new BABYLON.Quaternion(0, 0, 0, 0)); + // Vector3 + var _staticOffsetValueVector3 = Object.freeze(BABYLON.Vector3.Zero()); + // Vector2 + var _staticOffsetValueVector2 = Object.freeze(BABYLON.Vector2.Zero()); + // Size + var _staticOffsetValueSize = Object.freeze(BABYLON.Size.Zero()); + // Color3 + var _staticOffsetValueColor3 = Object.freeze(BABYLON.Color3.Black()); + /** + * Defines a runtime animation + */ + var RuntimeAnimation = /** @class */ (function () { + /** + * Create a new RuntimeAnimation object + * @param target defines the target of the animation + * @param animation defines the source animation object + * @param scene defines the hosting scene + * @param host defines the initiating Animatable + */ + function RuntimeAnimation(target, animation, scene, host) { + var _this = this; + this._events = new Array(); + /** + * The current frame of the runtime animation + */ + this._currentFrame = 0; + /** + * The original value of the runtime animation + */ + this._originalValue = new Array(); + /** + * The offsets cache of the runtime animation + */ + this._offsetsCache = {}; + /** + * The high limits cache of the runtime animation + */ + this._highLimitsCache = {}; + /** + * Specifies if the runtime animation has been stopped + */ + this._stopped = false; + /** + * The blending factor of the runtime animation + */ + this._blendingFactor = 0; + /** + * The target path of the runtime animation + */ + this._targetPath = ""; + /** + * The weight of the runtime animation + */ + this._weight = 1.0; + /** + * The ratio offset of the runtime animation + */ + this._ratioOffset = 0; + /** + * The previous delay of the runtime animation + */ + this._previousDelay = 0; + /** + * The previous ratio of the runtime animation + */ + this._previousRatio = 0; + this._animation = animation; + this._target = target; + this._scene = scene; + this._host = host; + animation._runtimeAnimations.push(this); + // Cloning events locally + var events = animation.getEvents(); + if (events && events.length > 0) { + events.forEach(function (e) { + _this._events.push(e._clone()); + }); + } + } + Object.defineProperty(RuntimeAnimation.prototype, "currentFrame", { + /** + * Gets the current frame of the runtime animation + */ + get: function () { + return this._currentFrame; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RuntimeAnimation.prototype, "weight", { + /** + * Gets the weight of the runtime animation + */ + get: function () { + return this._weight; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RuntimeAnimation.prototype, "currentValue", { + /** + * Gets the current value of the runtime animation + */ + get: function () { + return this._currentValue; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RuntimeAnimation.prototype, "targetPath", { + /** + * Gets the target path of the runtime animation + */ + get: function () { + return this._targetPath; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RuntimeAnimation.prototype, "target", { + /** + * Gets the actual target of the runtime animation + */ + get: function () { + return this._activeTarget; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RuntimeAnimation.prototype, "animation", { + /** + * Gets the animation from the runtime animation + */ + get: function () { + return this._animation; + }, + enumerable: true, + configurable: true + }); + /** + * Resets the runtime animation to the beginning + * @param restoreOriginal defines whether to restore the target property to the original value + */ + RuntimeAnimation.prototype.reset = function (restoreOriginal) { + if (restoreOriginal === void 0) { restoreOriginal = false; } + if (restoreOriginal) { + if (this._target instanceof Array) { + var index = 0; + for (var _i = 0, _a = this._target; _i < _a.length; _i++) { + var target = _a[_i]; + if (this._originalValue[index] !== undefined) { + this._setValue(target, this._originalValue[index], -1); + } + index++; + } + } + else { + if (this._originalValue[0] !== undefined) { + this._setValue(this._target, this._originalValue[0], -1); + } + } + } + this._offsetsCache = {}; + this._highLimitsCache = {}; + this._currentFrame = 0; + this._blendingFactor = 0; + this._originalValue = new Array(); + // Events + for (var index = 0; index < this._events.length; index++) { + this._events[index].isDone = false; + } + }; + /** + * Specifies if the runtime animation is stopped + * @returns Boolean specifying if the runtime animation is stopped + */ + RuntimeAnimation.prototype.isStopped = function () { + return this._stopped; + }; + /** + * Disposes of the runtime animation + */ + RuntimeAnimation.prototype.dispose = function () { + var index = this._animation.runtimeAnimations.indexOf(this); + if (index > -1) { + this._animation.runtimeAnimations.splice(index, 1); + } + }; + /** + * Interpolates the animation from the current frame + * @param currentFrame The frame to interpolate the animation to + * @param repeatCount The number of times that the animation should loop + * @param loopMode The type of looping mode to use + * @param offsetValue Animation offset value + * @param highLimitValue The high limit value + * @returns The interpolated value + */ + RuntimeAnimation.prototype._interpolate = function (currentFrame, repeatCount, loopMode, offsetValue, highLimitValue) { + this._currentFrame = currentFrame; + if (this._animation.dataType === BABYLON.Animation.ANIMATIONTYPE_MATRIX && !this._workValue) { + this._workValue = BABYLON.Matrix.Zero(); + } + return this._animation._interpolate(currentFrame, repeatCount, this._workValue, loopMode, offsetValue, highLimitValue); + }; + /** + * Apply the interpolated value to the target + * @param currentValue defines the value computed by the animation + * @param weight defines the weight to apply to this value (Defaults to 1.0) + */ + RuntimeAnimation.prototype.setValue = function (currentValue, weight) { + if (weight === void 0) { weight = 1.0; } + if (this._target instanceof Array) { + var index = 0; + for (var _i = 0, _a = this._target; _i < _a.length; _i++) { + var target = _a[_i]; + this._setValue(target, currentValue, weight, index); + index++; + } + } + else { + this._setValue(this._target, currentValue, weight); + } + }; + RuntimeAnimation.prototype._setValue = function (target, currentValue, weight, targetIndex) { + if (targetIndex === void 0) { targetIndex = 0; } + // Set value + var path; + var destination; + var targetPropertyPath = this._animation.targetPropertyPath; + if (targetPropertyPath.length > 1) { + var property = target[targetPropertyPath[0]]; + for (var index = 1; index < targetPropertyPath.length - 1; index++) { + property = property[targetPropertyPath[index]]; + } + path = targetPropertyPath[targetPropertyPath.length - 1]; + destination = property; + } + else { + path = targetPropertyPath[0]; + destination = target; + } + this._targetPath = path; + this._activeTarget = destination; + this._weight = weight; + if (this._originalValue[targetIndex] === undefined) { + var originalValue = void 0; + if (destination.getRestPose && path === "_matrix") { // For bones + originalValue = destination.getRestPose(); + } + else { + originalValue = destination[path]; + } + if (originalValue && originalValue.clone) { + this._originalValue[targetIndex] = originalValue.clone(); + } + else { + this._originalValue[targetIndex] = originalValue; + } + } + // Blending + var enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending; + if (enableBlending && this._blendingFactor <= 1.0) { + if (!this._originalBlendValue) { + var originalValue = destination[path]; + if (originalValue.clone) { + this._originalBlendValue = originalValue.clone(); + } + else { + this._originalBlendValue = originalValue; + } + } + if (this._originalBlendValue.m) { // Matrix + if (BABYLON.Animation.AllowMatrixDecomposeForInterpolation) { + if (this._currentValue) { + BABYLON.Matrix.DecomposeLerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue); + } + else { + this._currentValue = BABYLON.Matrix.DecomposeLerp(this._originalBlendValue, currentValue, this._blendingFactor); + } + } + else { + if (this._currentValue) { + BABYLON.Matrix.LerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue); + } + else { + this._currentValue = BABYLON.Matrix.Lerp(this._originalBlendValue, currentValue, this._blendingFactor); + } + } + } + else { + this._currentValue = BABYLON.Animation._UniversalLerp(this._originalBlendValue, currentValue, this._blendingFactor); + } + var blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed; + this._blendingFactor += blendingSpeed; + } + else { + this._currentValue = currentValue; + } + if (weight !== -1.0) { + this._scene._registerTargetForLateAnimationBinding(this, this._originalValue[targetIndex]); + } + else { + destination[path] = this._currentValue; + } + if (target.markAsDirty) { + target.markAsDirty(this._animation.targetProperty); + } + }; + /** + * Gets the loop pmode of the runtime animation + * @returns Loop Mode + */ + RuntimeAnimation.prototype._getCorrectLoopMode = function () { + if (this._target && this._target.animationPropertiesOverride) { + return this._target.animationPropertiesOverride.loopMode; + } + return this._animation.loopMode; + }; + /** + * Move the current animation to a given frame + * @param frame defines the frame to move to + */ + RuntimeAnimation.prototype.goToFrame = function (frame) { + var keys = this._animation.getKeys(); + if (frame < keys[0].frame) { + frame = keys[0].frame; + } + else if (frame > keys[keys.length - 1].frame) { + frame = keys[keys.length - 1].frame; + } + var currentValue = this._interpolate(frame, 0, this._getCorrectLoopMode()); + this.setValue(currentValue, -1); + }; + /** + * @hidden Internal use only + */ + RuntimeAnimation.prototype._prepareForSpeedRatioChange = function (newSpeedRatio) { + var newRatio = this._previousDelay * (this._animation.framePerSecond * newSpeedRatio) / 1000.0; + this._ratioOffset = this._previousRatio - newRatio; + }; + /** + * Execute the current animation + * @param delay defines the delay to add to the current frame + * @param from defines the lower bound of the animation range + * @param to defines the upper bound of the animation range + * @param loop defines if the current animation must loop + * @param speedRatio defines the current speed ratio + * @param weight defines the weight of the animation (default is -1 so no weight) + * @returns a boolean indicating if the animation is running + */ + RuntimeAnimation.prototype.animate = function (delay, from, to, loop, speedRatio, weight) { + if (weight === void 0) { weight = -1.0; } + var targetPropertyPath = this._animation.targetPropertyPath; + if (!targetPropertyPath || targetPropertyPath.length < 1) { + this._stopped = true; + return false; + } + var returnValue = true; + var keys = this._animation.getKeys(); + // Adding a start key at frame 0 if missing + if (keys[0].frame !== 0) { + var newKey = { frame: 0, value: keys[0].value }; + keys.splice(0, 0, newKey); + } + // Adding a duplicate key when there is only one key at frame zero + else if (keys.length === 1) { + var newKey = { frame: 0.001, value: keys[0].value }; + keys.push(newKey); + } + // Check limits + if (from < keys[0].frame || from > keys[keys.length - 1].frame) { + from = keys[0].frame; + } + if (to < keys[0].frame || to > keys[keys.length - 1].frame) { + to = keys[keys.length - 1].frame; + } + //to and from cannot be the same key + if (from === to) { + if (from > keys[0].frame) { + from--; + } + else if (to < keys[keys.length - 1].frame) { + to++; + } + } + // Compute ratio + var range = to - from; + var offsetValue; + // ratio represents the frame delta between from and to + var ratio = (delay * (this._animation.framePerSecond * speedRatio) / 1000.0) + this._ratioOffset; + var highLimitValue = 0; + this._previousDelay = delay; + this._previousRatio = ratio; + if (((to > from && ratio >= range) || (from > to && ratio <= range)) && !loop) { // If we are out of range and not looping get back to caller + returnValue = false; + highLimitValue = this._animation._getKeyValue(keys[keys.length - 1].value); + } + else { + // Get max value if required + if (this._getCorrectLoopMode() !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) { + var keyOffset = to.toString() + from.toString(); + if (!this._offsetsCache[keyOffset]) { + var fromValue = this._interpolate(from, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); + var toValue = this._interpolate(to, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); + switch (this._animation.dataType) { + // Float + case BABYLON.Animation.ANIMATIONTYPE_FLOAT: + this._offsetsCache[keyOffset] = toValue - fromValue; + break; + // Quaternion + case BABYLON.Animation.ANIMATIONTYPE_QUATERNION: + this._offsetsCache[keyOffset] = toValue.subtract(fromValue); + break; + // Vector3 + case BABYLON.Animation.ANIMATIONTYPE_VECTOR3: + this._offsetsCache[keyOffset] = toValue.subtract(fromValue); + // Vector2 + case BABYLON.Animation.ANIMATIONTYPE_VECTOR2: + this._offsetsCache[keyOffset] = toValue.subtract(fromValue); + // Size + case BABYLON.Animation.ANIMATIONTYPE_SIZE: + this._offsetsCache[keyOffset] = toValue.subtract(fromValue); + // Color3 + case BABYLON.Animation.ANIMATIONTYPE_COLOR3: + this._offsetsCache[keyOffset] = toValue.subtract(fromValue); + default: + break; + } + this._highLimitsCache[keyOffset] = toValue; + } + highLimitValue = this._highLimitsCache[keyOffset]; + offsetValue = this._offsetsCache[keyOffset]; + } + } + if (offsetValue === undefined) { + switch (this._animation.dataType) { + // Float + case BABYLON.Animation.ANIMATIONTYPE_FLOAT: + offsetValue = 0; + break; + // Quaternion + case BABYLON.Animation.ANIMATIONTYPE_QUATERNION: + offsetValue = _staticOffsetValueQuaternion; + break; + // Vector3 + case BABYLON.Animation.ANIMATIONTYPE_VECTOR3: + offsetValue = _staticOffsetValueVector3; + break; + // Vector2 + case BABYLON.Animation.ANIMATIONTYPE_VECTOR2: + offsetValue = _staticOffsetValueVector2; + break; + // Size + case BABYLON.Animation.ANIMATIONTYPE_SIZE: + offsetValue = _staticOffsetValueSize; + break; + // Color3 + case BABYLON.Animation.ANIMATIONTYPE_COLOR3: + offsetValue = _staticOffsetValueColor3; + } + } + // Compute value + var repeatCount = (ratio / range) >> 0; + var currentFrame = returnValue ? from + ratio % range : to; + // Need to normalize? + if (this._host && this._host.syncRoot) { + var syncRoot = this._host.syncRoot; + var hostNormalizedFrame = (syncRoot.masterFrame - syncRoot.fromFrame) / (syncRoot.toFrame - syncRoot.fromFrame); + currentFrame = from + (to - from) * hostNormalizedFrame; + } + // Reset events if looping + var events = this._events; + if (range > 0 && this.currentFrame > currentFrame || + range < 0 && this.currentFrame < currentFrame) { + // Need to reset animation events + for (var index = 0; index < events.length; index++) { + if (!events[index].onlyOnce) { + // reset event, the animation is looping + events[index].isDone = false; + } + } + } + var currentValue = this._interpolate(currentFrame, repeatCount, this._getCorrectLoopMode(), offsetValue, highLimitValue); + // Set value + this.setValue(currentValue, weight); + // Check events + for (var index = 0; index < events.length; index++) { + // Make sure current frame has passed event frame and that event frame is within the current range + // Also, handle both forward and reverse animations + if ((range > 0 && currentFrame >= events[index].frame && events[index].frame >= from) || + (range < 0 && currentFrame <= events[index].frame && events[index].frame <= from)) { + var event = events[index]; + if (!event.isDone) { + // If event should be done only once, remove it. + if (event.onlyOnce) { + events.splice(index, 1); + index--; + } + event.isDone = true; + event.action(currentFrame); + } // Don't do anything if the event has already be done. + } + } + if (!returnValue) { + this._stopped = true; + } + return returnValue; + }; + return RuntimeAnimation; + }()); + BABYLON.RuntimeAnimation = RuntimeAnimation; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.runtimeAnimation.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Class used to store an actual running animation + */ + var Animatable = /** @class */ (function () { + /** + * Creates a new Animatable + * @param scene defines the hosting scene + * @param target defines the target object + * @param fromFrame defines the starting frame number (default is 0) + * @param toFrame defines the ending frame number (default is 100) + * @param loopAnimation defines if the animation must loop (default is false) + * @param speedRatio defines the factor to apply to animation speed (default is 1) + * @param onAnimationEnd defines a callback to call when animation ends if it is not looping + * @param animations defines a group of animation to add to the new Animatable + */ + function Animatable(scene, + /** defines the target object */ + target, + /** defines the starting frame number (default is 0) */ + fromFrame, + /** defines the ending frame number (default is 100) */ + toFrame, + /** defines if the animation must loop (default is false) */ + loopAnimation, speedRatio, + /** defines a callback to call when animation ends if it is not looping */ + onAnimationEnd, animations) { + if (fromFrame === void 0) { fromFrame = 0; } + if (toFrame === void 0) { toFrame = 100; } + if (loopAnimation === void 0) { loopAnimation = false; } + if (speedRatio === void 0) { speedRatio = 1.0; } + this.target = target; + this.fromFrame = fromFrame; + this.toFrame = toFrame; + this.loopAnimation = loopAnimation; + this.onAnimationEnd = onAnimationEnd; + this._localDelayOffset = null; + this._pausedDelay = null; + this._runtimeAnimations = new Array(); + this._paused = false; + this._speedRatio = 1; + this._weight = -1.0; + /** + * Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation. + * This will only apply for non looping animation (default is true) + */ + this.disposeOnEnd = true; + /** + * Gets a boolean indicating if the animation has started + */ + this.animationStarted = false; + /** + * Observer raised when the animation ends + */ + this.onAnimationEndObservable = new BABYLON.Observable(); + this._scene = scene; + if (animations) { + this.appendAnimations(target, animations); + } + this._speedRatio = speedRatio; + scene._activeAnimatables.push(this); + } + Object.defineProperty(Animatable.prototype, "syncRoot", { + /** + * Gets the root Animatable used to synchronize and normalize animations + */ + get: function () { + return this._syncRoot; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animatable.prototype, "masterFrame", { + /** + * Gets the current frame of the first RuntimeAnimation + * Used to synchronize Animatables + */ + get: function () { + if (this._runtimeAnimations.length === 0) { + return 0; + } + return this._runtimeAnimations[0].currentFrame; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animatable.prototype, "weight", { + /** + * Gets or sets the animatable weight (-1.0 by default meaning not weighted) + */ + get: function () { + return this._weight; + }, + set: function (value) { + if (value === -1) { // -1 is ok and means no weight + this._weight = -1; + return; + } + // Else weight must be in [0, 1] range + this._weight = Math.min(Math.max(value, 0), 1.0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animatable.prototype, "speedRatio", { + /** + * Gets or sets the speed ratio to apply to the animatable (1.0 by default) + */ + get: function () { + return this._speedRatio; + }, + set: function (value) { + for (var index = 0; index < this._runtimeAnimations.length; index++) { + var animation = this._runtimeAnimations[index]; + animation._prepareForSpeedRatioChange(value); + } + this._speedRatio = value; + }, + enumerable: true, + configurable: true + }); + // Methods + /** + * Synchronize and normalize current Animatable with a source Animatable + * This is useful when using animation weights and when animations are not of the same length + * @param root defines the root Animatable to synchronize with + * @returns the current Animatable + */ + Animatable.prototype.syncWith = function (root) { + this._syncRoot = root; + if (root) { + // Make sure this animatable will animate after the root + var index = this._scene._activeAnimatables.indexOf(this); + if (index > -1) { + this._scene._activeAnimatables.splice(index, 1); + this._scene._activeAnimatables.push(this); + } + } + return this; + }; + /** + * Gets the list of runtime animations + * @returns an array of RuntimeAnimation + */ + Animatable.prototype.getAnimations = function () { + return this._runtimeAnimations; + }; + /** + * Adds more animations to the current animatable + * @param target defines the target of the animations + * @param animations defines the new animations to add + */ + Animatable.prototype.appendAnimations = function (target, animations) { + for (var index = 0; index < animations.length; index++) { + var animation = animations[index]; + this._runtimeAnimations.push(new BABYLON.RuntimeAnimation(target, animation, this._scene, this)); + } + }; + /** + * Gets the source animation for a specific property + * @param property defines the propertyu to look for + * @returns null or the source animation for the given property + */ + Animatable.prototype.getAnimationByTargetProperty = function (property) { + var runtimeAnimations = this._runtimeAnimations; + for (var index = 0; index < runtimeAnimations.length; index++) { + if (runtimeAnimations[index].animation.targetProperty === property) { + return runtimeAnimations[index].animation; + } + } + return null; + }; + /** + * Gets the runtime animation for a specific property + * @param property defines the propertyu to look for + * @returns null or the runtime animation for the given property + */ + Animatable.prototype.getRuntimeAnimationByTargetProperty = function (property) { + var runtimeAnimations = this._runtimeAnimations; + for (var index = 0; index < runtimeAnimations.length; index++) { + if (runtimeAnimations[index].animation.targetProperty === property) { + return runtimeAnimations[index]; + } + } + return null; + }; + /** + * Resets the animatable to its original state + */ + Animatable.prototype.reset = function () { + var runtimeAnimations = this._runtimeAnimations; + for (var index = 0; index < runtimeAnimations.length; index++) { + runtimeAnimations[index].reset(true); + } + this._localDelayOffset = null; + this._pausedDelay = null; + }; + /** + * Allows the animatable to blend with current running animations + * @see http://doc.babylonjs.com/babylon101/animations#animation-blending + * @param blendingSpeed defines the blending speed to use + */ + Animatable.prototype.enableBlending = function (blendingSpeed) { + var runtimeAnimations = this._runtimeAnimations; + for (var index = 0; index < runtimeAnimations.length; index++) { + runtimeAnimations[index].animation.enableBlending = true; + runtimeAnimations[index].animation.blendingSpeed = blendingSpeed; + } + }; + /** + * Disable animation blending + * @see http://doc.babylonjs.com/babylon101/animations#animation-blending + */ + Animatable.prototype.disableBlending = function () { + var runtimeAnimations = this._runtimeAnimations; + for (var index = 0; index < runtimeAnimations.length; index++) { + runtimeAnimations[index].animation.enableBlending = false; + } + }; + /** + * Jump directly to a given frame + * @param frame defines the frame to jump to + */ + Animatable.prototype.goToFrame = function (frame) { + var runtimeAnimations = this._runtimeAnimations; + if (runtimeAnimations[0]) { + var fps = runtimeAnimations[0].animation.framePerSecond; + var currentFrame = runtimeAnimations[0].currentFrame; + var adjustTime = frame - currentFrame; + var delay = adjustTime * 1000 / (fps * this.speedRatio); + if (this._localDelayOffset === null) { + this._localDelayOffset = 0; + } + this._localDelayOffset -= delay; + } + for (var index = 0; index < runtimeAnimations.length; index++) { + runtimeAnimations[index].goToFrame(frame); + } + }; + /** + * Pause the animation + */ + Animatable.prototype.pause = function () { + if (this._paused) { + return; + } + this._paused = true; + }; + /** + * Restart the animation + */ + Animatable.prototype.restart = function () { + this._paused = false; + }; + Animatable.prototype._raiseOnAnimationEnd = function () { + if (this.onAnimationEnd) { + this.onAnimationEnd(); + } + this.onAnimationEndObservable.notifyObservers(this); + }; + /** + * Stop and delete the current animation + * @param animationName defines a string used to only stop some of the runtime animations instead of all + * @param targetMask - a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty) + */ + Animatable.prototype.stop = function (animationName, targetMask) { + if (animationName || targetMask) { + var idx = this._scene._activeAnimatables.indexOf(this); + if (idx > -1) { + var runtimeAnimations = this._runtimeAnimations; + for (var index = runtimeAnimations.length - 1; index >= 0; index--) { + var runtimeAnimation = runtimeAnimations[index]; + if (animationName && runtimeAnimation.animation.name != animationName) { + continue; + } + if (targetMask && !targetMask(runtimeAnimation.target)) { + continue; + } + runtimeAnimation.dispose(); + runtimeAnimations.splice(index, 1); + } + if (runtimeAnimations.length == 0) { + this._scene._activeAnimatables.splice(idx, 1); + this._raiseOnAnimationEnd(); + } + } + } + else { + var index = this._scene._activeAnimatables.indexOf(this); + if (index > -1) { + this._scene._activeAnimatables.splice(index, 1); + var runtimeAnimations = this._runtimeAnimations; + for (var index = 0; index < runtimeAnimations.length; index++) { + runtimeAnimations[index].dispose(); + } + this._raiseOnAnimationEnd(); + } + } + }; + /** + * Wait asynchronously for the animation to end + * @returns a promise which will be fullfilled when the animation ends + */ + Animatable.prototype.waitAsync = function () { + var _this = this; + return new Promise(function (resolve, reject) { + _this.onAnimationEndObservable.add(function () { + resolve(_this); + }, undefined, undefined, _this, true); + }); + }; + /** @hidden */ + Animatable.prototype._animate = function (delay) { + if (this._paused) { + this.animationStarted = false; + if (this._pausedDelay === null) { + this._pausedDelay = delay; + } + return true; + } + if (this._localDelayOffset === null) { + this._localDelayOffset = delay; + this._pausedDelay = null; + } + else if (this._pausedDelay !== null) { + this._localDelayOffset += delay - this._pausedDelay; + this._pausedDelay = null; + } + if (this._weight === 0) { // We consider that an animation with a weight === 0 is "actively" paused + return true; + } + // Animating + var running = false; + var runtimeAnimations = this._runtimeAnimations; + var index; + for (index = 0; index < runtimeAnimations.length; index++) { + var animation = runtimeAnimations[index]; + var isRunning = animation.animate(delay - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio, this._weight); + running = running || isRunning; + } + this.animationStarted = running; + if (!running) { + if (this.disposeOnEnd) { + // Remove from active animatables + index = this._scene._activeAnimatables.indexOf(this); + this._scene._activeAnimatables.splice(index, 1); + // Dispose all runtime animations + for (index = 0; index < runtimeAnimations.length; index++) { + runtimeAnimations[index].dispose(); + } + } + this._raiseOnAnimationEnd(); + if (this.disposeOnEnd) { + this.onAnimationEnd = null; + this.onAnimationEndObservable.clear(); + } + } + return running; + }; + return Animatable; + }()); + BABYLON.Animatable = Animatable; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.animatable.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Base class used for every default easing function. + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var EasingFunction = /** @class */ (function () { + function EasingFunction() { + this._easingMode = EasingFunction.EASINGMODE_EASEIN; + } + /** + * Sets the easing mode of the current function. + * @param easingMode Defines the willing mode (EASINGMODE_EASEIN, EASINGMODE_EASEOUT or EASINGMODE_EASEINOUT) + */ + EasingFunction.prototype.setEasingMode = function (easingMode) { + var n = Math.min(Math.max(easingMode, 0), 2); + this._easingMode = n; + }; + /** + * Gets the current easing mode. + * @returns the easing mode + */ + EasingFunction.prototype.getEasingMode = function () { + return this._easingMode; + }; + /** + * @hidden + */ + EasingFunction.prototype.easeInCore = function (gradient) { + throw new Error('You must implement this method'); + }; + /** + * Given an input gradient between 0 and 1, this returns the corrseponding value + * of the easing function. + * @param gradient Defines the value between 0 and 1 we want the easing value for + * @returns the corresponding value on the curve defined by the easing function + */ + EasingFunction.prototype.ease = function (gradient) { + switch (this._easingMode) { + case EasingFunction.EASINGMODE_EASEIN: + return this.easeInCore(gradient); + case EasingFunction.EASINGMODE_EASEOUT: + return (1 - this.easeInCore(1 - gradient)); + } + if (gradient >= 0.5) { + return (((1 - this.easeInCore((1 - gradient) * 2)) * 0.5) + 0.5); + } + return (this.easeInCore(gradient * 2) * 0.5); + }; + /** + * Interpolation follows the mathematical formula associated with the easing function. + */ + EasingFunction.EASINGMODE_EASEIN = 0; + /** + * Interpolation follows 100% interpolation minus the output of the formula associated with the easing function. + */ + EasingFunction.EASINGMODE_EASEOUT = 1; + /** + * Interpolation uses EaseIn for the first half of the animation and EaseOut for the second half. + */ + EasingFunction.EASINGMODE_EASEINOUT = 2; + return EasingFunction; + }()); + BABYLON.EasingFunction = EasingFunction; + /** + * Easing function with a circle shape (see link below). + * @see https://easings.net/#easeInCirc + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var CircleEase = /** @class */ (function (_super) { + __extends(CircleEase, _super); + function CircleEase() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** @hidden */ + CircleEase.prototype.easeInCore = function (gradient) { + gradient = Math.max(0, Math.min(1, gradient)); + return (1.0 - Math.sqrt(1.0 - (gradient * gradient))); + }; + return CircleEase; + }(EasingFunction)); + BABYLON.CircleEase = CircleEase; + /** + * Easing function with a ease back shape (see link below). + * @see https://easings.net/#easeInBack + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var BackEase = /** @class */ (function (_super) { + __extends(BackEase, _super); + /** + * Instantiates a back ease easing + * @see https://easings.net/#easeInBack + * @param amplitude Defines the amplitude of the function + */ + function BackEase( + /** Defines the amplitude of the function */ + amplitude) { + if (amplitude === void 0) { amplitude = 1; } + var _this = _super.call(this) || this; + _this.amplitude = amplitude; + return _this; + } + /** @hidden */ + BackEase.prototype.easeInCore = function (gradient) { + var num = Math.max(0, this.amplitude); + return (Math.pow(gradient, 3.0) - ((gradient * num) * Math.sin(3.1415926535897931 * gradient))); + }; + return BackEase; + }(EasingFunction)); + BABYLON.BackEase = BackEase; + /** + * Easing function with a bouncing shape (see link below). + * @see https://easings.net/#easeInBounce + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var BounceEase = /** @class */ (function (_super) { + __extends(BounceEase, _super); + /** + * Instantiates a bounce easing + * @see https://easings.net/#easeInBounce + * @param bounces Defines the number of bounces + * @param bounciness Defines the amplitude of the bounce + */ + function BounceEase( + /** Defines the number of bounces */ + bounces, + /** Defines the amplitude of the bounce */ + bounciness) { + if (bounces === void 0) { bounces = 3; } + if (bounciness === void 0) { bounciness = 2; } + var _this = _super.call(this) || this; + _this.bounces = bounces; + _this.bounciness = bounciness; + return _this; + } + /** @hidden */ + BounceEase.prototype.easeInCore = function (gradient) { + var y = Math.max(0.0, this.bounces); + var bounciness = this.bounciness; + if (bounciness <= 1.0) { + bounciness = 1.001; + } + var num9 = Math.pow(bounciness, y); + var num5 = 1.0 - bounciness; + var num4 = ((1.0 - num9) / num5) + (num9 * 0.5); + var num15 = gradient * num4; + var num65 = Math.log((-num15 * (1.0 - bounciness)) + 1.0) / Math.log(bounciness); + var num3 = Math.floor(num65); + var num13 = num3 + 1.0; + var num8 = (1.0 - Math.pow(bounciness, num3)) / (num5 * num4); + var num12 = (1.0 - Math.pow(bounciness, num13)) / (num5 * num4); + var num7 = (num8 + num12) * 0.5; + var num6 = gradient - num7; + var num2 = num7 - num8; + return (((-Math.pow(1.0 / bounciness, y - num3) / (num2 * num2)) * (num6 - num2)) * (num6 + num2)); + }; + return BounceEase; + }(EasingFunction)); + BABYLON.BounceEase = BounceEase; + /** + * Easing function with a power of 3 shape (see link below). + * @see https://easings.net/#easeInCubic + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var CubicEase = /** @class */ (function (_super) { + __extends(CubicEase, _super); + function CubicEase() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** @hidden */ + CubicEase.prototype.easeInCore = function (gradient) { + return (gradient * gradient * gradient); + }; + return CubicEase; + }(EasingFunction)); + BABYLON.CubicEase = CubicEase; + /** + * Easing function with an elastic shape (see link below). + * @see https://easings.net/#easeInElastic + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var ElasticEase = /** @class */ (function (_super) { + __extends(ElasticEase, _super); + /** + * Instantiates an elastic easing function + * @see https://easings.net/#easeInElastic + * @param oscillations Defines the number of oscillations + * @param springiness Defines the amplitude of the oscillations + */ + function ElasticEase( + /** Defines the number of oscillations*/ + oscillations, + /** Defines the amplitude of the oscillations*/ + springiness) { + if (oscillations === void 0) { oscillations = 3; } + if (springiness === void 0) { springiness = 3; } + var _this = _super.call(this) || this; + _this.oscillations = oscillations; + _this.springiness = springiness; + return _this; + } + /** @hidden */ + ElasticEase.prototype.easeInCore = function (gradient) { + var num2; + var num3 = Math.max(0.0, this.oscillations); + var num = Math.max(0.0, this.springiness); + if (num == 0) { + num2 = gradient; + } + else { + num2 = (Math.exp(num * gradient) - 1.0) / (Math.exp(num) - 1.0); + } + return (num2 * Math.sin(((6.2831853071795862 * num3) + 1.5707963267948966) * gradient)); + }; + return ElasticEase; + }(EasingFunction)); + BABYLON.ElasticEase = ElasticEase; + /** + * Easing function with an exponential shape (see link below). + * @see https://easings.net/#easeInExpo + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var ExponentialEase = /** @class */ (function (_super) { + __extends(ExponentialEase, _super); + /** + * Instantiates an exponential easing function + * @see https://easings.net/#easeInExpo + * @param exponent Defines the exponent of the function + */ + function ExponentialEase( + /** Defines the exponent of the function */ + exponent) { + if (exponent === void 0) { exponent = 2; } + var _this = _super.call(this) || this; + _this.exponent = exponent; + return _this; + } + /** @hidden */ + ExponentialEase.prototype.easeInCore = function (gradient) { + if (this.exponent <= 0) { + return gradient; + } + return ((Math.exp(this.exponent * gradient) - 1.0) / (Math.exp(this.exponent) - 1.0)); + }; + return ExponentialEase; + }(EasingFunction)); + BABYLON.ExponentialEase = ExponentialEase; + /** + * Easing function with a power shape (see link below). + * @see https://easings.net/#easeInQuad + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var PowerEase = /** @class */ (function (_super) { + __extends(PowerEase, _super); + /** + * Instantiates an power base easing function + * @see https://easings.net/#easeInQuad + * @param power Defines the power of the function + */ + function PowerEase( + /** Defines the power of the function */ + power) { + if (power === void 0) { power = 2; } + var _this = _super.call(this) || this; + _this.power = power; + return _this; + } + /** @hidden */ + PowerEase.prototype.easeInCore = function (gradient) { + var y = Math.max(0.0, this.power); + return Math.pow(gradient, y); + }; + return PowerEase; + }(EasingFunction)); + BABYLON.PowerEase = PowerEase; + /** + * Easing function with a power of 2 shape (see link below). + * @see https://easings.net/#easeInQuad + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var QuadraticEase = /** @class */ (function (_super) { + __extends(QuadraticEase, _super); + function QuadraticEase() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** @hidden */ + QuadraticEase.prototype.easeInCore = function (gradient) { + return (gradient * gradient); + }; + return QuadraticEase; + }(EasingFunction)); + BABYLON.QuadraticEase = QuadraticEase; + /** + * Easing function with a power of 4 shape (see link below). + * @see https://easings.net/#easeInQuart + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var QuarticEase = /** @class */ (function (_super) { + __extends(QuarticEase, _super); + function QuarticEase() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** @hidden */ + QuarticEase.prototype.easeInCore = function (gradient) { + return (gradient * gradient * gradient * gradient); + }; + return QuarticEase; + }(EasingFunction)); + BABYLON.QuarticEase = QuarticEase; + /** + * Easing function with a power of 5 shape (see link below). + * @see https://easings.net/#easeInQuint + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var QuinticEase = /** @class */ (function (_super) { + __extends(QuinticEase, _super); + function QuinticEase() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** @hidden */ + QuinticEase.prototype.easeInCore = function (gradient) { + return (gradient * gradient * gradient * gradient * gradient); + }; + return QuinticEase; + }(EasingFunction)); + BABYLON.QuinticEase = QuinticEase; + /** + * Easing function with a sin shape (see link below). + * @see https://easings.net/#easeInSine + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var SineEase = /** @class */ (function (_super) { + __extends(SineEase, _super); + function SineEase() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** @hidden */ + SineEase.prototype.easeInCore = function (gradient) { + return (1.0 - Math.sin(1.5707963267948966 * (1.0 - gradient))); + }; + return SineEase; + }(EasingFunction)); + BABYLON.SineEase = SineEase; + /** + * Easing function with a bezier shape (see link below). + * @see http://cubic-bezier.com/#.17,.67,.83,.67 + * @see http://doc.babylonjs.com/babylon101/animations#easing-functions + */ + var BezierCurveEase = /** @class */ (function (_super) { + __extends(BezierCurveEase, _super); + /** + * Instantiates a bezier function + * @see http://cubic-bezier.com/#.17,.67,.83,.67 + * @param x1 Defines the x component of the start tangent in the bezier curve + * @param y1 Defines the y component of the start tangent in the bezier curve + * @param x2 Defines the x component of the end tangent in the bezier curve + * @param y2 Defines the y component of the end tangent in the bezier curve + */ + function BezierCurveEase( + /** Defines the x component of the start tangent in the bezier curve */ + x1, + /** Defines the y component of the start tangent in the bezier curve */ + y1, + /** Defines the x component of the end tangent in the bezier curve */ + x2, + /** Defines the y component of the end tangent in the bezier curve */ + y2) { + if (x1 === void 0) { x1 = 0; } + if (y1 === void 0) { y1 = 0; } + if (x2 === void 0) { x2 = 1; } + if (y2 === void 0) { y2 = 1; } + var _this = _super.call(this) || this; + _this.x1 = x1; + _this.y1 = y1; + _this.x2 = x2; + _this.y2 = y2; + return _this; + } + /** @hidden */ + BezierCurveEase.prototype.easeInCore = function (gradient) { + return BABYLON.BezierCurve.Interpolate(gradient, this.x1, this.y1, this.x2, this.y2); + }; + return BezierCurveEase; + }(EasingFunction)); + BABYLON.BezierCurveEase = BezierCurveEase; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.easing.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * A Condition applied to an Action + */ + var Condition = /** @class */ (function () { + /** + * Creates a new Condition + * @param actionManager the manager of the action the condition is applied to + */ + function Condition(actionManager) { + this._actionManager = actionManager; + } + /** + * Check if the current condition is valid + * @returns a boolean + */ + Condition.prototype.isValid = function () { + return true; + }; + /** + * Internal only + * @hidden + */ + Condition.prototype._getProperty = function (propertyPath) { + return this._actionManager._getProperty(propertyPath); + }; + /** + * Internal only + * @hidden + */ + Condition.prototype._getEffectiveTarget = function (target, propertyPath) { + return this._actionManager._getEffectiveTarget(target, propertyPath); + }; + /** + * Serialize placeholder for child classes + * @returns the serialized object + */ + Condition.prototype.serialize = function () { + }; + /** + * Internal only + * @hidden + */ + Condition.prototype._serialize = function (serializedCondition) { + return { + type: 2, + children: [], + name: serializedCondition.name, + properties: serializedCondition.properties + }; + }; + return Condition; + }()); + BABYLON.Condition = Condition; + /** + * Defines specific conditional operators as extensions of Condition + */ + var ValueCondition = /** @class */ (function (_super) { + __extends(ValueCondition, _super); + /** + * Creates a new ValueCondition + * @param actionManager manager for the action the condition applies to + * @param target for the action + * @param propertyPath path to specify the property of the target the conditional operator uses + * @param value the value compared by the conditional operator against the current value of the property + * @param operator the conditional operator, default ValueCondition.IsEqual + */ + function ValueCondition(actionManager, target, + /** path to specify the property of the target the conditional operator uses */ + propertyPath, + /** the value compared by the conditional operator against the current value of the property */ + value, + /** the conditional operator, default ValueCondition.IsEqual */ + operator) { + if (operator === void 0) { operator = ValueCondition.IsEqual; } + var _this = _super.call(this, actionManager) || this; + _this.propertyPath = propertyPath; + _this.value = value; + _this.operator = operator; + _this._target = target; + _this._effectiveTarget = _this._getEffectiveTarget(target, _this.propertyPath); + _this._property = _this._getProperty(_this.propertyPath); + return _this; + } + Object.defineProperty(ValueCondition, "IsEqual", { + /** + * returns the number for IsEqual + */ + get: function () { + return ValueCondition._IsEqual; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ValueCondition, "IsDifferent", { + /** + * Returns the number for IsDifferent + */ + get: function () { + return ValueCondition._IsDifferent; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ValueCondition, "IsGreater", { + /** + * Returns the number for IsGreater + */ + get: function () { + return ValueCondition._IsGreater; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ValueCondition, "IsLesser", { + /** + * Returns the number for IsLesser + */ + get: function () { + return ValueCondition._IsLesser; + }, + enumerable: true, + configurable: true + }); + /** + * Compares the given value with the property value for the specified conditional operator + * @returns the result of the comparison + */ + ValueCondition.prototype.isValid = function () { + switch (this.operator) { + case ValueCondition.IsGreater: + return this._effectiveTarget[this._property] > this.value; + case ValueCondition.IsLesser: + return this._effectiveTarget[this._property] < this.value; + case ValueCondition.IsEqual: + case ValueCondition.IsDifferent: + var check; + if (this.value.equals) { + check = this.value.equals(this._effectiveTarget[this._property]); + } + else { + check = this.value === this._effectiveTarget[this._property]; + } + return this.operator === ValueCondition.IsEqual ? check : !check; + } + return false; + }; + /** + * Serialize the ValueCondition into a JSON compatible object + * @returns serialization object + */ + ValueCondition.prototype.serialize = function () { + return this._serialize({ + name: "ValueCondition", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "propertyPath", value: this.propertyPath }, + { name: "value", value: BABYLON.Action._SerializeValueAsString(this.value) }, + { name: "operator", value: ValueCondition.GetOperatorName(this.operator) } + ] + }); + }; + /** + * Gets the name of the conditional operator for the ValueCondition + * @param operator the conditional operator + * @returns the name + */ + ValueCondition.GetOperatorName = function (operator) { + switch (operator) { + case ValueCondition._IsEqual: return "IsEqual"; + case ValueCondition._IsDifferent: return "IsDifferent"; + case ValueCondition._IsGreater: return "IsGreater"; + case ValueCondition._IsLesser: return "IsLesser"; + default: return ""; + } + }; + /** + * Internal only + * @hidden + */ + ValueCondition._IsEqual = 0; + /** + * Internal only + * @hidden + */ + ValueCondition._IsDifferent = 1; + /** + * Internal only + * @hidden + */ + ValueCondition._IsGreater = 2; + /** + * Internal only + * @hidden + */ + ValueCondition._IsLesser = 3; + return ValueCondition; + }(Condition)); + BABYLON.ValueCondition = ValueCondition; + /** + * Defines a predicate condition as an extension of Condition + */ + var PredicateCondition = /** @class */ (function (_super) { + __extends(PredicateCondition, _super); + /** + * Creates a new PredicateCondition + * @param actionManager manager for the action the condition applies to + * @param predicate defines the predicate function used to validate the condition + */ + function PredicateCondition(actionManager, + /** defines the predicate function used to validate the condition */ + predicate) { + var _this = _super.call(this, actionManager) || this; + _this.predicate = predicate; + return _this; + } + /** + * @returns the validity of the predicate condition + */ + PredicateCondition.prototype.isValid = function () { + return this.predicate(); + }; + return PredicateCondition; + }(Condition)); + BABYLON.PredicateCondition = PredicateCondition; + /** + * Defines a state condition as an extension of Condition + */ + var StateCondition = /** @class */ (function (_super) { + __extends(StateCondition, _super); + /** + * Creates a new StateCondition + * @param actionManager manager for the action the condition applies to + * @param target of the condition + * @param value to compare with target state + */ + function StateCondition(actionManager, target, + /** Value to compare with target state */ + value) { + var _this = _super.call(this, actionManager) || this; + _this.value = value; + _this._target = target; + return _this; + } + /** + * Gets a boolean indicating if the current condition is met + * @returns the validity of the state + */ + StateCondition.prototype.isValid = function () { + return this._target.state === this.value; + }; + /** + * Serialize the StateCondition into a JSON compatible object + * @returns serialization object + */ + StateCondition.prototype.serialize = function () { + return this._serialize({ + name: "StateCondition", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "value", value: this.value } + ] + }); + }; + return StateCondition; + }(Condition)); + BABYLON.StateCondition = StateCondition; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.condition.js.map + +var BABYLON; +(function (BABYLON) { + /** + * The action to be carried out following a trigger + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#available-actions + */ + var Action = /** @class */ (function () { + /** + * Creates a new Action + * @param triggerOptions the trigger, with or without parameters, for the action + * @param condition an optional determinant of action + */ + function Action( + /** the trigger, with or without parameters, for the action */ + triggerOptions, condition) { + this.triggerOptions = triggerOptions; + /** + * An event triggered prior to action being executed. + */ + this.onBeforeExecuteObservable = new BABYLON.Observable(); + if (triggerOptions.parameter) { + this.trigger = triggerOptions.trigger; + this._triggerParameter = triggerOptions.parameter; + } + else if (triggerOptions.trigger) { + this.trigger = triggerOptions.trigger; + } + else { + this.trigger = triggerOptions; + } + this._nextActiveAction = this; + this._condition = condition; + } + /** + * Internal only + * @hidden + */ + Action.prototype._prepare = function () { + }; + /** + * Gets the trigger parameters + * @returns the trigger parameters + */ + Action.prototype.getTriggerParameter = function () { + return this._triggerParameter; + }; + /** + * Internal only - executes current action event + * @hidden + */ + Action.prototype._executeCurrent = function (evt) { + if (this._nextActiveAction._condition) { + var condition = this._nextActiveAction._condition; + var currentRenderId = this._actionManager.getScene().getRenderId(); + // We cache the current evaluation for the current frame + if (condition._evaluationId === currentRenderId) { + if (!condition._currentResult) { + return; + } + } + else { + condition._evaluationId = currentRenderId; + if (!condition.isValid()) { + condition._currentResult = false; + return; + } + condition._currentResult = true; + } + } + this.onBeforeExecuteObservable.notifyObservers(this); + this._nextActiveAction.execute(evt); + this.skipToNextActiveAction(); + }; + /** + * Execute placeholder for child classes + * @param evt optional action event + */ + Action.prototype.execute = function (evt) { + }; + /** + * Skips to next active action + */ + Action.prototype.skipToNextActiveAction = function () { + if (this._nextActiveAction._child) { + if (!this._nextActiveAction._child._actionManager) { + this._nextActiveAction._child._actionManager = this._actionManager; + } + this._nextActiveAction = this._nextActiveAction._child; + } + else { + this._nextActiveAction = this; + } + }; + /** + * Adds action to chain of actions, may be a DoNothingAction + * @param action defines the next action to execute + * @returns The action passed in + * @see https://www.babylonjs-playground.com/#1T30HR#0 + */ + Action.prototype.then = function (action) { + this._child = action; + action._actionManager = this._actionManager; + action._prepare(); + return action; + }; + /** + * Internal only + * @hidden + */ + Action.prototype._getProperty = function (propertyPath) { + return this._actionManager._getProperty(propertyPath); + }; + /** + * Internal only + * @hidden + */ + Action.prototype._getEffectiveTarget = function (target, propertyPath) { + return this._actionManager._getEffectiveTarget(target, propertyPath); + }; + /** + * Serialize placeholder for child classes + * @param parent of child + * @returns the serialized object + */ + Action.prototype.serialize = function (parent) { + }; + /** + * Internal only called by serialize + * @hidden + */ + Action.prototype._serialize = function (serializedAction, parent) { + var serializationObject = { + type: 1, + children: [], + name: serializedAction.name, + properties: serializedAction.properties || [] + }; + // Serialize child + if (this._child) { + this._child.serialize(serializationObject); + } + // Check if "this" has a condition + if (this._condition) { + var serializedCondition = this._condition.serialize(); + serializedCondition.children.push(serializationObject); + if (parent) { + parent.children.push(serializedCondition); + } + return serializedCondition; + } + if (parent) { + parent.children.push(serializationObject); + } + return serializationObject; + }; + /** + * Internal only + * @hidden + */ + Action._SerializeValueAsString = function (value) { + if (typeof value === "number") { + return value.toString(); + } + if (typeof value === "boolean") { + return value ? "true" : "false"; + } + if (value instanceof BABYLON.Vector2) { + return value.x + ", " + value.y; + } + if (value instanceof BABYLON.Vector3) { + return value.x + ", " + value.y + ", " + value.z; + } + if (value instanceof BABYLON.Color3) { + return value.r + ", " + value.g + ", " + value.b; + } + if (value instanceof BABYLON.Color4) { + return value.r + ", " + value.g + ", " + value.b + ", " + value.a; + } + return value; // string + }; + /** + * Internal only + * @hidden + */ + Action._GetTargetProperty = function (target) { + return { + name: "target", + targetType: target instanceof BABYLON.Mesh ? "MeshProperties" + : target instanceof BABYLON.Light ? "LightProperties" + : target instanceof BABYLON.Camera ? "CameraProperties" + : "SceneProperties", + value: target instanceof BABYLON.Scene ? "Scene" : target.name + }; + }; + return Action; + }()); + BABYLON.Action = Action; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.action.js.map + +var BABYLON; +(function (BABYLON) { + /** + * ActionEvent is the event being sent when an action is triggered. + */ + var ActionEvent = /** @class */ (function () { + /** + * Creates a new ActionEvent + * @param source The mesh or sprite that triggered the action + * @param pointerX The X mouse cursor position at the time of the event + * @param pointerY The Y mouse cursor position at the time of the event + * @param meshUnderPointer The mesh that is currently pointed at (can be null) + * @param sourceEvent the original (browser) event that triggered the ActionEvent + * @param additionalData additional data for the event + */ + function ActionEvent( + /** The mesh or sprite that triggered the action */ + source, + /** The X mouse cursor position at the time of the event */ + pointerX, + /** The Y mouse cursor position at the time of the event */ + pointerY, + /** The mesh that is currently pointed at (can be null) */ + meshUnderPointer, + /** the original (browser) event that triggered the ActionEvent */ + sourceEvent, + /** additional data for the event */ + additionalData) { + this.source = source; + this.pointerX = pointerX; + this.pointerY = pointerY; + this.meshUnderPointer = meshUnderPointer; + this.sourceEvent = sourceEvent; + this.additionalData = additionalData; + } + /** + * Helper function to auto-create an ActionEvent from a source mesh. + * @param source The source mesh that triggered the event + * @param evt The original (browser) event + * @param additionalData additional data for the event + * @returns the new ActionEvent + */ + ActionEvent.CreateNew = function (source, evt, additionalData) { + var scene = source.getScene(); + return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt, additionalData); + }; + /** + * Helper function to auto-create an ActionEvent from a source sprite + * @param source The source sprite that triggered the event + * @param scene Scene associated with the sprite + * @param evt The original (browser) event + * @param additionalData additional data for the event + * @returns the new ActionEvent + */ + ActionEvent.CreateNewFromSprite = function (source, scene, evt, additionalData) { + return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt, additionalData); + }; + /** + * Helper function to auto-create an ActionEvent from a scene. If triggered by a mesh use ActionEvent.CreateNew + * @param scene the scene where the event occurred + * @param evt The original (browser) event + * @returns the new ActionEvent + */ + ActionEvent.CreateNewFromScene = function (scene, evt) { + return new ActionEvent(null, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt); + }; + /** + * Helper function to auto-create an ActionEvent from a primitive + * @param prim defines the target primitive + * @param pointerPos defines the pointer position + * @param evt The original (browser) event + * @param additionalData additional data for the event + * @returns the new ActionEvent + */ + ActionEvent.CreateNewFromPrimitive = function (prim, pointerPos, evt, additionalData) { + return new ActionEvent(prim, pointerPos.x, pointerPos.y, null, evt, additionalData); + }; + return ActionEvent; + }()); + BABYLON.ActionEvent = ActionEvent; + /** + * Action Manager manages all events to be triggered on a given mesh or the global scene. + * A single scene can have many Action Managers to handle predefined actions on specific meshes. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var ActionManager = /** @class */ (function () { + /** + * Creates a new action manager + * @param scene defines the hosting scene + */ + function ActionManager(scene) { + // Members + /** Gets the list of actions */ + this.actions = new Array(); + /** Gets the cursor to use when hovering items */ + this.hoverCursor = ''; + this._scene = scene || BABYLON.Engine.LastCreatedScene; + scene.actionManagers.push(this); + } + // Methods + /** + * Releases all associated resources + */ + ActionManager.prototype.dispose = function () { + var index = this._scene.actionManagers.indexOf(this); + for (var i = 0; i < this.actions.length; i++) { + var action = this.actions[i]; + ActionManager.Triggers[action.trigger]--; + if (ActionManager.Triggers[action.trigger] === 0) { + delete ActionManager.Triggers[action.trigger]; + } + } + if (index > -1) { + this._scene.actionManagers.splice(index, 1); + } + }; + /** + * Gets hosting scene + * @returns the hosting scene + */ + ActionManager.prototype.getScene = function () { + return this._scene; + }; + /** + * Does this action manager handles actions of any of the given triggers + * @param triggers defines the triggers to be tested + * @return a boolean indicating whether one (or more) of the triggers is handled + */ + ActionManager.prototype.hasSpecificTriggers = function (triggers) { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (triggers.indexOf(action.trigger) > -1) { + return true; + } + } + return false; + }; + /** + * Does this action manager handles actions of any of the given triggers. This function takes two arguments for + * speed. + * @param triggerA defines the trigger to be tested + * @param triggerB defines the trigger to be tested + * @return a boolean indicating whether one (or more) of the triggers is handled + */ + ActionManager.prototype.hasSpecificTriggers2 = function (triggerA, triggerB) { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (triggerA == action.trigger || triggerB == action.trigger) { + return true; + } + } + return false; + }; + /** + * Does this action manager handles actions of a given trigger + * @param trigger defines the trigger to be tested + * @param parameterPredicate defines an optional predicate to filter triggers by parameter + * @return whether the trigger is handled + */ + ActionManager.prototype.hasSpecificTrigger = function (trigger, parameterPredicate) { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (action.trigger === trigger) { + if (parameterPredicate) { + if (parameterPredicate(action.getTriggerParameter())) { + return true; + } + } + else { + return true; + } + } + } + return false; + }; + Object.defineProperty(ActionManager.prototype, "hasPointerTriggers", { + /** + * Does this action manager has pointer triggers + */ + get: function () { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (action.trigger >= ActionManager.OnPickTrigger && action.trigger <= ActionManager.OnPointerOutTrigger) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager.prototype, "hasPickTriggers", { + /** + * Does this action manager has pick triggers + */ + get: function () { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (action.trigger >= ActionManager.OnPickTrigger && action.trigger <= ActionManager.OnPickUpTrigger) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "HasTriggers", { + /** + * Does exist one action manager with at least one trigger + **/ + get: function () { + for (var t in ActionManager.Triggers) { + if (ActionManager.Triggers.hasOwnProperty(t)) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ActionManager, "HasPickTriggers", { + /** + * Does exist one action manager with at least one pick trigger + **/ + get: function () { + for (var t in ActionManager.Triggers) { + if (ActionManager.Triggers.hasOwnProperty(t)) { + var t_int = parseInt(t); + if (t_int >= ActionManager.OnPickTrigger && t_int <= ActionManager.OnPickUpTrigger) { + return true; + } + } + } + return false; + }, + enumerable: true, + configurable: true + }); + /** + * Does exist one action manager that handles actions of a given trigger + * @param trigger defines the trigger to be tested + * @return a boolean indicating whether the trigger is handeled by at least one action manager + **/ + ActionManager.HasSpecificTrigger = function (trigger) { + for (var t in ActionManager.Triggers) { + if (ActionManager.Triggers.hasOwnProperty(t)) { + var t_int = parseInt(t); + if (t_int === trigger) { + return true; + } + } + } + return false; + }; + /** + * Registers an action to this action manager + * @param action defines the action to be registered + * @return the action amended (prepared) after registration + */ + ActionManager.prototype.registerAction = function (action) { + if (action.trigger === ActionManager.OnEveryFrameTrigger) { + if (this.getScene().actionManager !== this) { + BABYLON.Tools.Warn("OnEveryFrameTrigger can only be used with scene.actionManager"); + return null; + } + } + this.actions.push(action); + if (ActionManager.Triggers[action.trigger]) { + ActionManager.Triggers[action.trigger]++; + } + else { + ActionManager.Triggers[action.trigger] = 1; + } + action._actionManager = this; + action._prepare(); + return action; + }; + /** + * Unregisters an action to this action manager + * @param action defines the action to be unregistered + * @return a boolean indicating whether the action has been unregistered + */ + ActionManager.prototype.unregisterAction = function (action) { + var index = this.actions.indexOf(action); + if (index !== -1) { + this.actions.splice(index, 1); + ActionManager.Triggers[action.trigger] -= 1; + if (ActionManager.Triggers[action.trigger] === 0) { + delete ActionManager.Triggers[action.trigger]; + } + delete action._actionManager; + return true; + } + return false; + }; + /** + * Process a specific trigger + * @param trigger defines the trigger to process + * @param evt defines the event details to be processed + */ + ActionManager.prototype.processTrigger = function (trigger, evt) { + for (var index = 0; index < this.actions.length; index++) { + var action = this.actions[index]; + if (action.trigger === trigger) { + if (evt) { + if (trigger === ActionManager.OnKeyUpTrigger + || trigger === ActionManager.OnKeyDownTrigger) { + var parameter = action.getTriggerParameter(); + if (parameter && parameter !== evt.sourceEvent.keyCode) { + if (!parameter.toLowerCase) { + continue; + } + var lowerCase = parameter.toLowerCase(); + if (lowerCase !== evt.sourceEvent.key) { + var unicode = evt.sourceEvent.charCode ? evt.sourceEvent.charCode : evt.sourceEvent.keyCode; + var actualkey = String.fromCharCode(unicode).toLowerCase(); + if (actualkey !== lowerCase) { + continue; + } + } + } + } + } + action._executeCurrent(evt); + } + } + }; + /** @hidden */ + ActionManager.prototype._getEffectiveTarget = function (target, propertyPath) { + var properties = propertyPath.split("."); + for (var index = 0; index < properties.length - 1; index++) { + target = target[properties[index]]; + } + return target; + }; + /** @hidden */ + ActionManager.prototype._getProperty = function (propertyPath) { + var properties = propertyPath.split("."); + return properties[properties.length - 1]; + }; + /** + * Serialize this manager to a JSON object + * @param name defines the property name to store this manager + * @returns a JSON representation of this manager + */ + ActionManager.prototype.serialize = function (name) { + var root = { + children: new Array(), + name: name, + type: 3, + properties: new Array() // Empty for root but required + }; + for (var i = 0; i < this.actions.length; i++) { + var triggerObject = { + type: 0, + children: new Array(), + name: ActionManager.GetTriggerName(this.actions[i].trigger), + properties: new Array() + }; + var triggerOptions = this.actions[i].triggerOptions; + if (triggerOptions && typeof triggerOptions !== "number") { + if (triggerOptions.parameter instanceof BABYLON.Node) { + triggerObject.properties.push(BABYLON.Action._GetTargetProperty(triggerOptions.parameter)); + } + else { + var parameter = {}; + BABYLON.Tools.DeepCopy(triggerOptions.parameter, parameter, ["mesh"]); + if (triggerOptions.parameter && triggerOptions.parameter.mesh) { + parameter._meshId = triggerOptions.parameter.mesh.id; + } + triggerObject.properties.push({ name: "parameter", targetType: null, value: parameter }); + } + } + // Serialize child action, recursively + this.actions[i].serialize(triggerObject); + // Add serialized trigger + root.children.push(triggerObject); + } + return root; + }; + /** + * Creates a new ActionManager from a JSON data + * @param parsedActions defines the JSON data to read from + * @param object defines the hosting mesh + * @param scene defines the hosting scene + */ + ActionManager.Parse = function (parsedActions, object, scene) { + var actionManager = new ActionManager(scene); + if (object === null) { + scene.actionManager = actionManager; + } + else { + object.actionManager = actionManager; + } + // instanciate a new object + var instanciate = function (name, params) { + // TODO: We will need to find a solution for the next line when using commonjs / es6 . + var newInstance = Object.create(BABYLON.Tools.Instantiate("BABYLON." + name).prototype); + newInstance.constructor.apply(newInstance, params); + return newInstance; + }; + var parseParameter = function (name, value, target, propertyPath) { + if (propertyPath === null) { + // String, boolean or float + var floatValue = parseFloat(value); + if (value === "true" || value === "false") { + return value === "true"; + } + else { + return isNaN(floatValue) ? value : floatValue; + } + } + var effectiveTarget = propertyPath.split("."); + var values = value.split(","); + // Get effective Target + for (var i = 0; i < effectiveTarget.length; i++) { + target = target[effectiveTarget[i]]; + } + // Return appropriate value with its type + if (typeof (target) === "boolean") { + return values[0] === "true"; + } + if (typeof (target) === "string") { + return values[0]; + } + // Parameters with multiple values such as Vector3 etc. + var split = new Array(); + for (var i = 0; i < values.length; i++) { + split.push(parseFloat(values[i])); + } + if (target instanceof BABYLON.Vector3) { + return BABYLON.Vector3.FromArray(split); + } + if (target instanceof BABYLON.Vector4) { + return BABYLON.Vector4.FromArray(split); + } + if (target instanceof BABYLON.Color3) { + return BABYLON.Color3.FromArray(split); + } + if (target instanceof BABYLON.Color4) { + return BABYLON.Color4.FromArray(split); + } + return parseFloat(values[0]); + }; + // traverse graph per trigger + var traverse = function (parsedAction, trigger, condition, action, combineArray) { + if (combineArray === void 0) { combineArray = null; } + if (parsedAction.detached) { + return; + } + var parameters = new Array(); + var target = null; + var propertyPath = null; + var combine = parsedAction.combine && parsedAction.combine.length > 0; + // Parameters + if (parsedAction.type === 2) { + parameters.push(actionManager); + } + else { + parameters.push(trigger); + } + if (combine) { + var actions = new Array(); + for (var j = 0; j < parsedAction.combine.length; j++) { + traverse(parsedAction.combine[j], ActionManager.NothingTrigger, condition, action, actions); + } + parameters.push(actions); + } + else { + for (var i = 0; i < parsedAction.properties.length; i++) { + var value = parsedAction.properties[i].value; + var name = parsedAction.properties[i].name; + var targetType = parsedAction.properties[i].targetType; + if (name === "target") { + if (targetType !== null && targetType === "SceneProperties") { + value = target = scene; + } + else { + value = target = scene.getNodeByName(value); + } + } + else if (name === "parent") { + value = scene.getNodeByName(value); + } + else if (name === "sound") { + // Can not externalize to component, so only checks for the presence off the API. + if (scene.getSoundByName) { + value = scene.getSoundByName(value); + } + } + else if (name !== "propertyPath") { + if (parsedAction.type === 2 && name === "operator") { + value = BABYLON.ValueCondition[value]; + } + else { + value = parseParameter(name, value, target, name === "value" ? propertyPath : null); + } + } + else { + propertyPath = value; + } + parameters.push(value); + } + } + if (combineArray === null) { + parameters.push(condition); + } + else { + parameters.push(null); + } + // If interpolate value action + if (parsedAction.name === "InterpolateValueAction") { + var param = parameters[parameters.length - 2]; + parameters[parameters.length - 1] = param; + parameters[parameters.length - 2] = condition; + } + // Action or condition(s) and not CombineAction + var newAction = instanciate(parsedAction.name, parameters); + if (newAction instanceof BABYLON.Condition && condition !== null) { + var nothing = new BABYLON.DoNothingAction(trigger, condition); + if (action) { + action.then(nothing); + } + else { + actionManager.registerAction(nothing); + } + action = nothing; + } + if (combineArray === null) { + if (newAction instanceof BABYLON.Condition) { + condition = newAction; + newAction = action; + } + else { + condition = null; + if (action) { + action.then(newAction); + } + else { + actionManager.registerAction(newAction); + } + } + } + else { + combineArray.push(newAction); + } + for (var i = 0; i < parsedAction.children.length; i++) { + traverse(parsedAction.children[i], trigger, condition, newAction, null); + } + }; + // triggers + for (var i = 0; i < parsedActions.children.length; i++) { + var triggerParams; + var trigger = parsedActions.children[i]; + if (trigger.properties.length > 0) { + var param = trigger.properties[0].value; + var value = trigger.properties[0].targetType === null ? param : scene.getMeshByName(param); + if (value._meshId) { + value.mesh = scene.getMeshByID(value._meshId); + } + triggerParams = { trigger: ActionManager[trigger.name], parameter: value }; + } + else { + triggerParams = ActionManager[trigger.name]; + } + for (var j = 0; j < trigger.children.length; j++) { + if (!trigger.detached) { + traverse(trigger.children[j], triggerParams, null, null); + } + } + } + }; + /** + * Get a trigger name by index + * @param trigger defines the trigger index + * @returns a trigger name + */ + ActionManager.GetTriggerName = function (trigger) { + switch (trigger) { + case 0: return "NothingTrigger"; + case 1: return "OnPickTrigger"; + case 2: return "OnLeftPickTrigger"; + case 3: return "OnRightPickTrigger"; + case 4: return "OnCenterPickTrigger"; + case 5: return "OnPickDownTrigger"; + case 6: return "OnPickUpTrigger"; + case 7: return "OnLongPressTrigger"; + case 8: return "OnPointerOverTrigger"; + case 9: return "OnPointerOutTrigger"; + case 10: return "OnEveryFrameTrigger"; + case 11: return "OnIntersectionEnterTrigger"; + case 12: return "OnIntersectionExitTrigger"; + case 13: return "OnKeyDownTrigger"; + case 14: return "OnKeyUpTrigger"; + case 15: return "OnPickOutTrigger"; + default: return ""; + } + }; + /** + * Nothing + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.NothingTrigger = 0; + /** + * On pick + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnPickTrigger = 1; + /** + * On left pick + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnLeftPickTrigger = 2; + /** + * On right pick + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnRightPickTrigger = 3; + /** + * On center pick + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnCenterPickTrigger = 4; + /** + * On pick down + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnPickDownTrigger = 5; + /** + * On double pick + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnDoublePickTrigger = 6; + /** + * On pick up + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnPickUpTrigger = 7; + /** + * On pick out. + * This trigger will only be raised if you also declared a OnPickDown + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnPickOutTrigger = 16; + /** + * On long press + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnLongPressTrigger = 8; + /** + * On pointer over + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnPointerOverTrigger = 9; + /** + * On pointer out + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnPointerOutTrigger = 10; + /** + * On every frame + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnEveryFrameTrigger = 11; + /** + * On intersection enter + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnIntersectionEnterTrigger = 12; + /** + * On intersection exit + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnIntersectionExitTrigger = 13; + /** + * On key down + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnKeyDownTrigger = 14; + /** + * On key up + * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers + */ + ActionManager.OnKeyUpTrigger = 15; + /** Gets the list of active triggers */ + ActionManager.Triggers = {}; + return ActionManager; + }()); + BABYLON.ActionManager = ActionManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.actionManager.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * This defines an action responsible to change the value of a property + * by interpolating between its current value and the newly set one once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var InterpolateValueAction = /** @class */ (function (_super) { + __extends(InterpolateValueAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param target defines the object containing the value to interpolate + * @param propertyPath defines the path to the property in the target object + * @param value defines the target value at the end of the interpolation + * @param duration deines the time it will take for the property to interpolate to the value. + * @param condition defines the trigger related conditions + * @param stopOtherAnimations defines if the other scene animations should be stopped when the action has been triggered + * @param onInterpolationDone defines a callback raised once the interpolation animation has been done + */ + function InterpolateValueAction(triggerOptions, target, propertyPath, value, duration, condition, stopOtherAnimations, onInterpolationDone) { + if (duration === void 0) { duration = 1000; } + var _this = _super.call(this, triggerOptions, condition) || this; + /** + * Defines the time it will take for the property to interpolate to the value. + */ + _this.duration = 1000; + /** + * Observable triggered once the interpolation animation has been done. + */ + _this.onInterpolationDoneObservable = new BABYLON.Observable(); + _this.propertyPath = propertyPath; + _this.value = value; + _this.duration = duration; + _this.stopOtherAnimations = stopOtherAnimations; + _this.onInterpolationDone = onInterpolationDone; + _this._target = _this._effectiveTarget = target; + return _this; + } + /** @hidden */ + InterpolateValueAction.prototype._prepare = function () { + this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath); + this._property = this._getProperty(this.propertyPath); + }; + /** + * Execute the action starts the value interpolation. + */ + InterpolateValueAction.prototype.execute = function () { + var _this = this; + var scene = this._actionManager.getScene(); + var keys = [ + { + frame: 0, + value: this._effectiveTarget[this._property] + }, { + frame: 100, + value: this.value + } + ]; + var dataType; + if (typeof this.value === "number") { + dataType = BABYLON.Animation.ANIMATIONTYPE_FLOAT; + } + else if (this.value instanceof BABYLON.Color3) { + dataType = BABYLON.Animation.ANIMATIONTYPE_COLOR3; + } + else if (this.value instanceof BABYLON.Vector3) { + dataType = BABYLON.Animation.ANIMATIONTYPE_VECTOR3; + } + else if (this.value instanceof BABYLON.Matrix) { + dataType = BABYLON.Animation.ANIMATIONTYPE_MATRIX; + } + else if (this.value instanceof BABYLON.Quaternion) { + dataType = BABYLON.Animation.ANIMATIONTYPE_QUATERNION; + } + else { + BABYLON.Tools.Warn("InterpolateValueAction: Unsupported type (" + typeof this.value + ")"); + return; + } + var animation = new BABYLON.Animation("InterpolateValueAction", this._property, 100 * (1000.0 / this.duration), dataType, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); + animation.setKeys(keys); + if (this.stopOtherAnimations) { + scene.stopAnimation(this._effectiveTarget); + } + var wrapper = function () { + _this.onInterpolationDoneObservable.notifyObservers(_this); + if (_this.onInterpolationDone) { + _this.onInterpolationDone(); + } + }; + scene.beginDirectAnimation(this._effectiveTarget, [animation], 0, 100, false, 1, wrapper); + }; + /** + * Serializes the actions and its related information. + * @param parent defines the object to serialize in + * @returns the serialized object + */ + InterpolateValueAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "InterpolateValueAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "propertyPath", value: this.propertyPath }, + { name: "value", value: BABYLON.Action._SerializeValueAsString(this.value) }, + { name: "duration", value: BABYLON.Action._SerializeValueAsString(this.duration) }, + { name: "stopOtherAnimations", value: BABYLON.Action._SerializeValueAsString(this.stopOtherAnimations) || false } + ] + }, parent); + }; + return InterpolateValueAction; + }(BABYLON.Action)); + BABYLON.InterpolateValueAction = InterpolateValueAction; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.interpolateValueAction.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * This defines an action responsible to toggle a boolean once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var SwitchBooleanAction = /** @class */ (function (_super) { + __extends(SwitchBooleanAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param target defines the object containing the boolean + * @param propertyPath defines the path to the boolean property in the target object + * @param condition defines the trigger related conditions + */ + function SwitchBooleanAction(triggerOptions, target, propertyPath, condition) { + var _this = _super.call(this, triggerOptions, condition) || this; + _this.propertyPath = propertyPath; + _this._target = _this._effectiveTarget = target; + return _this; + } + /** @hidden */ + SwitchBooleanAction.prototype._prepare = function () { + this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath); + this._property = this._getProperty(this.propertyPath); + }; + /** + * Execute the action toggle the boolean value. + */ + SwitchBooleanAction.prototype.execute = function () { + this._effectiveTarget[this._property] = !this._effectiveTarget[this._property]; + }; + /** + * Serializes the actions and its related information. + * @param parent defines the object to serialize in + * @returns the serialized object + */ + SwitchBooleanAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "SwitchBooleanAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "propertyPath", value: this.propertyPath } + ] + }, parent); + }; + return SwitchBooleanAction; + }(BABYLON.Action)); + BABYLON.SwitchBooleanAction = SwitchBooleanAction; + /** + * This defines an action responsible to set a the state field of the target + * to a desired value once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var SetStateAction = /** @class */ (function (_super) { + __extends(SetStateAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param target defines the object containing the state property + * @param value defines the value to store in the state field + * @param condition defines the trigger related conditions + */ + function SetStateAction(triggerOptions, target, value, condition) { + var _this = _super.call(this, triggerOptions, condition) || this; + _this.value = value; + _this._target = target; + return _this; + } + /** + * Execute the action and store the value on the target state property. + */ + SetStateAction.prototype.execute = function () { + this._target.state = this.value; + }; + /** + * Serializes the actions and its related information. + * @param parent defines the object to serialize in + * @returns the serialized object + */ + SetStateAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "SetStateAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "value", value: this.value } + ] + }, parent); + }; + return SetStateAction; + }(BABYLON.Action)); + BABYLON.SetStateAction = SetStateAction; + /** + * This defines an action responsible to set a property of the target + * to a desired value once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var SetValueAction = /** @class */ (function (_super) { + __extends(SetValueAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param target defines the object containing the property + * @param propertyPath defines the path of the property to set in the target + * @param value defines the value to set in the property + * @param condition defines the trigger related conditions + */ + function SetValueAction(triggerOptions, target, propertyPath, value, condition) { + var _this = _super.call(this, triggerOptions, condition) || this; + _this.propertyPath = propertyPath; + _this.value = value; + _this._target = _this._effectiveTarget = target; + return _this; + } + /** @hidden */ + SetValueAction.prototype._prepare = function () { + this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath); + this._property = this._getProperty(this.propertyPath); + }; + /** + * Execute the action and set the targetted property to the desired value. + */ + SetValueAction.prototype.execute = function () { + this._effectiveTarget[this._property] = this.value; + if (this._target.markAsDirty) { + this._target.markAsDirty(this._property); + } + }; + /** + * Serializes the actions and its related information. + * @param parent defines the object to serialize in + * @returns the serialized object + */ + SetValueAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "SetValueAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "propertyPath", value: this.propertyPath }, + { name: "value", value: BABYLON.Action._SerializeValueAsString(this.value) } + ] + }, parent); + }; + return SetValueAction; + }(BABYLON.Action)); + BABYLON.SetValueAction = SetValueAction; + /** + * This defines an action responsible to increment the target value + * to a desired value once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var IncrementValueAction = /** @class */ (function (_super) { + __extends(IncrementValueAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param target defines the object containing the property + * @param propertyPath defines the path of the property to increment in the target + * @param value defines the value value we should increment the property by + * @param condition defines the trigger related conditions + */ + function IncrementValueAction(triggerOptions, target, propertyPath, value, condition) { + var _this = _super.call(this, triggerOptions, condition) || this; + _this.propertyPath = propertyPath; + _this.value = value; + _this._target = _this._effectiveTarget = target; + return _this; + } + /** @hidden */ + IncrementValueAction.prototype._prepare = function () { + this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath); + this._property = this._getProperty(this.propertyPath); + if (typeof this._effectiveTarget[this._property] !== "number") { + BABYLON.Tools.Warn("Warning: IncrementValueAction can only be used with number values"); + } + }; + /** + * Execute the action and increment the target of the value amount. + */ + IncrementValueAction.prototype.execute = function () { + this._effectiveTarget[this._property] += this.value; + if (this._target.markAsDirty) { + this._target.markAsDirty(this._property); + } + }; + /** + * Serializes the actions and its related information. + * @param parent defines the object to serialize in + * @returns the serialized object + */ + IncrementValueAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "IncrementValueAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "propertyPath", value: this.propertyPath }, + { name: "value", value: BABYLON.Action._SerializeValueAsString(this.value) } + ] + }, parent); + }; + return IncrementValueAction; + }(BABYLON.Action)); + BABYLON.IncrementValueAction = IncrementValueAction; + /** + * This defines an action responsible to start an animation once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var PlayAnimationAction = /** @class */ (function (_super) { + __extends(PlayAnimationAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param target defines the target animation or animation name + * @param from defines from where the animation should start (animation frame) + * @param end defines where the animation should stop (animation frame) + * @param loop defines if the animation should loop or stop after the first play + * @param condition defines the trigger related conditions + */ + function PlayAnimationAction(triggerOptions, target, from, to, loop, condition) { + var _this = _super.call(this, triggerOptions, condition) || this; + _this.from = from; + _this.to = to; + _this.loop = loop; + _this._target = target; + return _this; + } + /** @hidden */ + PlayAnimationAction.prototype._prepare = function () { + }; + /** + * Execute the action and play the animation. + */ + PlayAnimationAction.prototype.execute = function () { + var scene = this._actionManager.getScene(); + scene.beginAnimation(this._target, this.from, this.to, this.loop); + }; + /** + * Serializes the actions and its related information. + * @param parent defines the object to serialize in + * @returns the serialized object + */ + PlayAnimationAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "PlayAnimationAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + { name: "from", value: String(this.from) }, + { name: "to", value: String(this.to) }, + { name: "loop", value: BABYLON.Action._SerializeValueAsString(this.loop) || false } + ] + }, parent); + }; + return PlayAnimationAction; + }(BABYLON.Action)); + BABYLON.PlayAnimationAction = PlayAnimationAction; + /** + * This defines an action responsible to stop an animation once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var StopAnimationAction = /** @class */ (function (_super) { + __extends(StopAnimationAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param target defines the target animation or animation name + * @param condition defines the trigger related conditions + */ + function StopAnimationAction(triggerOptions, target, condition) { + var _this = _super.call(this, triggerOptions, condition) || this; + _this._target = target; + return _this; + } + /** @hidden */ + StopAnimationAction.prototype._prepare = function () { + }; + /** + * Execute the action and stop the animation. + */ + StopAnimationAction.prototype.execute = function () { + var scene = this._actionManager.getScene(); + scene.stopAnimation(this._target); + }; + /** + * Serializes the actions and its related information. + * @param parent defines the object to serialize in + * @returns the serialized object + */ + StopAnimationAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "StopAnimationAction", + properties: [BABYLON.Action._GetTargetProperty(this._target)] + }, parent); + }; + return StopAnimationAction; + }(BABYLON.Action)); + BABYLON.StopAnimationAction = StopAnimationAction; + /** + * This defines an action responsible that does nothing once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var DoNothingAction = /** @class */ (function (_super) { + __extends(DoNothingAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param condition defines the trigger related conditions + */ + function DoNothingAction(triggerOptions, condition) { + if (triggerOptions === void 0) { triggerOptions = BABYLON.ActionManager.NothingTrigger; } + return _super.call(this, triggerOptions, condition) || this; + } + /** + * Execute the action and do nothing. + */ + DoNothingAction.prototype.execute = function () { + }; + /** + * Serializes the actions and its related information. + * @param parent defines the object to serialize in + * @returns the serialized object + */ + DoNothingAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "DoNothingAction", + properties: [] + }, parent); + }; + return DoNothingAction; + }(BABYLON.Action)); + BABYLON.DoNothingAction = DoNothingAction; + /** + * This defines an action responsible to trigger several actions once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var CombineAction = /** @class */ (function (_super) { + __extends(CombineAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param children defines the list of aggregated animations to run + * @param condition defines the trigger related conditions + */ + function CombineAction(triggerOptions, children, condition) { + var _this = _super.call(this, triggerOptions, condition) || this; + _this.children = children; + return _this; + } + /** @hidden */ + CombineAction.prototype._prepare = function () { + for (var index = 0; index < this.children.length; index++) { + this.children[index]._actionManager = this._actionManager; + this.children[index]._prepare(); + } + }; + /** + * Execute the action and executes all the aggregated actions. + */ + CombineAction.prototype.execute = function (evt) { + for (var index = 0; index < this.children.length; index++) { + this.children[index].execute(evt); + } + }; + /** + * Serializes the actions and its related information. + * @param parent defines the object to serialize in + * @returns the serialized object + */ + CombineAction.prototype.serialize = function (parent) { + var serializationObject = _super.prototype._serialize.call(this, { + name: "CombineAction", + properties: [], + combine: [] + }, parent); + for (var i = 0; i < this.children.length; i++) { + serializationObject.combine.push(this.children[i].serialize(null)); + } + return serializationObject; + }; + return CombineAction; + }(BABYLON.Action)); + BABYLON.CombineAction = CombineAction; + /** + * This defines an action responsible to run code (external event) once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var ExecuteCodeAction = /** @class */ (function (_super) { + __extends(ExecuteCodeAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param func defines the callback function to run + * @param condition defines the trigger related conditions + */ + function ExecuteCodeAction(triggerOptions, func, condition) { + var _this = _super.call(this, triggerOptions, condition) || this; + _this.func = func; + return _this; + } + /** + * Execute the action and run the attached code. + */ + ExecuteCodeAction.prototype.execute = function (evt) { + this.func(evt); + }; + return ExecuteCodeAction; + }(BABYLON.Action)); + BABYLON.ExecuteCodeAction = ExecuteCodeAction; + /** + * This defines an action responsible to set the parent property of the target once triggered. + * @see http://doc.babylonjs.com/how_to/how_to_use_actions + */ + var SetParentAction = /** @class */ (function (_super) { + __extends(SetParentAction, _super); + /** + * Instantiate the action + * @param triggerOptions defines the trigger options + * @param target defines the target containing the parent property + * @param parent defines from where the animation should start (animation frame) + * @param condition defines the trigger related conditions + */ + function SetParentAction(triggerOptions, target, parent, condition) { + var _this = _super.call(this, triggerOptions, condition) || this; + _this._target = target; + _this._parent = parent; + return _this; + } + /** @hidden */ + SetParentAction.prototype._prepare = function () { + }; + /** + * Execute the action and set the parent property. + */ + SetParentAction.prototype.execute = function () { + if (this._target.parent === this._parent) { + return; + } + var invertParentWorldMatrix = this._parent.getWorldMatrix().clone(); + invertParentWorldMatrix.invert(); + this._target.position = BABYLON.Vector3.TransformCoordinates(this._target.position, invertParentWorldMatrix); + this._target.parent = this._parent; + }; + /** + * Serializes the actions and its related information. + * @param parent defines the object to serialize in + * @returns the serialized object + */ + SetParentAction.prototype.serialize = function (parent) { + return _super.prototype._serialize.call(this, { + name: "SetParentAction", + properties: [ + BABYLON.Action._GetTargetProperty(this._target), + BABYLON.Action._GetTargetProperty(this._parent), + ] + }, parent); + }; + return SetParentAction; + }(BABYLON.Action)); + BABYLON.SetParentAction = SetParentAction; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.directActions.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Class used to manage multiple sprites on the same spritesheet + * @see http://doc.babylonjs.com/babylon101/sprites + */ + var SpriteManager = /** @class */ (function () { + /** + * Creates a new sprite manager + * @param name defines the manager's name + * @param imgUrl defines the sprite sheet url + * @param capacity defines the maximum allowed number of sprites + * @param cellSize defines the size of a sprite cell + * @param scene defines the hosting scene + * @param epsilon defines the epsilon value to align texture (0.01 by default) + * @param samplingMode defines the smapling mode to use with spritesheet + */ + function SpriteManager( + /** defines the manager's name */ + name, imgUrl, capacity, cellSize, scene, epsilon, samplingMode) { + if (epsilon === void 0) { epsilon = 0.01; } + if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; } + this.name = name; + /** Gets the list of sprites */ + this.sprites = new Array(); + /** Gets or sets the rendering group id (0 by default) */ + this.renderingGroupId = 0; + /** Gets or sets camera layer mask */ + this.layerMask = 0x0FFFFFFF; + /** Gets or sets a boolean indicating if the manager must consider scene fog when rendering */ + this.fogEnabled = true; + /** Gets or sets a boolean indicating if the sprites are pickable */ + this.isPickable = false; + /** + * An event triggered when the manager is disposed. + */ + this.onDisposeObservable = new BABYLON.Observable(); + this._vertexBuffers = {}; + if (!scene._getComponent(BABYLON.SceneComponentConstants.NAME_SPRITE)) { + scene._addComponent(new BABYLON.SpriteSceneComponent(scene)); + } + this._capacity = capacity; + this._spriteTexture = new BABYLON.Texture(imgUrl, scene, true, false, samplingMode); + this._spriteTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; + this._spriteTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; + if (cellSize.width && cellSize.height) { + this.cellWidth = cellSize.width; + this.cellHeight = cellSize.height; + } + else if (cellSize !== undefined) { + this.cellWidth = cellSize; + this.cellHeight = cellSize; + } + else { + return; + } + this._epsilon = epsilon; + this._scene = scene; + this._scene.spriteManagers.push(this); + var indices = []; + var index = 0; + for (var count = 0; count < capacity; count++) { + indices.push(index); + indices.push(index + 1); + indices.push(index + 2); + indices.push(index); + indices.push(index + 2); + indices.push(index + 3); + index += 4; + } + this._indexBuffer = scene.getEngine().createIndexBuffer(indices); + // VBO + // 16 floats per sprite (x, y, z, angle, sizeX, sizeY, offsetX, offsetY, invertU, invertV, cellIndexX, cellIndexY, color r, color g, color b, color a) + this._vertexData = new Float32Array(capacity * 16 * 4); + this._buffer = new BABYLON.Buffer(scene.getEngine(), this._vertexData, true, 16); + var positions = this._buffer.createVertexBuffer(BABYLON.VertexBuffer.PositionKind, 0, 4); + var options = this._buffer.createVertexBuffer("options", 4, 4); + var cellInfo = this._buffer.createVertexBuffer("cellInfo", 8, 4); + var colors = this._buffer.createVertexBuffer(BABYLON.VertexBuffer.ColorKind, 12, 4); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = positions; + this._vertexBuffers["options"] = options; + this._vertexBuffers["cellInfo"] = cellInfo; + this._vertexBuffers[BABYLON.VertexBuffer.ColorKind] = colors; + // Effects + this._effectBase = this._scene.getEngine().createEffect("sprites", [BABYLON.VertexBuffer.PositionKind, "options", "cellInfo", BABYLON.VertexBuffer.ColorKind], ["view", "projection", "textureInfos", "alphaTest"], ["diffuseSampler"], ""); + this._effectFog = this._scene.getEngine().createEffect("sprites", [BABYLON.VertexBuffer.PositionKind, "options", "cellInfo", BABYLON.VertexBuffer.ColorKind], ["view", "projection", "textureInfos", "alphaTest", "vFogInfos", "vFogColor"], ["diffuseSampler"], "#define FOG"); + } + Object.defineProperty(SpriteManager.prototype, "onDispose", { + /** + * Callback called when the manager is disposed + */ + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpriteManager.prototype, "texture", { + /** + * Gets or sets the spritesheet texture + */ + get: function () { + return this._spriteTexture; + }, + set: function (value) { + this._spriteTexture = value; + }, + enumerable: true, + configurable: true + }); + SpriteManager.prototype._appendSpriteVertex = function (index, sprite, offsetX, offsetY, rowSize) { + var arrayOffset = index * 16; + if (offsetX === 0) { + offsetX = this._epsilon; + } + else if (offsetX === 1) { + offsetX = 1 - this._epsilon; + } + if (offsetY === 0) { + offsetY = this._epsilon; + } + else if (offsetY === 1) { + offsetY = 1 - this._epsilon; + } + this._vertexData[arrayOffset] = sprite.position.x; + this._vertexData[arrayOffset + 1] = sprite.position.y; + this._vertexData[arrayOffset + 2] = sprite.position.z; + this._vertexData[arrayOffset + 3] = sprite.angle; + this._vertexData[arrayOffset + 4] = sprite.width; + this._vertexData[arrayOffset + 5] = sprite.height; + this._vertexData[arrayOffset + 6] = offsetX; + this._vertexData[arrayOffset + 7] = offsetY; + this._vertexData[arrayOffset + 8] = sprite.invertU ? 1 : 0; + this._vertexData[arrayOffset + 9] = sprite.invertV ? 1 : 0; + var offset = (sprite.cellIndex / rowSize) >> 0; + this._vertexData[arrayOffset + 10] = sprite.cellIndex - offset * rowSize; + this._vertexData[arrayOffset + 11] = offset; + // Color + this._vertexData[arrayOffset + 12] = sprite.color.r; + this._vertexData[arrayOffset + 13] = sprite.color.g; + this._vertexData[arrayOffset + 14] = sprite.color.b; + this._vertexData[arrayOffset + 15] = sprite.color.a; + }; + /** + * Intersects the sprites with a ray + * @param ray defines the ray to intersect with + * @param camera defines the current active camera + * @param predicate defines a predicate used to select candidate sprites + * @param fastCheck defines if a fast check only must be done (the first potential sprite is will be used and not the closer) + * @returns null if no hit or a PickingInfo + */ + SpriteManager.prototype.intersects = function (ray, camera, predicate, fastCheck) { + var count = Math.min(this._capacity, this.sprites.length); + var min = BABYLON.Vector3.Zero(); + var max = BABYLON.Vector3.Zero(); + var distance = Number.MAX_VALUE; + var currentSprite = null; + var cameraSpacePosition = BABYLON.Vector3.Zero(); + var cameraView = camera.getViewMatrix(); + for (var index = 0; index < count; index++) { + var sprite = this.sprites[index]; + if (!sprite) { + continue; + } + if (predicate) { + if (!predicate(sprite)) { + continue; + } + } + else if (!sprite.isPickable) { + continue; + } + BABYLON.Vector3.TransformCoordinatesToRef(sprite.position, cameraView, cameraSpacePosition); + min.copyFromFloats(cameraSpacePosition.x - sprite.width / 2, cameraSpacePosition.y - sprite.height / 2, cameraSpacePosition.z); + max.copyFromFloats(cameraSpacePosition.x + sprite.width / 2, cameraSpacePosition.y + sprite.height / 2, cameraSpacePosition.z); + if (ray.intersectsBoxMinMax(min, max)) { + var currentDistance = BABYLON.Vector3.Distance(cameraSpacePosition, ray.origin); + if (distance > currentDistance) { + distance = currentDistance; + currentSprite = sprite; + if (fastCheck) { + break; + } + } + } + } + if (currentSprite) { + var result = new BABYLON.PickingInfo(); + result.hit = true; + result.pickedSprite = currentSprite; + result.distance = distance; + return result; + } + return null; + }; + /** + * Render all child sprites + */ + SpriteManager.prototype.render = function () { + // Check + if (!this._effectBase.isReady() || !this._effectFog.isReady() || !this._spriteTexture || !this._spriteTexture.isReady()) { + return; + } + var engine = this._scene.getEngine(); + var baseSize = this._spriteTexture.getBaseSize(); + // Sprites + var deltaTime = engine.getDeltaTime(); + var max = Math.min(this._capacity, this.sprites.length); + var rowSize = baseSize.width / this.cellWidth; + var offset = 0; + for (var index = 0; index < max; index++) { + var sprite = this.sprites[index]; + if (!sprite || !sprite.isVisible) { + continue; + } + sprite._animate(deltaTime); + this._appendSpriteVertex(offset++, sprite, 0, 0, rowSize); + this._appendSpriteVertex(offset++, sprite, 1, 0, rowSize); + this._appendSpriteVertex(offset++, sprite, 1, 1, rowSize); + this._appendSpriteVertex(offset++, sprite, 0, 1, rowSize); + } + this._buffer.update(this._vertexData); + // Render + var effect = this._effectBase; + if (this._scene.fogEnabled && this._scene.fogMode !== BABYLON.Scene.FOGMODE_NONE && this.fogEnabled) { + effect = this._effectFog; + } + engine.enableEffect(effect); + var viewMatrix = this._scene.getViewMatrix(); + effect.setTexture("diffuseSampler", this._spriteTexture); + effect.setMatrix("view", viewMatrix); + effect.setMatrix("projection", this._scene.getProjectionMatrix()); + effect.setFloat2("textureInfos", this.cellWidth / baseSize.width, this.cellHeight / baseSize.height); + // Fog + if (this._scene.fogEnabled && this._scene.fogMode !== BABYLON.Scene.FOGMODE_NONE && this.fogEnabled) { + effect.setFloat4("vFogInfos", this._scene.fogMode, this._scene.fogStart, this._scene.fogEnd, this._scene.fogDensity); + effect.setColor3("vFogColor", this._scene.fogColor); + } + // VBOs + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect); + // Draw order + engine.setDepthFunctionToLessOrEqual(); + effect.setBool("alphaTest", true); + engine.setColorWrite(false); + engine.drawElementsType(BABYLON.Material.TriangleFillMode, 0, (offset / 4) * 6); + engine.setColorWrite(true); + effect.setBool("alphaTest", false); + engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE); + engine.drawElementsType(BABYLON.Material.TriangleFillMode, 0, (offset / 4) * 6); + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + }; + /** + * Release associated resources + */ + SpriteManager.prototype.dispose = function () { + if (this._buffer) { + this._buffer.dispose(); + this._buffer = null; + } + if (this._indexBuffer) { + this._scene.getEngine()._releaseBuffer(this._indexBuffer); + this._indexBuffer = null; + } + if (this._spriteTexture) { + this._spriteTexture.dispose(); + this._spriteTexture = null; + } + // Remove from scene + var index = this._scene.spriteManagers.indexOf(this); + this._scene.spriteManagers.splice(index, 1); + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + }; + return SpriteManager; + }()); + BABYLON.SpriteManager = SpriteManager; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.spriteManager.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Class used to represent a sprite + * @see http://doc.babylonjs.com/babylon101/sprites + */ + var Sprite = /** @class */ (function () { + /** + * Creates a new Sprite + * @param name defines the name + * @param manager defines the manager + */ + function Sprite( + /** defines the name */ + name, manager) { + this.name = name; + /** Gets or sets the main color */ + this.color = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0); + /** Gets or sets the width */ + this.width = 1.0; + /** Gets or sets the height */ + this.height = 1.0; + /** Gets or sets rotation angle */ + this.angle = 0; + /** Gets or sets the cell index in the sprite sheet */ + this.cellIndex = 0; + /** Gets or sets a boolean indicating if UV coordinates should be inverted in U axis */ + this.invertU = 0; + /** Gets or sets a boolean indicating if UV coordinates should be inverted in B axis */ + this.invertV = 0; + /** Gets the list of attached animations */ + this.animations = new Array(); + /** Gets or sets a boolean indicating if the sprite can be picked */ + this.isPickable = false; + this._animationStarted = false; + this._loopAnimation = false; + this._fromIndex = 0; + this._toIndex = 0; + this._delay = 0; + this._direction = 1; + this._time = 0; + /** + * Gets or sets a boolean indicating if the sprite is visible (renderable). Default is true + */ + this.isVisible = true; + this._manager = manager; + this._manager.sprites.push(this); + this.position = BABYLON.Vector3.Zero(); + } + Object.defineProperty(Sprite.prototype, "size", { + /** + * Gets or sets the sprite size + */ + get: function () { + return this.width; + }, + set: function (value) { + this.width = value; + this.height = value; + }, + enumerable: true, + configurable: true + }); + /** + * Starts an animation + * @param from defines the initial key + * @param to defines the end key + * @param loop defines if the animation must loop + * @param delay defines the start delay (in ms) + * @param onAnimationEnd defines a callback to call when animation ends + */ + Sprite.prototype.playAnimation = function (from, to, loop, delay, onAnimationEnd) { + this._fromIndex = from; + this._toIndex = to; + this._loopAnimation = loop; + this._delay = delay; + this._animationStarted = true; + this._direction = from < to ? 1 : -1; + this.cellIndex = from; + this._time = 0; + this._onAnimationEnd = onAnimationEnd; + }; + /** Stops current animation (if any) */ + Sprite.prototype.stopAnimation = function () { + this._animationStarted = false; + }; + /** @hidden */ + Sprite.prototype._animate = function (deltaTime) { + if (!this._animationStarted) { + return; + } + this._time += deltaTime; + if (this._time > this._delay) { + this._time = this._time % this._delay; + this.cellIndex += this._direction; + if (this.cellIndex > this._toIndex) { + if (this._loopAnimation) { + this.cellIndex = this._fromIndex; + } + else { + this.cellIndex = this._toIndex; + this._animationStarted = false; + if (this._onAnimationEnd) { + this._onAnimationEnd(); + } + if (this.disposeWhenFinishedAnimating) { + this.dispose(); + } + } + } + } + }; + /** Release associated resources */ + Sprite.prototype.dispose = function () { + for (var i = 0; i < this._manager.sprites.length; i++) { + if (this._manager.sprites[i] == this) { + this._manager.sprites.splice(i, 1); + } + } + }; + return Sprite; + }()); + BABYLON.Sprite = Sprite; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.sprite.js.map + +var BABYLON; +(function (BABYLON) { + BABYLON.Scene.prototype._internalPickSprites = function (ray, predicate, fastCheck, camera) { + if (!BABYLON.PickingInfo) { + return null; + } + var pickingInfo = null; + if (!camera) { + if (!this.activeCamera) { + return null; + } + camera = this.activeCamera; + } + if (this.spriteManagers.length > 0) { + for (var spriteIndex = 0; spriteIndex < this.spriteManagers.length; spriteIndex++) { + var spriteManager = this.spriteManagers[spriteIndex]; + if (!spriteManager.isPickable) { + continue; + } + var result = spriteManager.intersects(ray, camera, predicate, fastCheck); + if (!result || !result.hit) { + continue; + } + if (!fastCheck && pickingInfo != null && result.distance >= pickingInfo.distance) { + continue; + } + pickingInfo = result; + if (fastCheck) { + break; + } + } + } + return pickingInfo || new BABYLON.PickingInfo(); + }; + BABYLON.Scene.prototype.pickSprite = function (x, y, predicate, fastCheck, camera) { + this.createPickingRayInCameraSpaceToRef(x, y, this._tempSpritePickingRay, camera); + return this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera); + }; + BABYLON.Scene.prototype.pickSpriteWithRay = function (ray, predicate, fastCheck, camera) { + if (!this._tempSpritePickingRay) { + return null; + } + if (!camera) { + if (!this.activeCamera) { + return null; + } + camera = this.activeCamera; + } + BABYLON.Ray.TransformToRef(ray, camera.getViewMatrix(), this._tempSpritePickingRay); + return this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera); + }; + BABYLON.Scene.prototype.setPointerOverSprite = function (sprite) { + if (this._pointerOverSprite === sprite) { + return; + } + if (this._pointerOverSprite && this._pointerOverSprite.actionManager) { + this._pointerOverSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPointerOutTrigger, BABYLON.ActionEvent.CreateNewFromSprite(this._pointerOverSprite, this)); + } + this._pointerOverSprite = sprite; + if (this._pointerOverSprite && this._pointerOverSprite.actionManager) { + this._pointerOverSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPointerOverTrigger, BABYLON.ActionEvent.CreateNewFromSprite(this._pointerOverSprite, this)); + } + }; + BABYLON.Scene.prototype.getPointerOverSprite = function () { + return this._pointerOverSprite; + }; + /** + * Defines the sprite scene component responsible to manage sprites + * in a given scene. + */ + var SpriteSceneComponent = /** @class */ (function () { + /** + * Creates a new instance of the component for the given scene + * @param scene Defines the scene to register the component in + */ + function SpriteSceneComponent(scene) { + /** + * The component name helpfull to identify the component in the list of scene components. + */ + this.name = BABYLON.SceneComponentConstants.NAME_SPRITE; + this.scene = scene; + this.scene.spriteManagers = new Array(); + this.scene._tempSpritePickingRay = BABYLON.Ray ? BABYLON.Ray.Zero() : null; + this.scene.onBeforeSpritesRenderingObservable = new BABYLON.Observable(); + this.scene.onAfterSpritesRenderingObservable = new BABYLON.Observable(); + this._spritePredicate = function (sprite) { + if (!sprite.actionManager) { + return false; + } + return sprite.isPickable && sprite.actionManager.hasPointerTriggers; + }; + } + /** + * Registers the component in a given scene + */ + SpriteSceneComponent.prototype.register = function () { + this.scene._pointerMoveStage.registerStep(BABYLON.SceneComponentConstants.STEP_POINTERMOVE_SPRITE, this, this._pointerMove); + this.scene._pointerDownStage.registerStep(BABYLON.SceneComponentConstants.STEP_POINTERDOWN_SPRITE, this, this._pointerDown); + this.scene._pointerUpStage.registerStep(BABYLON.SceneComponentConstants.STEP_POINTERUP_SPRITE, this, this._pointerUp); + }; + /** + * Rebuilds the elements related to this component in case of + * context lost for instance. + */ + SpriteSceneComponent.prototype.rebuild = function () { + /** Nothing to do for sprites */ + }; + /** + * Disposes the component and the associated ressources. + */ + SpriteSceneComponent.prototype.dispose = function () { + this.scene.onBeforeSpritesRenderingObservable.clear(); + this.scene.onAfterSpritesRenderingObservable.clear(); + var spriteManagers = this.scene.spriteManagers; + while (spriteManagers.length) { + spriteManagers[0].dispose(); + } + }; + SpriteSceneComponent.prototype._pickSpriteButKeepRay = function (originalPointerInfo, x, y, fastCheck, camera) { + var result = this.scene.pickSprite(x, y, this._spritePredicate, fastCheck, camera); + if (result) { + result.ray = originalPointerInfo ? originalPointerInfo.ray : null; + } + return result; + }; + SpriteSceneComponent.prototype._pointerMove = function (unTranslatedPointerX, unTranslatedPointerY, pickResult, isMeshPicked, canvas) { + var scene = this.scene; + if (isMeshPicked) { + scene.setPointerOverSprite(null); + } + else { + pickResult = this._pickSpriteButKeepRay(pickResult, unTranslatedPointerX, unTranslatedPointerY, false, scene.cameraToUseForPointers || undefined); + if (pickResult && pickResult.hit && pickResult.pickedSprite) { + scene.setPointerOverSprite(pickResult.pickedSprite); + if (scene._pointerOverSprite && scene._pointerOverSprite.actionManager && scene._pointerOverSprite.actionManager.hoverCursor) { + canvas.style.cursor = scene._pointerOverSprite.actionManager.hoverCursor; + } + else { + canvas.style.cursor = scene.hoverCursor; + } + } + else { + scene.setPointerOverSprite(null); + } + } + return pickResult; + }; + SpriteSceneComponent.prototype._pointerDown = function (unTranslatedPointerX, unTranslatedPointerY, pickResult, evt) { + var scene = this.scene; + scene._pickedDownSprite = null; + if (scene.spriteManagers.length > 0) { + pickResult = scene.pickSprite(unTranslatedPointerX, unTranslatedPointerY, this._spritePredicate, false, scene.cameraToUseForPointers || undefined); + if (pickResult && pickResult.hit && pickResult.pickedSprite) { + if (pickResult.pickedSprite.actionManager) { + scene._pickedDownSprite = pickResult.pickedSprite; + switch (evt.button) { + case 0: + pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnLeftPickTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, scene, evt)); + break; + case 1: + pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnCenterPickTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, scene, evt)); + break; + case 2: + pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnRightPickTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, scene, evt)); + break; + } + if (pickResult.pickedSprite.actionManager) { + pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickDownTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, scene, evt)); + } + } + } + } + return pickResult; + }; + SpriteSceneComponent.prototype._pointerUp = function (unTranslatedPointerX, unTranslatedPointerY, pickResult, evt) { + var scene = this.scene; + if (scene.spriteManagers.length > 0) { + var spritePickResult = scene.pickSprite(unTranslatedPointerX, unTranslatedPointerY, this._spritePredicate, false, scene.cameraToUseForPointers || undefined); + if (spritePickResult) { + if (spritePickResult.hit && spritePickResult.pickedSprite) { + if (spritePickResult.pickedSprite.actionManager) { + spritePickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickUpTrigger, BABYLON.ActionEvent.CreateNewFromSprite(spritePickResult.pickedSprite, scene, evt)); + if (spritePickResult.pickedSprite.actionManager) { + if (!this.scene._isPointerSwiping()) { + spritePickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger, BABYLON.ActionEvent.CreateNewFromSprite(spritePickResult.pickedSprite, scene, evt)); + } + } + } + } + if (scene._pickedDownSprite && scene._pickedDownSprite.actionManager && scene._pickedDownSprite !== spritePickResult.pickedSprite) { + scene._pickedDownSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNewFromSprite(scene._pickedDownSprite, scene, evt)); + } + } + } + return pickResult; + }; + return SpriteSceneComponent; + }()); + BABYLON.SpriteSceneComponent = SpriteSceneComponent; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.spriteSceneComponent.js.map + +var BABYLON; +(function (BABYLON) { + /** + * @hidden + */ + var IntersectionInfo = /** @class */ (function () { + function IntersectionInfo(bu, bv, distance) { + this.bu = bu; + this.bv = bv; + this.distance = distance; + this.faceId = 0; + this.subMeshId = 0; + } + return IntersectionInfo; + }()); + BABYLON.IntersectionInfo = IntersectionInfo; + /** + * Information about the result of picking within a scene + * @see https://doc.babylonjs.com/babylon101/picking_collisions + */ + var PickingInfo = /** @class */ (function () { + function PickingInfo() { + /** + * If the pick collided with an object + */ + this.hit = false; + /** + * Distance away where the pick collided + */ + this.distance = 0; + /** + * The location of pick collision + */ + this.pickedPoint = null; + /** + * The mesh corresponding the the pick collision + */ + this.pickedMesh = null; + /** (See getTextureCoordinates) The barycentric U coordinate that is used when calulating the texture coordinates of the collision.*/ + this.bu = 0; + /** (See getTextureCoordinates) The barycentric V coordinate that is used when calulating the texture coordinates of the collision.*/ + this.bv = 0; + /** The id of the face on the mesh that was picked */ + this.faceId = -1; + /** Id of the the submesh that was picked */ + this.subMeshId = 0; + /** If a sprite was picked, this will be the sprite the pick collided with */ + this.pickedSprite = null; + /** + * If a mesh was used to do the picking (eg. 6dof controller) this will be populated. + */ + this.originMesh = null; + /** + * The ray that was used to perform the picking. + */ + this.ray = null; + } + /** + * Gets the normal correspodning to the face the pick collided with + * @param useWorldCoordinates If the resulting normal should be relative to the world (default: false) + * @param useVerticesNormals If the vertices normals should be used to calculate the normal instead of the normal map + * @returns The normal correspodning to the face the pick collided with + */ + PickingInfo.prototype.getNormal = function (useWorldCoordinates, useVerticesNormals) { + if (useWorldCoordinates === void 0) { useWorldCoordinates = false; } + if (useVerticesNormals === void 0) { useVerticesNormals = true; } + if (!this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) { + return null; + } + var indices = this.pickedMesh.getIndices(); + if (!indices) { + return null; + } + var result; + if (useVerticesNormals) { + var normals = this.pickedMesh.getVerticesData(BABYLON.VertexBuffer.NormalKind); + var normal0 = BABYLON.Vector3.FromArray(normals, indices[this.faceId * 3] * 3); + var normal1 = BABYLON.Vector3.FromArray(normals, indices[this.faceId * 3 + 1] * 3); + var normal2 = BABYLON.Vector3.FromArray(normals, indices[this.faceId * 3 + 2] * 3); + normal0 = normal0.scale(this.bu); + normal1 = normal1.scale(this.bv); + normal2 = normal2.scale(1.0 - this.bu - this.bv); + result = new BABYLON.Vector3(normal0.x + normal1.x + normal2.x, normal0.y + normal1.y + normal2.y, normal0.z + normal1.z + normal2.z); + } + else { + var positions = this.pickedMesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); + var vertex1 = BABYLON.Vector3.FromArray(positions, indices[this.faceId * 3] * 3); + var vertex2 = BABYLON.Vector3.FromArray(positions, indices[this.faceId * 3 + 1] * 3); + var vertex3 = BABYLON.Vector3.FromArray(positions, indices[this.faceId * 3 + 2] * 3); + var p1p2 = vertex1.subtract(vertex2); + var p3p2 = vertex3.subtract(vertex2); + result = BABYLON.Vector3.Cross(p1p2, p3p2); + } + if (useWorldCoordinates) { + var wm = this.pickedMesh.getWorldMatrix(); + if (this.pickedMesh.nonUniformScaling) { + BABYLON.Tmp.Matrix[0].copyFrom(wm); + wm = BABYLON.Tmp.Matrix[0]; + wm.setTranslationFromFloats(0, 0, 0); + wm.invert(); + wm.transposeToRef(BABYLON.Tmp.Matrix[1]); + wm = BABYLON.Tmp.Matrix[1]; + } + result = BABYLON.Vector3.TransformNormal(result, wm); + } + result.normalize(); + return result; + }; + /** + * Gets the texture coordinates of where the pick occured + * @returns the vector containing the coordnates of the texture + */ + PickingInfo.prototype.getTextureCoordinates = function () { + if (!this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) { + return null; + } + var indices = this.pickedMesh.getIndices(); + if (!indices) { + return null; + } + var uvs = this.pickedMesh.getVerticesData(BABYLON.VertexBuffer.UVKind); + if (!uvs) { + return null; + } + var uv0 = BABYLON.Vector2.FromArray(uvs, indices[this.faceId * 3] * 2); + var uv1 = BABYLON.Vector2.FromArray(uvs, indices[this.faceId * 3 + 1] * 2); + var uv2 = BABYLON.Vector2.FromArray(uvs, indices[this.faceId * 3 + 2] * 2); + uv0 = uv0.scale(1.0 - this.bu - this.bv); + uv1 = uv1.scale(this.bu); + uv2 = uv2.scale(this.bv); + return new BABYLON.Vector2(uv0.x + uv1.x + uv2.x, uv0.y + uv1.y + uv2.y); + }; + return PickingInfo; + }()); + BABYLON.PickingInfo = PickingInfo; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pickingInfo.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Class representing a ray with position and direction + */ + var Ray = /** @class */ (function () { + /** + * Creates a new ray + * @param origin origin point + * @param direction direction + * @param length length of the ray + */ + function Ray( + /** origin point */ + origin, + /** direction */ + direction, + /** length of the ray */ + length) { + if (length === void 0) { length = Number.MAX_VALUE; } + this.origin = origin; + this.direction = direction; + this.length = length; + } + // Methods + /** + * Checks if the ray intersects a box + * @param minimum bound of the box + * @param maximum bound of the box + * @returns if the box was hit + */ + Ray.prototype.intersectsBoxMinMax = function (minimum, maximum) { + var d = 0.0; + var maxValue = Number.MAX_VALUE; + var inv; + var min; + var max; + var temp; + if (Math.abs(this.direction.x) < 0.0000001) { + if (this.origin.x < minimum.x || this.origin.x > maximum.x) { + return false; + } + } + else { + inv = 1.0 / this.direction.x; + min = (minimum.x - this.origin.x) * inv; + max = (maximum.x - this.origin.x) * inv; + if (max === -Infinity) { + max = Infinity; + } + if (min > max) { + temp = min; + min = max; + max = temp; + } + d = Math.max(min, d); + maxValue = Math.min(max, maxValue); + if (d > maxValue) { + return false; + } + } + if (Math.abs(this.direction.y) < 0.0000001) { + if (this.origin.y < minimum.y || this.origin.y > maximum.y) { + return false; + } + } + else { + inv = 1.0 / this.direction.y; + min = (minimum.y - this.origin.y) * inv; + max = (maximum.y - this.origin.y) * inv; + if (max === -Infinity) { + max = Infinity; + } + if (min > max) { + temp = min; + min = max; + max = temp; + } + d = Math.max(min, d); + maxValue = Math.min(max, maxValue); + if (d > maxValue) { + return false; + } + } + if (Math.abs(this.direction.z) < 0.0000001) { + if (this.origin.z < minimum.z || this.origin.z > maximum.z) { + return false; + } + } + else { + inv = 1.0 / this.direction.z; + min = (minimum.z - this.origin.z) * inv; + max = (maximum.z - this.origin.z) * inv; + if (max === -Infinity) { + max = Infinity; + } + if (min > max) { + temp = min; + min = max; + max = temp; + } + d = Math.max(min, d); + maxValue = Math.min(max, maxValue); + if (d > maxValue) { + return false; + } + } + return true; + }; + /** + * Checks if the ray intersects a box + * @param box the bounding box to check + * @returns if the box was hit + */ + Ray.prototype.intersectsBox = function (box) { + return this.intersectsBoxMinMax(box.minimum, box.maximum); + }; + /** + * If the ray hits a sphere + * @param sphere the bounding sphere to check + * @returns true if it hits the sphere + */ + Ray.prototype.intersectsSphere = function (sphere) { + var x = sphere.center.x - this.origin.x; + var y = sphere.center.y - this.origin.y; + var z = sphere.center.z - this.origin.z; + var pyth = (x * x) + (y * y) + (z * z); + var rr = sphere.radius * sphere.radius; + if (pyth <= rr) { + return true; + } + var dot = (x * this.direction.x) + (y * this.direction.y) + (z * this.direction.z); + if (dot < 0.0) { + return false; + } + var temp = pyth - (dot * dot); + return temp <= rr; + }; + /** + * If the ray hits a triange + * @param vertex0 triangle vertex + * @param vertex1 triangle vertex + * @param vertex2 triangle vertex + * @returns intersection information if hit + */ + Ray.prototype.intersectsTriangle = function (vertex0, vertex1, vertex2) { + if (!this._edge1) { + this._edge1 = BABYLON.Vector3.Zero(); + this._edge2 = BABYLON.Vector3.Zero(); + this._pvec = BABYLON.Vector3.Zero(); + this._tvec = BABYLON.Vector3.Zero(); + this._qvec = BABYLON.Vector3.Zero(); + } + vertex1.subtractToRef(vertex0, this._edge1); + vertex2.subtractToRef(vertex0, this._edge2); + BABYLON.Vector3.CrossToRef(this.direction, this._edge2, this._pvec); + var det = BABYLON.Vector3.Dot(this._edge1, this._pvec); + if (det === 0) { + return null; + } + var invdet = 1 / det; + this.origin.subtractToRef(vertex0, this._tvec); + var bu = BABYLON.Vector3.Dot(this._tvec, this._pvec) * invdet; + if (bu < 0 || bu > 1.0) { + return null; + } + BABYLON.Vector3.CrossToRef(this._tvec, this._edge1, this._qvec); + var bv = BABYLON.Vector3.Dot(this.direction, this._qvec) * invdet; + if (bv < 0 || bu + bv > 1.0) { + return null; + } + //check if the distance is longer than the predefined length. + var distance = BABYLON.Vector3.Dot(this._edge2, this._qvec) * invdet; + if (distance > this.length) { + return null; + } + return new BABYLON.IntersectionInfo(bu, bv, distance); + }; + /** + * Checks if ray intersects a plane + * @param plane the plane to check + * @returns the distance away it was hit + */ + Ray.prototype.intersectsPlane = function (plane) { + var distance; + var result1 = BABYLON.Vector3.Dot(plane.normal, this.direction); + if (Math.abs(result1) < 9.99999997475243E-07) { + return null; + } + else { + var result2 = BABYLON.Vector3.Dot(plane.normal, this.origin); + distance = (-plane.d - result2) / result1; + if (distance < 0.0) { + if (distance < -9.99999997475243E-07) { + return null; + } + else { + return 0; + } + } + return distance; + } + }; + /** + * Checks if ray intersects a mesh + * @param mesh the mesh to check + * @param fastCheck if only the bounding box should checked + * @returns picking info of the intersecton + */ + Ray.prototype.intersectsMesh = function (mesh, fastCheck) { + var tm = BABYLON.Tmp.Matrix[0]; + mesh.getWorldMatrix().invertToRef(tm); + if (this._tmpRay) { + Ray.TransformToRef(this, tm, this._tmpRay); + } + else { + this._tmpRay = Ray.Transform(this, tm); + } + return mesh.intersects(this._tmpRay, fastCheck); + }; + /** + * Checks if ray intersects a mesh + * @param meshes the meshes to check + * @param fastCheck if only the bounding box should checked + * @param results array to store result in + * @returns Array of picking infos + */ + Ray.prototype.intersectsMeshes = function (meshes, fastCheck, results) { + if (results) { + results.length = 0; + } + else { + results = []; + } + for (var i = 0; i < meshes.length; i++) { + var pickInfo = this.intersectsMesh(meshes[i], fastCheck); + if (pickInfo.hit) { + results.push(pickInfo); + } + } + results.sort(this._comparePickingInfo); + return results; + }; + Ray.prototype._comparePickingInfo = function (pickingInfoA, pickingInfoB) { + if (pickingInfoA.distance < pickingInfoB.distance) { + return -1; + } + else if (pickingInfoA.distance > pickingInfoB.distance) { + return 1; + } + else { + return 0; + } + }; + /** + * Intersection test between the ray and a given segment whithin a given tolerance (threshold) + * @param sega the first point of the segment to test the intersection against + * @param segb the second point of the segment to test the intersection against + * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful + * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection + */ + Ray.prototype.intersectionSegment = function (sega, segb, threshold) { + var rsegb = this.origin.add(this.direction.multiplyByFloats(Ray.rayl, Ray.rayl, Ray.rayl)); + var u = segb.subtract(sega); + var v = rsegb.subtract(this.origin); + var w = sega.subtract(this.origin); + var a = BABYLON.Vector3.Dot(u, u); // always >= 0 + var b = BABYLON.Vector3.Dot(u, v); + var c = BABYLON.Vector3.Dot(v, v); // always >= 0 + var d = BABYLON.Vector3.Dot(u, w); + var e = BABYLON.Vector3.Dot(v, w); + var D = a * c - b * b; // always >= 0 + var sc, sN, sD = D; // sc = sN / sD, default sD = D >= 0 + var tc, tN, tD = D; // tc = tN / tD, default tD = D >= 0 + // compute the line parameters of the two closest points + if (D < Ray.smallnum) { // the lines are almost parallel + sN = 0.0; // force using point P0 on segment S1 + sD = 1.0; // to prevent possible division by 0.0 later + tN = e; + tD = c; + } + else { // get the closest points on the infinite lines + sN = (b * e - c * d); + tN = (a * e - b * d); + if (sN < 0.0) { // sc < 0 => the s=0 edge is visible + sN = 0.0; + tN = e; + tD = c; + } + else if (sN > sD) { // sc > 1 => the s=1 edge is visible + sN = sD; + tN = e + b; + tD = c; + } + } + if (tN < 0.0) { // tc < 0 => the t=0 edge is visible + tN = 0.0; + // recompute sc for this edge + if (-d < 0.0) { + sN = 0.0; + } + else if (-d > a) { + sN = sD; + } + else { + sN = -d; + sD = a; + } + } + else if (tN > tD) { // tc > 1 => the t=1 edge is visible + tN = tD; + // recompute sc for this edge + if ((-d + b) < 0.0) { + sN = 0; + } + else if ((-d + b) > a) { + sN = sD; + } + else { + sN = (-d + b); + sD = a; + } + } + // finally do the division to get sc and tc + sc = (Math.abs(sN) < Ray.smallnum ? 0.0 : sN / sD); + tc = (Math.abs(tN) < Ray.smallnum ? 0.0 : tN / tD); + // get the difference of the two closest points + var qtc = v.multiplyByFloats(tc, tc, tc); + var dP = w.add(u.multiplyByFloats(sc, sc, sc)).subtract(qtc); // = S1(sc) - S2(tc) + var isIntersected = (tc > 0) && (tc <= this.length) && (dP.lengthSquared() < (threshold * threshold)); // return intersection result + if (isIntersected) { + return qtc.length(); + } + return -1; + }; + /** + * Update the ray from viewport position + * @param x position + * @param y y position + * @param viewportWidth viewport width + * @param viewportHeight viewport height + * @param world world matrix + * @param view view matrix + * @param projection projection matrix + * @returns this ray updated + */ + Ray.prototype.update = function (x, y, viewportWidth, viewportHeight, world, view, projection) { + BABYLON.Vector3.UnprojectFloatsToRef(x, y, 0, viewportWidth, viewportHeight, world, view, projection, this.origin); + BABYLON.Vector3.UnprojectFloatsToRef(x, y, 1, viewportWidth, viewportHeight, world, view, projection, BABYLON.Tmp.Vector3[0]); + BABYLON.Tmp.Vector3[0].subtractToRef(this.origin, this.direction); + this.direction.normalize(); + return this; + }; + // Statics + /** + * Creates a ray with origin and direction of 0,0,0 + * @returns the new ray + */ + Ray.Zero = function () { + return new Ray(BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()); + }; + /** + * Creates a new ray from screen space and viewport + * @param x position + * @param y y position + * @param viewportWidth viewport width + * @param viewportHeight viewport height + * @param world world matrix + * @param view view matrix + * @param projection projection matrix + * @returns new ray + */ + Ray.CreateNew = function (x, y, viewportWidth, viewportHeight, world, view, projection) { + var result = Ray.Zero(); + return result.update(x, y, viewportWidth, viewportHeight, world, view, projection); + }; + /** + * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be + * transformed to the given world matrix. + * @param origin The origin point + * @param end The end point + * @param world a matrix to transform the ray to. Default is the identity matrix. + * @returns the new ray + */ + Ray.CreateNewFromTo = function (origin, end, world) { + if (world === void 0) { world = BABYLON.Matrix.Identity(); } + var direction = end.subtract(origin); + var length = Math.sqrt((direction.x * direction.x) + (direction.y * direction.y) + (direction.z * direction.z)); + direction.normalize(); + return Ray.Transform(new Ray(origin, direction, length), world); + }; + /** + * Transforms a ray by a matrix + * @param ray ray to transform + * @param matrix matrix to apply + * @returns the resulting new ray + */ + Ray.Transform = function (ray, matrix) { + var result = new Ray(new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(0, 0, 0)); + Ray.TransformToRef(ray, matrix, result); + return result; + }; + /** + * Transforms a ray by a matrix + * @param ray ray to transform + * @param matrix matrix to apply + * @param result ray to store result in + */ + Ray.TransformToRef = function (ray, matrix, result) { + BABYLON.Vector3.TransformCoordinatesToRef(ray.origin, matrix, result.origin); + BABYLON.Vector3.TransformNormalToRef(ray.direction, matrix, result.direction); + result.length = ray.length; + var dir = result.direction; + var len = dir.length(); + if (!(len === 0 || len === 1)) { + var num = 1.0 / len; + dir.x *= num; + dir.y *= num; + dir.z *= num; + result.length *= len; + } + }; + Ray.smallnum = 0.00000001; + Ray.rayl = 10e8; + return Ray; + }()); + BABYLON.Ray = Ray; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.ray.js.map + +var BABYLON; +(function (BABYLON) { + var intersectBoxAASphere = function (boxMin, boxMax, sphereCenter, sphereRadius) { + if (boxMin.x > sphereCenter.x + sphereRadius) { + return false; + } + if (sphereCenter.x - sphereRadius > boxMax.x) { + return false; + } + if (boxMin.y > sphereCenter.y + sphereRadius) { + return false; + } + if (sphereCenter.y - sphereRadius > boxMax.y) { + return false; + } + if (boxMin.z > sphereCenter.z + sphereRadius) { + return false; + } + if (sphereCenter.z - sphereRadius > boxMax.z) { + return false; + } + return true; + }; + var getLowestRoot = (function () { + var result = { root: 0, found: false }; + return function (a, b, c, maxR) { + result.root = 0; + result.found = false; + var determinant = b * b - 4.0 * a * c; + if (determinant < 0) { + return result; + } + var sqrtD = Math.sqrt(determinant); + var r1 = (-b - sqrtD) / (2.0 * a); + var r2 = (-b + sqrtD) / (2.0 * a); + if (r1 > r2) { + var temp = r2; + r2 = r1; + r1 = temp; + } + if (r1 > 0 && r1 < maxR) { + result.root = r1; + result.found = true; + return result; + } + if (r2 > 0 && r2 < maxR) { + result.root = r2; + result.found = true; + return result; + } + return result; + }; + })(); + /** @hidden */ + var Collider = /** @class */ (function () { + function Collider() { + this._collisionPoint = BABYLON.Vector3.Zero(); + this._planeIntersectionPoint = BABYLON.Vector3.Zero(); + this._tempVector = BABYLON.Vector3.Zero(); + this._tempVector2 = BABYLON.Vector3.Zero(); + this._tempVector3 = BABYLON.Vector3.Zero(); + this._tempVector4 = BABYLON.Vector3.Zero(); + this._edge = BABYLON.Vector3.Zero(); + this._baseToVertex = BABYLON.Vector3.Zero(); + this._destinationPoint = BABYLON.Vector3.Zero(); + this._slidePlaneNormal = BABYLON.Vector3.Zero(); + this._displacementVector = BABYLON.Vector3.Zero(); + /** @hidden */ + this._radius = BABYLON.Vector3.One(); + /** @hidden */ + this._retry = 0; + /** @hidden */ + this._basePointWorld = BABYLON.Vector3.Zero(); + this._velocityWorld = BABYLON.Vector3.Zero(); + this._normalizedVelocity = BABYLON.Vector3.Zero(); + this._collisionMask = -1; + } + Object.defineProperty(Collider.prototype, "collisionMask", { + get: function () { + return this._collisionMask; + }, + set: function (mask) { + this._collisionMask = !isNaN(mask) ? mask : -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Collider.prototype, "slidePlaneNormal", { + /** + * Gets the plane normal used to compute the sliding response (in local space) + */ + get: function () { + return this._slidePlaneNormal; + }, + enumerable: true, + configurable: true + }); + // Methods + /** @hidden */ + Collider.prototype._initialize = function (source, dir, e) { + this._velocity = dir; + BABYLON.Vector3.NormalizeToRef(dir, this._normalizedVelocity); + this._basePoint = source; + source.multiplyToRef(this._radius, this._basePointWorld); + dir.multiplyToRef(this._radius, this._velocityWorld); + this._velocityWorldLength = this._velocityWorld.length(); + this._epsilon = e; + this.collisionFound = false; + }; + /** @hidden */ + Collider.prototype._checkPointInTriangle = function (point, pa, pb, pc, n) { + pa.subtractToRef(point, this._tempVector); + pb.subtractToRef(point, this._tempVector2); + BABYLON.Vector3.CrossToRef(this._tempVector, this._tempVector2, this._tempVector4); + var d = BABYLON.Vector3.Dot(this._tempVector4, n); + if (d < 0) { + return false; + } + pc.subtractToRef(point, this._tempVector3); + BABYLON.Vector3.CrossToRef(this._tempVector2, this._tempVector3, this._tempVector4); + d = BABYLON.Vector3.Dot(this._tempVector4, n); + if (d < 0) { + return false; + } + BABYLON.Vector3.CrossToRef(this._tempVector3, this._tempVector, this._tempVector4); + d = BABYLON.Vector3.Dot(this._tempVector4, n); + return d >= 0; + }; + /** @hidden */ + Collider.prototype._canDoCollision = function (sphereCenter, sphereRadius, vecMin, vecMax) { + var distance = BABYLON.Vector3.Distance(this._basePointWorld, sphereCenter); + var max = Math.max(this._radius.x, this._radius.y, this._radius.z); + if (distance > this._velocityWorldLength + max + sphereRadius) { + return false; + } + if (!intersectBoxAASphere(vecMin, vecMax, this._basePointWorld, this._velocityWorldLength + max)) { + return false; + } + return true; + }; + /** @hidden */ + Collider.prototype._testTriangle = function (faceIndex, trianglePlaneArray, p1, p2, p3, hasMaterial) { + var t0; + var embeddedInPlane = false; + //defensive programming, actually not needed. + if (!trianglePlaneArray) { + trianglePlaneArray = []; + } + if (!trianglePlaneArray[faceIndex]) { + trianglePlaneArray[faceIndex] = new BABYLON.Plane(0, 0, 0, 0); + trianglePlaneArray[faceIndex].copyFromPoints(p1, p2, p3); + } + var trianglePlane = trianglePlaneArray[faceIndex]; + if ((!hasMaterial) && !trianglePlane.isFrontFacingTo(this._normalizedVelocity, 0)) { + return; + } + var signedDistToTrianglePlane = trianglePlane.signedDistanceTo(this._basePoint); + var normalDotVelocity = BABYLON.Vector3.Dot(trianglePlane.normal, this._velocity); + if (normalDotVelocity == 0) { + if (Math.abs(signedDistToTrianglePlane) >= 1.0) { + return; + } + embeddedInPlane = true; + t0 = 0; + } + else { + t0 = (-1.0 - signedDistToTrianglePlane) / normalDotVelocity; + var t1 = (1.0 - signedDistToTrianglePlane) / normalDotVelocity; + if (t0 > t1) { + var temp = t1; + t1 = t0; + t0 = temp; + } + if (t0 > 1.0 || t1 < 0.0) { + return; + } + if (t0 < 0) { + t0 = 0; + } + if (t0 > 1.0) { + t0 = 1.0; + } + } + this._collisionPoint.copyFromFloats(0, 0, 0); + var found = false; + var t = 1.0; + if (!embeddedInPlane) { + this._basePoint.subtractToRef(trianglePlane.normal, this._planeIntersectionPoint); + this._velocity.scaleToRef(t0, this._tempVector); + this._planeIntersectionPoint.addInPlace(this._tempVector); + if (this._checkPointInTriangle(this._planeIntersectionPoint, p1, p2, p3, trianglePlane.normal)) { + found = true; + t = t0; + this._collisionPoint.copyFrom(this._planeIntersectionPoint); + } + } + if (!found) { + var velocitySquaredLength = this._velocity.lengthSquared(); + var a = velocitySquaredLength; + this._basePoint.subtractToRef(p1, this._tempVector); + var b = 2.0 * (BABYLON.Vector3.Dot(this._velocity, this._tempVector)); + var c = this._tempVector.lengthSquared() - 1.0; + var lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + t = lowestRoot.root; + found = true; + this._collisionPoint.copyFrom(p1); + } + this._basePoint.subtractToRef(p2, this._tempVector); + b = 2.0 * (BABYLON.Vector3.Dot(this._velocity, this._tempVector)); + c = this._tempVector.lengthSquared() - 1.0; + lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + t = lowestRoot.root; + found = true; + this._collisionPoint.copyFrom(p2); + } + this._basePoint.subtractToRef(p3, this._tempVector); + b = 2.0 * (BABYLON.Vector3.Dot(this._velocity, this._tempVector)); + c = this._tempVector.lengthSquared() - 1.0; + lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + t = lowestRoot.root; + found = true; + this._collisionPoint.copyFrom(p3); + } + p2.subtractToRef(p1, this._edge); + p1.subtractToRef(this._basePoint, this._baseToVertex); + var edgeSquaredLength = this._edge.lengthSquared(); + var edgeDotVelocity = BABYLON.Vector3.Dot(this._edge, this._velocity); + var edgeDotBaseToVertex = BABYLON.Vector3.Dot(this._edge, this._baseToVertex); + a = edgeSquaredLength * (-velocitySquaredLength) + edgeDotVelocity * edgeDotVelocity; + b = edgeSquaredLength * (2.0 * BABYLON.Vector3.Dot(this._velocity, this._baseToVertex)) - 2.0 * edgeDotVelocity * edgeDotBaseToVertex; + c = edgeSquaredLength * (1.0 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex; + lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + var f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength; + if (f >= 0.0 && f <= 1.0) { + t = lowestRoot.root; + found = true; + this._edge.scaleInPlace(f); + p1.addToRef(this._edge, this._collisionPoint); + } + } + p3.subtractToRef(p2, this._edge); + p2.subtractToRef(this._basePoint, this._baseToVertex); + edgeSquaredLength = this._edge.lengthSquared(); + edgeDotVelocity = BABYLON.Vector3.Dot(this._edge, this._velocity); + edgeDotBaseToVertex = BABYLON.Vector3.Dot(this._edge, this._baseToVertex); + a = edgeSquaredLength * (-velocitySquaredLength) + edgeDotVelocity * edgeDotVelocity; + b = edgeSquaredLength * (2.0 * BABYLON.Vector3.Dot(this._velocity, this._baseToVertex)) - 2.0 * edgeDotVelocity * edgeDotBaseToVertex; + c = edgeSquaredLength * (1.0 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex; + lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength; + if (f >= 0.0 && f <= 1.0) { + t = lowestRoot.root; + found = true; + this._edge.scaleInPlace(f); + p2.addToRef(this._edge, this._collisionPoint); + } + } + p1.subtractToRef(p3, this._edge); + p3.subtractToRef(this._basePoint, this._baseToVertex); + edgeSquaredLength = this._edge.lengthSquared(); + edgeDotVelocity = BABYLON.Vector3.Dot(this._edge, this._velocity); + edgeDotBaseToVertex = BABYLON.Vector3.Dot(this._edge, this._baseToVertex); + a = edgeSquaredLength * (-velocitySquaredLength) + edgeDotVelocity * edgeDotVelocity; + b = edgeSquaredLength * (2.0 * BABYLON.Vector3.Dot(this._velocity, this._baseToVertex)) - 2.0 * edgeDotVelocity * edgeDotBaseToVertex; + c = edgeSquaredLength * (1.0 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex; + lowestRoot = getLowestRoot(a, b, c, t); + if (lowestRoot.found) { + f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength; + if (f >= 0.0 && f <= 1.0) { + t = lowestRoot.root; + found = true; + this._edge.scaleInPlace(f); + p3.addToRef(this._edge, this._collisionPoint); + } + } + } + if (found) { + var distToCollision = t * this._velocity.length(); + if (!this.collisionFound || distToCollision < this._nearestDistance) { + if (!this.intersectionPoint) { + this.intersectionPoint = this._collisionPoint.clone(); + } + else { + this.intersectionPoint.copyFrom(this._collisionPoint); + } + this._nearestDistance = distToCollision; + this.collisionFound = true; + } + } + }; + /** @hidden */ + Collider.prototype._collide = function (trianglePlaneArray, pts, indices, indexStart, indexEnd, decal, hasMaterial) { + for (var i = indexStart; i < indexEnd; i += 3) { + var p1 = pts[indices[i] - decal]; + var p2 = pts[indices[i + 1] - decal]; + var p3 = pts[indices[i + 2] - decal]; + this._testTriangle(i, trianglePlaneArray, p3, p2, p1, hasMaterial); + } + }; + /** @hidden */ + Collider.prototype._getResponse = function (pos, vel) { + pos.addToRef(vel, this._destinationPoint); + vel.scaleInPlace((this._nearestDistance / vel.length())); + this._basePoint.addToRef(vel, pos); + pos.subtractToRef(this.intersectionPoint, this._slidePlaneNormal); + this._slidePlaneNormal.normalize(); + this._slidePlaneNormal.scaleToRef(this._epsilon, this._displacementVector); + pos.addInPlace(this._displacementVector); + this.intersectionPoint.addInPlace(this._displacementVector); + this._slidePlaneNormal.scaleInPlace(BABYLON.Plane.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint, this._slidePlaneNormal, this._destinationPoint)); + this._destinationPoint.subtractInPlace(this._slidePlaneNormal); + this._destinationPoint.subtractToRef(this.intersectionPoint, vel); + }; + return Collider; + }()); + BABYLON.Collider = Collider; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.collider.js.map + +var BABYLON; +(function (BABYLON) { + //WebWorker code will be inserted to this variable. + /** @hidden */ + BABYLON.CollisionWorker = ""; + /** Defines supported task for worker process */ + var WorkerTaskType; + (function (WorkerTaskType) { + /** Initialization */ + WorkerTaskType[WorkerTaskType["INIT"] = 0] = "INIT"; + /** Update of geometry */ + WorkerTaskType[WorkerTaskType["UPDATE"] = 1] = "UPDATE"; + /** Evaluate collision */ + WorkerTaskType[WorkerTaskType["COLLIDE"] = 2] = "COLLIDE"; + })(WorkerTaskType = BABYLON.WorkerTaskType || (BABYLON.WorkerTaskType = {})); + /** Defines kind of replies returned by worker */ + var WorkerReplyType; + (function (WorkerReplyType) { + /** Success */ + WorkerReplyType[WorkerReplyType["SUCCESS"] = 0] = "SUCCESS"; + /** Unkown error */ + WorkerReplyType[WorkerReplyType["UNKNOWN_ERROR"] = 1] = "UNKNOWN_ERROR"; + })(WorkerReplyType = BABYLON.WorkerReplyType || (BABYLON.WorkerReplyType = {})); + /** @hidden */ + var CollisionCoordinatorWorker = /** @class */ (function () { + function CollisionCoordinatorWorker() { + var _this = this; + this._scaledPosition = BABYLON.Vector3.Zero(); + this._scaledVelocity = BABYLON.Vector3.Zero(); + this.onMeshUpdated = function (transformNode) { + _this._addUpdateMeshesList[transformNode.uniqueId] = CollisionCoordinatorWorker.SerializeMesh(transformNode); + }; + this.onGeometryUpdated = function (geometry) { + _this._addUpdateGeometriesList[geometry.id] = CollisionCoordinatorWorker.SerializeGeometry(geometry); + }; + this._afterRender = function () { + if (!_this._init) { + return; + } + if (_this._toRemoveGeometryArray.length == 0 && _this._toRemoveMeshesArray.length == 0 && Object.keys(_this._addUpdateGeometriesList).length == 0 && Object.keys(_this._addUpdateMeshesList).length == 0) { + return; + } + //5 concurrent updates were sent to the web worker and were not yet processed. Abort next update. + //TODO make sure update runs as fast as possible to be able to update 60 FPS. + if (_this._runningUpdated > 4) { + return; + } + ++_this._runningUpdated; + var payload = { + updatedMeshes: _this._addUpdateMeshesList, + updatedGeometries: _this._addUpdateGeometriesList, + removedGeometries: _this._toRemoveGeometryArray, + removedMeshes: _this._toRemoveMeshesArray + }; + var message = { + payload: payload, + taskType: WorkerTaskType.UPDATE + }; + var serializable = []; + for (var id in payload.updatedGeometries) { + if (payload.updatedGeometries.hasOwnProperty(id)) { + //prepare transferables + serializable.push(message.payload.updatedGeometries[id].indices.buffer); + serializable.push(message.payload.updatedGeometries[id].normals.buffer); + serializable.push(message.payload.updatedGeometries[id].positions.buffer); + } + } + _this._worker.postMessage(message, serializable); + _this._addUpdateMeshesList = {}; + _this._addUpdateGeometriesList = {}; + _this._toRemoveGeometryArray = []; + _this._toRemoveMeshesArray = []; + }; + this._onMessageFromWorker = function (e) { + var returnData = e.data; + if (returnData.error != WorkerReplyType.SUCCESS) { + //TODO what errors can be returned from the worker? + BABYLON.Tools.Warn("error returned from worker!"); + return; + } + switch (returnData.taskType) { + case WorkerTaskType.INIT: + _this._init = true; + //Update the worked with ALL of the scene's current state + _this._scene.meshes.forEach(function (mesh) { + _this.onMeshAdded(mesh); + }); + _this._scene.getGeometries().forEach(function (geometry) { + _this.onGeometryAdded(geometry); + }); + break; + case WorkerTaskType.UPDATE: + _this._runningUpdated--; + break; + case WorkerTaskType.COLLIDE: + var returnPayload = returnData.payload; + if (!_this._collisionsCallbackArray[returnPayload.collisionId]) { + return; + } + var callback = _this._collisionsCallbackArray[returnPayload.collisionId]; + if (callback) { + var mesh = _this._scene.getMeshByUniqueID(returnPayload.collidedMeshUniqueId); + if (mesh) { + callback(returnPayload.collisionId, BABYLON.Vector3.FromArray(returnPayload.newPosition), mesh); + } + } + //cleanup + _this._collisionsCallbackArray[returnPayload.collisionId] = null; + break; + } + }; + this._collisionsCallbackArray = []; + this._init = false; + this._runningUpdated = 0; + this._addUpdateMeshesList = {}; + this._addUpdateGeometriesList = {}; + this._toRemoveGeometryArray = []; + this._toRemoveMeshesArray = []; + } + CollisionCoordinatorWorker.prototype.getNewPosition = function (position, displacement, collider, maximumRetry, excludedMesh, onNewPosition, collisionIndex) { + if (!this._init) { + return; + } + if (this._collisionsCallbackArray[collisionIndex] || this._collisionsCallbackArray[collisionIndex + 100000]) { + return; + } + position.divideToRef(collider._radius, this._scaledPosition); + displacement.divideToRef(collider._radius, this._scaledVelocity); + this._collisionsCallbackArray[collisionIndex] = onNewPosition; + var payload = { + collider: { + position: this._scaledPosition.asArray(), + velocity: this._scaledVelocity.asArray(), + radius: collider._radius.asArray() + }, + collisionId: collisionIndex, + excludedMeshUniqueId: excludedMesh ? excludedMesh.uniqueId : null, + maximumRetry: maximumRetry + }; + var message = { + payload: payload, + taskType: WorkerTaskType.COLLIDE + }; + this._worker.postMessage(message); + }; + CollisionCoordinatorWorker.prototype.init = function (scene) { + this._scene = scene; + this._scene.registerAfterRender(this._afterRender); + var workerUrl = BABYLON.WorkerIncluded ? BABYLON.Engine.CodeRepository + "Collisions/babylon.collisionWorker.js" : URL.createObjectURL(new Blob([BABYLON.CollisionWorker], { type: 'application/javascript' })); + this._worker = new Worker(workerUrl); + this._worker.onmessage = this._onMessageFromWorker; + var message = { + payload: {}, + taskType: WorkerTaskType.INIT + }; + this._worker.postMessage(message); + }; + CollisionCoordinatorWorker.prototype.destroy = function () { + this._scene.unregisterAfterRender(this._afterRender); + this._worker.terminate(); + }; + CollisionCoordinatorWorker.prototype.onMeshAdded = function (mesh) { + mesh.registerAfterWorldMatrixUpdate(this.onMeshUpdated); + this.onMeshUpdated(mesh); + }; + CollisionCoordinatorWorker.prototype.onMeshRemoved = function (mesh) { + this._toRemoveMeshesArray.push(mesh.uniqueId); + }; + CollisionCoordinatorWorker.prototype.onGeometryAdded = function (geometry) { + //TODO this will break if the user uses his own function. This should be an array of callbacks! + geometry.onGeometryUpdated = this.onGeometryUpdated; + this.onGeometryUpdated(geometry); + }; + CollisionCoordinatorWorker.prototype.onGeometryDeleted = function (geometry) { + this._toRemoveGeometryArray.push(geometry.id); + }; + CollisionCoordinatorWorker.SerializeMesh = function (mesh) { + var submeshes = []; + if (mesh.subMeshes) { + submeshes = mesh.subMeshes.map(function (sm, idx) { + var boundingInfo = sm.getBoundingInfo(); + return { + position: idx, + verticesStart: sm.verticesStart, + verticesCount: sm.verticesCount, + indexStart: sm.indexStart, + indexCount: sm.indexCount, + hasMaterial: !!sm.getMaterial(), + sphereCenter: boundingInfo.boundingSphere.centerWorld.asArray(), + sphereRadius: boundingInfo.boundingSphere.radiusWorld, + boxMinimum: boundingInfo.boundingBox.minimumWorld.asArray(), + boxMaximum: boundingInfo.boundingBox.maximumWorld.asArray() + }; + }); + } + var geometryId = null; + if (mesh instanceof BABYLON.Mesh) { + var geometry = mesh.geometry; + geometryId = geometry ? geometry.id : null; + } + else if (mesh instanceof BABYLON.InstancedMesh) { + var geometry = mesh.sourceMesh && mesh.sourceMesh.geometry; + geometryId = geometry ? geometry.id : null; + } + var boundingInfo = mesh.getBoundingInfo(); + return { + uniqueId: mesh.uniqueId, + id: mesh.id, + name: mesh.name, + geometryId: geometryId, + sphereCenter: boundingInfo.boundingSphere.centerWorld.asArray(), + sphereRadius: boundingInfo.boundingSphere.radiusWorld, + boxMinimum: boundingInfo.boundingBox.minimumWorld.asArray(), + boxMaximum: boundingInfo.boundingBox.maximumWorld.asArray(), + worldMatrixFromCache: mesh.worldMatrixFromCache.asArray(), + subMeshes: submeshes, + checkCollisions: mesh.checkCollisions + }; + }; + CollisionCoordinatorWorker.SerializeGeometry = function (geometry) { + return { + id: geometry.id, + positions: new Float32Array(geometry.getVerticesData(BABYLON.VertexBuffer.PositionKind) || []), + normals: new Float32Array(geometry.getVerticesData(BABYLON.VertexBuffer.NormalKind) || []), + indices: new Uint32Array(geometry.getIndices() || []), + }; + }; + return CollisionCoordinatorWorker; + }()); + BABYLON.CollisionCoordinatorWorker = CollisionCoordinatorWorker; + /** @hidden */ + var CollisionCoordinatorLegacy = /** @class */ (function () { + function CollisionCoordinatorLegacy() { + this._scaledPosition = BABYLON.Vector3.Zero(); + this._scaledVelocity = BABYLON.Vector3.Zero(); + this._finalPosition = BABYLON.Vector3.Zero(); + } + CollisionCoordinatorLegacy.prototype.getNewPosition = function (position, displacement, collider, maximumRetry, excludedMesh, onNewPosition, collisionIndex) { + position.divideToRef(collider._radius, this._scaledPosition); + displacement.divideToRef(collider._radius, this._scaledVelocity); + collider.collidedMesh = null; + collider._retry = 0; + collider._initialVelocity = this._scaledVelocity; + collider._initialPosition = this._scaledPosition; + this._collideWithWorld(this._scaledPosition, this._scaledVelocity, collider, maximumRetry, this._finalPosition, excludedMesh); + this._finalPosition.multiplyInPlace(collider._radius); + //run the callback + onNewPosition(collisionIndex, this._finalPosition, collider.collidedMesh); + }; + CollisionCoordinatorLegacy.prototype.init = function (scene) { + this._scene = scene; + }; + CollisionCoordinatorLegacy.prototype.destroy = function () { + //Legacy need no destruction method. + }; + //No update in legacy mode + CollisionCoordinatorLegacy.prototype.onMeshAdded = function (mesh) { }; + CollisionCoordinatorLegacy.prototype.onMeshUpdated = function (mesh) { }; + CollisionCoordinatorLegacy.prototype.onMeshRemoved = function (mesh) { }; + CollisionCoordinatorLegacy.prototype.onGeometryAdded = function (geometry) { }; + CollisionCoordinatorLegacy.prototype.onGeometryUpdated = function (geometry) { }; + CollisionCoordinatorLegacy.prototype.onGeometryDeleted = function (geometry) { }; + CollisionCoordinatorLegacy.prototype._collideWithWorld = function (position, velocity, collider, maximumRetry, finalPosition, excludedMesh) { + if (excludedMesh === void 0) { excludedMesh = null; } + var closeDistance = BABYLON.Engine.CollisionsEpsilon * 10.0; + if (collider._retry >= maximumRetry) { + finalPosition.copyFrom(position); + return; + } + // Check if this is a mesh else camera or -1 + var collisionMask = (excludedMesh ? excludedMesh.collisionMask : collider.collisionMask); + collider._initialize(position, velocity, closeDistance); + // Check all meshes + for (var index = 0; index < this._scene.meshes.length; index++) { + var mesh = this._scene.meshes[index]; + if (mesh.isEnabled() && mesh.checkCollisions && mesh.subMeshes && mesh !== excludedMesh && ((collisionMask & mesh.collisionGroup) !== 0)) { + mesh._checkCollision(collider); + } + } + if (!collider.collisionFound) { + position.addToRef(velocity, finalPosition); + return; + } + if (velocity.x !== 0 || velocity.y !== 0 || velocity.z !== 0) { + collider._getResponse(position, velocity); + } + if (velocity.length() <= closeDistance) { + finalPosition.copyFrom(position); + return; + } + collider._retry++; + this._collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh); + }; + return CollisionCoordinatorLegacy; + }()); + BABYLON.CollisionCoordinatorLegacy = CollisionCoordinatorLegacy; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.collisionCoordinator.js.map + +var BABYLON; +(function (BABYLON) { + /** + * A particle represents one of the element emitted by a particle system. + * This is mainly define by its coordinates, direction, velocity and age. + */ + var Particle = /** @class */ (function () { + /** + * Creates a new instance Particle + * @param particleSystem the particle system the particle belongs to + */ + function Particle( + /** + * The particle system the particle belongs to. + */ + particleSystem) { + this.particleSystem = particleSystem; + /** + * The world position of the particle in the scene. + */ + this.position = BABYLON.Vector3.Zero(); + /** + * The world direction of the particle in the scene. + */ + this.direction = BABYLON.Vector3.Zero(); + /** + * The color of the particle. + */ + this.color = new BABYLON.Color4(0, 0, 0, 0); + /** + * The color change of the particle per step. + */ + this.colorStep = new BABYLON.Color4(0, 0, 0, 0); + /** + * Defines how long will the life of the particle be. + */ + this.lifeTime = 1.0; + /** + * The current age of the particle. + */ + this.age = 0; + /** + * The current size of the particle. + */ + this.size = 0; + /** + * The current scale of the particle. + */ + this.scale = new BABYLON.Vector2(1, 1); + /** + * The current angle of the particle. + */ + this.angle = 0; + /** + * Defines how fast is the angle changing. + */ + this.angularSpeed = 0; + /** + * Defines the cell index used by the particle to be rendered from a sprite. + */ + this.cellIndex = 0; + /** @hidden */ + this._attachedSubEmitters = null; + /** @hidden */ + this._currentColor1 = new BABYLON.Color4(0, 0, 0, 0); + /** @hidden */ + this._currentColor2 = new BABYLON.Color4(0, 0, 0, 0); + /** @hidden */ + this._currentSize1 = 0; + /** @hidden */ + this._currentSize2 = 0; + /** @hidden */ + this._currentAngularSpeed1 = 0; + /** @hidden */ + this._currentAngularSpeed2 = 0; + /** @hidden */ + this._currentVelocity1 = 0; + /** @hidden */ + this._currentVelocity2 = 0; + /** @hidden */ + this._currentLimitVelocity1 = 0; + /** @hidden */ + this._currentLimitVelocity2 = 0; + /** @hidden */ + this._currentDrag1 = 0; + /** @hidden */ + this._currentDrag2 = 0; + this.id = Particle._Count++; + if (!this.particleSystem.isAnimationSheetEnabled) { + return; + } + this.updateCellInfoFromSystem(); + } + Particle.prototype.updateCellInfoFromSystem = function () { + this.cellIndex = this.particleSystem.startSpriteCellID; + }; + /** + * Defines how the sprite cell index is updated for the particle + */ + Particle.prototype.updateCellIndex = function () { + var offsetAge = this.age; + var changeSpeed = this.particleSystem.spriteCellChangeSpeed; + if (this.particleSystem.spriteRandomStartCell) { + if (this._randomCellOffset === undefined) { + this._randomCellOffset = Math.random() * this.lifeTime; + } + if (changeSpeed === 0) { // Special case when speed = 0 meaning we want to stay on initial cell + changeSpeed = 1; + offsetAge = this._randomCellOffset; + } + else { + offsetAge += this._randomCellOffset; + } + } + var dist = (this._initialEndSpriteCellID - this._initialStartSpriteCellID); + var ratio = BABYLON.Scalar.Clamp(((offsetAge * changeSpeed) % this.lifeTime) / this.lifeTime); + this.cellIndex = this._initialStartSpriteCellID + (ratio * dist) | 0; + }; + /** @hidden */ + Particle.prototype._inheritParticleInfoToSubEmitter = function (subEmitter) { + if (subEmitter.particleSystem.emitter.position) { + var emitterMesh = subEmitter.particleSystem.emitter; + emitterMesh.position.copyFrom(this.position); + if (subEmitter.inheritDirection) { + emitterMesh.position.subtractToRef(this.direction, BABYLON.Tmp.Vector3[0]); + // Look at using Y as forward + emitterMesh.lookAt(BABYLON.Tmp.Vector3[0], 0, Math.PI / 2); + } + } + else { + var emitterPosition = subEmitter.particleSystem.emitter; + emitterPosition.copyFrom(this.position); + } + // Set inheritedVelocityOffset to be used when new particles are created + this.direction.scaleToRef(subEmitter.inheritedVelocityAmount / 2, BABYLON.Tmp.Vector3[0]); + subEmitter.particleSystem._inheritedVelocityOffset.copyFrom(BABYLON.Tmp.Vector3[0]); + }; + /** @hidden */ + Particle.prototype._inheritParticleInfoToSubEmitters = function () { + var _this = this; + if (this._attachedSubEmitters && this._attachedSubEmitters.length > 0) { + this._attachedSubEmitters.forEach(function (subEmitter) { + _this._inheritParticleInfoToSubEmitter(subEmitter); + }); + } + }; + /** @hidden */ + Particle.prototype._reset = function () { + this.age = 0; + this._currentColorGradient = null; + this._currentSizeGradient = null; + this._currentAngularSpeedGradient = null; + this._currentVelocityGradient = null; + this._currentLimitVelocityGradient = null; + this._currentDragGradient = null; + this.cellIndex = this.particleSystem.startSpriteCellID; + this._randomCellOffset = undefined; + }; + /** + * Copy the properties of particle to another one. + * @param other the particle to copy the information to. + */ + Particle.prototype.copyTo = function (other) { + other.position.copyFrom(this.position); + if (this._initialDirection) { + if (other._initialDirection) { + other._initialDirection.copyFrom(this._initialDirection); + } + else { + other._initialDirection = this._initialDirection.clone(); + } + } + else { + other._initialDirection = null; + } + other.direction.copyFrom(this.direction); + other.color.copyFrom(this.color); + other.colorStep.copyFrom(this.colorStep); + other.lifeTime = this.lifeTime; + other.age = this.age; + other._randomCellOffset = this._randomCellOffset; + other.size = this.size; + other.scale.copyFrom(this.scale); + other.angle = this.angle; + other.angularSpeed = this.angularSpeed; + other.particleSystem = this.particleSystem; + other.cellIndex = this.cellIndex; + other.id = this.id; + other._attachedSubEmitters = this._attachedSubEmitters; + if (this._currentColorGradient) { + other._currentColorGradient = this._currentColorGradient; + other._currentColor1.copyFrom(this._currentColor1); + other._currentColor2.copyFrom(this._currentColor2); + } + if (this._currentSizeGradient) { + other._currentSizeGradient = this._currentSizeGradient; + other._currentSize1 = this._currentSize1; + other._currentSize2 = this._currentSize2; + } + if (this._currentAngularSpeedGradient) { + other._currentAngularSpeedGradient = this._currentAngularSpeedGradient; + other._currentAngularSpeed1 = this._currentAngularSpeed1; + other._currentAngularSpeed2 = this._currentAngularSpeed2; + } + if (this._currentVelocityGradient) { + other._currentVelocityGradient = this._currentVelocityGradient; + other._currentVelocity1 = this._currentVelocity1; + other._currentVelocity2 = this._currentVelocity2; + } + if (this._currentLimitVelocityGradient) { + other._currentLimitVelocityGradient = this._currentLimitVelocityGradient; + other._currentLimitVelocity1 = this._currentLimitVelocity1; + other._currentLimitVelocity2 = this._currentLimitVelocity2; + } + if (this._currentDragGradient) { + other._currentDragGradient = this._currentDragGradient; + other._currentDrag1 = this._currentDrag1; + other._currentDrag2 = this._currentDrag2; + } + if (this.particleSystem.isAnimationSheetEnabled) { + other._initialStartSpriteCellID = this._initialStartSpriteCellID; + other._initialEndSpriteCellID = this._initialEndSpriteCellID; + } + if (this.particleSystem.useRampGradients) { + other.remapData.copyFrom(this.remapData); + } + if (this._randomNoiseCoordinates1) { + if (other._randomNoiseCoordinates1) { + other._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1); + other._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2); + } + else { + other._randomNoiseCoordinates1 = this._randomNoiseCoordinates1.clone(); + other._randomNoiseCoordinates2 = this._randomNoiseCoordinates2.clone(); + } + } + }; + Particle._Count = 0; + return Particle; + }()); + BABYLON.Particle = Particle; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.particle.js.map + +var BABYLON; +(function (BABYLON) { + /** + * This represents the base class for particle system in Babylon. + * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust. + * Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function. + * @example https://doc.babylonjs.com/babylon101/particles + */ + var BaseParticleSystem = /** @class */ (function () { + /** + * Instantiates a particle system. + * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust. + * @param name The name of the particle system + */ + function BaseParticleSystem(name) { + /** + * List of animations used by the particle system. + */ + this.animations = []; + /** + * The rendering group used by the Particle system to chose when to render. + */ + this.renderingGroupId = 0; + /** + * The emitter represents the Mesh or position we are attaching the particle system to. + */ + this.emitter = null; + /** + * The maximum number of particles to emit per frame + */ + this.emitRate = 10; + /** + * If you want to launch only a few particles at once, that can be done, as well. + */ + this.manualEmitCount = -1; + /** + * The overall motion speed (0.01 is default update speed, faster updates = faster animation) + */ + this.updateSpeed = 0.01; + /** + * The amount of time the particle system is running (depends of the overall update speed). + */ + this.targetStopDuration = 0; + /** + * Specifies whether the particle system will be disposed once it reaches the end of the animation. + */ + this.disposeOnStop = false; + /** + * Minimum power of emitting particles. + */ + this.minEmitPower = 1; + /** + * Maximum power of emitting particles. + */ + this.maxEmitPower = 1; + /** + * Minimum life time of emitting particles. + */ + this.minLifeTime = 1; + /** + * Maximum life time of emitting particles. + */ + this.maxLifeTime = 1; + /** + * Minimum Size of emitting particles. + */ + this.minSize = 1; + /** + * Maximum Size of emitting particles. + */ + this.maxSize = 1; + /** + * Minimum scale of emitting particles on X axis. + */ + this.minScaleX = 1; + /** + * Maximum scale of emitting particles on X axis. + */ + this.maxScaleX = 1; + /** + * Minimum scale of emitting particles on Y axis. + */ + this.minScaleY = 1; + /** + * Maximum scale of emitting particles on Y axis. + */ + this.maxScaleY = 1; + /** + * Gets or sets the minimal initial rotation in radians. + */ + this.minInitialRotation = 0; + /** + * Gets or sets the maximal initial rotation in radians. + */ + this.maxInitialRotation = 0; + /** + * Minimum angular speed of emitting particles (Z-axis rotation for each particle). + */ + this.minAngularSpeed = 0; + /** + * Maximum angular speed of emitting particles (Z-axis rotation for each particle). + */ + this.maxAngularSpeed = 0; + /** + * The layer mask we are rendering the particles through. + */ + this.layerMask = 0x0FFFFFFF; + /** + * This can help using your own shader to render the particle system. + * The according effect will be created + */ + this.customShader = null; + /** + * By default particle system starts as soon as they are created. This prevents the + * automatic start to happen and let you decide when to start emitting particles. + */ + this.preventAutoStart = false; + /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */ + this.noiseStrength = new BABYLON.Vector3(10, 10, 10); + /** + * Callback triggered when the particle animation is ending. + */ + this.onAnimationEnd = null; + /** + * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE or ParticleSystem.BLENDMODE_STANDARD. + */ + this.blendMode = BABYLON.ParticleSystem.BLENDMODE_ONEONE; + /** + * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls + * to override the particles. + */ + this.forceDepthWrite = false; + /** Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0 */ + this.preWarmCycles = 0; + /** Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1) */ + this.preWarmStepOffset = 1; + /** + * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime) + */ + this.spriteCellChangeSpeed = 1; + /** + * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display + */ + this.startSpriteCellID = 0; + /** + * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display + */ + this.endSpriteCellID = 0; + /** + * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use + */ + this.spriteCellWidth = 0; + /** + * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use + */ + this.spriteCellHeight = 0; + /** + * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID + */ + this.spriteRandomStartCell = false; + /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */ + this.translationPivot = new BABYLON.Vector2(0, 0); + /** + * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called + */ + this.beginAnimationOnStart = false; + /** + * Gets or sets the frame to start the animation from when beginAnimationOnStart is true + */ + this.beginAnimationFrom = 0; + /** + * Gets or sets the frame to end the animation on when beginAnimationOnStart is true + */ + this.beginAnimationTo = 60; + /** + * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true + */ + this.beginAnimationLoop = false; + /** + * You can use gravity if you want to give an orientation to your particles. + */ + this.gravity = BABYLON.Vector3.Zero(); + this._colorGradients = null; + this._sizeGradients = null; + this._lifeTimeGradients = null; + this._angularSpeedGradients = null; + this._velocityGradients = null; + this._limitVelocityGradients = null; + this._dragGradients = null; + this._emitRateGradients = null; + this._startSizeGradients = null; + this._rampGradients = null; + this._colorRemapGradients = null; + this._alphaRemapGradients = null; + /** + * Defines the delay in milliseconds before starting the system (0 by default) + */ + this.startDelay = 0; + /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */ + this.limitVelocityDamping = 0.4; + /** + * Random color of each particle after it has been emitted, between color1 and color2 vectors + */ + this.color1 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0); + /** + * Random color of each particle after it has been emitted, between color1 and color2 vectors + */ + this.color2 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0); + /** + * Color the particle will have at the end of its lifetime + */ + this.colorDead = new BABYLON.Color4(0, 0, 0, 1.0); + /** + * An optional mask to filter some colors out of the texture, or filter a part of the alpha channel + */ + this.textureMask = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0); + /** @hidden */ + this._isSubEmitter = false; + /** + * Gets or sets the billboard mode to use when isBillboardBased = true. + * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED + */ + this.billboardMode = BABYLON.ParticleSystem.BILLBOARDMODE_ALL; + this._isBillboardBased = true; + /** + * Local cache of defines for image processing. + */ + this._imageProcessingConfigurationDefines = new BABYLON.ImageProcessingConfigurationDefines(); + this.id = name; + this.name = name; + } + Object.defineProperty(BaseParticleSystem.prototype, "isAnimationSheetEnabled", { + /** + * Gets or sets whether an animation sprite sheet is enabled or not on the particle system + */ + get: function () { + return this._isAnimationSheetEnabled; + }, + set: function (value) { + if (this._isAnimationSheetEnabled == value) { + return; + } + this._isAnimationSheetEnabled = value; + this._reset(); + }, + enumerable: true, + configurable: true + }); + /** + * Get hosting scene + * @returns the scene + */ + BaseParticleSystem.prototype.getScene = function () { + return this._scene; + }; + BaseParticleSystem.prototype._hasTargetStopDurationDependantGradient = function () { + return (this._startSizeGradients && this._startSizeGradients.length > 0) + || (this._emitRateGradients && this._emitRateGradients.length > 0) + || (this._lifeTimeGradients && this._lifeTimeGradients.length > 0); + }; + /** + * Gets the current list of drag gradients. + * You must use addDragGradient and removeDragGradient to udpate this list + * @returns the list of drag gradients + */ + BaseParticleSystem.prototype.getDragGradients = function () { + return this._dragGradients; + }; + /** + * Gets the current list of limit velocity gradients. + * You must use addLimitVelocityGradient and removeLimitVelocityGradient to udpate this list + * @returns the list of limit velocity gradients + */ + BaseParticleSystem.prototype.getLimitVelocityGradients = function () { + return this._limitVelocityGradients; + }; + /** + * Gets the current list of color gradients. + * You must use addColorGradient and removeColorGradient to udpate this list + * @returns the list of color gradients + */ + BaseParticleSystem.prototype.getColorGradients = function () { + return this._colorGradients; + }; + /** + * Gets the current list of size gradients. + * You must use addSizeGradient and removeSizeGradient to udpate this list + * @returns the list of size gradients + */ + BaseParticleSystem.prototype.getSizeGradients = function () { + return this._sizeGradients; + }; + /** + * Gets the current list of color remap gradients. + * You must use addColorRemapGradient and removeColorRemapGradient to udpate this list + * @returns the list of color remap gradients + */ + BaseParticleSystem.prototype.getColorRemapGradients = function () { + return this._colorRemapGradients; + }; + /** + * Gets the current list of alpha remap gradients. + * You must use addAlphaRemapGradient and removeAlphaRemapGradient to udpate this list + * @returns the list of alpha remap gradients + */ + BaseParticleSystem.prototype.getAlphaRemapGradients = function () { + return this._alphaRemapGradients; + }; + /** + * Gets the current list of life time gradients. + * You must use addLifeTimeGradient and removeLifeTimeGradient to udpate this list + * @returns the list of life time gradients + */ + BaseParticleSystem.prototype.getLifeTimeGradients = function () { + return this._lifeTimeGradients; + }; + /** + * Gets the current list of angular speed gradients. + * You must use addAngularSpeedGradient and removeAngularSpeedGradient to udpate this list + * @returns the list of angular speed gradients + */ + BaseParticleSystem.prototype.getAngularSpeedGradients = function () { + return this._angularSpeedGradients; + }; + /** + * Gets the current list of velocity gradients. + * You must use addVelocityGradient and removeVelocityGradient to udpate this list + * @returns the list of velocity gradients + */ + BaseParticleSystem.prototype.getVelocityGradients = function () { + return this._velocityGradients; + }; + /** + * Gets the current list of start size gradients. + * You must use addStartSizeGradient and removeStartSizeGradient to udpate this list + * @returns the list of start size gradients + */ + BaseParticleSystem.prototype.getStartSizeGradients = function () { + return this._startSizeGradients; + }; + /** + * Gets the current list of emit rate gradients. + * You must use addEmitRateGradient and removeEmitRateGradient to udpate this list + * @returns the list of emit rate gradients + */ + BaseParticleSystem.prototype.getEmitRateGradients = function () { + return this._emitRateGradients; + }; + Object.defineProperty(BaseParticleSystem.prototype, "direction1", { + /** + * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors. + * This only works when particleEmitterTyps is a BoxParticleEmitter + */ + get: function () { + if (this.particleEmitterType.direction1) { + return this.particleEmitterType.direction1; + } + return BABYLON.Vector3.Zero(); + }, + set: function (value) { + if (this.particleEmitterType.direction1) { + this.particleEmitterType.direction1 = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseParticleSystem.prototype, "direction2", { + /** + * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors. + * This only works when particleEmitterTyps is a BoxParticleEmitter + */ + get: function () { + if (this.particleEmitterType.direction2) { + return this.particleEmitterType.direction2; + } + return BABYLON.Vector3.Zero(); + }, + set: function (value) { + if (this.particleEmitterType.direction2) { + this.particleEmitterType.direction2 = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseParticleSystem.prototype, "minEmitBox", { + /** + * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so. + * This only works when particleEmitterTyps is a BoxParticleEmitter + */ + get: function () { + if (this.particleEmitterType.minEmitBox) { + return this.particleEmitterType.minEmitBox; + } + return BABYLON.Vector3.Zero(); + }, + set: function (value) { + if (this.particleEmitterType.minEmitBox) { + this.particleEmitterType.minEmitBox = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseParticleSystem.prototype, "maxEmitBox", { + /** + * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so. + * This only works when particleEmitterTyps is a BoxParticleEmitter + */ + get: function () { + if (this.particleEmitterType.maxEmitBox) { + return this.particleEmitterType.maxEmitBox; + } + return BABYLON.Vector3.Zero(); + }, + set: function (value) { + if (this.particleEmitterType.maxEmitBox) { + this.particleEmitterType.maxEmitBox = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseParticleSystem.prototype, "isBillboardBased", { + /** + * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction + */ + get: function () { + return this._isBillboardBased; + }, + set: function (value) { + if (this._isBillboardBased === value) { + return; + } + this._isBillboardBased = value; + this._reset(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseParticleSystem.prototype, "imageProcessingConfiguration", { + /** + * Gets the image processing configuration used either in this material. + */ + get: function () { + return this._imageProcessingConfiguration; + }, + /** + * Sets the Default image processing configuration used either in the this material. + * + * If sets to null, the scene one is in use. + */ + set: function (value) { + this._attachImageProcessingConfiguration(value); + }, + enumerable: true, + configurable: true + }); + /** + * Attaches a new image processing configuration to the Standard Material. + * @param configuration + */ + BaseParticleSystem.prototype._attachImageProcessingConfiguration = function (configuration) { + if (configuration === this._imageProcessingConfiguration) { + return; + } + // Pick the scene configuration if needed. + if (!configuration) { + this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration; + } + else { + this._imageProcessingConfiguration = configuration; + } + }; + /** @hidden */ + BaseParticleSystem.prototype._reset = function () { + }; + /** @hidden */ + BaseParticleSystem.prototype._removeGradientAndTexture = function (gradient, gradients, texture) { + if (!gradients) { + return this; + } + var index = 0; + for (var _i = 0, gradients_1 = gradients; _i < gradients_1.length; _i++) { + var valueGradient = gradients_1[_i]; + if (valueGradient.gradient === gradient) { + gradients.splice(index, 1); + break; + } + index++; + } + if (texture) { + texture.dispose(); + } + return this; + }; + /** + * Creates a Point Emitter for the particle system (emits directly from the emitter position) + * @param direction1 Particles are emitted between the direction1 and direction2 from within the box + * @param direction2 Particles are emitted between the direction1 and direction2 from within the box + * @returns the emitter + */ + BaseParticleSystem.prototype.createPointEmitter = function (direction1, direction2) { + var particleEmitter = new BABYLON.PointParticleEmitter(); + particleEmitter.direction1 = direction1; + particleEmitter.direction2 = direction2; + this.particleEmitterType = particleEmitter; + return particleEmitter; + }; + /** + * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius) + * @param radius The radius of the hemisphere to emit from + * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius + * @returns the emitter + */ + BaseParticleSystem.prototype.createHemisphericEmitter = function (radius, radiusRange) { + if (radius === void 0) { radius = 1; } + if (radiusRange === void 0) { radiusRange = 1; } + var particleEmitter = new BABYLON.HemisphericParticleEmitter(radius, radiusRange); + this.particleEmitterType = particleEmitter; + return particleEmitter; + }; + /** + * Creates a Sphere Emitter for the particle system (emits along the sphere radius) + * @param radius The radius of the sphere to emit from + * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius + * @returns the emitter + */ + BaseParticleSystem.prototype.createSphereEmitter = function (radius, radiusRange) { + if (radius === void 0) { radius = 1; } + if (radiusRange === void 0) { radiusRange = 1; } + var particleEmitter = new BABYLON.SphereParticleEmitter(radius, radiusRange); + this.particleEmitterType = particleEmitter; + return particleEmitter; + }; + /** + * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2) + * @param radius The radius of the sphere to emit from + * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere + * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere + * @returns the emitter + */ + BaseParticleSystem.prototype.createDirectedSphereEmitter = function (radius, direction1, direction2) { + if (radius === void 0) { radius = 1; } + if (direction1 === void 0) { direction1 = new BABYLON.Vector3(0, 1.0, 0); } + if (direction2 === void 0) { direction2 = new BABYLON.Vector3(0, 1.0, 0); } + var particleEmitter = new BABYLON.SphereDirectedParticleEmitter(radius, direction1, direction2); + this.particleEmitterType = particleEmitter; + return particleEmitter; + }; + /** + * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position) + * @param radius The radius of the emission cylinder + * @param height The height of the emission cylinder + * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius + * @param directionRandomizer How much to randomize the particle direction [0-1] + * @returns the emitter + */ + BaseParticleSystem.prototype.createCylinderEmitter = function (radius, height, radiusRange, directionRandomizer) { + if (radius === void 0) { radius = 1; } + if (height === void 0) { height = 1; } + if (radiusRange === void 0) { radiusRange = 1; } + if (directionRandomizer === void 0) { directionRandomizer = 0; } + var particleEmitter = new BABYLON.CylinderParticleEmitter(radius, height, radiusRange, directionRandomizer); + this.particleEmitterType = particleEmitter; + return particleEmitter; + }; + /** + * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2) + * @param radius The radius of the cylinder to emit from + * @param height The height of the emission cylinder + * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default) + * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder + * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder + * @returns the emitter + */ + BaseParticleSystem.prototype.createDirectedCylinderEmitter = function (radius, height, radiusRange, direction1, direction2) { + if (radius === void 0) { radius = 1; } + if (height === void 0) { height = 1; } + if (radiusRange === void 0) { radiusRange = 1; } + if (direction1 === void 0) { direction1 = new BABYLON.Vector3(0, 1.0, 0); } + if (direction2 === void 0) { direction2 = new BABYLON.Vector3(0, 1.0, 0); } + var particleEmitter = new BABYLON.CylinderDirectedParticleEmitter(radius, height, radiusRange, direction1, direction2); + this.particleEmitterType = particleEmitter; + return particleEmitter; + }; + /** + * Creates a Cone Emitter for the particle system (emits from the cone to the particle position) + * @param radius The radius of the cone to emit from + * @param angle The base angle of the cone + * @returns the emitter + */ + BaseParticleSystem.prototype.createConeEmitter = function (radius, angle) { + if (radius === void 0) { radius = 1; } + if (angle === void 0) { angle = Math.PI / 4; } + var particleEmitter = new BABYLON.ConeParticleEmitter(radius, angle); + this.particleEmitterType = particleEmitter; + return particleEmitter; + }; + /** + * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox) + * @param direction1 Particles are emitted between the direction1 and direction2 from within the box + * @param direction2 Particles are emitted between the direction1 and direction2 from within the box + * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox + * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox + * @returns the emitter + */ + BaseParticleSystem.prototype.createBoxEmitter = function (direction1, direction2, minEmitBox, maxEmitBox) { + var particleEmitter = new BABYLON.BoxParticleEmitter(); + this.particleEmitterType = particleEmitter; + this.direction1 = direction1; + this.direction2 = direction2; + this.minEmitBox = minEmitBox; + this.maxEmitBox = maxEmitBox; + return particleEmitter; + }; + /** + * Source color is added to the destination color without alpha affecting the result + */ + BaseParticleSystem.BLENDMODE_ONEONE = 0; + /** + * Blend current color and particle color using particle’s alpha + */ + BaseParticleSystem.BLENDMODE_STANDARD = 1; + /** + * Add current color and particle color multiplied by particle’s alpha + */ + BaseParticleSystem.BLENDMODE_ADD = 2; + /** + * Multiply current color with particle color + */ + BaseParticleSystem.BLENDMODE_MULTIPLY = 3; + /** + * Multiply current color with particle color then add current color and particle color multiplied by particle’s alpha + */ + BaseParticleSystem.BLENDMODE_MULTIPLYADD = 4; + return BaseParticleSystem; + }()); + BABYLON.BaseParticleSystem = BaseParticleSystem; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.baseParticleSystem.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * This represents a particle system in Babylon. + * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust. + * Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function. + * @example https://doc.babylonjs.com/babylon101/particles + */ + var ParticleSystem = /** @class */ (function (_super) { + __extends(ParticleSystem, _super); + /** + * Instantiates a particle system. + * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust. + * @param name The name of the particle system + * @param capacity The max number of particles alive at the same time + * @param scene The scene the particle system belongs to + * @param customEffect a custom effect used to change the way particles are rendered by default + * @param isAnimationSheetEnabled Must be true if using a spritesheet to animate the particles texture + * @param epsilon Offset used to render the particles + */ + function ParticleSystem(name, capacity, scene, customEffect, isAnimationSheetEnabled, epsilon) { + if (customEffect === void 0) { customEffect = null; } + if (isAnimationSheetEnabled === void 0) { isAnimationSheetEnabled = false; } + if (epsilon === void 0) { epsilon = 0.01; } + var _this = _super.call(this, name) || this; + /** + * @hidden + */ + _this._inheritedVelocityOffset = new BABYLON.Vector3(); + /** + * An event triggered when the system is disposed + */ + _this.onDisposeObservable = new BABYLON.Observable(); + _this._particles = new Array(); + _this._stockParticles = new Array(); + _this._newPartsExcess = 0; + _this._vertexBuffers = {}; + _this._scaledColorStep = new BABYLON.Color4(0, 0, 0, 0); + _this._colorDiff = new BABYLON.Color4(0, 0, 0, 0); + _this._scaledDirection = BABYLON.Vector3.Zero(); + _this._scaledGravity = BABYLON.Vector3.Zero(); + _this._currentRenderId = -1; + _this._useInstancing = false; + _this._started = false; + _this._stopped = false; + _this._actualFrame = 0; + /** @hidden */ + _this._currentEmitRate1 = 0; + /** @hidden */ + _this._currentEmitRate2 = 0; + /** @hidden */ + _this._currentStartSize1 = 0; + /** @hidden */ + _this._currentStartSize2 = 0; + _this._rawTextureWidth = 256; + _this._useRampGradients = false; + /** + * @hidden + * If the particle systems emitter should be disposed when the particle system is disposed + */ + _this._disposeEmitterOnDispose = false; + // start of sub system methods + /** + * "Recycles" one of the particle by copying it back to the "stock" of particles and removing it from the active list. + * Its lifetime will start back at 0. + */ + _this.recycleParticle = function (particle) { + // move particle from activeParticle list to stock particles + var lastParticle = _this._particles.pop(); + if (lastParticle !== particle) { + lastParticle.copyTo(particle); + } + _this._stockParticles.push(lastParticle); + }; + _this._createParticle = function () { + var particle; + if (_this._stockParticles.length !== 0) { + particle = _this._stockParticles.pop(); + particle._reset(); + } + else { + particle = new BABYLON.Particle(_this); + } + // Attach emitters + if (_this._subEmitters && _this._subEmitters.length > 0) { + var subEmitters = _this._subEmitters[Math.floor(Math.random() * _this._subEmitters.length)]; + particle._attachedSubEmitters = []; + subEmitters.forEach(function (subEmitter) { + if (subEmitter.type === BABYLON.SubEmitterType.ATTACHED) { + var newEmitter = subEmitter.clone(); + particle._attachedSubEmitters.push(newEmitter); + newEmitter.particleSystem.start(); + } + }); + } + return particle; + }; + _this._emitFromParticle = function (particle) { + if (!_this._subEmitters || _this._subEmitters.length === 0) { + return; + } + var templateIndex = Math.floor(Math.random() * _this._subEmitters.length); + _this._subEmitters[templateIndex].forEach(function (subEmitter) { + if (subEmitter.type === BABYLON.SubEmitterType.END) { + var subSystem = subEmitter.clone(); + particle._inheritParticleInfoToSubEmitter(subSystem); + subSystem.particleSystem._rootParticleSystem = _this; + _this.activeSubSystems.push(subSystem.particleSystem); + subSystem.particleSystem.start(); + } + }); + }; + _this._capacity = capacity; + _this._epsilon = epsilon; + _this._isAnimationSheetEnabled = isAnimationSheetEnabled; + _this._scene = scene || BABYLON.Engine.LastCreatedScene; + // Setup the default processing configuration to the scene. + _this._attachImageProcessingConfiguration(null); + _this._customEffect = customEffect; + _this._scene.particleSystems.push(_this); + _this._useInstancing = _this._scene.getEngine().getCaps().instancedArrays; + _this._createIndexBuffer(); + _this._createVertexBuffers(); + // Default emitter type + _this.particleEmitterType = new BABYLON.BoxParticleEmitter(); + // Update + _this.updateFunction = function (particles) { + var noiseTextureSize = null; + var noiseTextureData = null; + if (_this.noiseTexture) { // We need to get texture data back to CPU + noiseTextureSize = _this.noiseTexture.getSize(); + noiseTextureData = (_this.noiseTexture.getContent()); + } + var _loop_1 = function () { + particle = particles[index]; + var scaledUpdateSpeed = _this._scaledUpdateSpeed; + var previousAge = particle.age; + particle.age += scaledUpdateSpeed; + // Evaluate step to death + if (particle.age > particle.lifeTime) { + var diff = particle.age - previousAge; + var oldDiff = particle.lifeTime - previousAge; + scaledUpdateSpeed = (oldDiff * scaledUpdateSpeed) / diff; + particle.age = particle.lifeTime; + } + var ratio = particle.age / particle.lifeTime; + // Color + if (_this._colorGradients && _this._colorGradients.length > 0) { + BABYLON.Tools.GetCurrentGradient(ratio, _this._colorGradients, function (currentGradient, nextGradient, scale) { + if (currentGradient !== particle._currentColorGradient) { + particle._currentColor1.copyFrom(particle._currentColor2); + nextGradient.getColorToRef(particle._currentColor2); + particle._currentColorGradient = currentGradient; + } + BABYLON.Color4.LerpToRef(particle._currentColor1, particle._currentColor2, scale, particle.color); + }); + } + else { + particle.colorStep.scaleToRef(scaledUpdateSpeed, _this._scaledColorStep); + particle.color.addInPlace(_this._scaledColorStep); + if (particle.color.a < 0) { + particle.color.a = 0; + } + } + // Angular speed + if (_this._angularSpeedGradients && _this._angularSpeedGradients.length > 0) { + BABYLON.Tools.GetCurrentGradient(ratio, _this._angularSpeedGradients, function (currentGradient, nextGradient, scale) { + if (currentGradient !== particle._currentAngularSpeedGradient) { + particle._currentAngularSpeed1 = particle._currentAngularSpeed2; + particle._currentAngularSpeed2 = nextGradient.getFactor(); + particle._currentAngularSpeedGradient = currentGradient; + } + particle.angularSpeed = BABYLON.Scalar.Lerp(particle._currentAngularSpeed1, particle._currentAngularSpeed2, scale); + }); + } + particle.angle += particle.angularSpeed * scaledUpdateSpeed; + // Direction + var directionScale = scaledUpdateSpeed; + /// Velocity + if (_this._velocityGradients && _this._velocityGradients.length > 0) { + BABYLON.Tools.GetCurrentGradient(ratio, _this._velocityGradients, function (currentGradient, nextGradient, scale) { + if (currentGradient !== particle._currentVelocityGradient) { + particle._currentVelocity1 = particle._currentVelocity2; + particle._currentVelocity2 = nextGradient.getFactor(); + particle._currentVelocityGradient = currentGradient; + } + directionScale *= BABYLON.Scalar.Lerp(particle._currentVelocity1, particle._currentVelocity2, scale); + }); + } + particle.direction.scaleToRef(directionScale, _this._scaledDirection); + /// Limit velocity + if (_this._limitVelocityGradients && _this._limitVelocityGradients.length > 0) { + BABYLON.Tools.GetCurrentGradient(ratio, _this._limitVelocityGradients, function (currentGradient, nextGradient, scale) { + if (currentGradient !== particle._currentLimitVelocityGradient) { + particle._currentLimitVelocity1 = particle._currentLimitVelocity2; + particle._currentLimitVelocity2 = nextGradient.getFactor(); + particle._currentLimitVelocityGradient = currentGradient; + } + var limitVelocity = BABYLON.Scalar.Lerp(particle._currentLimitVelocity1, particle._currentLimitVelocity2, scale); + var currentVelocity = particle.direction.length(); + if (currentVelocity > limitVelocity) { + particle.direction.scaleInPlace(_this.limitVelocityDamping); + } + }); + } + /// Drag + if (_this._dragGradients && _this._dragGradients.length > 0) { + BABYLON.Tools.GetCurrentGradient(ratio, _this._dragGradients, function (currentGradient, nextGradient, scale) { + if (currentGradient !== particle._currentDragGradient) { + particle._currentDrag1 = particle._currentDrag2; + particle._currentDrag2 = nextGradient.getFactor(); + particle._currentDragGradient = currentGradient; + } + var drag = BABYLON.Scalar.Lerp(particle._currentDrag1, particle._currentDrag2, scale); + _this._scaledDirection.scaleInPlace(1.0 - drag); + }); + } + particle.position.addInPlace(_this._scaledDirection); + // Noise + if (noiseTextureData && noiseTextureSize) { + var fetchedColorR = _this._fetchR(particle._randomNoiseCoordinates1.x, particle._randomNoiseCoordinates1.y, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData); + var fetchedColorG = _this._fetchR(particle._randomNoiseCoordinates1.z, particle._randomNoiseCoordinates2.x, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData); + var fetchedColorB = _this._fetchR(particle._randomNoiseCoordinates2.y, particle._randomNoiseCoordinates2.z, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData); + var force = BABYLON.Tmp.Vector3[0]; + var scaledForce = BABYLON.Tmp.Vector3[1]; + force.copyFromFloats((2 * fetchedColorR - 1) * _this.noiseStrength.x, (2 * fetchedColorG - 1) * _this.noiseStrength.y, (2 * fetchedColorB - 1) * _this.noiseStrength.z); + force.scaleToRef(scaledUpdateSpeed, scaledForce); + particle.direction.addInPlace(scaledForce); + } + // Gravity + _this.gravity.scaleToRef(scaledUpdateSpeed, _this._scaledGravity); + particle.direction.addInPlace(_this._scaledGravity); + // Size + if (_this._sizeGradients && _this._sizeGradients.length > 0) { + BABYLON.Tools.GetCurrentGradient(ratio, _this._sizeGradients, function (currentGradient, nextGradient, scale) { + if (currentGradient !== particle._currentSizeGradient) { + particle._currentSize1 = particle._currentSize2; + particle._currentSize2 = nextGradient.getFactor(); + particle._currentSizeGradient = currentGradient; + } + particle.size = BABYLON.Scalar.Lerp(particle._currentSize1, particle._currentSize2, scale); + }); + } + // Remap data + if (_this._useRampGradients) { + if (_this._colorRemapGradients && _this._colorRemapGradients.length > 0) { + BABYLON.Tools.GetCurrentGradient(ratio, _this._colorRemapGradients, function (currentGradient, nextGradient, scale) { + var min = BABYLON.Scalar.Lerp(currentGradient.factor1, nextGradient.factor1, scale); + var max = BABYLON.Scalar.Lerp(currentGradient.factor2, nextGradient.factor2, scale); + particle.remapData.x = min; + particle.remapData.y = max - min; + }); + } + if (_this._alphaRemapGradients && _this._alphaRemapGradients.length > 0) { + BABYLON.Tools.GetCurrentGradient(ratio, _this._alphaRemapGradients, function (currentGradient, nextGradient, scale) { + var min = BABYLON.Scalar.Lerp(currentGradient.factor1, nextGradient.factor1, scale); + var max = BABYLON.Scalar.Lerp(currentGradient.factor2, nextGradient.factor2, scale); + particle.remapData.z = min; + particle.remapData.w = max - min; + }); + } + } + if (_this._isAnimationSheetEnabled) { + particle.updateCellIndex(); + } + // Update the position of the attached sub-emitters to match their attached particle + particle._inheritParticleInfoToSubEmitters(); + if (particle.age >= particle.lifeTime) { // Recycle by swapping with last particle + _this._emitFromParticle(particle); + if (particle._attachedSubEmitters) { + particle._attachedSubEmitters.forEach(function (subEmitter) { + subEmitter.particleSystem.disposeOnStop = true; + subEmitter.particleSystem.stop(); + }); + particle._attachedSubEmitters = null; + } + _this.recycleParticle(particle); + index--; + return "continue"; + } + }; + var particle; + for (var index = 0; index < particles.length; index++) { + _loop_1(); + } + }; + return _this; + } + Object.defineProperty(ParticleSystem.prototype, "onDispose", { + /** + * Sets a callback that will be triggered when the system is disposed + */ + set: function (callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleSystem.prototype, "useRampGradients", { + /** Gets or sets a boolean indicating that ramp gradients must be used + * @see http://doc.babylonjs.com/babylon101/particles#ramp-gradients + */ + get: function () { + return this._useRampGradients; + }, + set: function (value) { + if (this._useRampGradients === value) { + return; + } + this._useRampGradients = value; + this._resetEffect(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleSystem.prototype, "particles", { + //end of Sub-emitter + /** + * Gets the current list of active particles + */ + get: function () { + return this._particles; + }, + enumerable: true, + configurable: true + }); + /** + * Returns the string "ParticleSystem" + * @returns a string containing the class name + */ + ParticleSystem.prototype.getClassName = function () { + return "ParticleSystem"; + }; + ParticleSystem.prototype._addFactorGradient = function (factorGradients, gradient, factor, factor2) { + var newGradient = new BABYLON.FactorGradient(); + newGradient.gradient = gradient; + newGradient.factor1 = factor; + newGradient.factor2 = factor2; + factorGradients.push(newGradient); + factorGradients.sort(function (a, b) { + if (a.gradient < b.gradient) { + return -1; + } + else if (a.gradient > b.gradient) { + return 1; + } + return 0; + }); + }; + ParticleSystem.prototype._removeFactorGradient = function (factorGradients, gradient) { + if (!factorGradients) { + return; + } + var index = 0; + for (var _i = 0, factorGradients_1 = factorGradients; _i < factorGradients_1.length; _i++) { + var factorGradient = factorGradients_1[_i]; + if (factorGradient.gradient === gradient) { + factorGradients.splice(index, 1); + break; + } + index++; + } + }; + /** + * Adds a new life time gradient + * @param gradient defines the gradient to use (between 0 and 1) + * @param factor defines the life time factor to affect to the specified gradient + * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from + * @returns the current particle system + */ + ParticleSystem.prototype.addLifeTimeGradient = function (gradient, factor, factor2) { + if (!this._lifeTimeGradients) { + this._lifeTimeGradients = []; + } + this._addFactorGradient(this._lifeTimeGradients, gradient, factor, factor2); + return this; + }; + /** + * Remove a specific life time gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeLifeTimeGradient = function (gradient) { + this._removeFactorGradient(this._lifeTimeGradients, gradient); + return this; + }; + /** + * Adds a new size gradient + * @param gradient defines the gradient to use (between 0 and 1) + * @param factor defines the size factor to affect to the specified gradient + * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from + * @returns the current particle system + */ + ParticleSystem.prototype.addSizeGradient = function (gradient, factor, factor2) { + if (!this._sizeGradients) { + this._sizeGradients = []; + } + this._addFactorGradient(this._sizeGradients, gradient, factor, factor2); + return this; + }; + /** + * Remove a specific size gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeSizeGradient = function (gradient) { + this._removeFactorGradient(this._sizeGradients, gradient); + return this; + }; + /** + * Adds a new color remap gradient + * @param gradient defines the gradient to use (between 0 and 1) + * @param min defines the color remap minimal range + * @param max defines the color remap maximal range + * @returns the current particle system + */ + ParticleSystem.prototype.addColorRemapGradient = function (gradient, min, max) { + if (!this._colorRemapGradients) { + this._colorRemapGradients = []; + } + this._addFactorGradient(this._colorRemapGradients, gradient, min, max); + return this; + }; + /** + * Remove a specific color remap gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeColorRemapGradient = function (gradient) { + this._removeFactorGradient(this._colorRemapGradients, gradient); + return this; + }; + /** + * Adds a new alpha remap gradient + * @param gradient defines the gradient to use (between 0 and 1) + * @param min defines the alpha remap minimal range + * @param max defines the alpha remap maximal range + * @returns the current particle system + */ + ParticleSystem.prototype.addAlphaRemapGradient = function (gradient, min, max) { + if (!this._alphaRemapGradients) { + this._alphaRemapGradients = []; + } + this._addFactorGradient(this._alphaRemapGradients, gradient, min, max); + return this; + }; + /** + * Remove a specific alpha remap gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeAlphaRemapGradient = function (gradient) { + this._removeFactorGradient(this._alphaRemapGradients, gradient); + return this; + }; + /** + * Adds a new angular speed gradient + * @param gradient defines the gradient to use (between 0 and 1) + * @param factor defines the angular speed to affect to the specified gradient + * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from + * @returns the current particle system + */ + ParticleSystem.prototype.addAngularSpeedGradient = function (gradient, factor, factor2) { + if (!this._angularSpeedGradients) { + this._angularSpeedGradients = []; + } + this._addFactorGradient(this._angularSpeedGradients, gradient, factor, factor2); + return this; + }; + /** + * Remove a specific angular speed gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeAngularSpeedGradient = function (gradient) { + this._removeFactorGradient(this._angularSpeedGradients, gradient); + return this; + }; + /** + * Adds a new velocity gradient + * @param gradient defines the gradient to use (between 0 and 1) + * @param factor defines the velocity to affect to the specified gradient + * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from + * @returns the current particle system + */ + ParticleSystem.prototype.addVelocityGradient = function (gradient, factor, factor2) { + if (!this._velocityGradients) { + this._velocityGradients = []; + } + this._addFactorGradient(this._velocityGradients, gradient, factor, factor2); + return this; + }; + /** + * Remove a specific velocity gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeVelocityGradient = function (gradient) { + this._removeFactorGradient(this._velocityGradients, gradient); + return this; + }; + /** + * Adds a new limit velocity gradient + * @param gradient defines the gradient to use (between 0 and 1) + * @param factor defines the limit velocity value to affect to the specified gradient + * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from + * @returns the current particle system + */ + ParticleSystem.prototype.addLimitVelocityGradient = function (gradient, factor, factor2) { + if (!this._limitVelocityGradients) { + this._limitVelocityGradients = []; + } + this._addFactorGradient(this._limitVelocityGradients, gradient, factor, factor2); + return this; + }; + /** + * Remove a specific limit velocity gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeLimitVelocityGradient = function (gradient) { + this._removeFactorGradient(this._limitVelocityGradients, gradient); + return this; + }; + /** + * Adds a new drag gradient + * @param gradient defines the gradient to use (between 0 and 1) + * @param factor defines the drag value to affect to the specified gradient + * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from + * @returns the current particle system + */ + ParticleSystem.prototype.addDragGradient = function (gradient, factor, factor2) { + if (!this._dragGradients) { + this._dragGradients = []; + } + this._addFactorGradient(this._dragGradients, gradient, factor, factor2); + return this; + }; + /** + * Remove a specific drag gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeDragGradient = function (gradient) { + this._removeFactorGradient(this._dragGradients, gradient); + return this; + }; + /** + * Adds a new emit rate gradient (please note that this will only work if you set the targetStopDuration property) + * @param gradient defines the gradient to use (between 0 and 1) + * @param factor defines the emit rate value to affect to the specified gradient + * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from + * @returns the current particle system + */ + ParticleSystem.prototype.addEmitRateGradient = function (gradient, factor, factor2) { + if (!this._emitRateGradients) { + this._emitRateGradients = []; + } + this._addFactorGradient(this._emitRateGradients, gradient, factor, factor2); + return this; + }; + /** + * Remove a specific emit rate gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeEmitRateGradient = function (gradient) { + this._removeFactorGradient(this._emitRateGradients, gradient); + return this; + }; + /** + * Adds a new start size gradient (please note that this will only work if you set the targetStopDuration property) + * @param gradient defines the gradient to use (between 0 and 1) + * @param factor defines the start size value to affect to the specified gradient + * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from + * @returns the current particle system + */ + ParticleSystem.prototype.addStartSizeGradient = function (gradient, factor, factor2) { + if (!this._startSizeGradients) { + this._startSizeGradients = []; + } + this._addFactorGradient(this._startSizeGradients, gradient, factor, factor2); + return this; + }; + /** + * Remove a specific start size gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeStartSizeGradient = function (gradient) { + this._removeFactorGradient(this._emitRateGradients, gradient); + return this; + }; + ParticleSystem.prototype._createRampGradientTexture = function () { + if (!this._rampGradients || !this._rampGradients.length || this._rampGradientsTexture) { + return; + } + var data = new Uint8Array(this._rawTextureWidth * 4); + var tmpColor = BABYLON.Tmp.Color3[0]; + for (var x = 0; x < this._rawTextureWidth; x++) { + var ratio = x / this._rawTextureWidth; + BABYLON.Tools.GetCurrentGradient(ratio, this._rampGradients, function (currentGradient, nextGradient, scale) { + BABYLON.Color3.LerpToRef(currentGradient.color, nextGradient.color, scale, tmpColor); + data[x * 4] = tmpColor.r * 255; + data[x * 4 + 1] = tmpColor.g * 255; + data[x * 4 + 2] = tmpColor.b * 255; + data[x * 4 + 3] = 255; + }); + } + this._rampGradientsTexture = BABYLON.RawTexture.CreateRGBATexture(data, this._rawTextureWidth, 1, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE); + }; + /** + * Gets the current list of ramp gradients. + * You must use addRampGradient and removeRampGradient to udpate this list + * @returns the list of ramp gradients + */ + ParticleSystem.prototype.getRampGradients = function () { + return this._rampGradients; + }; + /** + * Adds a new ramp gradient used to remap particle colors + * @param gradient defines the gradient to use (between 0 and 1) + * @param color defines the color to affect to the specified gradient + * @returns the current particle system + */ + ParticleSystem.prototype.addRampGradient = function (gradient, color) { + if (!this._rampGradients) { + this._rampGradients = []; + } + var rampGradient = new BABYLON.Color3Gradient(); + rampGradient.gradient = gradient; + rampGradient.color = color; + this._rampGradients.push(rampGradient); + this._rampGradients.sort(function (a, b) { + if (a.gradient < b.gradient) { + return -1; + } + else if (a.gradient > b.gradient) { + return 1; + } + return 0; + }); + if (this._rampGradientsTexture) { + this._rampGradientsTexture.dispose(); + this._rampGradientsTexture = null; + } + this._createRampGradientTexture(); + return this; + }; + /** + * Remove a specific ramp gradient + * @param gradient defines the gradient to remove + * @returns the current particle system + */ + ParticleSystem.prototype.removeRampGradient = function (gradient) { + this._removeGradientAndTexture(gradient, this._rampGradients, this._rampGradientsTexture); + this._rampGradientsTexture = null; + if (this._rampGradients && this._rampGradients.length > 0) { + this._createRampGradientTexture(); + } + return this; + }; + /** + * Adds a new color gradient + * @param gradient defines the gradient to use (between 0 and 1) + * @param color1 defines the color to affect to the specified gradient + * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from + * @returns this particle system + */ + ParticleSystem.prototype.addColorGradient = function (gradient, color1, color2) { + if (!this._colorGradients) { + this._colorGradients = []; + } + var colorGradient = new BABYLON.ColorGradient(); + colorGradient.gradient = gradient; + colorGradient.color1 = color1; + colorGradient.color2 = color2; + this._colorGradients.push(colorGradient); + this._colorGradients.sort(function (a, b) { + if (a.gradient < b.gradient) { + return -1; + } + else if (a.gradient > b.gradient) { + return 1; + } + return 0; + }); + return this; + }; + /** + * Remove a specific color gradient + * @param gradient defines the gradient to remove + * @returns this particle system + */ + ParticleSystem.prototype.removeColorGradient = function (gradient) { + if (!this._colorGradients) { + return this; + } + var index = 0; + for (var _i = 0, _a = this._colorGradients; _i < _a.length; _i++) { + var colorGradient = _a[_i]; + if (colorGradient.gradient === gradient) { + this._colorGradients.splice(index, 1); + break; + } + index++; + } + return this; + }; + ParticleSystem.prototype._fetchR = function (u, v, width, height, pixels) { + u = Math.abs(u) * 0.5 + 0.5; + v = Math.abs(v) * 0.5 + 0.5; + var wrappedU = ((u * width) % width) | 0; + var wrappedV = ((v * height) % height) | 0; + var position = (wrappedU + wrappedV * width) * 4; + return pixels[position] / 255; + }; + ParticleSystem.prototype._reset = function () { + this._resetEffect(); + }; + ParticleSystem.prototype._resetEffect = function () { + if (this._vertexBuffer) { + this._vertexBuffer.dispose(); + this._vertexBuffer = null; + } + if (this._spriteBuffer) { + this._spriteBuffer.dispose(); + this._spriteBuffer = null; + } + this._createVertexBuffers(); + }; + ParticleSystem.prototype._createVertexBuffers = function () { + this._vertexBufferSize = this._useInstancing ? 10 : 12; + if (this._isAnimationSheetEnabled) { + this._vertexBufferSize += 1; + } + if (!this._isBillboardBased || this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED) { + this._vertexBufferSize += 3; + } + if (this._useRampGradients) { + this._vertexBufferSize += 4; + } + var engine = this._scene.getEngine(); + this._vertexData = new Float32Array(this._capacity * this._vertexBufferSize * (this._useInstancing ? 1 : 4)); + this._vertexBuffer = new BABYLON.Buffer(engine, this._vertexData, true, this._vertexBufferSize); + var dataOffset = 0; + var positions = this._vertexBuffer.createVertexBuffer(BABYLON.VertexBuffer.PositionKind, dataOffset, 3, this._vertexBufferSize, this._useInstancing); + this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = positions; + dataOffset += 3; + var colors = this._vertexBuffer.createVertexBuffer(BABYLON.VertexBuffer.ColorKind, dataOffset, 4, this._vertexBufferSize, this._useInstancing); + this._vertexBuffers[BABYLON.VertexBuffer.ColorKind] = colors; + dataOffset += 4; + var options = this._vertexBuffer.createVertexBuffer("angle", dataOffset, 1, this._vertexBufferSize, this._useInstancing); + this._vertexBuffers["angle"] = options; + dataOffset += 1; + var size = this._vertexBuffer.createVertexBuffer("size", dataOffset, 2, this._vertexBufferSize, this._useInstancing); + this._vertexBuffers["size"] = size; + dataOffset += 2; + if (this._isAnimationSheetEnabled) { + var cellIndexBuffer = this._vertexBuffer.createVertexBuffer("cellIndex", dataOffset, 1, this._vertexBufferSize, this._useInstancing); + this._vertexBuffers["cellIndex"] = cellIndexBuffer; + dataOffset += 1; + } + if (!this._isBillboardBased || this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED) { + var directionBuffer = this._vertexBuffer.createVertexBuffer("direction", dataOffset, 3, this._vertexBufferSize, this._useInstancing); + this._vertexBuffers["direction"] = directionBuffer; + dataOffset += 3; + } + if (this._useRampGradients) { + var rampDataBuffer = this._vertexBuffer.createVertexBuffer("remapData", dataOffset, 4, this._vertexBufferSize, this._useInstancing); + this._vertexBuffers["remapData"] = rampDataBuffer; + dataOffset += 4; + } + var offsets; + if (this._useInstancing) { + var spriteData = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]); + this._spriteBuffer = new BABYLON.Buffer(engine, spriteData, false, 2); + offsets = this._spriteBuffer.createVertexBuffer("offset", 0, 2); + } + else { + offsets = this._vertexBuffer.createVertexBuffer("offset", dataOffset, 2, this._vertexBufferSize, this._useInstancing); + dataOffset += 2; + } + this._vertexBuffers["offset"] = offsets; + }; + ParticleSystem.prototype._createIndexBuffer = function () { + if (this._useInstancing) { + return; + } + var indices = []; + var index = 0; + for (var count = 0; count < this._capacity; count++) { + indices.push(index); + indices.push(index + 1); + indices.push(index + 2); + indices.push(index); + indices.push(index + 2); + indices.push(index + 3); + index += 4; + } + this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices); + }; + /** + * Gets the maximum number of particles active at the same time. + * @returns The max number of active particles. + */ + ParticleSystem.prototype.getCapacity = function () { + return this._capacity; + }; + /** + * Gets whether there are still active particles in the system. + * @returns True if it is alive, otherwise false. + */ + ParticleSystem.prototype.isAlive = function () { + return this._alive; + }; + /** + * Gets if the system has been started. (Note: this will still be true after stop is called) + * @returns True if it has been started, otherwise false. + */ + ParticleSystem.prototype.isStarted = function () { + return this._started; + }; + ParticleSystem.prototype._prepareSubEmitterInternalArray = function () { + var _this = this; + this._subEmitters = new Array(); + if (this.subEmitters) { + this.subEmitters.forEach(function (subEmitter) { + if (subEmitter instanceof ParticleSystem) { + _this._subEmitters.push([new BABYLON.SubEmitter(subEmitter)]); + } + else if (subEmitter instanceof BABYLON.SubEmitter) { + _this._subEmitters.push([subEmitter]); + } + else if (subEmitter instanceof Array) { + _this._subEmitters.push(subEmitter); + } + }); + } + }; + /** + * Starts the particle system and begins to emit + * @param delay defines the delay in milliseconds before starting the system (this.startDelay by default) + */ + ParticleSystem.prototype.start = function (delay) { + var _this = this; + if (delay === void 0) { delay = this.startDelay; } + if (!this.targetStopDuration && this._hasTargetStopDurationDependantGradient()) { + throw "Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set"; + } + if (delay) { + setTimeout(function () { + _this.start(0); + }, delay); + return; + } + // Convert the subEmitters field to the constant type field _subEmitters + this._prepareSubEmitterInternalArray(); + this._started = true; + this._stopped = false; + this._actualFrame = 0; + if (this._subEmitters && this._subEmitters.length != 0) { + this.activeSubSystems = new Array(); + } + // Reset emit gradient so it acts the same on every start + if (this._emitRateGradients) { + if (this._emitRateGradients.length > 0) { + this._currentEmitRateGradient = this._emitRateGradients[0]; + this._currentEmitRate1 = this._currentEmitRateGradient.getFactor(); + this._currentEmitRate2 = this._currentEmitRate1; + } + if (this._emitRateGradients.length > 1) { + this._currentEmitRate2 = this._emitRateGradients[1].getFactor(); + } + } + // Reset start size gradient so it acts the same on every start + if (this._startSizeGradients) { + if (this._startSizeGradients.length > 0) { + this._currentStartSizeGradient = this._startSizeGradients[0]; + this._currentStartSize1 = this._currentStartSizeGradient.getFactor(); + this._currentStartSize2 = this._currentStartSize1; + } + if (this._startSizeGradients.length > 1) { + this._currentStartSize2 = this._startSizeGradients[1].getFactor(); + } + } + if (this.preWarmCycles) { + if (this.emitter instanceof BABYLON.AbstractMesh) { + this.emitter.computeWorldMatrix(true); + } + var noiseTextureAsProcedural_1 = this.noiseTexture; + if (noiseTextureAsProcedural_1 && noiseTextureAsProcedural_1.onGeneratedObservable) { + noiseTextureAsProcedural_1.onGeneratedObservable.addOnce(function () { + setTimeout(function () { + for (var index = 0; index < _this.preWarmCycles; index++) { + _this.animate(true); + noiseTextureAsProcedural_1.render(); + } + }); + }); + } + else { + for (var index = 0; index < this.preWarmCycles; index++) { + this.animate(true); + } + } + } + // Animations + if (this.beginAnimationOnStart && this.animations && this.animations.length > 0) { + this.getScene().beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop); + } + }; + /** + * Stops the particle system. + * @param stopSubEmitters if true it will stop the current system and all created sub-Systems if false it will stop the current root system only, this param is used by the root particle system only. the default value is true. + */ + ParticleSystem.prototype.stop = function (stopSubEmitters) { + if (stopSubEmitters === void 0) { stopSubEmitters = true; } + this._stopped = true; + if (stopSubEmitters) { + this._stopSubEmitters(); + } + }; + // animation sheet + /** + * Remove all active particles + */ + ParticleSystem.prototype.reset = function () { + this._stockParticles = []; + this._particles = []; + }; + /** + * @hidden (for internal use only) + */ + ParticleSystem.prototype._appendParticleVertex = function (index, particle, offsetX, offsetY) { + var offset = index * this._vertexBufferSize; + this._vertexData[offset++] = particle.position.x; + this._vertexData[offset++] = particle.position.y; + this._vertexData[offset++] = particle.position.z; + this._vertexData[offset++] = particle.color.r; + this._vertexData[offset++] = particle.color.g; + this._vertexData[offset++] = particle.color.b; + this._vertexData[offset++] = particle.color.a; + this._vertexData[offset++] = particle.angle; + this._vertexData[offset++] = particle.scale.x * particle.size; + this._vertexData[offset++] = particle.scale.y * particle.size; + if (this._isAnimationSheetEnabled) { + this._vertexData[offset++] = particle.cellIndex; + } + if (!this._isBillboardBased) { + if (particle._initialDirection) { + this._vertexData[offset++] = particle._initialDirection.x; + this._vertexData[offset++] = particle._initialDirection.y; + this._vertexData[offset++] = particle._initialDirection.z; + } + else { + this._vertexData[offset++] = particle.direction.x; + this._vertexData[offset++] = particle.direction.y; + this._vertexData[offset++] = particle.direction.z; + } + } + else if (this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED) { + this._vertexData[offset++] = particle.direction.x; + this._vertexData[offset++] = particle.direction.y; + this._vertexData[offset++] = particle.direction.z; + } + if (this._useRampGradients) { + this._vertexData[offset++] = particle.remapData.x; + this._vertexData[offset++] = particle.remapData.y; + this._vertexData[offset++] = particle.remapData.z; + this._vertexData[offset++] = particle.remapData.w; + } + if (!this._useInstancing) { + if (this._isAnimationSheetEnabled) { + if (offsetX === 0) { + offsetX = this._epsilon; + } + else if (offsetX === 1) { + offsetX = 1 - this._epsilon; + } + if (offsetY === 0) { + offsetY = this._epsilon; + } + else if (offsetY === 1) { + offsetY = 1 - this._epsilon; + } + } + this._vertexData[offset++] = offsetX; + this._vertexData[offset++] = offsetY; + } + }; + ParticleSystem.prototype._stopSubEmitters = function () { + if (!this.activeSubSystems) { + return; + } + this.activeSubSystems.forEach(function (subSystem) { + subSystem.stop(true); + }); + this.activeSubSystems = new Array(); + }; + ParticleSystem.prototype._removeFromRoot = function () { + if (!this._rootParticleSystem) { + return; + } + var index = this._rootParticleSystem.activeSubSystems.indexOf(this); + if (index !== -1) { + this._rootParticleSystem.activeSubSystems.splice(index, 1); + } + this._rootParticleSystem = null; + }; + // End of sub system methods + ParticleSystem.prototype._update = function (newParticles) { + var _this = this; + // Update current + this._alive = this._particles.length > 0; + if (this.emitter.position) { + var emitterMesh = this.emitter; + this._emitterWorldMatrix = emitterMesh.getWorldMatrix(); + } + else { + var emitterPosition = this.emitter; + this._emitterWorldMatrix = BABYLON.Matrix.Translation(emitterPosition.x, emitterPosition.y, emitterPosition.z); + } + this.updateFunction(this._particles); + // Add new ones + var particle; + var _loop_2 = function () { + if (this_1._particles.length === this_1._capacity) { + return "break"; + } + particle = this_1._createParticle(); + this_1._particles.push(particle); + // Emitter + var emitPower = BABYLON.Scalar.RandomRange(this_1.minEmitPower, this_1.maxEmitPower); + if (this_1.startPositionFunction) { + this_1.startPositionFunction(this_1._emitterWorldMatrix, particle.position, particle); + } + else { + this_1.particleEmitterType.startPositionFunction(this_1._emitterWorldMatrix, particle.position, particle); + } + if (this_1.startDirectionFunction) { + this_1.startDirectionFunction(this_1._emitterWorldMatrix, particle.direction, particle); + } + else { + this_1.particleEmitterType.startDirectionFunction(this_1._emitterWorldMatrix, particle.direction, particle); + } + if (emitPower === 0) { + if (!particle._initialDirection) { + particle._initialDirection = particle.direction.clone(); + } + else { + particle._initialDirection.copyFrom(particle.direction); + } + } + else { + particle._initialDirection = null; + } + particle.direction.scaleInPlace(emitPower); + // Life time + if (this_1.targetStopDuration && this_1._lifeTimeGradients && this_1._lifeTimeGradients.length > 0) { + var ratio_1 = BABYLON.Scalar.Clamp(this_1._actualFrame / this_1.targetStopDuration); + BABYLON.Tools.GetCurrentGradient(ratio_1, this_1._lifeTimeGradients, function (currentGradient, nextGradient, scale) { + var factorGradient1 = currentGradient; + var factorGradient2 = nextGradient; + var lifeTime1 = factorGradient1.getFactor(); + var lifeTime2 = factorGradient2.getFactor(); + var gradient = (ratio_1 - factorGradient1.gradient) / (factorGradient2.gradient - factorGradient1.gradient); + particle.lifeTime = BABYLON.Scalar.Lerp(lifeTime1, lifeTime2, gradient); + }); + } + else { + particle.lifeTime = BABYLON.Scalar.RandomRange(this_1.minLifeTime, this_1.maxLifeTime); + } + // Size + if (!this_1._sizeGradients || this_1._sizeGradients.length === 0) { + particle.size = BABYLON.Scalar.RandomRange(this_1.minSize, this_1.maxSize); + } + else { + particle._currentSizeGradient = this_1._sizeGradients[0]; + particle._currentSize1 = particle._currentSizeGradient.getFactor(); + particle.size = particle._currentSize1; + if (this_1._sizeGradients.length > 1) { + particle._currentSize2 = this_1._sizeGradients[1].getFactor(); + } + else { + particle._currentSize2 = particle._currentSize1; + } + } + // Size and scale + particle.scale.copyFromFloats(BABYLON.Scalar.RandomRange(this_1.minScaleX, this_1.maxScaleX), BABYLON.Scalar.RandomRange(this_1.minScaleY, this_1.maxScaleY)); + // Adjust scale by start size + if (this_1._startSizeGradients && this_1._startSizeGradients[0] && this_1.targetStopDuration) { + var ratio = this_1._actualFrame / this_1.targetStopDuration; + BABYLON.Tools.GetCurrentGradient(ratio, this_1._startSizeGradients, function (currentGradient, nextGradient, scale) { + if (currentGradient !== _this._currentStartSizeGradient) { + _this._currentStartSize1 = _this._currentStartSize2; + _this._currentStartSize2 = nextGradient.getFactor(); + _this._currentStartSizeGradient = currentGradient; + } + var value = BABYLON.Scalar.Lerp(_this._currentStartSize1, _this._currentStartSize2, scale); + particle.scale.scaleInPlace(value); + }); + } + // Angle + if (!this_1._angularSpeedGradients || this_1._angularSpeedGradients.length === 0) { + particle.angularSpeed = BABYLON.Scalar.RandomRange(this_1.minAngularSpeed, this_1.maxAngularSpeed); + } + else { + particle._currentAngularSpeedGradient = this_1._angularSpeedGradients[0]; + particle.angularSpeed = particle._currentAngularSpeedGradient.getFactor(); + particle._currentAngularSpeed1 = particle.angularSpeed; + if (this_1._angularSpeedGradients.length > 1) { + particle._currentAngularSpeed2 = this_1._angularSpeedGradients[1].getFactor(); + } + else { + particle._currentAngularSpeed2 = particle._currentAngularSpeed1; + } + } + particle.angle = BABYLON.Scalar.RandomRange(this_1.minInitialRotation, this_1.maxInitialRotation); + // Velocity + if (this_1._velocityGradients && this_1._velocityGradients.length > 0) { + particle._currentVelocityGradient = this_1._velocityGradients[0]; + particle._currentVelocity1 = particle._currentVelocityGradient.getFactor(); + if (this_1._velocityGradients.length > 1) { + particle._currentVelocity2 = this_1._velocityGradients[1].getFactor(); + } + else { + particle._currentVelocity2 = particle._currentVelocity1; + } + } + // Limit velocity + if (this_1._limitVelocityGradients && this_1._limitVelocityGradients.length > 0) { + particle._currentLimitVelocityGradient = this_1._limitVelocityGradients[0]; + particle._currentLimitVelocity1 = particle._currentLimitVelocityGradient.getFactor(); + if (this_1._limitVelocityGradients.length > 1) { + particle._currentLimitVelocity2 = this_1._limitVelocityGradients[1].getFactor(); + } + else { + particle._currentLimitVelocity2 = particle._currentLimitVelocity1; + } + } + // Drag + if (this_1._dragGradients && this_1._dragGradients.length > 0) { + particle._currentDragGradient = this_1._dragGradients[0]; + particle._currentDrag1 = particle._currentDragGradient.getFactor(); + if (this_1._dragGradients.length > 1) { + particle._currentDrag2 = this_1._dragGradients[1].getFactor(); + } + else { + particle._currentDrag2 = particle._currentDrag1; + } + } + // Color + if (!this_1._colorGradients || this_1._colorGradients.length === 0) { + step = BABYLON.Scalar.RandomRange(0, 1.0); + BABYLON.Color4.LerpToRef(this_1.color1, this_1.color2, step, particle.color); + this_1.colorDead.subtractToRef(particle.color, this_1._colorDiff); + this_1._colorDiff.scaleToRef(1.0 / particle.lifeTime, particle.colorStep); + } + else { + particle._currentColorGradient = this_1._colorGradients[0]; + particle._currentColorGradient.getColorToRef(particle.color); + particle._currentColor1.copyFrom(particle.color); + if (this_1._colorGradients.length > 1) { + this_1._colorGradients[1].getColorToRef(particle._currentColor2); + } + else { + particle._currentColor2.copyFrom(particle.color); + } + } + // Sheet + if (this_1._isAnimationSheetEnabled) { + particle._initialStartSpriteCellID = this_1.startSpriteCellID; + particle._initialEndSpriteCellID = this_1.endSpriteCellID; + } + // Inherited Velocity + particle.direction.addInPlace(this_1._inheritedVelocityOffset); + // Ramp + if (this_1._useRampGradients) { + particle.remapData = new BABYLON.Vector4(0, 1, 0, 1); + } + // Noise texture coordinates + if (this_1.noiseTexture) { + if (particle._randomNoiseCoordinates1) { + particle._randomNoiseCoordinates1.copyFromFloats(Math.random(), Math.random(), Math.random()); + particle._randomNoiseCoordinates2.copyFromFloats(Math.random(), Math.random(), Math.random()); + } + else { + particle._randomNoiseCoordinates1 = new BABYLON.Vector3(Math.random(), Math.random(), Math.random()); + particle._randomNoiseCoordinates2 = new BABYLON.Vector3(Math.random(), Math.random(), Math.random()); + } + } + // Update the position of the attached sub-emitters to match their attached particle + particle._inheritParticleInfoToSubEmitters(); + }; + var this_1 = this, step; + for (var index = 0; index < newParticles; index++) { + var state_1 = _loop_2(); + if (state_1 === "break") + break; + } + }; + /** @hidden */ + ParticleSystem._GetAttributeNamesOrOptions = function (isAnimationSheetEnabled, isBillboardBased, useRampGradients) { + if (isAnimationSheetEnabled === void 0) { isAnimationSheetEnabled = false; } + if (isBillboardBased === void 0) { isBillboardBased = false; } + if (useRampGradients === void 0) { useRampGradients = false; } + var attributeNamesOrOptions = [BABYLON.VertexBuffer.PositionKind, BABYLON.VertexBuffer.ColorKind, "angle", "offset", "size"]; + if (isAnimationSheetEnabled) { + attributeNamesOrOptions.push("cellIndex"); + } + if (!isBillboardBased) { + attributeNamesOrOptions.push("direction"); + } + if (useRampGradients) { + attributeNamesOrOptions.push("remapData"); + } + return attributeNamesOrOptions; + }; + /** @hidden */ + ParticleSystem._GetEffectCreationOptions = function (isAnimationSheetEnabled) { + if (isAnimationSheetEnabled === void 0) { isAnimationSheetEnabled = false; } + var effectCreationOption = ["invView", "view", "projection", "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "textureMask", "translationPivot", "eyePosition"]; + if (isAnimationSheetEnabled) { + effectCreationOption.push("particlesInfos"); + } + return effectCreationOption; + }; + /** @hidden */ + ParticleSystem.prototype._getEffect = function (blendMode) { + if (this._customEffect) { + return this._customEffect; + } + var defines = []; + if (this._scene.clipPlane) { + defines.push("#define CLIPPLANE"); + } + if (this._scene.clipPlane2) { + defines.push("#define CLIPPLANE2"); + } + if (this._scene.clipPlane3) { + defines.push("#define CLIPPLANE3"); + } + if (this._scene.clipPlane4) { + defines.push("#define CLIPPLANE4"); + } + if (this._isAnimationSheetEnabled) { + defines.push("#define ANIMATESHEET"); + } + if (blendMode === ParticleSystem.BLENDMODE_MULTIPLY) { + defines.push("#define BLENDMULTIPLYMODE"); + } + if (this._useRampGradients) { + defines.push("#define RAMPGRADIENT"); + } + if (this._isBillboardBased) { + defines.push("#define BILLBOARD"); + switch (this.billboardMode) { + case ParticleSystem.BILLBOARDMODE_Y: + defines.push("#define BILLBOARDY"); + break; + case ParticleSystem.BILLBOARDMODE_STRETCHED: + defines.push("#define BILLBOARDSTRETCHED"); + break; + case ParticleSystem.BILLBOARDMODE_ALL: + default: + break; + } + } + if (this._imageProcessingConfiguration) { + this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines); + defines.push(this._imageProcessingConfigurationDefines.toString()); + } + // Effect + var join = defines.join("\n"); + if (this._cachedDefines !== join) { + this._cachedDefines = join; + var attributesNamesOrOptions = ParticleSystem._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled, this._isBillboardBased && this.billboardMode !== ParticleSystem.BILLBOARDMODE_STRETCHED, this._useRampGradients); + var effectCreationOption = ParticleSystem._GetEffectCreationOptions(this._isAnimationSheetEnabled); + var samplers = ["diffuseSampler", "rampSampler"]; + if (BABYLON.ImageProcessingConfiguration) { + BABYLON.ImageProcessingConfiguration.PrepareUniforms(effectCreationOption, this._imageProcessingConfigurationDefines); + BABYLON.ImageProcessingConfiguration.PrepareSamplers(samplers, this._imageProcessingConfigurationDefines); + } + this._effect = this._scene.getEngine().createEffect("particles", attributesNamesOrOptions, effectCreationOption, samplers, join); + } + return this._effect; + }; + /** + * Animates the particle system for the current frame by emitting new particles and or animating the living ones. + * @param preWarmOnly will prevent the system from updating the vertex buffer (default is false) + */ + ParticleSystem.prototype.animate = function (preWarmOnly) { + var _this = this; + if (preWarmOnly === void 0) { preWarmOnly = false; } + if (!this._started) { + return; + } + if (!preWarmOnly) { + // Check + if (!this.isReady()) { + return; + } + if (this._currentRenderId === this._scene.getRenderId()) { + return; + } + this._currentRenderId = this._scene.getRenderId(); + } + this._scaledUpdateSpeed = this.updateSpeed * (preWarmOnly ? this.preWarmStepOffset : this._scene.getAnimationRatio()); + // Determine the number of particles we need to create + var newParticles; + if (this.manualEmitCount > -1) { + newParticles = this.manualEmitCount; + this._newPartsExcess = 0; + this.manualEmitCount = 0; + } + else { + var rate_1 = this.emitRate; + if (this._emitRateGradients && this._emitRateGradients.length > 0 && this.targetStopDuration) { + var ratio = this._actualFrame / this.targetStopDuration; + BABYLON.Tools.GetCurrentGradient(ratio, this._emitRateGradients, function (currentGradient, nextGradient, scale) { + if (currentGradient !== _this._currentEmitRateGradient) { + _this._currentEmitRate1 = _this._currentEmitRate2; + _this._currentEmitRate2 = nextGradient.getFactor(); + _this._currentEmitRateGradient = currentGradient; + } + rate_1 = BABYLON.Scalar.Lerp(_this._currentEmitRate1, _this._currentEmitRate2, scale); + }); + } + newParticles = ((rate_1 * this._scaledUpdateSpeed) >> 0); + this._newPartsExcess += rate_1 * this._scaledUpdateSpeed - newParticles; + } + if (this._newPartsExcess > 1.0) { + newParticles += this._newPartsExcess >> 0; + this._newPartsExcess -= this._newPartsExcess >> 0; + } + this._alive = false; + if (!this._stopped) { + this._actualFrame += this._scaledUpdateSpeed; + if (this.targetStopDuration && this._actualFrame >= this.targetStopDuration) { + this.stop(); + } + } + else { + newParticles = 0; + } + this._update(newParticles); + // Stopped? + if (this._stopped) { + if (!this._alive) { + this._started = false; + if (this.onAnimationEnd) { + this.onAnimationEnd(); + } + if (this.disposeOnStop) { + this._scene._toBeDisposed.push(this); + } + } + } + if (!preWarmOnly) { + // Update VBO + var offset = 0; + for (var index = 0; index < this._particles.length; index++) { + var particle = this._particles[index]; + this._appendParticleVertices(offset, particle); + offset += this._useInstancing ? 1 : 4; + } + if (this._vertexBuffer) { + this._vertexBuffer.update(this._vertexData); + } + } + if (this.manualEmitCount === 0 && this.disposeOnStop) { + this.stop(); + } + }; + ParticleSystem.prototype._appendParticleVertices = function (offset, particle) { + this._appendParticleVertex(offset++, particle, 0, 0); + if (!this._useInstancing) { + this._appendParticleVertex(offset++, particle, 1, 0); + this._appendParticleVertex(offset++, particle, 1, 1); + this._appendParticleVertex(offset++, particle, 0, 1); + } + }; + /** + * Rebuilds the particle system. + */ + ParticleSystem.prototype.rebuild = function () { + this._createIndexBuffer(); + if (this._vertexBuffer) { + this._vertexBuffer._rebuild(); + } + }; + /** + * Is this system ready to be used/rendered + * @return true if the system is ready + */ + ParticleSystem.prototype.isReady = function () { + if (!this.emitter || !this._imageProcessingConfiguration.isReady() || !this.particleTexture || !this.particleTexture.isReady()) { + return false; + } + if (this.blendMode !== ParticleSystem.BLENDMODE_MULTIPLYADD) { + if (!this._getEffect(this.blendMode).isReady()) { + return false; + } + } + else { + if (!this._getEffect(ParticleSystem.BLENDMODE_MULTIPLY).isReady()) { + return false; + } + if (!this._getEffect(ParticleSystem.BLENDMODE_ADD).isReady()) { + return false; + } + } + return true; + }; + ParticleSystem.prototype._render = function (blendMode) { + var effect = this._getEffect(blendMode); + var engine = this._scene.getEngine(); + // Render + engine.enableEffect(effect); + var viewMatrix = this._scene.getViewMatrix(); + effect.setTexture("diffuseSampler", this.particleTexture); + effect.setMatrix("view", viewMatrix); + effect.setMatrix("projection", this._scene.getProjectionMatrix()); + if (this._isAnimationSheetEnabled && this.particleTexture) { + var baseSize = this.particleTexture.getBaseSize(); + effect.setFloat3("particlesInfos", this.spriteCellWidth / baseSize.width, this.spriteCellHeight / baseSize.height, baseSize.width / this.spriteCellWidth); + } + effect.setVector2("translationPivot", this.translationPivot); + effect.setFloat4("textureMask", this.textureMask.r, this.textureMask.g, this.textureMask.b, this.textureMask.a); + if (this._isBillboardBased) { + var camera = this._scene.activeCamera; + effect.setVector3("eyePosition", camera.globalPosition); + } + if (this._rampGradientsTexture) { + effect.setTexture("rampSampler", this._rampGradientsTexture); + } + if (this._scene.clipPlane || this._scene.clipPlane2 || this._scene.clipPlane3 || this._scene.clipPlane4) { + var invView = viewMatrix.clone(); + invView.invert(); + effect.setMatrix("invView", invView); + BABYLON.MaterialHelper.BindClipPlane(effect, this._scene); + } + engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect); + // image processing + if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) { + this._imageProcessingConfiguration.bind(effect); + } + // Draw order + switch (blendMode) { + case ParticleSystem.BLENDMODE_ADD: + engine.setAlphaMode(BABYLON.Engine.ALPHA_ADD); + break; + case ParticleSystem.BLENDMODE_ONEONE: + engine.setAlphaMode(BABYLON.Engine.ALPHA_ONEONE); + break; + case ParticleSystem.BLENDMODE_STANDARD: + engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE); + break; + case ParticleSystem.BLENDMODE_MULTIPLY: + engine.setAlphaMode(BABYLON.Engine.ALPHA_MULTIPLY); + break; + } + if (this._useInstancing) { + engine.drawArraysType(BABYLON.Material.TriangleFanDrawMode, 0, 4, this._particles.length); + } + else { + engine.drawElementsType(BABYLON.Material.TriangleFillMode, 0, this._particles.length * 6); + } + return this._particles.length; + }; + /** + * Renders the particle system in its current state. + * @returns the current number of particles + */ + ParticleSystem.prototype.render = function () { + // Check + if (!this.isReady() || !this._particles.length) { + return 0; + } + var engine = this._scene.getEngine(); + engine.setState(false); + if (this.forceDepthWrite) { + engine.setDepthWrite(true); + } + var outparticles = 0; + if (this.blendMode === ParticleSystem.BLENDMODE_MULTIPLYADD) { + outparticles = this._render(ParticleSystem.BLENDMODE_MULTIPLY) + this._render(ParticleSystem.BLENDMODE_ADD); + } + outparticles = this._render(this.blendMode); + engine.unbindInstanceAttributes(); + engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); + return outparticles; + }; + /** + * Disposes the particle system and free the associated resources + * @param disposeTexture defines if the particule texture must be disposed as well (true by default) + */ + ParticleSystem.prototype.dispose = function (disposeTexture) { + if (disposeTexture === void 0) { disposeTexture = true; } + if (this._vertexBuffer) { + this._vertexBuffer.dispose(); + this._vertexBuffer = null; + } + if (this._spriteBuffer) { + this._spriteBuffer.dispose(); + this._spriteBuffer = null; + } + if (this._indexBuffer) { + this._scene.getEngine()._releaseBuffer(this._indexBuffer); + this._indexBuffer = null; + } + if (disposeTexture && this.particleTexture) { + this.particleTexture.dispose(); + this.particleTexture = null; + } + if (disposeTexture && this.noiseTexture) { + this.noiseTexture.dispose(); + this.noiseTexture = null; + } + if (this._rampGradientsTexture) { + this._rampGradientsTexture.dispose(); + this._rampGradientsTexture = null; + } + this._removeFromRoot(); + if (this._subEmitters && this._subEmitters.length) { + for (var index = 0; index < this._subEmitters.length; index++) { + for (var _i = 0, _a = this._subEmitters[index]; _i < _a.length; _i++) { + var subEmitter = _a[_i]; + subEmitter.dispose(); + } + } + this._subEmitters = []; + this.subEmitters = []; + } + if (this._disposeEmitterOnDispose && this.emitter && this.emitter.dispose) { + this.emitter.dispose(true); + } + // Remove from scene + var index = this._scene.particleSystems.indexOf(this); + if (index > -1) { + this._scene.particleSystems.splice(index, 1); + } + this._scene._activeParticleSystems.dispose(); + // Callback + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + this.reset(); + }; + // Clone + /** + * Clones the particle system. + * @param name The name of the cloned object + * @param newEmitter The new emitter to use + * @returns the cloned particle system + */ + ParticleSystem.prototype.clone = function (name, newEmitter) { + var custom = null; + var program = null; + if (this.customShader != null) { + program = this.customShader; + var defines = (program.shaderOptions.defines.length > 0) ? program.shaderOptions.defines.join("\n") : ""; + custom = this._scene.getEngine().createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines); + } + else if (this._customEffect) { + custom = this._customEffect; + } + var result = new ParticleSystem(name, this._capacity, this._scene, custom); + result.customShader = program; + BABYLON.Tools.DeepCopy(this, result, ["particles", "customShader", "noiseTexture"]); + if (newEmitter === undefined) { + newEmitter = this.emitter; + } + result.noiseTexture = this.noiseTexture; + result.emitter = newEmitter; + if (this.particleTexture) { + result.particleTexture = new BABYLON.Texture(this.particleTexture.url, this._scene); + } + // Clone gradients + if (this._colorGradients) { + this._colorGradients.forEach(function (v) { + result.addColorGradient(v.gradient, v.color1, v.color2); + }); + } + if (this._dragGradients) { + this._dragGradients.forEach(function (v) { + result.addDragGradient(v.gradient, v.factor1, v.factor2); + }); + } + if (this._angularSpeedGradients) { + this._angularSpeedGradients.forEach(function (v) { + result.addAngularSpeedGradient(v.gradient, v.factor1, v.factor2); + }); + } + if (this._emitRateGradients) { + this._emitRateGradients.forEach(function (v) { + result.addEmitRateGradient(v.gradient, v.factor1, v.factor2); + }); + } + if (this._lifeTimeGradients) { + this._lifeTimeGradients.forEach(function (v) { + result.addLifeTimeGradient(v.gradient, v.factor1, v.factor2); + }); + } + if (this._limitVelocityGradients) { + this._limitVelocityGradients.forEach(function (v) { + result.addLimitVelocityGradient(v.gradient, v.factor1, v.factor2); + }); + } + if (this._sizeGradients) { + this._sizeGradients.forEach(function (v) { + result.addSizeGradient(v.gradient, v.factor1, v.factor2); + }); + } + if (this._startSizeGradients) { + this._startSizeGradients.forEach(function (v) { + result.addStartSizeGradient(v.gradient, v.factor1, v.factor2); + }); + } + if (this._velocityGradients) { + this._velocityGradients.forEach(function (v) { + result.addVelocityGradient(v.gradient, v.factor1, v.factor2); + }); + } + if (this._rampGradients) { + this._rampGradients.forEach(function (v) { + result.addRampGradient(v.gradient, v.color); + }); + } + if (this._colorRemapGradients) { + this._colorRemapGradients.forEach(function (v) { + result.addColorRemapGradient(v.gradient, v.factor1, v.factor2); + }); + } + if (this._alphaRemapGradients) { + this._alphaRemapGradients.forEach(function (v) { + result.addAlphaRemapGradient(v.gradient, v.factor1, v.factor2); + }); + } + if (!this.preventAutoStart) { + result.start(); + } + return result; + }; + /** + * Serializes the particle system to a JSON object. + * @returns the JSON object + */ + ParticleSystem.prototype.serialize = function () { + var serializationObject = {}; + ParticleSystem._Serialize(serializationObject, this); + serializationObject.textureMask = this.textureMask.asArray(); + serializationObject.customShader = this.customShader; + serializationObject.preventAutoStart = this.preventAutoStart; + // SubEmitters + if (this.subEmitters) { + serializationObject.subEmitters = []; + if (!this._subEmitters) { + this._prepareSubEmitterInternalArray(); + } + for (var _i = 0, _a = this._subEmitters; _i < _a.length; _i++) { + var subs = _a[_i]; + var cell = []; + for (var _b = 0, subs_1 = subs; _b < subs_1.length; _b++) { + var sub = subs_1[_b]; + cell.push(sub.serialize()); + } + serializationObject.subEmitters.push(cell); + } + } + return serializationObject; + }; + /** @hidden */ + ParticleSystem._Serialize = function (serializationObject, particleSystem) { + serializationObject.name = particleSystem.name; + serializationObject.id = particleSystem.id; + serializationObject.capacity = particleSystem.getCapacity(); + // Emitter + if (particleSystem.emitter.position) { + var emitterMesh = particleSystem.emitter; + serializationObject.emitterId = emitterMesh.id; + } + else { + var emitterPosition = particleSystem.emitter; + serializationObject.emitter = emitterPosition.asArray(); + } + // Emitter + if (particleSystem.particleEmitterType) { + serializationObject.particleEmitterType = particleSystem.particleEmitterType.serialize(); + } + if (particleSystem.particleTexture) { + serializationObject.textureName = particleSystem.particleTexture.name; + serializationObject.invertY = particleSystem.particleTexture._invertY; + } + // Animations + BABYLON.Animation.AppendSerializedAnimations(particleSystem, serializationObject); + serializationObject.beginAnimationOnStart = particleSystem.beginAnimationOnStart; + serializationObject.beginAnimationFrom = particleSystem.beginAnimationFrom; + serializationObject.beginAnimationTo = particleSystem.beginAnimationTo; + serializationObject.beginAnimationLoop = particleSystem.beginAnimationLoop; + // Particle system + serializationObject.startDelay = particleSystem.startDelay; + serializationObject.renderingGroupId = particleSystem.renderingGroupId; + serializationObject.isBillboardBased = particleSystem.isBillboardBased; + serializationObject.billboardMode = particleSystem.billboardMode; + serializationObject.minAngularSpeed = particleSystem.minAngularSpeed; + serializationObject.maxAngularSpeed = particleSystem.maxAngularSpeed; + serializationObject.minSize = particleSystem.minSize; + serializationObject.maxSize = particleSystem.maxSize; + serializationObject.minScaleX = particleSystem.minScaleX; + serializationObject.maxScaleX = particleSystem.maxScaleX; + serializationObject.minScaleY = particleSystem.minScaleY; + serializationObject.maxScaleY = particleSystem.maxScaleY; + serializationObject.minEmitPower = particleSystem.minEmitPower; + serializationObject.maxEmitPower = particleSystem.maxEmitPower; + serializationObject.minLifeTime = particleSystem.minLifeTime; + serializationObject.maxLifeTime = particleSystem.maxLifeTime; + serializationObject.emitRate = particleSystem.emitRate; + serializationObject.gravity = particleSystem.gravity.asArray(); + serializationObject.noiseStrength = particleSystem.noiseStrength.asArray(); + serializationObject.color1 = particleSystem.color1.asArray(); + serializationObject.color2 = particleSystem.color2.asArray(); + serializationObject.colorDead = particleSystem.colorDead.asArray(); + serializationObject.updateSpeed = particleSystem.updateSpeed; + serializationObject.targetStopDuration = particleSystem.targetStopDuration; + serializationObject.blendMode = particleSystem.blendMode; + serializationObject.preWarmCycles = particleSystem.preWarmCycles; + serializationObject.preWarmStepOffset = particleSystem.preWarmStepOffset; + serializationObject.minInitialRotation = particleSystem.minInitialRotation; + serializationObject.maxInitialRotation = particleSystem.maxInitialRotation; + serializationObject.startSpriteCellID = particleSystem.startSpriteCellID; + serializationObject.endSpriteCellID = particleSystem.endSpriteCellID; + serializationObject.spriteCellChangeSpeed = particleSystem.spriteCellChangeSpeed; + serializationObject.spriteCellWidth = particleSystem.spriteCellWidth; + serializationObject.spriteCellHeight = particleSystem.spriteCellHeight; + serializationObject.spriteRandomStartCell = particleSystem.spriteRandomStartCell; + serializationObject.isAnimationSheetEnabled = particleSystem.isAnimationSheetEnabled; + var colorGradients = particleSystem.getColorGradients(); + if (colorGradients) { + serializationObject.colorGradients = []; + for (var _i = 0, colorGradients_1 = colorGradients; _i < colorGradients_1.length; _i++) { + var colorGradient = colorGradients_1[_i]; + var serializedGradient = { + gradient: colorGradient.gradient, + color1: colorGradient.color1.asArray() + }; + if (colorGradient.color2) { + serializedGradient.color2 = colorGradient.color2.asArray(); + } + serializationObject.colorGradients.push(serializedGradient); + } + } + var rampGradients = particleSystem.getRampGradients(); + if (rampGradients) { + serializationObject.rampGradients = []; + for (var _a = 0, rampGradients_1 = rampGradients; _a < rampGradients_1.length; _a++) { + var rampGradient = rampGradients_1[_a]; + var serializedGradient = { + gradient: rampGradient.gradient, + color: rampGradient.color.asArray() + }; + serializationObject.rampGradients.push(serializedGradient); + } + serializationObject.useRampGradients = particleSystem.useRampGradients; + } + var colorRemapGradients = particleSystem.getColorRemapGradients(); + if (colorRemapGradients) { + serializationObject.colorRemapGradients = []; + for (var _b = 0, colorRemapGradients_1 = colorRemapGradients; _b < colorRemapGradients_1.length; _b++) { + var colorRemapGradient = colorRemapGradients_1[_b]; + var serializedGradient = { + gradient: colorRemapGradient.gradient, + factor1: colorRemapGradient.factor1 + }; + if (colorRemapGradient.factor2 !== undefined) { + serializedGradient.factor2 = colorRemapGradient.factor2; + } + serializationObject.colorRemapGradients.push(serializedGradient); + } + } + var alphaRemapGradients = particleSystem.getAlphaRemapGradients(); + if (alphaRemapGradients) { + serializationObject.alphaRemapGradients = []; + for (var _c = 0, alphaRemapGradients_1 = alphaRemapGradients; _c < alphaRemapGradients_1.length; _c++) { + var alphaRemapGradient = alphaRemapGradients_1[_c]; + var serializedGradient = { + gradient: alphaRemapGradient.gradient, + factor1: alphaRemapGradient.factor1 + }; + if (alphaRemapGradient.factor2 !== undefined) { + serializedGradient.factor2 = alphaRemapGradient.factor2; + } + serializationObject.alphaRemapGradients.push(serializedGradient); + } + } + var sizeGradients = particleSystem.getSizeGradients(); + if (sizeGradients) { + serializationObject.sizeGradients = []; + for (var _d = 0, sizeGradients_1 = sizeGradients; _d < sizeGradients_1.length; _d++) { + var sizeGradient = sizeGradients_1[_d]; + var serializedGradient = { + gradient: sizeGradient.gradient, + factor1: sizeGradient.factor1 + }; + if (sizeGradient.factor2 !== undefined) { + serializedGradient.factor2 = sizeGradient.factor2; + } + serializationObject.sizeGradients.push(serializedGradient); + } + } + var angularSpeedGradients = particleSystem.getAngularSpeedGradients(); + if (angularSpeedGradients) { + serializationObject.angularSpeedGradients = []; + for (var _e = 0, angularSpeedGradients_1 = angularSpeedGradients; _e < angularSpeedGradients_1.length; _e++) { + var angularSpeedGradient = angularSpeedGradients_1[_e]; + var serializedGradient = { + gradient: angularSpeedGradient.gradient, + factor1: angularSpeedGradient.factor1 + }; + if (angularSpeedGradient.factor2 !== undefined) { + serializedGradient.factor2 = angularSpeedGradient.factor2; + } + serializationObject.angularSpeedGradients.push(serializedGradient); + } + } + var velocityGradients = particleSystem.getVelocityGradients(); + if (velocityGradients) { + serializationObject.velocityGradients = []; + for (var _f = 0, velocityGradients_1 = velocityGradients; _f < velocityGradients_1.length; _f++) { + var velocityGradient = velocityGradients_1[_f]; + var serializedGradient = { + gradient: velocityGradient.gradient, + factor1: velocityGradient.factor1 + }; + if (velocityGradient.factor2 !== undefined) { + serializedGradient.factor2 = velocityGradient.factor2; + } + serializationObject.velocityGradients.push(serializedGradient); + } + } + var dragGradients = particleSystem.getDragGradients(); + if (dragGradients) { + serializationObject.dragyGradients = []; + for (var _g = 0, dragGradients_1 = dragGradients; _g < dragGradients_1.length; _g++) { + var dragGradient = dragGradients_1[_g]; + var serializedGradient = { + gradient: dragGradient.gradient, + factor1: dragGradient.factor1 + }; + if (dragGradient.factor2 !== undefined) { + serializedGradient.factor2 = dragGradient.factor2; + } + serializationObject.dragGradients.push(serializedGradient); + } + } + var emitRateGradients = particleSystem.getEmitRateGradients(); + if (emitRateGradients) { + serializationObject.emitRateGradients = []; + for (var _h = 0, emitRateGradients_1 = emitRateGradients; _h < emitRateGradients_1.length; _h++) { + var emitRateGradient = emitRateGradients_1[_h]; + var serializedGradient = { + gradient: emitRateGradient.gradient, + factor1: emitRateGradient.factor1 + }; + if (emitRateGradient.factor2 !== undefined) { + serializedGradient.factor2 = emitRateGradient.factor2; + } + serializationObject.emitRateGradients.push(serializedGradient); + } + } + var startSizeGradients = particleSystem.getStartSizeGradients(); + if (startSizeGradients) { + serializationObject.startSizeGradients = []; + for (var _j = 0, startSizeGradients_1 = startSizeGradients; _j < startSizeGradients_1.length; _j++) { + var startSizeGradient = startSizeGradients_1[_j]; + var serializedGradient = { + gradient: startSizeGradient.gradient, + factor1: startSizeGradient.factor1 + }; + if (startSizeGradient.factor2 !== undefined) { + serializedGradient.factor2 = startSizeGradient.factor2; + } + serializationObject.startSizeGradients.push(serializedGradient); + } + } + var lifeTimeGradients = particleSystem.getLifeTimeGradients(); + if (lifeTimeGradients) { + serializationObject.lifeTimeGradients = []; + for (var _k = 0, lifeTimeGradients_1 = lifeTimeGradients; _k < lifeTimeGradients_1.length; _k++) { + var lifeTimeGradient = lifeTimeGradients_1[_k]; + var serializedGradient = { + gradient: lifeTimeGradient.gradient, + factor1: lifeTimeGradient.factor1 + }; + if (lifeTimeGradient.factor2 !== undefined) { + serializedGradient.factor2 = lifeTimeGradient.factor2; + } + serializationObject.lifeTimeGradients.push(serializedGradient); + } + } + var limitVelocityGradients = particleSystem.getLimitVelocityGradients(); + if (limitVelocityGradients) { + serializationObject.limitVelocityGradients = []; + for (var _l = 0, limitVelocityGradients_1 = limitVelocityGradients; _l < limitVelocityGradients_1.length; _l++) { + var limitVelocityGradient = limitVelocityGradients_1[_l]; + var serializedGradient = { + gradient: limitVelocityGradient.gradient, + factor1: limitVelocityGradient.factor1 + }; + if (limitVelocityGradient.factor2 !== undefined) { + serializedGradient.factor2 = limitVelocityGradient.factor2; + } + serializationObject.limitVelocityGradients.push(serializedGradient); + } + serializationObject.limitVelocityDamping = particleSystem.limitVelocityDamping; + } + if (particleSystem.noiseTexture) { + serializationObject.noiseTexture = particleSystem.noiseTexture.serialize(); + } + }; + /** @hidden */ + ParticleSystem._Parse = function (parsedParticleSystem, particleSystem, scene, rootUrl) { + // Texture + if (parsedParticleSystem.textureName) { + particleSystem.particleTexture = new BABYLON.Texture(rootUrl + parsedParticleSystem.textureName, scene, false, parsedParticleSystem.invertY !== undefined ? parsedParticleSystem.invertY : true); + particleSystem.particleTexture.name = parsedParticleSystem.textureName; + } + // Emitter + if (!parsedParticleSystem.emitterId && parsedParticleSystem.emitterId !== 0 && parsedParticleSystem.emitter === undefined) { + particleSystem.emitter = BABYLON.Vector3.Zero(); + } + else if (parsedParticleSystem.emitterId) { + particleSystem.emitter = scene.getLastMeshByID(parsedParticleSystem.emitterId); + } + else { + particleSystem.emitter = BABYLON.Vector3.FromArray(parsedParticleSystem.emitter); + } + // Misc. + if (parsedParticleSystem.renderingGroupId !== undefined) { + particleSystem.renderingGroupId = parsedParticleSystem.renderingGroupId; + } + if (parsedParticleSystem.isBillboardBased !== undefined) { + particleSystem.isBillboardBased = parsedParticleSystem.isBillboardBased; + } + if (parsedParticleSystem.billboardMode !== undefined) { + particleSystem.billboardMode = parsedParticleSystem.billboardMode; + } + // Animations + if (parsedParticleSystem.animations) { + for (var animationIndex = 0; animationIndex < parsedParticleSystem.animations.length; animationIndex++) { + var parsedAnimation = parsedParticleSystem.animations[animationIndex]; + particleSystem.animations.push(BABYLON.Animation.Parse(parsedAnimation)); + } + particleSystem.beginAnimationOnStart = parsedParticleSystem.beginAnimationOnStart; + particleSystem.beginAnimationFrom = parsedParticleSystem.beginAnimationFrom; + particleSystem.beginAnimationTo = parsedParticleSystem.beginAnimationTo; + particleSystem.beginAnimationLoop = parsedParticleSystem.beginAnimationLoop; + } + if (parsedParticleSystem.autoAnimate) { + scene.beginAnimation(particleSystem, parsedParticleSystem.autoAnimateFrom, parsedParticleSystem.autoAnimateTo, parsedParticleSystem.autoAnimateLoop, parsedParticleSystem.autoAnimateSpeed || 1.0); + } + // Particle system + particleSystem.startDelay = parsedParticleSystem.startDelay | 0; + particleSystem.minAngularSpeed = parsedParticleSystem.minAngularSpeed; + particleSystem.maxAngularSpeed = parsedParticleSystem.maxAngularSpeed; + particleSystem.minSize = parsedParticleSystem.minSize; + particleSystem.maxSize = parsedParticleSystem.maxSize; + if (parsedParticleSystem.minScaleX) { + particleSystem.minScaleX = parsedParticleSystem.minScaleX; + particleSystem.maxScaleX = parsedParticleSystem.maxScaleX; + particleSystem.minScaleY = parsedParticleSystem.minScaleY; + particleSystem.maxScaleY = parsedParticleSystem.maxScaleY; + } + if (parsedParticleSystem.preWarmCycles !== undefined) { + particleSystem.preWarmCycles = parsedParticleSystem.preWarmCycles; + particleSystem.preWarmStepOffset = parsedParticleSystem.preWarmStepOffset; + } + if (parsedParticleSystem.minInitialRotation !== undefined) { + particleSystem.minInitialRotation = parsedParticleSystem.minInitialRotation; + particleSystem.maxInitialRotation = parsedParticleSystem.maxInitialRotation; + } + particleSystem.minLifeTime = parsedParticleSystem.minLifeTime; + particleSystem.maxLifeTime = parsedParticleSystem.maxLifeTime; + particleSystem.minEmitPower = parsedParticleSystem.minEmitPower; + particleSystem.maxEmitPower = parsedParticleSystem.maxEmitPower; + particleSystem.emitRate = parsedParticleSystem.emitRate; + particleSystem.gravity = BABYLON.Vector3.FromArray(parsedParticleSystem.gravity); + if (parsedParticleSystem.noiseStrength) { + particleSystem.noiseStrength = BABYLON.Vector3.FromArray(parsedParticleSystem.noiseStrength); + } + particleSystem.color1 = BABYLON.Color4.FromArray(parsedParticleSystem.color1); + particleSystem.color2 = BABYLON.Color4.FromArray(parsedParticleSystem.color2); + particleSystem.colorDead = BABYLON.Color4.FromArray(parsedParticleSystem.colorDead); + particleSystem.updateSpeed = parsedParticleSystem.updateSpeed; + particleSystem.targetStopDuration = parsedParticleSystem.targetStopDuration; + particleSystem.blendMode = parsedParticleSystem.blendMode; + if (parsedParticleSystem.colorGradients) { + for (var _i = 0, _a = parsedParticleSystem.colorGradients; _i < _a.length; _i++) { + var colorGradient = _a[_i]; + particleSystem.addColorGradient(colorGradient.gradient, BABYLON.Color4.FromArray(colorGradient.color1), colorGradient.color2 ? BABYLON.Color4.FromArray(colorGradient.color2) : undefined); + } + } + if (parsedParticleSystem.rampGradients) { + for (var _b = 0, _c = parsedParticleSystem.rampGradients; _b < _c.length; _b++) { + var rampGradient = _c[_b]; + particleSystem.addRampGradient(rampGradient.gradient, BABYLON.Color3.FromArray(rampGradient.color)); + } + particleSystem.useRampGradients = parsedParticleSystem.useRampGradients; + } + if (parsedParticleSystem.colorRemapGradients) { + for (var _d = 0, _e = parsedParticleSystem.colorRemapGradients; _d < _e.length; _d++) { + var colorRemapGradient = _e[_d]; + particleSystem.addColorRemapGradient(colorRemapGradient.gradient, colorRemapGradient.factor1 !== undefined ? colorRemapGradient.factor1 : colorRemapGradient.factor, colorRemapGradient.factor2); + } + } + if (parsedParticleSystem.alphaRemapGradients) { + for (var _f = 0, _g = parsedParticleSystem.alphaRemapGradients; _f < _g.length; _f++) { + var alphaRemapGradient = _g[_f]; + particleSystem.addAlphaRemapGradient(alphaRemapGradient.gradient, alphaRemapGradient.factor1 !== undefined ? alphaRemapGradient.factor1 : alphaRemapGradient.factor, alphaRemapGradient.factor2); + } + } + if (parsedParticleSystem.sizeGradients) { + for (var _h = 0, _j = parsedParticleSystem.sizeGradients; _h < _j.length; _h++) { + var sizeGradient = _j[_h]; + particleSystem.addSizeGradient(sizeGradient.gradient, sizeGradient.factor1 !== undefined ? sizeGradient.factor1 : sizeGradient.factor, sizeGradient.factor2); + } + } + if (parsedParticleSystem.sizeGradients) { + for (var _k = 0, _l = parsedParticleSystem.sizeGradients; _k < _l.length; _k++) { + var sizeGradient = _l[_k]; + particleSystem.addSizeGradient(sizeGradient.gradient, sizeGradient.factor1 !== undefined ? sizeGradient.factor1 : sizeGradient.factor, sizeGradient.factor2); + } + } + if (parsedParticleSystem.angularSpeedGradients) { + for (var _m = 0, _o = parsedParticleSystem.angularSpeedGradients; _m < _o.length; _m++) { + var angularSpeedGradient = _o[_m]; + particleSystem.addAngularSpeedGradient(angularSpeedGradient.gradient, angularSpeedGradient.factor1 !== undefined ? angularSpeedGradient.factor1 : angularSpeedGradient.factor, angularSpeedGradient.factor2); + } + } + if (parsedParticleSystem.velocityGradients) { + for (var _p = 0, _q = parsedParticleSystem.velocityGradients; _p < _q.length; _p++) { + var velocityGradient = _q[_p]; + particleSystem.addVelocityGradient(velocityGradient.gradient, velocityGradient.factor1 !== undefined ? velocityGradient.factor1 : velocityGradient.factor, velocityGradient.factor2); + } + } + if (parsedParticleSystem.dragGradients) { + for (var _r = 0, _s = parsedParticleSystem.dragGradients; _r < _s.length; _r++) { + var dragGradient = _s[_r]; + particleSystem.addDragGradient(dragGradient.gradient, dragGradient.factor1 !== undefined ? dragGradient.factor1 : dragGradient.factor, dragGradient.factor2); + } + } + if (parsedParticleSystem.emitRateGradients) { + for (var _t = 0, _u = parsedParticleSystem.emitRateGradients; _t < _u.length; _t++) { + var emitRateGradient = _u[_t]; + particleSystem.addEmitRateGradient(emitRateGradient.gradient, emitRateGradient.factor1 !== undefined ? emitRateGradient.factor1 : emitRateGradient.factor, emitRateGradient.factor2); + } + } + if (parsedParticleSystem.startSizeGradients) { + for (var _v = 0, _w = parsedParticleSystem.startSizeGradients; _v < _w.length; _v++) { + var startSizeGradient = _w[_v]; + particleSystem.addStartSizeGradient(startSizeGradient.gradient, startSizeGradient.factor1 !== undefined ? startSizeGradient.factor1 : startSizeGradient.factor, startSizeGradient.factor2); + } + } + if (parsedParticleSystem.lifeTimeGradients) { + for (var _x = 0, _y = parsedParticleSystem.lifeTimeGradients; _x < _y.length; _x++) { + var lifeTimeGradient = _y[_x]; + particleSystem.addLifeTimeGradient(lifeTimeGradient.gradient, lifeTimeGradient.factor1 !== undefined ? lifeTimeGradient.factor1 : lifeTimeGradient.factor, lifeTimeGradient.factor2); + } + } + if (parsedParticleSystem.limitVelocityGradients) { + for (var _z = 0, _0 = parsedParticleSystem.limitVelocityGradients; _z < _0.length; _z++) { + var limitVelocityGradient = _0[_z]; + particleSystem.addLimitVelocityGradient(limitVelocityGradient.gradient, limitVelocityGradient.factor1 !== undefined ? limitVelocityGradient.factor1 : limitVelocityGradient.factor, limitVelocityGradient.factor2); + } + particleSystem.limitVelocityDamping = parsedParticleSystem.limitVelocityDamping; + } + if (parsedParticleSystem.noiseTexture) { + particleSystem.noiseTexture = BABYLON.ProceduralTexture.Parse(parsedParticleSystem.noiseTexture, scene, rootUrl); + } + // Emitter + var emitterType; + if (parsedParticleSystem.particleEmitterType) { + switch (parsedParticleSystem.particleEmitterType.type) { + case "SphereParticleEmitter": + emitterType = new BABYLON.SphereParticleEmitter(); + break; + case "SphereDirectedParticleEmitter": + emitterType = new BABYLON.SphereDirectedParticleEmitter(); + break; + case "ConeEmitter": + case "ConeParticleEmitter": + emitterType = new BABYLON.ConeParticleEmitter(); + break; + case "CylinderParticleEmitter": + emitterType = new BABYLON.CylinderParticleEmitter(); + break; + case "HemisphericParticleEmitter": + emitterType = new BABYLON.HemisphericParticleEmitter(); + break; + case "BoxEmitter": + case "BoxParticleEmitter": + default: + emitterType = new BABYLON.BoxParticleEmitter(); + break; + } + emitterType.parse(parsedParticleSystem.particleEmitterType); + } + else { + emitterType = new BABYLON.BoxParticleEmitter(); + emitterType.parse(parsedParticleSystem); + } + particleSystem.particleEmitterType = emitterType; + // Animation sheet + particleSystem.startSpriteCellID = parsedParticleSystem.startSpriteCellID; + particleSystem.endSpriteCellID = parsedParticleSystem.endSpriteCellID; + particleSystem.spriteCellWidth = parsedParticleSystem.spriteCellWidth; + particleSystem.spriteCellHeight = parsedParticleSystem.spriteCellHeight; + particleSystem.spriteCellChangeSpeed = parsedParticleSystem.spriteCellChangeSpeed; + particleSystem.spriteRandomStartCell = parsedParticleSystem.spriteRandomStartCell; + }; + /** + * Parses a JSON object to create a particle system. + * @param parsedParticleSystem The JSON object to parse + * @param scene The scene to create the particle system in + * @param rootUrl The root url to use to load external dependencies like texture + * @param doNotStart Ignore the preventAutoStart attribute and does not start + * @returns the Parsed particle system + */ + ParticleSystem.Parse = function (parsedParticleSystem, scene, rootUrl, doNotStart) { + if (doNotStart === void 0) { doNotStart = false; } + var name = parsedParticleSystem.name; + var custom = null; + var program = null; + if (parsedParticleSystem.customShader) { + program = parsedParticleSystem.customShader; + var defines = (program.shaderOptions.defines.length > 0) ? program.shaderOptions.defines.join("\n") : ""; + custom = scene.getEngine().createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines); + } + var particleSystem = new ParticleSystem(name, parsedParticleSystem.capacity, scene, custom, parsedParticleSystem.isAnimationSheetEnabled); + particleSystem.customShader = program; + if (parsedParticleSystem.id) { + particleSystem.id = parsedParticleSystem.id; + } + // SubEmitters + if (parsedParticleSystem.subEmitters) { + particleSystem.subEmitters = []; + for (var _i = 0, _a = parsedParticleSystem.subEmitters; _i < _a.length; _i++) { + var cell = _a[_i]; + var cellArray = []; + for (var _b = 0, cell_1 = cell; _b < cell_1.length; _b++) { + var sub = cell_1[_b]; + cellArray.push(BABYLON.SubEmitter.Parse(sub, scene, rootUrl)); + } + particleSystem.subEmitters.push(cellArray); + } + } + ParticleSystem._Parse(parsedParticleSystem, particleSystem, scene, rootUrl); + particleSystem.textureMask = BABYLON.Color4.FromArray(parsedParticleSystem.textureMask); + // Auto start + if (parsedParticleSystem.preventAutoStart) { + particleSystem.preventAutoStart = parsedParticleSystem.preventAutoStart; + } + if (!doNotStart && !particleSystem.preventAutoStart) { + particleSystem.start(); + } + return particleSystem; + }; + /** + * Billboard mode will only apply to Y axis + */ + ParticleSystem.BILLBOARDMODE_Y = 2; + /** + * Billboard mode will apply to all axes + */ + ParticleSystem.BILLBOARDMODE_ALL = 7; + /** + * Special billboard mode where the particle will be biilboard to the camera but rotated to align with direction + */ + ParticleSystem.BILLBOARDMODE_STRETCHED = 8; + return ParticleSystem; + }(BABYLON.BaseParticleSystem)); + BABYLON.ParticleSystem = ParticleSystem; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.particleSystem.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Particle emitter emitting particles from the inside of a box. + * It emits the particles randomly between 2 given directions. + */ + var BoxParticleEmitter = /** @class */ (function () { + /** + * Creates a new instance BoxParticleEmitter + */ + function BoxParticleEmitter() { + /** + * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors. + */ + this.direction1 = new BABYLON.Vector3(0, 1.0, 0); + /** + * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors. + */ + this.direction2 = new BABYLON.Vector3(0, 1.0, 0); + /** + * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so. + */ + this.minEmitBox = new BABYLON.Vector3(-0.5, -0.5, -0.5); + /** + * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so. + */ + this.maxEmitBox = new BABYLON.Vector3(0.5, 0.5, 0.5); + } + /** + * Called by the particle System when the direction is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param directionToUpdate is the direction vector to update with the result + * @param particle is the particle we are computed the direction for + */ + BoxParticleEmitter.prototype.startDirectionFunction = function (worldMatrix, directionToUpdate, particle) { + var randX = BABYLON.Scalar.RandomRange(this.direction1.x, this.direction2.x); + var randY = BABYLON.Scalar.RandomRange(this.direction1.y, this.direction2.y); + var randZ = BABYLON.Scalar.RandomRange(this.direction1.z, this.direction2.z); + BABYLON.Vector3.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate); + }; + /** + * Called by the particle System when the position is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param positionToUpdate is the position vector to update with the result + * @param particle is the particle we are computed the position for + */ + BoxParticleEmitter.prototype.startPositionFunction = function (worldMatrix, positionToUpdate, particle) { + var randX = BABYLON.Scalar.RandomRange(this.minEmitBox.x, this.maxEmitBox.x); + var randY = BABYLON.Scalar.RandomRange(this.minEmitBox.y, this.maxEmitBox.y); + var randZ = BABYLON.Scalar.RandomRange(this.minEmitBox.z, this.maxEmitBox.z); + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate); + }; + /** + * Clones the current emitter and returns a copy of it + * @returns the new emitter + */ + BoxParticleEmitter.prototype.clone = function () { + var newOne = new BoxParticleEmitter(); + BABYLON.Tools.DeepCopy(this, newOne); + return newOne; + }; + /** + * Called by the GPUParticleSystem to setup the update shader + * @param effect defines the update shader + */ + BoxParticleEmitter.prototype.applyToShader = function (effect) { + effect.setVector3("direction1", this.direction1); + effect.setVector3("direction2", this.direction2); + effect.setVector3("minEmitBox", this.minEmitBox); + effect.setVector3("maxEmitBox", this.maxEmitBox); + }; + /** + * Returns a string to use to update the GPU particles update shader + * @returns a string containng the defines string + */ + BoxParticleEmitter.prototype.getEffectDefines = function () { + return "#define BOXEMITTER"; + }; + /** + * Returns the string "BoxParticleEmitter" + * @returns a string containing the class name + */ + BoxParticleEmitter.prototype.getClassName = function () { + return "BoxParticleEmitter"; + }; + /** + * Serializes the particle system to a JSON object. + * @returns the JSON object + */ + BoxParticleEmitter.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.type = this.getClassName(); + serializationObject.direction1 = this.direction1.asArray(); + serializationObject.direction2 = this.direction2.asArray(); + serializationObject.minEmitBox = this.minEmitBox.asArray(); + serializationObject.maxEmitBox = this.maxEmitBox.asArray(); + return serializationObject; + }; + /** + * Parse properties from a JSON object + * @param serializationObject defines the JSON object + */ + BoxParticleEmitter.prototype.parse = function (serializationObject) { + BABYLON.Vector3.FromArrayToRef(serializationObject.direction1, 0, this.direction1); + BABYLON.Vector3.FromArrayToRef(serializationObject.direction2, 0, this.direction2); + BABYLON.Vector3.FromArrayToRef(serializationObject.minEmitBox, 0, this.minEmitBox); + BABYLON.Vector3.FromArrayToRef(serializationObject.maxEmitBox, 0, this.maxEmitBox); + }; + return BoxParticleEmitter; + }()); + BABYLON.BoxParticleEmitter = BoxParticleEmitter; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.boxParticleEmitter.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Particle emitter emitting particles from the inside of a cylinder. + * It emits the particles alongside the cylinder radius. The emission direction might be randomized. + */ + var CylinderParticleEmitter = /** @class */ (function () { + /** + * Creates a new instance CylinderParticleEmitter + * @param radius the radius of the emission cylinder (1 by default) + * @param height the height of the emission cylinder (1 by default) + * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default) + * @param directionRandomizer defines how much to randomize the particle direction [0-1] + */ + function CylinderParticleEmitter( + /** + * The radius of the emission cylinder. + */ + radius, + /** + * The height of the emission cylinder. + */ + height, + /** + * The range of emission [0-1] 0 Surface only, 1 Entire Radius. + */ + radiusRange, + /** + * How much to randomize the particle direction [0-1]. + */ + directionRandomizer) { + if (radius === void 0) { radius = 1; } + if (height === void 0) { height = 1; } + if (radiusRange === void 0) { radiusRange = 1; } + if (directionRandomizer === void 0) { directionRandomizer = 0; } + this.radius = radius; + this.height = height; + this.radiusRange = radiusRange; + this.directionRandomizer = directionRandomizer; + } + /** + * Called by the particle System when the direction is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param directionToUpdate is the direction vector to update with the result + * @param particle is the particle we are computed the direction for + */ + CylinderParticleEmitter.prototype.startDirectionFunction = function (worldMatrix, directionToUpdate, particle) { + var direction = particle.position.subtract(worldMatrix.getTranslation()).normalize(); + var randY = BABYLON.Scalar.RandomRange(-this.directionRandomizer / 2, this.directionRandomizer / 2); + var angle = Math.atan2(direction.x, direction.z); + angle += BABYLON.Scalar.RandomRange(-Math.PI / 2, Math.PI / 2) * this.directionRandomizer; + direction.y = randY; // set direction y to rand y to mirror normal of cylinder surface + direction.x = Math.sin(angle); + direction.z = Math.cos(angle); + direction.normalize(); + BABYLON.Vector3.TransformNormalFromFloatsToRef(direction.x, direction.y, direction.z, worldMatrix, directionToUpdate); + }; + /** + * Called by the particle System when the position is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param positionToUpdate is the position vector to update with the result + * @param particle is the particle we are computed the position for + */ + CylinderParticleEmitter.prototype.startPositionFunction = function (worldMatrix, positionToUpdate, particle) { + var yPos = BABYLON.Scalar.RandomRange(-this.height / 2, this.height / 2); + var angle = BABYLON.Scalar.RandomRange(0, 2 * Math.PI); + // Pick a properly distributed point within the circle https://programming.guide/random-point-within-circle.html + var radiusDistribution = BABYLON.Scalar.RandomRange((1 - this.radiusRange) * (1 - this.radiusRange), 1); + var positionRadius = Math.sqrt(radiusDistribution) * this.radius; + var xPos = positionRadius * Math.cos(angle); + var zPos = positionRadius * Math.sin(angle); + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(xPos, yPos, zPos, worldMatrix, positionToUpdate); + }; + /** + * Clones the current emitter and returns a copy of it + * @returns the new emitter + */ + CylinderParticleEmitter.prototype.clone = function () { + var newOne = new CylinderParticleEmitter(this.radius, this.directionRandomizer); + BABYLON.Tools.DeepCopy(this, newOne); + return newOne; + }; + /** + * Called by the GPUParticleSystem to setup the update shader + * @param effect defines the update shader + */ + CylinderParticleEmitter.prototype.applyToShader = function (effect) { + effect.setFloat("radius", this.radius); + effect.setFloat("height", this.height); + effect.setFloat("radiusRange", this.radiusRange); + effect.setFloat("directionRandomizer", this.directionRandomizer); + }; + /** + * Returns a string to use to update the GPU particles update shader + * @returns a string containng the defines string + */ + CylinderParticleEmitter.prototype.getEffectDefines = function () { + return "#define CYLINDEREMITTER"; + }; + /** + * Returns the string "CylinderParticleEmitter" + * @returns a string containing the class name + */ + CylinderParticleEmitter.prototype.getClassName = function () { + return "CylinderParticleEmitter"; + }; + /** + * Serializes the particle system to a JSON object. + * @returns the JSON object + */ + CylinderParticleEmitter.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.type = this.getClassName(); + serializationObject.radius = this.radius; + serializationObject.height = this.height; + serializationObject.radiusRange = this.radiusRange; + serializationObject.directionRandomizer = this.directionRandomizer; + return serializationObject; + }; + /** + * Parse properties from a JSON object + * @param serializationObject defines the JSON object + */ + CylinderParticleEmitter.prototype.parse = function (serializationObject) { + this.radius = serializationObject.radius; + this.height = serializationObject.height; + this.radiusRange = serializationObject.radiusRange; + this.directionRandomizer = serializationObject.directionRandomizer; + }; + return CylinderParticleEmitter; + }()); + BABYLON.CylinderParticleEmitter = CylinderParticleEmitter; + /** + * Particle emitter emitting particles from the inside of a cylinder. + * It emits the particles randomly between two vectors. + */ + var CylinderDirectedParticleEmitter = /** @class */ (function (_super) { + __extends(CylinderDirectedParticleEmitter, _super); + /** + * Creates a new instance CylinderDirectedParticleEmitter + * @param radius the radius of the emission cylinder (1 by default) + * @param height the height of the emission cylinder (1 by default) + * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default) + * @param direction1 the min limit of the emission direction (up vector by default) + * @param direction2 the max limit of the emission direction (up vector by default) + */ + function CylinderDirectedParticleEmitter(radius, height, radiusRange, + /** + * The min limit of the emission direction. + */ + direction1, + /** + * The max limit of the emission direction. + */ + direction2) { + if (radius === void 0) { radius = 1; } + if (height === void 0) { height = 1; } + if (radiusRange === void 0) { radiusRange = 1; } + if (direction1 === void 0) { direction1 = new BABYLON.Vector3(0, 1, 0); } + if (direction2 === void 0) { direction2 = new BABYLON.Vector3(0, 1, 0); } + var _this = _super.call(this, radius, height, radiusRange) || this; + _this.direction1 = direction1; + _this.direction2 = direction2; + return _this; + } + /** + * Called by the particle System when the direction is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param directionToUpdate is the direction vector to update with the result + * @param particle is the particle we are computed the direction for + */ + CylinderDirectedParticleEmitter.prototype.startDirectionFunction = function (worldMatrix, directionToUpdate, particle) { + var randX = BABYLON.Scalar.RandomRange(this.direction1.x, this.direction2.x); + var randY = BABYLON.Scalar.RandomRange(this.direction1.y, this.direction2.y); + var randZ = BABYLON.Scalar.RandomRange(this.direction1.z, this.direction2.z); + BABYLON.Vector3.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate); + }; + /** + * Clones the current emitter and returns a copy of it + * @returns the new emitter + */ + CylinderDirectedParticleEmitter.prototype.clone = function () { + var newOne = new CylinderDirectedParticleEmitter(this.radius, this.height, this.radiusRange, this.direction1, this.direction2); + BABYLON.Tools.DeepCopy(this, newOne); + return newOne; + }; + /** + * Called by the GPUParticleSystem to setup the update shader + * @param effect defines the update shader + */ + CylinderDirectedParticleEmitter.prototype.applyToShader = function (effect) { + effect.setFloat("radius", this.radius); + effect.setFloat("height", this.height); + effect.setFloat("radiusRange", this.radiusRange); + effect.setVector3("direction1", this.direction1); + effect.setVector3("direction2", this.direction2); + }; + /** + * Returns a string to use to update the GPU particles update shader + * @returns a string containng the defines string + */ + CylinderDirectedParticleEmitter.prototype.getEffectDefines = function () { + return "#define CYLINDEREMITTER\n#define DIRECTEDCYLINDEREMITTER"; + }; + /** + * Returns the string "CylinderDirectedParticleEmitter" + * @returns a string containing the class name + */ + CylinderDirectedParticleEmitter.prototype.getClassName = function () { + return "CylinderDirectedParticleEmitter"; + }; + /** + * Serializes the particle system to a JSON object. + * @returns the JSON object + */ + CylinderDirectedParticleEmitter.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.direction1 = this.direction1.asArray(); + serializationObject.direction2 = this.direction2.asArray(); + return serializationObject; + }; + /** + * Parse properties from a JSON object + * @param serializationObject defines the JSON object + */ + CylinderDirectedParticleEmitter.prototype.parse = function (serializationObject) { + _super.prototype.parse.call(this, serializationObject); + this.direction1.copyFrom(serializationObject.direction1); + this.direction2.copyFrom(serializationObject.direction2); + }; + return CylinderDirectedParticleEmitter; + }(CylinderParticleEmitter)); + BABYLON.CylinderDirectedParticleEmitter = CylinderDirectedParticleEmitter; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.cylinderParticleEmitter.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Particle emitter emitting particles from the inside of a cone. + * It emits the particles alongside the cone volume from the base to the particle. + * The emission direction might be randomized. + */ + var ConeParticleEmitter = /** @class */ (function () { + /** + * Creates a new instance ConeParticleEmitter + * @param radius the radius of the emission cone (1 by default) + * @param angles the cone base angle (PI by default) + * @param directionRandomizer defines how much to randomize the particle direction [0-1] (default is 0) + */ + function ConeParticleEmitter(radius, angle, + /** defines how much to randomize the particle direction [0-1] (default is 0) */ + directionRandomizer) { + if (radius === void 0) { radius = 1; } + if (angle === void 0) { angle = Math.PI; } + if (directionRandomizer === void 0) { directionRandomizer = 0; } + this.directionRandomizer = directionRandomizer; + /** + * Gets or sets a value indicating where on the radius the start position should be picked (1 = everywhere, 0 = only surface) + */ + this.radiusRange = 1; + /** + * Gets or sets a value indicating where on the height the start position should be picked (1 = everywhere, 0 = only surface) + */ + this.heightRange = 1; + /** + * Gets or sets a value indicating if all the particles should be emitted from the spawn point only (the base of the cone) + */ + this.emitFromSpawnPointOnly = false; + this.angle = angle; + this.radius = radius; + } + Object.defineProperty(ConeParticleEmitter.prototype, "radius", { + /** + * Gets or sets the radius of the emission cone + */ + get: function () { + return this._radius; + }, + set: function (value) { + this._radius = value; + this._buildHeight(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ConeParticleEmitter.prototype, "angle", { + /** + * Gets or sets the angle of the emission cone + */ + get: function () { + return this._angle; + }, + set: function (value) { + this._angle = value; + this._buildHeight(); + }, + enumerable: true, + configurable: true + }); + ConeParticleEmitter.prototype._buildHeight = function () { + if (this._angle !== 0) { + this._height = this._radius / Math.tan(this._angle / 2); + } + else { + this._height = 1; + } + }; + /** + * Called by the particle System when the direction is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param directionToUpdate is the direction vector to update with the result + * @param particle is the particle we are computed the direction for + */ + ConeParticleEmitter.prototype.startDirectionFunction = function (worldMatrix, directionToUpdate, particle) { + if (Math.abs(Math.cos(this._angle)) === 1.0) { + BABYLON.Vector3.TransformNormalFromFloatsToRef(0, 1.0, 0, worldMatrix, directionToUpdate); + } + else { + // measure the direction Vector from the emitter to the particle. + var direction = particle.position.subtract(worldMatrix.getTranslation()).normalize(); + var randX = BABYLON.Scalar.RandomRange(0, this.directionRandomizer); + var randY = BABYLON.Scalar.RandomRange(0, this.directionRandomizer); + var randZ = BABYLON.Scalar.RandomRange(0, this.directionRandomizer); + direction.x += randX; + direction.y += randY; + direction.z += randZ; + direction.normalize(); + BABYLON.Vector3.TransformNormalFromFloatsToRef(direction.x, direction.y, direction.z, worldMatrix, directionToUpdate); + } + }; + /** + * Called by the particle System when the position is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param positionToUpdate is the position vector to update with the result + * @param particle is the particle we are computed the position for + */ + ConeParticleEmitter.prototype.startPositionFunction = function (worldMatrix, positionToUpdate, particle) { + var s = BABYLON.Scalar.RandomRange(0, Math.PI * 2); + var h; + if (!this.emitFromSpawnPointOnly) { + h = BABYLON.Scalar.RandomRange(0, this.heightRange); + // Better distribution in a cone at normal angles. + h = 1 - h * h; + } + else { + h = 0.0001; + } + var radius = this._radius - BABYLON.Scalar.RandomRange(0, this._radius * this.radiusRange); + radius = radius * h; + var randX = radius * Math.sin(s); + var randZ = radius * Math.cos(s); + var randY = h * this._height; + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate); + }; + /** + * Clones the current emitter and returns a copy of it + * @returns the new emitter + */ + ConeParticleEmitter.prototype.clone = function () { + var newOne = new ConeParticleEmitter(this._radius, this._angle, this.directionRandomizer); + BABYLON.Tools.DeepCopy(this, newOne); + return newOne; + }; + /** + * Called by the GPUParticleSystem to setup the update shader + * @param effect defines the update shader + */ + ConeParticleEmitter.prototype.applyToShader = function (effect) { + effect.setFloat2("radius", this._radius, this.radiusRange); + effect.setFloat("coneAngle", this._angle); + effect.setFloat2("height", this._height, this.heightRange); + effect.setFloat("directionRandomizer", this.directionRandomizer); + }; + /** + * Returns a string to use to update the GPU particles update shader + * @returns a string containng the defines string + */ + ConeParticleEmitter.prototype.getEffectDefines = function () { + var defines = "#define CONEEMITTER"; + if (this.emitFromSpawnPointOnly) { + defines += "\n#define CONEEMITTERSPAWNPOINT"; + } + return defines; + }; + /** + * Returns the string "ConeParticleEmitter" + * @returns a string containing the class name + */ + ConeParticleEmitter.prototype.getClassName = function () { + return "ConeParticleEmitter"; + }; + /** + * Serializes the particle system to a JSON object. + * @returns the JSON object + */ + ConeParticleEmitter.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.type = this.getClassName(); + serializationObject.radius = this._radius; + serializationObject.angle = this._angle; + serializationObject.directionRandomizer = this.directionRandomizer; + return serializationObject; + }; + /** + * Parse properties from a JSON object + * @param serializationObject defines the JSON object + */ + ConeParticleEmitter.prototype.parse = function (serializationObject) { + this.radius = serializationObject.radius; + this.angle = serializationObject.angle; + this.directionRandomizer = serializationObject.directionRandomizer; + }; + return ConeParticleEmitter; + }()); + BABYLON.ConeParticleEmitter = ConeParticleEmitter; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.coneParticleEmitter.js.map + + +var BABYLON; +(function (BABYLON) { + /** + * Particle emitter emitting particles from the inside of a sphere. + * It emits the particles alongside the sphere radius. The emission direction might be randomized. + */ + var SphereParticleEmitter = /** @class */ (function () { + /** + * Creates a new instance SphereParticleEmitter + * @param radius the radius of the emission sphere (1 by default) + * @param radiusRange the range of the emission sphere [0-1] 0 Surface only, 1 Entire Radius (1 by default) + * @param directionRandomizer defines how much to randomize the particle direction [0-1] + */ + function SphereParticleEmitter( + /** + * The radius of the emission sphere. + */ + radius, + /** + * The range of emission [0-1] 0 Surface only, 1 Entire Radius. + */ + radiusRange, + /** + * How much to randomize the particle direction [0-1]. + */ + directionRandomizer) { + if (radius === void 0) { radius = 1; } + if (radiusRange === void 0) { radiusRange = 1; } + if (directionRandomizer === void 0) { directionRandomizer = 0; } + this.radius = radius; + this.radiusRange = radiusRange; + this.directionRandomizer = directionRandomizer; + } + /** + * Called by the particle System when the direction is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param directionToUpdate is the direction vector to update with the result + * @param particle is the particle we are computed the direction for + */ + SphereParticleEmitter.prototype.startDirectionFunction = function (worldMatrix, directionToUpdate, particle) { + var direction = particle.position.subtract(worldMatrix.getTranslation()).normalize(); + var randX = BABYLON.Scalar.RandomRange(0, this.directionRandomizer); + var randY = BABYLON.Scalar.RandomRange(0, this.directionRandomizer); + var randZ = BABYLON.Scalar.RandomRange(0, this.directionRandomizer); + direction.x += randX; + direction.y += randY; + direction.z += randZ; + direction.normalize(); + BABYLON.Vector3.TransformNormalFromFloatsToRef(direction.x, direction.y, direction.z, worldMatrix, directionToUpdate); + }; + /** + * Called by the particle System when the position is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param positionToUpdate is the position vector to update with the result + * @param particle is the particle we are computed the position for + */ + SphereParticleEmitter.prototype.startPositionFunction = function (worldMatrix, positionToUpdate, particle) { + var randRadius = this.radius - BABYLON.Scalar.RandomRange(0, this.radius * this.radiusRange); + var v = BABYLON.Scalar.RandomRange(0, 1.0); + var phi = BABYLON.Scalar.RandomRange(0, 2 * Math.PI); + var theta = Math.acos(2 * v - 1); + var randX = randRadius * Math.cos(phi) * Math.sin(theta); + var randY = randRadius * Math.cos(theta); + var randZ = randRadius * Math.sin(phi) * Math.sin(theta); + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate); + }; + /** + * Clones the current emitter and returns a copy of it + * @returns the new emitter + */ + SphereParticleEmitter.prototype.clone = function () { + var newOne = new SphereParticleEmitter(this.radius, this.directionRandomizer); + BABYLON.Tools.DeepCopy(this, newOne); + return newOne; + }; + /** + * Called by the GPUParticleSystem to setup the update shader + * @param effect defines the update shader + */ + SphereParticleEmitter.prototype.applyToShader = function (effect) { + effect.setFloat("radius", this.radius); + effect.setFloat("radiusRange", this.radiusRange); + effect.setFloat("directionRandomizer", this.directionRandomizer); + }; + /** + * Returns a string to use to update the GPU particles update shader + * @returns a string containng the defines string + */ + SphereParticleEmitter.prototype.getEffectDefines = function () { + return "#define SPHEREEMITTER"; + }; + /** + * Returns the string "SphereParticleEmitter" + * @returns a string containing the class name + */ + SphereParticleEmitter.prototype.getClassName = function () { + return "SphereParticleEmitter"; + }; + /** + * Serializes the particle system to a JSON object. + * @returns the JSON object + */ + SphereParticleEmitter.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.type = this.getClassName(); + serializationObject.radius = this.radius; + serializationObject.radiusRange = this.radiusRange; + serializationObject.directionRandomizer = this.directionRandomizer; + return serializationObject; + }; + /** + * Parse properties from a JSON object + * @param serializationObject defines the JSON object + */ + SphereParticleEmitter.prototype.parse = function (serializationObject) { + this.radius = serializationObject.radius; + this.radiusRange = serializationObject.radiusRange; + this.directionRandomizer = serializationObject.directionRandomizer; + }; + return SphereParticleEmitter; + }()); + BABYLON.SphereParticleEmitter = SphereParticleEmitter; + /** + * Particle emitter emitting particles from the inside of a sphere. + * It emits the particles randomly between two vectors. + */ + var SphereDirectedParticleEmitter = /** @class */ (function (_super) { + __extends(SphereDirectedParticleEmitter, _super); + /** + * Creates a new instance SphereDirectedParticleEmitter + * @param radius the radius of the emission sphere (1 by default) + * @param direction1 the min limit of the emission direction (up vector by default) + * @param direction2 the max limit of the emission direction (up vector by default) + */ + function SphereDirectedParticleEmitter(radius, + /** + * The min limit of the emission direction. + */ + direction1, + /** + * The max limit of the emission direction. + */ + direction2) { + if (radius === void 0) { radius = 1; } + if (direction1 === void 0) { direction1 = new BABYLON.Vector3(0, 1, 0); } + if (direction2 === void 0) { direction2 = new BABYLON.Vector3(0, 1, 0); } + var _this = _super.call(this, radius) || this; + _this.direction1 = direction1; + _this.direction2 = direction2; + return _this; + } + /** + * Called by the particle System when the direction is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param directionToUpdate is the direction vector to update with the result + * @param particle is the particle we are computed the direction for + */ + SphereDirectedParticleEmitter.prototype.startDirectionFunction = function (worldMatrix, directionToUpdate, particle) { + var randX = BABYLON.Scalar.RandomRange(this.direction1.x, this.direction2.x); + var randY = BABYLON.Scalar.RandomRange(this.direction1.y, this.direction2.y); + var randZ = BABYLON.Scalar.RandomRange(this.direction1.z, this.direction2.z); + BABYLON.Vector3.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate); + }; + /** + * Clones the current emitter and returns a copy of it + * @returns the new emitter + */ + SphereDirectedParticleEmitter.prototype.clone = function () { + var newOne = new SphereDirectedParticleEmitter(this.radius, this.direction1, this.direction2); + BABYLON.Tools.DeepCopy(this, newOne); + return newOne; + }; + /** + * Called by the GPUParticleSystem to setup the update shader + * @param effect defines the update shader + */ + SphereDirectedParticleEmitter.prototype.applyToShader = function (effect) { + effect.setFloat("radius", this.radius); + effect.setFloat("radiusRange", this.radiusRange); + effect.setVector3("direction1", this.direction1); + effect.setVector3("direction2", this.direction2); + }; + /** + * Returns a string to use to update the GPU particles update shader + * @returns a string containng the defines string + */ + SphereDirectedParticleEmitter.prototype.getEffectDefines = function () { + return "#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER"; + }; + /** + * Returns the string "SphereDirectedParticleEmitter" + * @returns a string containing the class name + */ + SphereDirectedParticleEmitter.prototype.getClassName = function () { + return "SphereDirectedParticleEmitter"; + }; + /** + * Serializes the particle system to a JSON object. + * @returns the JSON object + */ + SphereDirectedParticleEmitter.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.direction1 = this.direction1.asArray(); + serializationObject.direction2 = this.direction2.asArray(); + return serializationObject; + }; + /** + * Parse properties from a JSON object + * @param serializationObject defines the JSON object + */ + SphereDirectedParticleEmitter.prototype.parse = function (serializationObject) { + _super.prototype.parse.call(this, serializationObject); + this.direction1.copyFrom(serializationObject.direction1); + this.direction2.copyFrom(serializationObject.direction2); + }; + return SphereDirectedParticleEmitter; + }(SphereParticleEmitter)); + BABYLON.SphereDirectedParticleEmitter = SphereDirectedParticleEmitter; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.sphereParticleEmitter.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Particle emitter emitting particles from the inside of a hemisphere. + * It emits the particles alongside the hemisphere radius. The emission direction might be randomized. + */ + var HemisphericParticleEmitter = /** @class */ (function () { + /** + * Creates a new instance HemisphericParticleEmitter + * @param radius the radius of the emission hemisphere (1 by default) + * @param radiusRange the range of the emission hemisphere [0-1] 0 Surface only, 1 Entire Radius (1 by default) + * @param directionRandomizer defines how much to randomize the particle direction [0-1] + */ + function HemisphericParticleEmitter( + /** + * The radius of the emission hemisphere. + */ + radius, + /** + * The range of emission [0-1] 0 Surface only, 1 Entire Radius. + */ + radiusRange, + /** + * How much to randomize the particle direction [0-1]. + */ + directionRandomizer) { + if (radius === void 0) { radius = 1; } + if (radiusRange === void 0) { radiusRange = 1; } + if (directionRandomizer === void 0) { directionRandomizer = 0; } + this.radius = radius; + this.radiusRange = radiusRange; + this.directionRandomizer = directionRandomizer; + } + /** + * Called by the particle System when the direction is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param directionToUpdate is the direction vector to update with the result + * @param particle is the particle we are computed the direction for + */ + HemisphericParticleEmitter.prototype.startDirectionFunction = function (worldMatrix, directionToUpdate, particle) { + var direction = particle.position.subtract(worldMatrix.getTranslation()).normalize(); + var randX = BABYLON.Scalar.RandomRange(0, this.directionRandomizer); + var randY = BABYLON.Scalar.RandomRange(0, this.directionRandomizer); + var randZ = BABYLON.Scalar.RandomRange(0, this.directionRandomizer); + direction.x += randX; + direction.y += randY; + direction.z += randZ; + direction.normalize(); + BABYLON.Vector3.TransformNormalFromFloatsToRef(direction.x, direction.y, direction.z, worldMatrix, directionToUpdate); + }; + /** + * Called by the particle System when the position is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param positionToUpdate is the position vector to update with the result + * @param particle is the particle we are computed the position for + */ + HemisphericParticleEmitter.prototype.startPositionFunction = function (worldMatrix, positionToUpdate, particle) { + var randRadius = this.radius - BABYLON.Scalar.RandomRange(0, this.radius * this.radiusRange); + var v = BABYLON.Scalar.RandomRange(0, 1.0); + var phi = BABYLON.Scalar.RandomRange(0, 2 * Math.PI); + var theta = Math.acos(2 * v - 1); + var randX = randRadius * Math.cos(phi) * Math.sin(theta); + var randY = randRadius * Math.cos(theta); + var randZ = randRadius * Math.sin(phi) * Math.sin(theta); + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(randX, Math.abs(randY), randZ, worldMatrix, positionToUpdate); + }; + /** + * Clones the current emitter and returns a copy of it + * @returns the new emitter + */ + HemisphericParticleEmitter.prototype.clone = function () { + var newOne = new HemisphericParticleEmitter(this.radius, this.directionRandomizer); + BABYLON.Tools.DeepCopy(this, newOne); + return newOne; + }; + /** + * Called by the GPUParticleSystem to setup the update shader + * @param effect defines the update shader + */ + HemisphericParticleEmitter.prototype.applyToShader = function (effect) { + effect.setFloat("radius", this.radius); + effect.setFloat("radiusRange", this.radiusRange); + effect.setFloat("directionRandomizer", this.directionRandomizer); + }; + /** + * Returns a string to use to update the GPU particles update shader + * @returns a string containng the defines string + */ + HemisphericParticleEmitter.prototype.getEffectDefines = function () { + return "#define HEMISPHERICEMITTER"; + }; + /** + * Returns the string "HemisphericParticleEmitter" + * @returns a string containing the class name + */ + HemisphericParticleEmitter.prototype.getClassName = function () { + return "HemisphericParticleEmitter"; + }; + /** + * Serializes the particle system to a JSON object. + * @returns the JSON object + */ + HemisphericParticleEmitter.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.type = this.getClassName(); + serializationObject.radius = this.radius; + serializationObject.radiusRange = this.radiusRange; + serializationObject.directionRandomizer = this.directionRandomizer; + return serializationObject; + }; + /** + * Parse properties from a JSON object + * @param serializationObject defines the JSON object + */ + HemisphericParticleEmitter.prototype.parse = function (serializationObject) { + this.radius = serializationObject.radius; + this.radiusRange = serializationObject.radiusRange; + this.directionRandomizer = serializationObject.directionRandomizer; + }; + return HemisphericParticleEmitter; + }()); + BABYLON.HemisphericParticleEmitter = HemisphericParticleEmitter; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.hemisphericParticleEmitter.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Particle emitter emitting particles from a point. + * It emits the particles randomly between 2 given directions. + */ + var PointParticleEmitter = /** @class */ (function () { + /** + * Creates a new instance PointParticleEmitter + */ + function PointParticleEmitter() { + /** + * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors. + */ + this.direction1 = new BABYLON.Vector3(0, 1.0, 0); + /** + * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors. + */ + this.direction2 = new BABYLON.Vector3(0, 1.0, 0); + } + /** + * Called by the particle System when the direction is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param directionToUpdate is the direction vector to update with the result + * @param particle is the particle we are computed the direction for + */ + PointParticleEmitter.prototype.startDirectionFunction = function (worldMatrix, directionToUpdate, particle) { + var randX = BABYLON.Scalar.RandomRange(this.direction1.x, this.direction2.x); + var randY = BABYLON.Scalar.RandomRange(this.direction1.y, this.direction2.y); + var randZ = BABYLON.Scalar.RandomRange(this.direction1.z, this.direction2.z); + BABYLON.Vector3.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate); + }; + /** + * Called by the particle System when the position is computed for the created particle. + * @param worldMatrix is the world matrix of the particle system + * @param positionToUpdate is the position vector to update with the result + * @param particle is the particle we are computed the position for + */ + PointParticleEmitter.prototype.startPositionFunction = function (worldMatrix, positionToUpdate, particle) { + BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(0, 0, 0, worldMatrix, positionToUpdate); + }; + /** + * Clones the current emitter and returns a copy of it + * @returns the new emitter + */ + PointParticleEmitter.prototype.clone = function () { + var newOne = new PointParticleEmitter(); + BABYLON.Tools.DeepCopy(this, newOne); + return newOne; + }; + /** + * Called by the GPUParticleSystem to setup the update shader + * @param effect defines the update shader + */ + PointParticleEmitter.prototype.applyToShader = function (effect) { + effect.setVector3("direction1", this.direction1); + effect.setVector3("direction2", this.direction2); + }; + /** + * Returns a string to use to update the GPU particles update shader + * @returns a string containng the defines string + */ + PointParticleEmitter.prototype.getEffectDefines = function () { + return "#define POINTEMITTER"; + }; + /** + * Returns the string "PointParticleEmitter" + * @returns a string containing the class name + */ + PointParticleEmitter.prototype.getClassName = function () { + return "PointParticleEmitter"; + }; + /** + * Serializes the particle system to a JSON object. + * @returns the JSON object + */ + PointParticleEmitter.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.type = this.getClassName(); + serializationObject.direction1 = this.direction1.asArray(); + serializationObject.direction2 = this.direction2.asArray(); + return serializationObject; + }; + /** + * Parse properties from a JSON object + * @param serializationObject defines the JSON object + */ + PointParticleEmitter.prototype.parse = function (serializationObject) { + BABYLON.Vector3.FromArrayToRef(serializationObject.direction1, 0, this.direction1); + BABYLON.Vector3.FromArrayToRef(serializationObject.direction2, 0, this.direction2); + }; + return PointParticleEmitter; + }()); + BABYLON.PointParticleEmitter = PointParticleEmitter; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.pointParticleEmitter.js.map + +var BABYLON; +(function (BABYLON) { + // Adds the parsers to the scene parsers. + BABYLON.AbstractScene.AddParser(BABYLON.SceneComponentConstants.NAME_PARTICLESYSTEM, function (parsedData, scene, container, rootUrl) { + var individualParser = BABYLON.AbstractScene.GetIndividualParser(BABYLON.SceneComponentConstants.NAME_PARTICLESYSTEM); + if (!individualParser) { + return; + } + // Particles Systems + if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) { + for (var index = 0, cache = parsedData.particleSystems.length; index < cache; index++) { + var parsedParticleSystem = parsedData.particleSystems[index]; + container.particleSystems.push(individualParser(parsedParticleSystem, scene, rootUrl)); + } + } + }); + BABYLON.AbstractScene.AddIndividualParser(BABYLON.SceneComponentConstants.NAME_PARTICLESYSTEM, function (parsedParticleSystem, scene, rootUrl) { + if (parsedParticleSystem.activeParticleCount) { + var ps = BABYLON.GPUParticleSystem.Parse(parsedParticleSystem, scene, rootUrl); + return ps; + } + else { + var ps = BABYLON.ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl); + return ps; + } + }); + BABYLON.Engine.prototype.createEffectForParticles = function (fragmentName, uniformsNames, samplers, defines, fallbacks, onCompiled, onError) { + if (uniformsNames === void 0) { uniformsNames = []; } + if (samplers === void 0) { samplers = []; } + if (defines === void 0) { defines = ""; } + var attributesNamesOrOptions = BABYLON.ParticleSystem._GetAttributeNamesOrOptions(); + var effectCreationOption = BABYLON.ParticleSystem._GetEffectCreationOptions(); + if (defines.indexOf(" BILLBOARD") === -1) { + defines += "\n#define BILLBOARD\n"; + } + if (samplers.indexOf("diffuseSampler") === -1) { + samplers.push("diffuseSampler"); + } + return this.createEffect({ + vertex: "particles", + fragmentElement: fragmentName + }, attributesNamesOrOptions, effectCreationOption.concat(uniformsNames), samplers, defines, fallbacks, onCompiled, onError); + }; + BABYLON.Mesh.prototype.getEmittedParticleSystems = function () { + var results = new Array(); + for (var index = 0; index < this.getScene().particleSystems.length; index++) { + var particleSystem = this.getScene().particleSystems[index]; + if (particleSystem.emitter === this) { + results.push(particleSystem); + } + } + return results; + }; + BABYLON.Mesh.prototype.getHierarchyEmittedParticleSystems = function () { + var results = new Array(); + var descendants = this.getDescendants(); + descendants.push(this); + for (var index = 0; index < this.getScene().particleSystems.length; index++) { + var particleSystem = this.getScene().particleSystems[index]; + var emitter = particleSystem.emitter; + if (emitter.position && descendants.indexOf(emitter) !== -1) { + results.push(particleSystem); + } + } + return results; + }; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.particleSystemComponent.js.map + +var BABYLON; +(function (BABYLON) { + /** + * Type of sub emitter + */ + var SubEmitterType; + (function (SubEmitterType) { + /** + * Attached to the particle over it's lifetime + */ + SubEmitterType[SubEmitterType["ATTACHED"] = 0] = "ATTACHED"; + /** + * Created when the particle dies + */ + SubEmitterType[SubEmitterType["END"] = 1] = "END"; + })(SubEmitterType = BABYLON.SubEmitterType || (BABYLON.SubEmitterType = {})); + /** + * Sub emitter class used to emit particles from an existing particle + */ + var SubEmitter = /** @class */ (function () { + /** + * Creates a sub emitter + * @param particleSystem the particle system to be used by the sub emitter + */ + function SubEmitter( + /** + * the particle system to be used by the sub emitter + */ + particleSystem) { + this.particleSystem = particleSystem; + /** + * Type of the submitter (Default: END) + */ + this.type = SubEmitterType.END; + /** + * If the particle should inherit the direction from the particle it's attached to. (+Y will face the direction the particle is moving) (Default: false) + * Note: This only is supported when using an emitter of type Mesh + */ + this.inheritDirection = false; + /** + * How much of the attached particles speed should be added to the sub emitted particle (default: 0) + */ + this.inheritedVelocityAmount = 0; + // Create mesh as emitter to support rotation + if (!particleSystem.emitter || !particleSystem.emitter.dispose) { + particleSystem.emitter = new BABYLON.AbstractMesh("SubemitterSystemEmitter", particleSystem.getScene()); + } + // Automatically dispose of subemitter when system is disposed + particleSystem.onDisposeObservable.add(function () { + if (particleSystem.emitter && particleSystem.emitter.dispose) { + particleSystem.emitter.dispose(); + } + }); + } + /** + * Clones the sub emitter + * @returns the cloned sub emitter + */ + SubEmitter.prototype.clone = function () { + // Clone particle system + var emitter = this.particleSystem.emitter; + if (!emitter) { + emitter = new BABYLON.Vector3(); + } + else if (emitter instanceof BABYLON.Vector3) { + emitter = emitter.clone(); + } + else if (emitter instanceof BABYLON.AbstractMesh) { + emitter = new BABYLON.Mesh("", emitter.getScene()); + emitter.isVisible = false; + } + var clone = new SubEmitter(this.particleSystem.clone("", emitter)); + // Clone properties + clone.type = this.type; + clone.inheritDirection = this.inheritDirection; + clone.inheritedVelocityAmount = this.inheritedVelocityAmount; + clone.particleSystem._disposeEmitterOnDispose = true; + clone.particleSystem.disposeOnStop = true; + return clone; + }; + /** + * Serialize current object to a JSON object + * @returns the serialized object + */ + SubEmitter.prototype.serialize = function () { + var serializationObject = {}; + serializationObject.type = this.type; + serializationObject.inheritDirection = this.inheritDirection; + serializationObject.inheritedVelocityAmount = this.inheritedVelocityAmount; + serializationObject.particleSystem = this.particleSystem.serialize(); + return serializationObject; + }; + /** + * Creates a new SubEmitter from a serialized JSON version + * @param serializationObject defines the JSON object to read from + * @param scene defines the hosting scene + * @param rootUrl defines the rootUrl for data loading + * @returns a new SubEmitter + */ + SubEmitter.Parse = function (serializationObject, scene, rootUrl) { + var system = serializationObject.particleSystem; + var subEmitter = new SubEmitter(BABYLON.ParticleSystem.Parse(system, scene, rootUrl)); + subEmitter.type = serializationObject.type; + subEmitter.inheritDirection = serializationObject.inheritDirection; + subEmitter.inheritedVelocityAmount = serializationObject.inheritedVelocityAmount; + subEmitter.particleSystem._isSubEmitter = true; + return subEmitter; + }; + /** Release associated resources */ + SubEmitter.prototype.dispose = function () { + this.particleSystem.dispose(); + }; + return SubEmitter; + }()); + BABYLON.SubEmitter = SubEmitter; +})(BABYLON || (BABYLON = {})); + +//# sourceMappingURL=babylon.subEmitter.js.map + + + + + + + +var BABYLON; +(function (BABYLON) { + /** + * The ShaderMaterial object has the necessary methods to pass data from your scene to the Vertex and Fragment Shaders and returns a material that can be applied to any mesh. + * + * This returned material effects how the mesh will look based on the code in the shaders. + * + * @see http://doc.babylonjs.com/how_to/shader_material + */ + var ShaderMaterial = /** @class */ (function (_super) { + __extends(ShaderMaterial, _super); + /** + * Instantiate a new shader material. + * The ShaderMaterial object has the necessary methods to pass data from your scene to the Vertex and Fragment Shaders and returns a material that can be applied to any mesh. + * This returned material effects how the mesh will look based on the code in the shaders. + * @see http://doc.babylonjs.com/how_to/shader_material + * @param name Define the name of the material in the scene + * @param scene Define the scene the material belongs to + * @param shaderPath Defines the route to the shader code in one of three ways: + * - object - { vertex: "custom", fragment: "custom" }, used with BABYLON.Effect.ShadersStore["customVertexShader"] and BABYLON.Effect.ShadersStore["customFragmentShader"] + * - object - { vertexElement: "vertexShaderCode", fragmentElement: "fragmentShaderCode" }, used with shader code in + + + + + + +
+ + +
+ + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.UWP/html/spherical.css b/Source/Sketch360.XPlat.UWP/html/spherical.css new file mode 100644 index 0000000..8ace549 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/html/spherical.css @@ -0,0 +1,14 @@ +html, body, main { + overflow: hidden; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + background-color: white; +} + +#renderCanvas { + width: 100%; + height: 100%; + touch-action: none; +} diff --git a/Source/Sketch360.XPlat.UWP/html/spherical.gui.js b/Source/Sketch360.XPlat.UWP/html/spherical.gui.js new file mode 100644 index 0000000..0fb7ac2 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/html/spherical.gui.js @@ -0,0 +1,232 @@ +"use strict"; + +var sphericalGui = (function () { + + var _isVrCamera = false; + var _vrCamera = null; + var _camera = null; + + var addUI = function(scene, camera) { + _vrCamera = scene.activeCamera; + _camera = camera; + + var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI"); + + var panel = new BABYLON.GUI.StackPanel(); + panel.adaptHeightToChildren = true; + panel.adaptWidthToChildren = true; + panel.background = "gray"; + panel.top = "16px"; + panel.left = "-16px"; + + panel.isVertical = false; + panel.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; + panel.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; + advancedTexture.addControl(panel); + + var button = BABYLON.GUI.Button.CreateImageButton("but", "Tilt & rotate", "TiltRotate.png"); + button.color="white"; + button.width = "138px"; + button.height = "40px"; + button.onPointerClickObservable.add(function (value) { + if (_isVrCamera) { + scene.activeCamera = _camera; + panel.background="gray"; + } else { + scene.activeCamera = _vrCamera; + panel.background = "black"; + } + _isVrCamera = !_isVrCamera; + + resetPointerDownCount(); + }); + + panel.addControl(button); + }; + + var addSphericalPanningCameraToScene = function (scene, canvas) { + // Set cursor to grab. + scene.defaultCursor = "grab"; + + // Add the actual camera to the scene. Since we are going to be controlling it manually, + // we don't attach any inputs directly to it. + // NOTE: We position the camera at origin in this case, but it doesn't have to be there. + // Spherical panning should work just fine regardless of the camera's position. + var camera = new BABYLON.FreeCamera("camera", BABYLON.Vector3.Zero(), scene); + + // Ensure the camera's rotation quaternion is initialized correctly. + camera.rotationQuaternion = BABYLON.Quaternion.Identity(); + + // The spherical panning math has singularities at the poles (up and down) that cause + // the orientation to seem to "flip." This is undesirable, so this method helps reject + // inputs that would cause this behavior. + var isNewForwardVectorTooCloseToSingularity = v => { + const TOO_CLOSE_TO_UP_THRESHOLD = 0.99; + return Math.abs(BABYLON.Vector3.Dot(v, BABYLON.Vector3.Up())) > TOO_CLOSE_TO_UP_THRESHOLD; + }; + + // Local state variables which will be used in the spherical pan method; declared outside + // because they must persist from frame to frame. + var ptrX = 0; + var ptrY = 0; + var inertiaX = 0; + var inertiaY = 0; + + // Variables internal to spherical pan, declared here just to avoid reallocating them when + // running. + var priorDir = new BABYLON.Vector3(); + var currentDir = new BABYLON.Vector3(); + var rotationAxis = new BABYLON.Vector3(); + var rotationAngle = 0; + var rotation = new BABYLON.Quaternion(); + var newForward = new BABYLON.Vector3(); + var newRight = new BABYLON.Vector3(); + var newUp = new BABYLON.Vector3(); + var matrix = new BABYLON.Matrix.Identity(); + + // The core pan method. + // Intuition: there exists a rotation of the camera that brings priorDir to currentDir. + // By concatenating this rotation with the existing rotation of the camera, we can move + // the camera so that the cursor appears to remain over the same point in the scene, + // creating the feeling of smooth and responsive 1-to-1 motion. + var pan = (currX, currY) => { + // Helper method to convert a screen point (in pixels) to a direction in view space. + var getPointerViewSpaceDirectionToRef = (x, y, ref) => { + BABYLON.Vector3.UnprojectToRef( + new BABYLON.Vector3(x, y, 0), + canvas.width, + canvas.height, + BABYLON.Matrix.Identity(), + BABYLON.Matrix.Identity(), + camera.getProjectionMatrix(), + ref); + ref.normalize(); + }; + + // Helper method that computes the new forward direction. This was split into its own + // function because, near the singularity, we may to do this twice in a single frame + // in order to reject inputs that would bring the forward vector too close to vertical. + var computeNewForward = (x, y) => { + getPointerViewSpaceDirectionToRef(ptrX, ptrY, priorDir); + getPointerViewSpaceDirectionToRef(x, y, currentDir); + + BABYLON.Vector3.CrossToRef(priorDir, currentDir, rotationAxis); + + // If the magnitude of the cross-product is zero, then the cursor has not moved + // since the prior frame and there is no need to do anything. + if (rotationAxis.lengthSquared() > 0) { + rotationAngle = BABYLON.Vector3.GetAngleBetweenVectors(priorDir, currentDir, rotationAxis); + BABYLON.Quaternion.RotationAxisToRef(rotationAxis, -rotationAngle, rotation); + + // Order matters here. We create the new forward vector by applying the new rotation + // first, then apply the camera's existing rotation. This is because, since the new + // rotation is computed in view space, it only makes sense for a camera that is + // facing forward. + newForward.set(0, 0, 1); + newForward.rotateByQuaternionToRef(rotation, newForward); + newForward.rotateByQuaternionToRef(camera.rotationQuaternion, newForward); + + return !isNewForwardVectorTooCloseToSingularity(newForward); + } + + return false; + }; + + // Compute the new forward vector first using the actual input, both X and Y. If this results + // in a forward vector that would be too close to the singularity, recompute using only the + // new X input, repeating the Y input from the prior frame. If either of these computations + // succeeds, construct the new rotation matrix using the result. + if (computeNewForward(currX, currY) || computeNewForward(currX, ptrY)) { + // We manually compute the new right and up vectors to ensure that the camera + // only has pitch and yaw, never roll. This dependency on the world-space + // vertical axis is what causes the singularity described above. + BABYLON.Vector3.CrossToRef(BABYLON.Vector3.Up(), newForward, newRight); + BABYLON.Vector3.CrossToRef(newForward, newRight, newUp); + + // Create the new world-space rotation matrix from the computed forward, right, + // and up vectors. + matrix.setRowFromFloats(0, newRight.x, newRight.y, newRight.z, 0); + matrix.setRowFromFloats(1, newUp.x, newUp.y, newUp.z, 0); + matrix.setRowFromFloats(2, newForward.x, newForward.y, newForward.z, 0); + + BABYLON.Quaternion.FromRotationMatrixToRef(matrix.getRotationMatrix(), camera.rotationQuaternion); + } + }; + + // The main panning loop, to be run while the pointer is down. + var sphericalPan = () => { + pan(scene.pointerX, scene.pointerY); + + // Store the state variables for use in the next frame. + inertiaX = scene.pointerX - ptrX; + inertiaY = scene.pointerY - ptrY; + ptrX = scene.pointerX; + ptrY = scene.pointerY; + }; + + // The inertial panning loop, to be run after the pointer is released until inertia + // runs out, or until the pointer goes down again, whichever happens first. Essentially + // just pretends to provide a decreasing amount of input based on the last observed input, + // removing itself once the input becomes negligible. + const INERTIA_DECAY_FACTOR = 0.9; + const INERTIA_NEGLIGIBLE_THRESHOLD = 0.5; + var inertialPanObserver; + var inertialPan = () => { + if (Math.abs(inertiaX) > INERTIA_NEGLIGIBLE_THRESHOLD || Math.abs(inertiaY) > INERTIA_NEGLIGIBLE_THRESHOLD) { + pan(ptrX + inertiaX, ptrY + inertiaY); + + inertiaX *= INERTIA_DECAY_FACTOR; + inertiaY *= INERTIA_DECAY_FACTOR; + } + else { + scene.onBeforeRenderObservable.remove(inertialPanObserver); + } + }; + + // Enable/disable spherical panning depending on click state. Note that this is an + // extremely simplistic way to do this, so it gets a little janky on multi-touch. + var sphericalPanObserver; + var pointersDown = 0; + scene.onPointerDown = () => { + pointersDown += 1; + if (pointersDown !== 1) { + return; + } + + // Disable inertial panning. + scene.onBeforeRenderObservable.remove(inertialPanObserver); + + // Switch cursor to grabbing. + scene.defaultCursor = "grabbing"; + + // Store the current pointer position to clean out whatever values were left in + // there from prior iterations. + ptrX = scene.pointerX; + ptrY = scene.pointerY; + + // Enable spherical panning. + sphericalPanObserver = scene.onBeforeRenderObservable.add(sphericalPan); + }; + scene.onPointerUp = () => { + pointersDown -= 1; + if (pointersDown !== 0) { + return; + } + + // Switch cursor to grab. + scene.defaultCursor = "grab"; + + // Disable spherical panning. + scene.onBeforeRenderObservable.remove(sphericalPanObserver); + + // Enable inertial panning. + inertialPanObserver = scene.onBeforeRenderObservable.add(inertialPan); + }; + }; + + return { + addSphericalPanningCameraToScene: addSphericalPanningCameraToScene, + addUI: addUI + }; + +})(); \ No newline at end of file diff --git a/Source/Sketch360.XPlat.UWP/html/spherical.html b/Source/Sketch360.XPlat.UWP/html/spherical.html new file mode 100644 index 0000000..1f5db7f --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/html/spherical.html @@ -0,0 +1,26 @@ + + + + + + Sketch 360 + + + + + + + + + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.UWP/html/spherical.js b/Source/Sketch360.XPlat.UWP/html/spherical.js new file mode 100644 index 0000000..5657503 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/html/spherical.js @@ -0,0 +1,400 @@ +/// Copyright (c) Michael S. Scherotter +/// spherical.js v 1.2 +"use strict"; + +var spherical = (function () { + "use strict"; + /// fov + + /// Pos + + /// fov,Pos + + /// JS2085,JS3058,JS2038,JS3092,JS3057,JS3053 + /// EnableStrictMode,DeclareVariablesBeforeUse,DoNotReferenceUndefined,DeclarePropertiesBeforeUse,AvoidImplicitTypeCoercion,IncorrectNumberOfArguments + /// JS2085.EnableStrictMode,JS3058.DeclareVariablesBeforeUse,JS2038.DoNotReferenceUndefined,JS3092.DeclarePropertiesBeforeUse,JS3057.AvoidImplicitTypeCoercion,JS3053.IncorrectNumberOfArguments + + var canvas = document.getElementById("renderCanvas"); // Get the canvas element. + + var engine = new BABYLON.Engine(canvas, true); // Generate the BABYLON 3D engine. + + var scene; + var _camera = null; + var _dome; + var _zoomLevel = 1; + + + /******* Add the create scene function ******/ + var createScene = function () { + + // Create the scene space + scene = new BABYLON.Scene(engine); + + // This creates and positions a free camera (non-mesh) + //_camera = new BABYLON.ArcRotateCamera("camera1", + // -Math.PI / 2, + // Math.PI / 2.0, + // 5, + // new BABYLON.Vector3.Zero(), + // scene); + + //_camera.upperRadiusLimit = 180; + //_camera.lowerRadiusLimit = 1; + + //// This attaches the camera to the canvas + //_camera.attachControl(canvas, true); + + scene.registerAfterRender(function () { + _dome.fovMultiplier = _zoomLevel; + }); + + scene.onPointerObservable.add(function (e) { + if (_dome === undefined) { return; } + _zoomLevel += e.event.wheelDelta * -0.0005; + if (_zoomLevel < 0) { _zoomLevel = 0; } + if (_zoomLevel > 2) { _zoomLevel = 2; } + fovChanged(); + }, BABYLON.PointerEventTypes.POINTERWHEEL); + + var _pointerDownCount = 0; + var _pointer1Pos = null; + var _pointer1Id = null; + var _pointer2Pos = null; + var _pointer2Id = null; + var _originalDelta = null; + var _initialZoomLevel = _zoomLevel; + + function getDistance() { + return Math.sqrt( + Math.pow(_pointer2Pos.x - _pointer1Pos.x, 2) + + Math.pow(_pointer2Pos.y - _pointer1Pos.y, 2)); + } + + scene.onPointerObservable.add(function (e) { + if (_dome === undefined) { return; } + switch (_pointerDownCount) { + case 0: + _pointer1Pos = { x: e.event.x, y: e.event.y }; + _pointer1Id = e.event.pointerId; + _pointerDownCount = 1; + break; + case 1: + _pointer2Pos = { x: e.event.x, y: e.event.y }; + _pointerDownCount = 2; + _pointer2Id = e.event.pointerId; + _originalDelta = getDistance(); + _initialZoomLevel = _zoomLevel; + break; + + default: + break; + } + }, BABYLON.PointerEventTypes.POINTERDOWN); + + scene.onPointerObservable.add(function (e) { + if (_dome === undefined) { return; } + switch (_pointerDownCount) { + case 0: + break; + case 1: + break; + case 2: + if (e.event.pointerId === _pointer1Id) { + _pointer1Pos = { x: e.event.x, y: e.event.y }; + } else if (e.event.pointerId === _pointer2Id) { + _pointer2Pos = { x: e.event.x, y: e.event.y }; + } + var newDistance = getDistance(); + var deltaPercentage = _originalDelta / newDistance; + _zoomLevel = Math.max(0, Math.min(2, _initialZoomLevel * deltaPercentage)); + fovChanged(); + break; + default: + break; + } + + }, BABYLON.PointerEventTypes.POINTERMOVE); + + scene.onPointerObservable.add(function (e) { + if (_dome === undefined) { return; } + switch (_pointerDownCount) { + case 0: + break; + default: + _pointerDownCount--; + break; + } + }, BABYLON.PointerEventTypes.POINTERUP); + + //_camera.inputs.attached.mousewheel.detachControl(canvas); + + _dome = new BABYLON.PhotoDome("drawing360", "scene.png?cache=0", { + resolution: 32, + size: 1000, + useDirectMapping: false + }, + scene); + + //setMaterial(); + + var viewModeQuery = "?viewMode"; + + var viewMode = "SingleView";// document.location.search.substr(viewModeQuery.length + 1); + + sphericalGui.addSphericalPanningCameraToScene(scene, canvas); + + var sphericalPanningCamera = scene.activeCamera; + + _camera = scene.activeCamera; + + var vrExperience = null; + + switch (viewMode) { + case "None": + break; + case "SingleView": + var vrOptions = { + createFallbackVRDeviceOrientationFreeCamera: false + }; + vrExperience = scene.createDefaultVRExperience(vrOptions); + sphericalGui.addUI(scene, _camera); + break; + case "HeadMountedDisplay": + vrExperience = scene.createDefaultVRExperience(); + sphericalGui.addUI(scene, _camera); + break; + + default: + vrExperience = scene.createDefaultVRExperience(); + sphericalGui.addUI(scene, _camera); + break; + } + + scene.activeCamera = sphericalPanningCamera; + + if (vrExperience !== null) { + vrExperience.onExitingVRObservable.add(() => { + setTimeout(() => { + scene.activeCamera = sphericalPanningCamera; + }, 0); + }); + } + }; + + var cacheBuster = 1; + + function imageUpdated(base64) { + var base64StringOrBitsArray = "data:image/jpg;base64," + base64; + var newTexture = new BABYLON.Texture("data:scene" + cacheBuster, scene, + false, true, BABYLON.Texture.TRILINEAR_SAMPLINGMOD, null, null, base64StringOrBitsArray, true); + + newTexture.onLoadObservable.add(function () { + + if (_dome.photoTexture !== null) { + _dome.photoTexture.dispose(); + } + + _dome.photoTexture = newTexture; + + cacheBuster++; + }); + + } + function setMaterial() { + var newTexture = new BABYLON.Texture("scene.png?cache=" + cacheBuster); + + newTexture.onLoadObservable.add(function () { + + if (_dome.photoTexture !== null) { + _dome.photoTexture.dispose(); + } + + _dome.photoTexture = newTexture; + + cacheBuster++; + }); + } + + function getPosition() { + return JSON.stringify({ + alpha: _camera.alpha, + beta: _camera.beta + }); + } + + function setPositionAB(position) { + + var ab = JSON.parse(position); + + var frameRate = 10; + var alphaAnimation = new BABYLON.Animation("alpha", "alpha", frameRate, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); + + var keyFrames = []; + keyFrames.push({ frame: 0, value: _camera.alpha }); + keyFrames.push({ frame: frameRate, value: ab.alpha }); + alphaAnimation.setKeys(keyFrames); + + var easingAlpha = new BABYLON.CubicEase(); + + easingAlpha.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT); + + alphaAnimation.setEasingFunction(easingAlpha); + + var betaAnimation = new BABYLON.Animation("beta", "beta", frameRate, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); + + var keyFramesB = []; + keyFramesB.push({ frame: 0, value: _camera.beta }); + keyFramesB.push({ frame: frameRate, value: ab.beta }); + betaAnimation.setKeys(keyFramesB); + + var easingBeta = new BABYLON.CubicEase(); + + easingBeta.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT); + + betaAnimation.setEasingFunction(easingBeta); + + scene.beginDirectAnimation(_camera, [alphaAnimation, betaAnimation], 0, 2 * frameRate, false); + } + + // set the position with yaw/pitch (alpha and beta in a json structure) + function setPosition(position) { + var ab = JSON.parse(position); + + setPosition2(ab.alpha, ab.beta); + } + // set the position with yaw/pitch + function setPosition2(alpha, beta) { + + var roll = 0; + + var alphaOffset = -Math.PI / 2; + + var betaMultiplier = -1.0; + + var betaOffset = Math.PI / 2; + + var quaternion = BABYLON.Quaternion.RotationYawPitchRoll(-alpha + alphaOffset, (beta * betaMultiplier) + betaOffset, roll); + + // _camera.rotationQuaternion = quaternion; + + var frameRate = 10; + + var alphaAnimation = new BABYLON.Animation( + "cameraRotation", + "rotationQuaternion", + frameRate, + BABYLON.Animation.ANIMATIONTYPE_QUATERNION, + BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); + + var keyFrames = []; + keyFrames.push({ frame: 0, value: _camera.rotationQuaternion }); + keyFrames.push({ frame: frameRate, value: quaternion }); + alphaAnimation.setKeys(keyFrames); + + var easingAlpha = new BABYLON.CubicEase(); + + easingAlpha.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT); + + alphaAnimation.setEasingFunction(easingAlpha); + + scene.beginDirectAnimation(_camera, [alphaAnimation], 0, 2 * frameRate, false); + } + + function zoom(direction) { + if (direction === "in") { + if (_zoomLevel > 0.1) { + _zoomLevel -= 0.1; + fovChanged(); + } + } else { + if (_zoomLevel < 1.9) { + _zoomLevel += 0.1; + fovChanged(); + } + + } + } + + function setZoomLevel(value) { + if (value > 0.1 && value < 1.9) { + _zoomLevel = value; + fovChanged(); + } + } + + function getZoomLevel() { + return _zoomLevel; + } + + createScene(); // Call the createScene function + + engine.runRenderLoop(function () { // Register a render loop to repeatedly render the scene + scene.render(); + }); + + window.addEventListener("resize", function () { // Watch for browser/canvas resize events + engine.resize(); + }); + + function fovChanged() { + var message = JSON.stringify({ + type: "fovChanged", + value: _zoomLevel + }); + + window.external.notify(message); + } + + function resetPointerDownCount() { + _pointerDownCount = 0; + } + + + return { + zoom: zoom, + setPosition: setPosition, + setPosition2: setPosition2, + getPosition: getPosition, + setMaterial: setMaterial, + imageUpdated: imageUpdated, + getZoomLevel: getZoomLevel, + setZoomLevel: setZoomLevel, + resetPointerDownCount: resetPointerDownCount + }; +})(); + +function resetPointerDownCount() { + spherical.resetPointerDownCount(); +} +function setPosition(pos) { + spherical.setPosition(pos); +} +function setPosition2(alpha, beta) { + spherical.setPosition2(alpha, beta); +} + +function zoom(direction) { + spherical.zoom(direction); +} + +function setZoomLevel(level) { + //console.log("set zoom level:" + level); + + spherical.setZoomLevel(level); +} + +function getZoomLevel() { + return spherical.getZoomLevel(); +} + +function getPosition() { + return spherical.getPosition(); +} + +function setMaterial() { + spherical.setMaterial(); +} + +function imageUpdated(base64) { + spherical.imageUpdated(base64); +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.UWP/html/spherical.js.txt b/Source/Sketch360.XPlat.UWP/html/spherical.js.txt new file mode 100644 index 0000000..d972ad1 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/html/spherical.js.txt @@ -0,0 +1,267 @@ +"use strict"; + +var spherical = (function () { + "use strict"; + + /// fov + + /// Pos + + /// fov,Pos + + /// JS2085,JS3058,JS2038,JS3092,JS3057,JS3053 + /// EnableStrictMode,DeclareVariablesBeforeUse,DoNotReferenceUndefined,DeclarePropertiesBeforeUse,AvoidImplicitTypeCoercion,IncorrectNumberOfArguments + /// JS2085.EnableStrictMode,JS3058.DeclareVariablesBeforeUse,JS2038.DoNotReferenceUndefined,JS3092.DeclarePropertiesBeforeUse,JS3057.AvoidImplicitTypeCoercion,JS3053.IncorrectNumberOfArguments + + var canvas = document.getElementById("renderCanvas"); // Get the canvas element. + + var engine = new BABYLON.Engine(canvas, true); // Generate the BABYLON 3D engine. + + var scene; + var _camera; + var _dome; + var _zoomLevel = 1; + + /******* Add the create scene function ******/ + var createScene = function () { + + // Create the scene space + scene = new BABYLON.Scene(engine); + + // This creates and positions a free camera (non-mesh) + _camera = new BABYLON.ArcRotateCamera("camera1", + -Math.PI / 2, + Math.PI / 2.0, + 5, + new BABYLON.Vector3.Zero(), + scene); + + _camera.upperRadiusLimit = 180; + _camera.lowerRadiusLimit = 1; + + // This attaches the camera to the canvas + _camera.attachControl(canvas, true); + + scene.registerAfterRender(function () { + _dome.fovMultiplier = _zoomLevel; + }); + + scene.onPointerObservable.add(function (e) { + if (_dome === undefined) { return; } + _zoomLevel += e.event.wheelDelta * -0.0005; + if (_zoomLevel < 0) { _zoomLevel = 0; } + if (_zoomLevel > 2) { _zoomLevel = 2; } + fovChanged(); + }, BABYLON.PointerEventTypes.POINTERWHEEL); + + var _pointerDownCount = 0; + var _pointer1Pos = null; + var _pointer1Id = null; + var _pointer2Pos = null; + var _pointer2Id = null; + var _originalDelta = null; + var _initialZoomLevel = _zoomLevel; + + function getDistance() { + return Math.sqrt( + Math.pow(_pointer2Pos.x - _pointer1Pos.x, 2) + + Math.pow(_pointer2Pos.y - _pointer1Pos.y, 2)); + } + + scene.onPointerObservable.add(function (e) { + if (_dome === undefined) { return; } + switch (_pointerDownCount) { + case 0: + _pointer1Pos = { x: e.event.x, y: e.event.y }; + _pointer1Id = e.event.pointerId; + _pointerDownCount = 1; + break; + case 1: + _pointer2Pos = { x: e.event.x, y: e.event.y }; + _pointerDownCount = 2; + _pointer2Id = e.event.pointerId; + _originalDelta = getDistance(); + _initialZoomLevel = _zoomLevel; + break; + + default: + break; + } + }, BABYLON.PointerEventTypes.POINTERDOWN); + + scene.onPointerObservable.add(function (e) { + if (_dome === undefined) { return; } + switch (_pointerDownCount) { + case 0: + break; + case 1: + break; + case 2: + if (e.event.pointerId === _pointer1Id) { + _pointer1Pos = { x: e.event.x, y: e.event.y }; + } else if (e.event.pointerId === _pointer2Id) { + _pointer2Pos = { x: e.event.x, y: e.event.y }; + } + var newDistance = getDistance(); + var deltaPercentage = _originalDelta / newDistance; + _zoomLevel = Math.max(0, Math.min(2, _initialZoomLevel * deltaPercentage)); + fovChanged(); + break; + default: + break; + } + + }, BABYLON.PointerEventTypes.POINTERMOVE); + + scene.onPointerObservable.add(function (e) { + if (_dome === undefined) { return; } + switch (_pointerDownCount) { + case 0: + break; + default: + _pointerDownCount--; + break; + } + }, BABYLON.PointerEventTypes.POINTERUP); + + _camera.inputs.attached.mousewheel.detachControl(canvas); + + _dome = new BABYLON.PhotoDome("drawing360", "scene.png?cache=0", { + resolution: 5, + size: 10000, + useDirectMapping: false + }, + scene); + + setMaterial(); + + var viewModeQuery = "?viewMode"; + + var viewMode = document.location.search.substr(viewModeQuery.length + 1); + + switch (viewMode) { + case "None": + break; + case "SingleView": + var vrOptions = { + createFallbackVRDeviceOrientationFreeCamera: false + }; + scene.createDefaultVRExperience(vrOptions); + break; + case "HeadMountedDisplay": + scene.createDefaultVRExperience(); + break; + + default: + scene.createDefaultVRExperience(); + break; + } + }; + + var cacheBuster = 1; + + function setMaterial() { + var newTexture = new BABYLON.Texture("scene.png?cache=" + cacheBuster); + + _dome.photoTexture = newTexture; + + cacheBuster++; + } + + function getPosition() { + return JSON.stringify({ + alpha: _camera.alpha, + beta: _camera.beta + }); + } + + function setPosition(position) { + var ab = JSON.parse(position); + + var frameRate = 10; + var alphaAnimation = new BABYLON.Animation("alpha", "alpha", frameRate, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); + + var keyFrames = []; + keyFrames.push({ frame: 0, value: _camera.alpha }); + keyFrames.push({ frame: frameRate, value: ab.alpha }); + alphaAnimation.setKeys(keyFrames); + + var easingAlpha = new BABYLON.CubicEase(); + + easingAlpha.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT); + + alphaAnimation.setEasingFunction(easingAlpha); + + var betaAnimation = new BABYLON.Animation("beta", "beta", frameRate, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); + + var keyFramesB = []; + keyFramesB.push({ frame: 0, value: _camera.beta }); + keyFramesB.push({ frame: frameRate, value: ab.beta }); + betaAnimation.setKeys(keyFramesB); + + var easingBeta = new BABYLON.CubicEase(); + + easingBeta.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT); + + betaAnimation.setEasingFunction(easingBeta); + + scene.beginDirectAnimation(_camera, [alphaAnimation, betaAnimation], 0, 2 * frameRate, false); + } + + function zoom(direction) { + if (direction === "in") { + if (_zoomLevel > 0.1) { + _zoomLevel -= 0.1; + fovChanged(); + } + } else { + if (_zoomLevel < 1.9) { + _zoomLevel += 0.1; + fovChanged(); + } + + } + } + + createScene(); // Call the createScene function + + engine.runRenderLoop(function () { // Register a render loop to repeatedly render the scene + scene.render(); + }); + + window.addEventListener("resize", function () { // Watch for browser/canvas resize events + engine.resize(); + }); + + function fovChanged() { + var message = JSON.stringify({ + type: "fovChanged", + value: _zoomLevel + }); + + window.external.notify(message); + } + + return { + zoom: zoom, + setPosition: setPosition, + getPosition: getPosition, + setMaterial: setMaterial + }; +})(); + +function setPosition(pos) { + spherical.setPosition(pos); +} + +function zoom(direction) { + spherical.zoom(direction); +} + +function getPosition() { + return spherical.getPosition(); +} + +function setMaterial() { + spherical.setMaterial(); +} diff --git a/Source/Sketch360.XPlat.UWP/html/toolbar.png b/Source/Sketch360.XPlat.UWP/html/toolbar.png new file mode 100644 index 0000000..e0177ee Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/html/toolbar.png differ diff --git a/Source/Sketch360.XPlat.UWP/html/ui.png b/Source/Sketch360.XPlat.UWP/html/ui.png new file mode 100644 index 0000000..0f8a9b2 Binary files /dev/null and b/Source/Sketch360.XPlat.UWP/html/ui.png differ diff --git a/Source/Sketch360.XPlat.UWP/local.html b/Source/Sketch360.XPlat.UWP/local.html new file mode 100644 index 0000000..078a731 --- /dev/null +++ b/Source/Sketch360.XPlat.UWP/local.html @@ -0,0 +1,14 @@ + + + + + +

Sketch 360

+

+ + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.iOS/AppDelegate.cs b/Source/Sketch360.XPlat.iOS/AppDelegate.cs new file mode 100644 index 0000000..f4c74f1 --- /dev/null +++ b/Source/Sketch360.XPlat.iOS/AppDelegate.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using Foundation; +using UIKit; + +namespace Sketch360.XPlat.iOS +{ + // The UIApplicationDelegate for the application. This class is responsible for launching the + // User Interface of the application, as well as listening (and optionally responding) to + // application events from iOS. + [Register("AppDelegate")] + public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate + { + // + // This method is invoked when the application has loaded and is ready to run. In this + // method you should instantiate the window, load the UI into it and then make the window + // visible. + // + // You have 17 seconds to return from this method, or iOS will terminate your application. + // + public override bool FinishedLaunching(UIApplication app, NSDictionary options) + { + global::Xamarin.Forms.Forms.Init(); + LoadApplication(new App()); + + return base.FinishedLaunching(app, options); + } + } +} diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..98f4d03 --- /dev/null +++ b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,117 @@ +{ + "images": [ + { + "scale": "2x", + "size": "20x20", + "idiom": "iphone", + "filename": "Icon40.png" + }, + { + "scale": "3x", + "size": "20x20", + "idiom": "iphone", + "filename": "Icon60.png" + }, + { + "scale": "2x", + "size": "29x29", + "idiom": "iphone", + "filename": "Icon58.png" + }, + { + "scale": "3x", + "size": "29x29", + "idiom": "iphone", + "filename": "Icon87.png" + }, + { + "scale": "2x", + "size": "40x40", + "idiom": "iphone", + "filename": "Icon80.png" + }, + { + "scale": "3x", + "size": "40x40", + "idiom": "iphone", + "filename": "Icon120.png" + }, + { + "scale": "2x", + "size": "60x60", + "idiom": "iphone", + "filename": "Icon120.png" + }, + { + "scale": "3x", + "size": "60x60", + "idiom": "iphone", + "filename": "Icon180.png" + }, + { + "scale": "1x", + "size": "20x20", + "idiom": "ipad", + "filename": "Icon20.png" + }, + { + "scale": "2x", + "size": "20x20", + "idiom": "ipad", + "filename": "Icon40.png" + }, + { + "scale": "1x", + "size": "29x29", + "idiom": "ipad", + "filename": "Icon29.png" + }, + { + "scale": "2x", + "size": "29x29", + "idiom": "ipad", + "filename": "Icon58.png" + }, + { + "scale": "1x", + "size": "40x40", + "idiom": "ipad", + "filename": "Icon40.png" + }, + { + "scale": "2x", + "size": "40x40", + "idiom": "ipad", + "filename": "Icon80.png" + }, + { + "scale": "1x", + "size": "76x76", + "idiom": "ipad", + "filename": "Icon76.png" + }, + { + "scale": "2x", + "size": "76x76", + "idiom": "ipad", + "filename": "Icon152.png" + }, + { + "scale": "2x", + "size": "83.5x83.5", + "idiom": "ipad", + "filename": "Icon167.png" + }, + { + "scale": "1x", + "size": "1024x1024", + "idiom": "ios-marketing", + "filename": "Icon1024.png" + } + ], + "properties": {}, + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png new file mode 100644 index 0000000..9174c98 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png new file mode 100644 index 0000000..9c60a17 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png new file mode 100644 index 0000000..448d6ef Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png new file mode 100644 index 0000000..8524768 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png new file mode 100644 index 0000000..60a6470 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png new file mode 100644 index 0000000..45268a6 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png new file mode 100644 index 0000000..6a6c77a Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png new file mode 100644 index 0000000..cc7edcf Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png new file mode 100644 index 0000000..1ad04f0 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png new file mode 100644 index 0000000..2dd5262 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png new file mode 100644 index 0000000..b058cae Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png new file mode 100644 index 0000000..02e47a2 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png differ diff --git a/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png new file mode 100644 index 0000000..4954a4b Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png differ diff --git a/Source/Sketch360.XPlat.iOS/BaseUrl.cs b/Source/Sketch360.XPlat.iOS/BaseUrl.cs new file mode 100644 index 0000000..a2d5f97 --- /dev/null +++ b/Source/Sketch360.XPlat.iOS/BaseUrl.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.IO; +using System.Reflection; +using Foundation; + +[assembly: Xamarin.Forms.Dependency(typeof(Sketch360.XPlat.iOS.BaseUrl))] + +namespace Sketch360.XPlat.iOS +{ + public class BaseUrl : IBaseUrl + { + public string GetBase() + { + return $"{NSBundle.MainBundle.BundlePath}/"; + } + + public Stream GetDrawableImageStream(string filename) + { + string resourceID = "Sketch360.XPlat.Droid.Resources.drawable." + filename; + + var assembly = typeof(BaseUrl).GetTypeInfo().Assembly; + + //var names = assembly.GetManifestResourceNames(); + + return assembly.GetManifestResourceStream(resourceID); + + } + } +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat.iOS/Entitlements.plist b/Source/Sketch360.XPlat.iOS/Entitlements.plist new file mode 100644 index 0000000..e9a3005 --- /dev/null +++ b/Source/Sketch360.XPlat.iOS/Entitlements.plist @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Source/Sketch360.XPlat.iOS/Info.plist b/Source/Sketch360.XPlat.iOS/Info.plist new file mode 100644 index 0000000..baad4a1 --- /dev/null +++ b/Source/Sketch360.XPlat.iOS/Info.plist @@ -0,0 +1,40 @@ + + + + + UIDeviceFamily + + 1 + 2 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + MinimumOSVersion + 8.0 + CFBundleDisplayName + Sketch 360 + CFBundleVersion + 1.28 + UILaunchStoryboardName + LaunchScreen + CFBundleName + Sketch360.XPlat + XSAppIconAssets + Assets.xcassets/AppIcon.appiconset + CFBundleIdentifier + com.microsoft.garage.sketch360 + CFBundleShortVersionString + 1 + + diff --git a/Source/Sketch360.XPlat.iOS/Main.cs b/Source/Sketch360.XPlat.iOS/Main.cs new file mode 100644 index 0000000..ac609ad --- /dev/null +++ b/Source/Sketch360.XPlat.iOS/Main.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.Linq; + +using Foundation; +using UIKit; + +namespace Sketch360.XPlat.iOS +{ + public class Application + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, "AppDelegate"); + } + } +} diff --git a/Source/Sketch360.XPlat.iOS/Properties/AssemblyInfo.cs b/Source/Sketch360.XPlat.iOS/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..be3df01 --- /dev/null +++ b/Source/Sketch360.XPlat.iOS/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Sketch360.XPlat.iOS")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Sketch360.XPlat.iOS")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Source/Sketch360.XPlat.iOS/Resources/Default-568h@2x.png b/Source/Sketch360.XPlat.iOS/Resources/Default-568h@2x.png new file mode 100644 index 0000000..26c6461 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/Default-568h@2x.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/Default-Portrait.png b/Source/Sketch360.XPlat.iOS/Resources/Default-Portrait.png new file mode 100644 index 0000000..5d0d1ab Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/Default-Portrait.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/Default-Portrait@2x.png b/Source/Sketch360.XPlat.iOS/Resources/Default-Portrait@2x.png new file mode 100644 index 0000000..0ee2688 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/Default-Portrait@2x.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/Default.png b/Source/Sketch360.XPlat.iOS/Resources/Default.png new file mode 100644 index 0000000..b74643c Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/Default.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/Default@2x.png b/Source/Sketch360.XPlat.iOS/Resources/Default@2x.png new file mode 100644 index 0000000..dbd6bd3 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/Default@2x.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/DrawButton.png b/Source/Sketch360.XPlat.iOS/Resources/DrawButton.png new file mode 100644 index 0000000..2db17d1 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/DrawButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/DrawingViewButton.png b/Source/Sketch360.XPlat.iOS/Resources/DrawingViewButton.png new file mode 100644 index 0000000..c6a2337 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/DrawingViewButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/DrawingViewCarousel.png b/Source/Sketch360.XPlat.iOS/Resources/DrawingViewCarousel.png new file mode 100644 index 0000000..8b5d745 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/DrawingViewCarousel.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/EraserButton.png b/Source/Sketch360.XPlat.iOS/Resources/EraserButton.png new file mode 100644 index 0000000..eb758df Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/EraserButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/FrontBackButton.png b/Source/Sketch360.XPlat.iOS/Resources/FrontBackButton.png new file mode 100644 index 0000000..04c1181 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/FrontBackButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/LaunchScreen.storyboard b/Source/Sketch360.XPlat.iOS/Resources/LaunchScreen.storyboard new file mode 100644 index 0000000..a639c2f --- /dev/null +++ b/Source/Sketch360.XPlat.iOS/Resources/LaunchScreen.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Sketch360.XPlat.iOS/Resources/LeftRightButton.png b/Source/Sketch360.XPlat.iOS/Resources/LeftRightButton.png new file mode 100644 index 0000000..1796606 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/LeftRightButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/MenuButton.png b/Source/Sketch360.XPlat.iOS/Resources/MenuButton.png new file mode 100644 index 0000000..100e6c7 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/MenuButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/PaletteButton.png b/Source/Sketch360.XPlat.iOS/Resources/PaletteButton.png new file mode 100644 index 0000000..cc03a9d Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/PaletteButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/PanZoomButton.png b/Source/Sketch360.XPlat.iOS/Resources/PanZoomButton.png new file mode 100644 index 0000000..38bd4ac Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/PanZoomButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/PenSizeButton.png b/Source/Sketch360.XPlat.iOS/Resources/PenSizeButton.png new file mode 100644 index 0000000..5fb4edc Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/PenSizeButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/RedoButton.png b/Source/Sketch360.XPlat.iOS/Resources/RedoButton.png new file mode 100644 index 0000000..874342c Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/RedoButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/SphericalViewCarousel.png b/Source/Sketch360.XPlat.iOS/Resources/SphericalViewCarousel.png new file mode 100644 index 0000000..b230eb9 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/SphericalViewCarousel.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/StencilButton.png b/Source/Sketch360.XPlat.iOS/Resources/StencilButton.png new file mode 100644 index 0000000..4904814 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/StencilButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/TouchDrawing.png b/Source/Sketch360.XPlat.iOS/Resources/TouchDrawing.png new file mode 100644 index 0000000..2d136ee Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/TouchDrawing.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/UndoButton.png b/Source/Sketch360.XPlat.iOS/Resources/UndoButton.png new file mode 100644 index 0000000..ccc62bb Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/UndoButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/VerticalLinesButton.png b/Source/Sketch360.XPlat.iOS/Resources/VerticalLinesButton.png new file mode 100644 index 0000000..a12d973 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/VerticalLinesButton.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/View360Button.png b/Source/Sketch360.XPlat.iOS/Resources/View360Button.png new file mode 100644 index 0000000..c3952a8 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/View360Button.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/export360Degree.png b/Source/Sketch360.XPlat.iOS/Resources/export360Degree.png new file mode 100644 index 0000000..6a907e4 Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/export360Degree.png differ diff --git a/Source/Sketch360.XPlat.iOS/Resources/logo.png b/Source/Sketch360.XPlat.iOS/Resources/logo.png new file mode 100644 index 0000000..8b6798c Binary files /dev/null and b/Source/Sketch360.XPlat.iOS/Resources/logo.png differ diff --git a/Source/Sketch360.XPlat.iOS/Sketch360.XPlat.iOS.csproj b/Source/Sketch360.XPlat.iOS/Sketch360.XPlat.iOS.csproj new file mode 100644 index 0000000..e862857 --- /dev/null +++ b/Source/Sketch360.XPlat.iOS/Sketch360.XPlat.iOS.csproj @@ -0,0 +1,296 @@ + + + + Debug + iPhoneSimulator + 8.0.30703 + 2.0 + {8243B4DD-4F02-452F-B2DD-544805644FF9} + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {6143fdea-f3c2-4a09-aafa-6e230626515e} + Exe + Sketch360.XPlat.iOS + Resources + Sketch360.XPlat.iOS + true + NSUrlSessionHandler + manual + + + true + full + false + bin\iPhoneSimulator\Debug + DEBUG + prompt + 4 + x86_64 + None + true + + + none + true + bin\iPhoneSimulator\Release + prompt + 4 + None + x86_64 + + + true + full + false + bin\iPhone\Debug + DEBUG + prompt + 4 + ARM64 + iPhone Developer + true + Entitlements.plist + + + none + true + bin\iPhone\Release + prompt + 4 + ARM64 + iPhone Developer + Entitlements.plist + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + 3.4.3 + + + 3.4.3 + + + + + 2.80.2 + + + 2.80.2 + + + + + + {DA1D6F34-3FD1-4842-8FBF-D73F820D04FC} + Sketch360.XPlat + + + + + Designer + MSBuild:UpdateGeneratedFiles + + + Designer + MSBuild:UpdateGeneratedFiles + + + MSBuild:UpdateGeneratedFiles + Designer + + + Designer + MSBuild:UpdateGeneratedFiles + + + Designer + MSBuild:UpdateGeneratedFiles + + + Designer + MSBuild:UpdateGeneratedFiles + + + MSBuild:UpdateGeneratedFiles + Designer + + + Designer + MSBuild:UpdateGeneratedFiles + + + Designer + MSBuild:UpdateGeneratedFiles + + + MSBuild:UpdateGeneratedFiles + Designer + + + Designer + MSBuild:UpdateGeneratedFiles + + + Designer + MSBuild:UpdateGeneratedFiles + + + Designer + MSBuild:UpdateGeneratedFiles + + + MSBuild:UpdateGeneratedFiles + Designer + + + Resources\babylon.4.1.js + + + Resources\babylon.4.1.gui.js + + + Resources\babylon.gui.js + + + Resources\spherical.html + + + Resources\spherical.js + + + Resources\spherical.gui.js + + + Resources\spherical.css + + + + + Designer + MSBuild:UpdateGeneratedFiles + + + Designer + MSBuild:UpdateGeneratedFiles + + + Designer + MSBuild:UpdateGeneratedFiles + + + Designer + MSBuild:UpdateGeneratedFiles + + + MSBuild:UpdateGeneratedFiles + Designer + + + + + Resources\about.html + + + + + Resources\EquirectangularGrid.png + + + + + Resources\garage.png + + + + + Resources\ui.png + + + + + Resources\about.css + + + + + Resources\about.js + + + + + Resources\grid.jpg + + + + + Resources\TiltRotate.png + + + + + Resources\BackButton.png + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat.sln b/Source/Sketch360.XPlat.sln new file mode 100644 index 0000000..504e562 --- /dev/null +++ b/Source/Sketch360.XPlat.sln @@ -0,0 +1,212 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29326.143 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sketch360.XPlat", "Sketch360.XPlat\Sketch360.XPlat.csproj", "{5F72144C-C148-4AB9-9906-5433975EC053}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sketch360.XPlat.Android", "Sketch360.XPlat.Android\Sketch360.XPlat.Android.csproj", "{319EA186-FA3E-49FB-9919-E48FBB2E35E6}" + ProjectSection(ProjectDependencies) = postProject + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD} = {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD} + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xamarin.Forms.Inking", "Xamarin.Forms.Inking\Xamarin.Forms.Inking.csproj", "{8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{535BB397-4EFB-46A1-8B4D-24AC480B6BDD}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + about.css = about.css + about.html = about.html + about.js = about.js + build.txt = build.txt + grid.jpg = grid.jpg + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Packages", "Packages", "{9314C655-4F12-49DC-8C75-04E22EF09B67}" + ProjectSection(SolutionItems) = preProject + Packages\com.microsoft.garage.sketch360.apk = Packages\com.microsoft.garage.sketch360.apk + Packages\packages.txt = Packages\packages.txt + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sketch360.XPlat.iOS", "Sketch360.XPlat.iOS\Sketch360.XPlat.iOS.csproj", "{8243B4DD-4F02-452F-B2DD-544805644FF9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sketch360.XPlat.UWP", "Sketch360.XPlat.UWP\Sketch360.XPlat.UWP.csproj", "{B819336B-C0A1-4ADF-AA0D-E7284BFDB664}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xamarin.Forms.Inking.Tests", "Xamarin.Forms.Inking.Tests\Xamarin.Forms.Inking.Tests.csproj", "{83770343-7E98-4735-87DB-E566FC5280CB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|iPhone = Debug|iPhone + Debug|iPhoneSimulator = Debug|iPhoneSimulator + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|iPhone = Release|iPhone + Release|iPhoneSimulator = Release|iPhoneSimulator + Release|x64 = Release|x64 + Release|x86 = Release|x86 + Description = Sketch 360 Cross-platform application + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|ARM.ActiveCfg = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|ARM.Build.0 = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|iPhone.Build.0 = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|x64.ActiveCfg = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|x64.Build.0 = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|x86.ActiveCfg = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Debug|x86.Build.0 = Debug|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|Any CPU.Build.0 = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|ARM.ActiveCfg = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|ARM.Build.0 = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|iPhone.ActiveCfg = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|iPhone.Build.0 = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|x64.ActiveCfg = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|x64.Build.0 = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|x86.ActiveCfg = Release|Any CPU + {5F72144C-C148-4AB9-9906-5433975EC053}.Release|x86.Build.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|ARM.ActiveCfg = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|ARM.Build.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|ARM.Deploy.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|iPhone.Build.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|iPhone.Deploy.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|x64.ActiveCfg = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|x64.Build.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|x64.Deploy.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|x86.ActiveCfg = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|x86.Build.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Debug|x86.Deploy.0 = Debug|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|Any CPU.Build.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|Any CPU.Deploy.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|ARM.ActiveCfg = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|ARM.Build.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|ARM.Deploy.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|iPhone.ActiveCfg = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|iPhone.Build.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|iPhone.Deploy.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|x64.ActiveCfg = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|x64.Build.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|x64.Deploy.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|x86.ActiveCfg = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|x86.Build.0 = Release|Any CPU + {319EA186-FA3E-49FB-9919-E48FBB2E35E6}.Release|x86.Deploy.0 = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|ARM.ActiveCfg = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|ARM.Build.0 = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|iPhone.Build.0 = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|x64.ActiveCfg = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|x64.Build.0 = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|x86.ActiveCfg = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Debug|x86.Build.0 = Debug|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|Any CPU.Build.0 = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|ARM.ActiveCfg = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|ARM.Build.0 = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|iPhone.ActiveCfg = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|iPhone.Build.0 = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|x64.ActiveCfg = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|x64.Build.0 = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|x86.ActiveCfg = Release|Any CPU + {8B3E3AF3-67F5-492F-8C25-793BAEDD4EFD}.Release|x86.Build.0 = Release|Any CPU + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Debug|Any CPU.ActiveCfg = Debug|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Debug|ARM.ActiveCfg = Debug|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Debug|iPhone.ActiveCfg = Debug|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Debug|iPhone.Build.0 = Debug|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Debug|x64.ActiveCfg = Debug|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Debug|x86.ActiveCfg = Debug|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Release|Any CPU.ActiveCfg = Release|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Release|ARM.ActiveCfg = Release|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Release|iPhone.ActiveCfg = Release|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Release|iPhone.Build.0 = Release|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Release|x64.ActiveCfg = Release|iPhone + {8243B4DD-4F02-452F-B2DD-544805644FF9}.Release|x86.ActiveCfg = Release|iPhone + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|Any CPU.ActiveCfg = Debug|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|ARM.ActiveCfg = Debug|ARM + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|ARM.Build.0 = Debug|ARM + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|ARM.Deploy.0 = Debug|ARM + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|iPhone.ActiveCfg = Debug|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|x64.ActiveCfg = Debug|x64 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|x64.Build.0 = Debug|x64 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|x64.Deploy.0 = Debug|x64 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|x86.ActiveCfg = Debug|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|x86.Build.0 = Debug|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Debug|x86.Deploy.0 = Debug|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|Any CPU.ActiveCfg = Release|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|ARM.ActiveCfg = Release|ARM + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|ARM.Build.0 = Release|ARM + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|ARM.Deploy.0 = Release|ARM + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|iPhone.ActiveCfg = Release|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|iPhoneSimulator.ActiveCfg = Release|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|x64.ActiveCfg = Release|x64 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|x64.Build.0 = Release|x64 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|x64.Deploy.0 = Release|x64 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|x86.ActiveCfg = Release|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|x86.Build.0 = Release|x86 + {B819336B-C0A1-4ADF-AA0D-E7284BFDB664}.Release|x86.Deploy.0 = Release|x86 + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|ARM.ActiveCfg = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|ARM.Build.0 = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|iPhone.Build.0 = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|x64.ActiveCfg = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|x64.Build.0 = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|x86.ActiveCfg = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Debug|x86.Build.0 = Debug|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|Any CPU.Build.0 = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|ARM.ActiveCfg = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|ARM.Build.0 = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|iPhone.ActiveCfg = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|iPhone.Build.0 = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|x64.ActiveCfg = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|x64.Build.0 = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|x86.ActiveCfg = Release|Any CPU + {83770343-7E98-4735-87DB-E566FC5280CB}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {9314C655-4F12-49DC-8C75-04E22EF09B67} = {535BB397-4EFB-46A1-8B4D-24AC480B6BDD} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3551ECD4-60BD-42DB-872E-79A691C3B2A9} + EndGlobalSection +EndGlobal diff --git a/Source/Sketch360.XPlat/App.xaml b/Source/Sketch360.XPlat/App.xaml new file mode 100644 index 0000000..a9fc9c6 --- /dev/null +++ b/Source/Sketch360.XPlat/App.xaml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Sketch360.XPlat/App.xaml.cs b/Source/Sketch360.XPlat/App.xaml.cs new file mode 100644 index 0000000..97ca018 --- /dev/null +++ b/Source/Sketch360.XPlat/App.xaml.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Autofac; +using Microsoft.AppCenter; +using Microsoft.AppCenter.Analytics; +using Microsoft.AppCenter.Crashes; +//using Microsoft.AppCenter.Distribute; +using Plugin.Multilingual; +using Sketch360.XPlat.Data; +using Sketch360.XPlat.Interfaces; +using Sketch360.XPlat.Modes; +using Sketch360.XPlat.Resources; +using Sketch360.XPlat.Serialization; +using Sketch360.XPlat.Support; +using Sketch360.XPlat.ViewModels; +using System; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text.Json; +using System.Threading.Tasks; +using Xamarin.Essentials; +using Xamarin.Forms; + +namespace Sketch360.XPlat +{ + /// + /// Xamarin Forms App + /// + public sealed partial class App : Application, IDisposable + { + private SketchData _sketchData; + private readonly ISplitPage _splitPage; + private readonly UndoManager _undoManager = new UndoManager(); + /// + /// Initializes a new instance of the App class + /// + public App() + { + + VersionTracking.Track(); + + InitializeContainer(); + + InitializeComponent(); + + var culture = CrossMultilingual.Current.DeviceCultureInfo; + + AppResources.Culture = culture; + + _splitPage = App.Container.Resolve(); + + if (VersionTracking.IsFirstLaunchForCurrentVersion) + { + // Navigating to Carousel on first time load + var carouselPage = App.Container.Resolve(); + MainPage = new NavigationPage(carouselPage as Page); + } + else + { + MainPage = new NavigationPage(_splitPage as Page); + } + } + + /// + /// Gets the sketch data + /// + /// the sketch data + public static ISketchData GetSketchData() + { + if (App.Current is App app) + { + return app._sketchData; + } + + return null; + } + + /// + /// Gets or sets the AutoFAC DI Container + /// + public static IContainer Container { get; private set; } + + /// + /// Gets the sketch data path + /// + public static string SketchDataPath + { + get + { + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "_sketchData.json"); + } + } + + private bool _isSaving; + + /// + /// Show the carousel pages + /// + public void ShowCarouselPage() + { + var carouselPage = App.Container.Resolve(); + + MainPage = new NavigationPage(carouselPage as Page); + } + + /// + /// Serialize the sketch data + /// + /// + public string SerializeSketchData() + { + lock (_sketchData) + { + var sketchData = new SketchData + { + BackgroundColor = _sketchData.BackgroundColor, + Height = _sketchData.Height, + InkStrokes = _sketchData.InkStrokes.ToArray(), + Width = _sketchData.Width, + Name = _sketchData.Name, + Start = _sketchData.Start + }; + + var options = CreateSerializationOptions(); + + var json = JsonSerializer.Serialize(sketchData, options); + + return json; + } + } + /// + /// Save the sketch data + /// + /// an async task + public async Task SaveSketchDataAsync() + { + if (_isSaving) return; + + _isSaving = true; + + await Task.Run(delegate + { + _isSaving = true; + + var json = SerializeSketchData(); + + File.WriteAllText(SketchDataPath, json); + + _isSaving = false; + }).ConfigureAwait(false); + } + + static JsonSerializerOptions CreateSerializationOptions() + { + var options = new JsonSerializerOptions(); + options.Converters.Add(new ColorConverter()); + options.Converters.Add(new SKRectConverter()); + //options.Converters.Add(new PointConverter()); + //options.Converters.Add(new DateTimeOffsetConverter()); // the default converter is sufficient + + options.WriteIndented = true; + + return options; + } + + + /// + /// Load a sketch from a JSON string + /// + /// the JSON string + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "")] + public bool LoadSketch(string json) + { + if (string.IsNullOrWhiteSpace(json)) + { + return false; + } + + var options = CreateSerializationOptions(); + + try + { + var sketchData = JsonSerializer.Deserialize(json, options); + + foreach (var stroke in sketchData.InkStrokes) + { + if (stroke.DrawingAttributes.Color.A == 0) + { + stroke.DrawingAttributes.Color = Xamarin.Forms.Color.FromRgba(stroke.DrawingAttributes.Color.R, stroke.DrawingAttributes.Color.G, stroke.DrawingAttributes.Color.B, 255); + } + stroke.UpdateBounds(); + } + + _sketchData = sketchData; + } + catch (Exception e) + { + System.Diagnostics.Debug.WriteLine($"Error deserializing SketchData: {e.Message}"); + + _sketchData = new SketchData(); + + Crashes.TrackError(e); + } + + _splitPage.SketchDataUpdated(_sketchData); + + return true; + } + + public async Task LoadInitialSketchAsync() + { + var assembly = GetType().GetTypeInfo().Assembly; + + using var stream = assembly.GetManifestResourceStream("Sketch360.XPlat.Assets.sketch360.json"); + using var reader = new StreamReader(stream); + while (!reader.EndOfStream) + { + var json = await reader.ReadToEndAsync().ConfigureAwait(false); + + LoadSketch(json); + } + } + + /// + /// App startup + /// + protected override async void OnStart() + { + AppCenter.Start( + "android=585676e3-a68b-48f0-8090-119788c6b1e5;" + + //"uwp={Your UWP App secret here};" + + "ios={87bd45a1-e43a-4c0f-9401-0ac71509de57}", + typeof(Analytics), typeof(Crashes));//, typeof(Distribute)); + + await Task.Run(async delegate + { + var path = SketchDataPath; + + if (File.Exists(path)) + { + var json = File.ReadAllText(path); + + LoadSketch(json); + } + else + { + if (VersionTracking.IsFirstLaunchEver) + { + await LoadInitialSketchAsync().ConfigureAwait(true); + } + else + { + _sketchData = new SketchData(); + + _splitPage.SketchDataUpdated(_sketchData); + } + } + }).ConfigureAwait(false); + } + + /// + /// App sleep + /// + protected override void OnSleep() + { + // Handle when your app sleeps + } + + /// + /// App resume + /// + protected override void OnResume() + { + // Handle when your app resumes + } + + private void InitializeContainer() + { + var builder = new Autofac.ContainerBuilder(); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(_undoManager).As(); + + Container = builder.Build(); + } + + /// + /// Dispose of the resources + /// + public void Dispose() + { + _undoManager?.Dispose(); + } + } +} diff --git a/Source/Sketch360.XPlat/AssemblyInfo.cs b/Source/Sketch360.XPlat/AssemblyInfo.cs new file mode 100644 index 0000000..0508665 --- /dev/null +++ b/Source/Sketch360.XPlat/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Xamarin.Forms.Xaml; + +[assembly: XamlCompilation(XamlCompilationOptions.Compile)] diff --git a/Source/Sketch360.XPlat/Assets/Bezier Curves.csv b/Source/Sketch360.XPlat/Assets/Bezier Curves.csv new file mode 100644 index 0000000..588ff50 --- /dev/null +++ b/Source/Sketch360.XPlat/Assets/Bezier Curves.csv @@ -0,0 +1,11 @@ +P1X,P1Y,P2X,P2Y +0,-10,0,0 +10,-1,58,15 +27,21,55,26 +19,61,46,34 +3,100,30,45 +2,100,39,56 +3,100,47,66 +1,99,61,76 +0,100,55,89 +0,100,100,100 diff --git a/Source/Sketch360.XPlat/Assets/Equirectangular Grid.png b/Source/Sketch360.XPlat/Assets/Equirectangular Grid.png new file mode 100644 index 0000000..0cfefc6 Binary files /dev/null and b/Source/Sketch360.XPlat/Assets/Equirectangular Grid.png differ diff --git a/Source/Sketch360.XPlat/Assets/sketch360.json b/Source/Sketch360.XPlat/Assets/sketch360.json new file mode 100644 index 0000000..db9ec68 --- /dev/null +++ b/Source/Sketch360.XPlat/Assets/sketch360.json @@ -0,0 +1,93942 @@ +{ + "Name": "Sketch", + "BackgroundColor": "#FFF5F5DC", + "InkStrokes": [ + { + "Id": "5bde7bab-3910-4a72-8a7d-16798c57ec33", + "Points": [ + { + "Pressure": 0.168200195, + "Position": { + "X": 973.78052092459382, + "Y": 499.27013618043804, + "IsEmpty": false + }, + "Timestamp": 637316491291155150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.227527276, + "Position": { + "X": 973.36662961633817, + "Y": 499.15235218624787, + "IsEmpty": false + }, + "Timestamp": 637316491291501060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.280994892, + "Position": { + "X": 972.83449672261725, + "Y": 499.03447667380271, + "IsEmpty": false + }, + "Timestamp": 637316491291590240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.31273365, + "Position": { + "X": 971.88849540020442, + "Y": 499.03447667380271, + "IsEmpty": false + }, + "Timestamp": 637316491291771040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.362783253, + "Position": { + "X": 971.11985645598929, + "Y": 499.15235218624787, + "IsEmpty": false + }, + "Timestamp": 637316491291959320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.406729221, + "Position": { + "X": 969.28695172433243, + "Y": 499.80048446818637, + "IsEmpty": false + }, + "Timestamp": 637316491292129860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.453360796, + "Position": { + "X": 968.69567515831523, + "Y": 500.33083275593469, + "IsEmpty": false + }, + "Timestamp": 637316491292292160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.490226597, + "Position": { + "X": 968.10442147186166, + "Y": 502.03975313162488, + "IsEmpty": false + }, + "Timestamp": 637316491292476860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513664424, + "Position": { + "X": 968.4000483150885, + "Y": 504.04327077017302, + "IsEmpty": false + }, + "Timestamp": 637316491292612220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531731129, + "Position": { + "X": 968.69567515831523, + "Y": 505.57537787719536, + "IsEmpty": false + }, + "Timestamp": 637316491292783370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547112226, + "Position": { + "X": 970.52857988997209, + "Y": 507.40217376533076, + "IsEmpty": false + }, + "Timestamp": 637316491292943340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562981606, + "Position": { + "X": 973.248388030873, + "Y": 508.58074585327256, + "IsEmpty": false + }, + "Timestamp": 637316491293127330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.569573522, + "Position": { + "X": 975.43604039848924, + "Y": 508.52180809704998, + "IsEmpty": false + }, + "Timestamp": 637316491293299310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573479831, + "Position": { + "X": 977.03243907965191, + "Y": 507.69677102818872, + "IsEmpty": false + }, + "Timestamp": 637316491293495800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577630281, + "Position": { + "X": 977.97846328162848, + "Y": 505.92900441453094, + "IsEmpty": false + }, + "Timestamp": 637316491293639610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579583406, + "Position": { + "X": 977.62371564566911, + "Y": 502.98257419467637, + "IsEmpty": false + }, + "Timestamp": 637316491293801640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579583406, + "Position": { + "X": 976.50030618593098, + "Y": 501.68621811254434, + "IsEmpty": false + }, + "Timestamp": 637316491293967240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579583406, + "Position": { + "X": 974.84478671203567, + "Y": 500.74339704949284, + "IsEmpty": false + }, + "Timestamp": 637316491294140560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579583406, + "Position": { + "X": 972.83449672261725, + "Y": 500.86118104368302, + "IsEmpty": false + }, + "Timestamp": 637316491294309290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.581536591, + "Position": { + "X": 971.65198934971022, + "Y": 501.74515586876691, + "IsEmpty": false + }, + "Timestamp": 637316491294465770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583489716, + "Position": { + "X": 970.70596514773365, + "Y": 502.8647902004862, + "IsEmpty": false + }, + "Timestamp": 637316491294636100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588616788, + "Position": { + "X": 969.46431410253024, + "Y": 504.16114628261818, + "IsEmpty": false + }, + "Timestamp": 637316491294817920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.598382533, + "Position": { + "X": 970.41033830450692, + "Y": 505.57537787719536, + "IsEmpty": false + }, + "Timestamp": 637316491294987270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.603509545, + "Position": { + "X": 971.29721883418711, + "Y": 506.16466392116632, + "IsEmpty": false + }, + "Timestamp": 637316491295147350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 973.0118819803788, + "Y": 506.40041494605669, + "IsEmpty": false + }, + "Timestamp": 637316491295322410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615472674, + "Position": { + "X": 974.43089540378003, + "Y": 505.57537787719536, + "IsEmpty": false + }, + "Timestamp": 637316491295500720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614740193, + "Position": { + "X": 975.90905249947753, + "Y": 502.80585244426356, + "IsEmpty": false + }, + "Timestamp": 637316491295665130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614740193, + "Position": { + "X": 976.14555854997161, + "Y": 500.56658378082511, + "IsEmpty": false + }, + "Timestamp": 637316491295838990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614740193, + "Position": { + "X": 975.73166724171597, + "Y": 498.85766340513493, + "IsEmpty": false + }, + "Timestamp": 637316491295984750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.366201252, + "Position": { + "X": 975.61342565625068, + "Y": 498.44519062983176, + "IsEmpty": false + }, + "Timestamp": 637316491296166060, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "700f7f04-09f3-45f6-af63-7fbb4c1eff4e", + "Points": [ + { + "Pressure": 0.0702983141, + "Position": { + "X": 993.94247297281947, + "Y": 523.90190844175152, + "IsEmpty": false + }, + "Timestamp": 637316491331262360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0764019191, + "Position": { + "X": 994.41548507380776, + "Y": 524.07863019216427, + "IsEmpty": false + }, + "Timestamp": 637316491331388090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.148424506, + "Position": { + "X": 995.30236560348794, + "Y": 524.31438121705457, + "IsEmpty": false + }, + "Timestamp": 637316491331557540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.242908373, + "Position": { + "X": 995.7162569117437, + "Y": 524.49119448572242, + "IsEmpty": false + }, + "Timestamp": 637316491331717730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.370107561, + "Position": { + "X": 996.36665427049354, + "Y": 524.90366726102548, + "IsEmpty": false + }, + "Timestamp": 637316491331886150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.437491417, + "Position": { + "X": 995.00673876026121, + "Y": 524.72685399235775, + "IsEmpty": false + }, + "Timestamp": 637316491332568060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.463370711, + "Position": { + "X": 993.76511059462166, + "Y": 524.49119448572242, + "IsEmpty": false + }, + "Timestamp": 637316491332738170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.48754102, + "Position": { + "X": 992.40519508438933, + "Y": 524.19650570460942, + "IsEmpty": false + }, + "Timestamp": 637316491332900800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.505607665, + "Position": { + "X": 991.04530245372075, + "Y": 523.96084619797409, + "IsEmpty": false + }, + "Timestamp": 637316491333076630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.524406791, + "Position": { + "X": 988.38463798511623, + "Y": 523.25368464155792, + "IsEmpty": false + }, + "Timestamp": 637316491333244770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.535393298, + "Position": { + "X": 986.84736009668609, + "Y": 522.95899586044504, + "IsEmpty": false + }, + "Timestamp": 637316491333415420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547112226, + "Position": { + "X": 984.54144326404094, + "Y": 522.90014962247744, + "IsEmpty": false + }, + "Timestamp": 637316491333575000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558587015, + "Position": { + "X": 981.7625143304075, + "Y": 522.90014962247744, + "IsEmpty": false + }, + "Timestamp": 637316491333744980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.565423071, + "Position": { + "X": 978.33321091758785, + "Y": 523.0768713728902, + "IsEmpty": false + }, + "Timestamp": 637316491333919670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 972.12497857113476, + "Y": 523.01793361666762, + "IsEmpty": false + }, + "Timestamp": 637316491334082540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577142, + "Position": { + "X": 967.33578252764664, + "Y": 522.78227411003218, + "IsEmpty": false + }, + "Timestamp": 637316491334251880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579095125, + "Position": { + "X": 963.55173147886774, + "Y": 522.25192582228385, + "IsEmpty": false + }, + "Timestamp": 637316491334422360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58519876, + "Position": { + "X": 959.41290991456572, + "Y": 521.48582650964522, + "IsEmpty": false + }, + "Timestamp": 637316491334595450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 957.04787228918792, + "Y": 521.5447642658678, + "IsEmpty": false + }, + "Timestamp": 637316491334765480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594964504, + "Position": { + "X": 955.4514507284614, + "Y": 521.95723704117097, + "IsEmpty": false + }, + "Timestamp": 637316491334929220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.601800561, + "Position": { + "X": 954.03243730506028, + "Y": 522.7233363538096, + "IsEmpty": false + }, + "Timestamp": 637316491335104920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.613275349, + "Position": { + "X": 952.6725446743917, + "Y": 523.37156015400319, + "IsEmpty": false + }, + "Timestamp": 637316491335273640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 952.19953257340342, + "Y": 523.48934414819337, + "IsEmpty": false + }, + "Timestamp": 637316491335443460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622064531, + "Position": { + "X": 951.78564126514766, + "Y": 523.60721966063852, + "IsEmpty": false + }, + "Timestamp": 637316491335602100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643793404, + "Position": { + "X": 952.14041178067077, + "Y": 523.60721966063852, + "IsEmpty": false + }, + "Timestamp": 637316491335942160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647699714, + "Position": { + "X": 953.3229191535778, + "Y": 523.6661574168611, + "IsEmpty": false + }, + "Timestamp": 637316491336112880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649896979, + "Position": { + "X": 955.21494467796731, + "Y": 524.07863019216427, + "IsEmpty": false + }, + "Timestamp": 637316491336279150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651850164, + "Position": { + "X": 955.56971519349042, + "Y": 524.19650570460942, + "IsEmpty": false + }, + "Timestamp": 637316491336452960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651850164, + "Position": { + "X": 955.98358362218232, + "Y": 524.255443460832, + "IsEmpty": false + }, + "Timestamp": 637316491336625860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651850164, + "Position": { + "X": 956.27923334497279, + "Y": 524.01969243594169, + "IsEmpty": false + }, + "Timestamp": 637316491337132740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653803289, + "Position": { + "X": 957.10699308192045, + "Y": 523.6661574168611, + "IsEmpty": false + }, + "Timestamp": 637316491337302250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655756474, + "Position": { + "X": 959.47203070729825, + "Y": 523.78403292930625, + "IsEmpty": false + }, + "Timestamp": 637316491337471730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657709599, + "Position": { + "X": 961.1866709739262, + "Y": 524.13756794838685, + "IsEmpty": false + }, + "Timestamp": 637316491337639280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657709599, + "Position": { + "X": 963.72909385706555, + "Y": 524.78579174858032, + "IsEmpty": false + }, + "Timestamp": 637316491337801140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657709599, + "Position": { + "X": 968.22266305732694, + "Y": 525.90542608029955, + "IsEmpty": false + }, + "Timestamp": 637316491337978130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 973.0118819803788, + "Y": 526.20002334315757, + "IsEmpty": false + }, + "Timestamp": 637316491338137490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 975.1404135552624, + "Y": 526.43577436804787, + "IsEmpty": false + }, + "Timestamp": 637316491338311010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 979.1609706545355, + "Y": 527.14293592446404, + "IsEmpty": false + }, + "Timestamp": 637316491338512690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 980.16611564924472, + "Y": 527.37859543109937, + "IsEmpty": false + }, + "Timestamp": 637316491338647990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 987.61599904090122, + "Y": 528.26247873792829, + "IsEmpty": false + }, + "Timestamp": 637316491338813240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 989.09415613659871, + "Y": 527.55540869976721, + "IsEmpty": false + }, + "Timestamp": 637316491338979950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 989.9810366662789, + "Y": 526.31789885560272, + "IsEmpty": false + }, + "Timestamp": 637316491339157650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 990.45404876726718, + "Y": 525.49295330499649, + "IsEmpty": false + }, + "Timestamp": 637316491339328090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 990.57229035273247, + "Y": 525.13932676766092, + "IsEmpty": false + }, + "Timestamp": 637316491339498450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653803289, + "Position": { + "X": 990.86791719595919, + "Y": 524.78579174858032, + "IsEmpty": false + }, + "Timestamp": 637316491339835030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643060982, + "Position": { + "X": 991.34092929694748, + "Y": 524.55004072369002, + "IsEmpty": false + }, + "Timestamp": 637316491340165930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62182039, + "Position": { + "X": 991.87306219066841, + "Y": 524.55004072369002, + "IsEmpty": false + }, + "Timestamp": 637316491340332520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605951011, + "Position": { + "X": 992.87820718537762, + "Y": 525.02154277347074, + "IsEmpty": false + }, + "Timestamp": 637316491340509540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588128507, + "Position": { + "X": 994.47460586654029, + "Y": 526.55364988049314, + "IsEmpty": false + }, + "Timestamp": 637316491340681530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576165378, + "Position": { + "X": 995.36150927578433, + "Y": 527.02506041201889, + "IsEmpty": false + }, + "Timestamp": 637316491340851610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570550084, + "Position": { + "X": 996.36665427049354, + "Y": 527.08399816824146, + "IsEmpty": false + }, + "Timestamp": 637316491341014960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568352759, + "Position": { + "X": 997.54916164340057, + "Y": 526.61258763671572, + "IsEmpty": false + }, + "Timestamp": 637316491341184640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568352759, + "Position": { + "X": 998.90905427406915, + "Y": 524.255443460832, + "IsEmpty": false + }, + "Timestamp": 637316491341351010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562005043, + "Position": { + "X": 999.14556032456323, + "Y": 521.83945304698079, + "IsEmpty": false + }, + "Timestamp": 637316491341525250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 998.73169189587134, + "Y": 519.89478164640025, + "IsEmpty": false + }, + "Timestamp": 637316491341686130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 998.19955900215041, + "Y": 519.0698360957939, + "IsEmpty": false + }, + "Timestamp": 637316491341862230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 997.54916164340057, + "Y": 518.59842556426815, + "IsEmpty": false + }, + "Timestamp": 637316491342032920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 996.78052269918555, + "Y": 518.89302282712617, + "IsEmpty": false + }, + "Timestamp": 637316491342194770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 996.01188375497043, + "Y": 520.07159491506798, + "IsEmpty": false + }, + "Timestamp": 637316491342364510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566643775, + "Position": { + "X": 995.77537770447634, + "Y": 521.5447642658678, + "IsEmpty": false + }, + "Timestamp": 637316491342532710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 995.65713611901106, + "Y": 522.95899586044504, + "IsEmpty": false + }, + "Timestamp": 637316491342702880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.578362703, + "Position": { + "X": 995.7162569117437, + "Y": 523.43049791022577, + "IsEmpty": false + }, + "Timestamp": 637316491342876390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605706871, + "Position": { + "X": 996.07100454770307, + "Y": 523.3126223977805, + "IsEmpty": false + }, + "Timestamp": 637316491343555690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61351949, + "Position": { + "X": 996.42577506322618, + "Y": 523.13580912911277, + "IsEmpty": false + }, + "Timestamp": 637316491343715830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 996.42577506322618, + "Y": 524.19650570460942, + "IsEmpty": false + }, + "Timestamp": 637316491344058960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 996.01188375497043, + "Y": 526.61258763671572, + "IsEmpty": false + }, + "Timestamp": 637316491344223360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 994.8293763820634, + "Y": 529.79467736320566, + "IsEmpty": false + }, + "Timestamp": 637316491344393190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629144728, + "Position": { + "X": 993.64684612959263, + "Y": 533.86065039652453, + "IsEmpty": false + }, + "Timestamp": 637316491344559100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 990.98618166098811, + "Y": 540.93189988766551, + "IsEmpty": false + }, + "Timestamp": 637316491344730490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 989.44890377255808, + "Y": 546.47113379003918, + "IsEmpty": false + }, + "Timestamp": 637316491344903870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 988.85765008610451, + "Y": 552.7763754867965, + "IsEmpty": false + }, + "Timestamp": 637316491345068970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644769967, + "Position": { + "X": 987.97074667686047, + "Y": 559.67090322752472, + "IsEmpty": false + }, + "Timestamp": 637316491345236320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644769967, + "Position": { + "X": 985.96047956700579, + "Y": 568.51001085057851, + "IsEmpty": false + }, + "Timestamp": 637316491345404800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646723151, + "Position": { + "X": 984.95533457229658, + "Y": 573.16526992786828, + "IsEmpty": false + }, + "Timestamp": 637316491345579230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 984.12757483534892, + "Y": 577.34920999188728, + "IsEmpty": false + }, + "Timestamp": 637316491345741000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 983.18155063337235, + "Y": 581.5919047756189, + "IsEmpty": false + }, + "Timestamp": 637316491345916160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 981.99902038090158, + "Y": 587.13113867799257, + "IsEmpty": false + }, + "Timestamp": 637316491346088450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 981.23038143668657, + "Y": 590.25429064825994, + "IsEmpty": false + }, + "Timestamp": 637316491346251830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 980.46174249247144, + "Y": 592.49355931169839, + "IsEmpty": false + }, + "Timestamp": 637316491346421270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 979.9887532710469, + "Y": 593.78991539383037, + "IsEmpty": false + }, + "Timestamp": 637316491346591730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 979.63398275552379, + "Y": 594.67389021891427, + "IsEmpty": false + }, + "Timestamp": 637316491346764040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652582586, + "Position": { + "X": 979.1609706545355, + "Y": 595.97024630104636, + "IsEmpty": false + }, + "Timestamp": 637316491346933730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652582586, + "Position": { + "X": 978.39233171032049, + "Y": 597.50235340806876, + "IsEmpty": false + }, + "Timestamp": 637316491347095500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652582586, + "Position": { + "X": 977.44633038790755, + "Y": 598.97561427712355, + "IsEmpty": false + }, + "Timestamp": 637316491347271310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652582586, + "Position": { + "X": 976.67769144369254, + "Y": 601.03806967189428, + "IsEmpty": false + }, + "Timestamp": 637316491347440130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652582586, + "Position": { + "X": 976.55942697866362, + "Y": 601.80407746627793, + "IsEmpty": false + }, + "Timestamp": 637316491347610010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 976.38206460046581, + "Y": 602.1577040036135, + "IsEmpty": false + }, + "Timestamp": 637316491347778420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 976.67769144369254, + "Y": 601.21479142230703, + "IsEmpty": false + }, + "Timestamp": 637316491348788880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.25584802, + "Position": { + "X": 977.50545118064019, + "Y": 598.20951496448481, + "IsEmpty": false + }, + "Timestamp": 637316491348891430, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "77309851-4967-4665-b856-a2ee1d866233", + "Points": [ + { + "Pressure": 0.0783550739, + "Position": { + "X": 952.6725446743917, + "Y": 523.01793361666762, + "IsEmpty": false + }, + "Timestamp": 637316491353158320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.150865942, + "Position": { + "X": 953.02729231035107, + "Y": 523.3126223977805, + "IsEmpty": false + }, + "Timestamp": 637316491353579210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.283192188, + "Position": { + "X": 953.79593125456609, + "Y": 523.78403292930625, + "IsEmpty": false + }, + "Timestamp": 637316491354039000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.333974212, + "Position": { + "X": 954.91931783474058, + "Y": 525.49295330499649, + "IsEmpty": false + }, + "Timestamp": 637316491354192650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.364980549, + "Position": { + "X": 955.4514507284614, + "Y": 526.90718489957362, + "IsEmpty": false + }, + "Timestamp": 637316491354391400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.38158235, + "Position": { + "X": 955.56971519349042, + "Y": 527.49647094354452, + "IsEmpty": false + }, + "Timestamp": 637316491354527450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.421622038, + "Position": { + "X": 955.80622124398451, + "Y": 531.26784671400549, + "IsEmpty": false + }, + "Timestamp": 637316491354696040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.444327444, + "Position": { + "X": 955.0375822997695, + "Y": 537.04274012301448, + "IsEmpty": false + }, + "Timestamp": 637316491354872110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.45091936, + "Position": { + "X": 954.74195545654277, + "Y": 541.81587471274941, + "IsEmpty": false + }, + "Timestamp": 637316491355038940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.462394148, + "Position": { + "X": 955.0375822997695, + "Y": 546.4121960338166, + "IsEmpty": false + }, + "Timestamp": 637316491355204960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.475577921, + "Position": { + "X": 955.68795677895559, + "Y": 550.83179560447093, + "IsEmpty": false + }, + "Timestamp": 637316491355375170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.489005864, + "Position": { + "X": 956.16096887994388, + "Y": 556.96022403256052, + "IsEmpty": false + }, + "Timestamp": 637316491355541340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.490959018, + "Position": { + "X": 956.33835413770544, + "Y": 560.79053755924394, + "IsEmpty": false + }, + "Timestamp": 637316491355708710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.492912173, + "Position": { + "X": 956.63398098093217, + "Y": 564.50297557348222, + "IsEmpty": false + }, + "Timestamp": 637316491355882050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.497306794, + "Position": { + "X": 956.98872861689154, + "Y": 567.21365476844653, + "IsEmpty": false + }, + "Timestamp": 637316491356057130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503166258, + "Position": { + "X": 957.10699308192045, + "Y": 567.74400305619486, + "IsEmpty": false + }, + "Timestamp": 637316491356226230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 957.99387361160075, + "Y": 570.69034175779439, + "IsEmpty": false + }, + "Timestamp": 637316491356903190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 958.8216333485484, + "Y": 572.51713764592978, + "IsEmpty": false + }, + "Timestamp": 637316491357065010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 959.29464544953669, + "Y": 573.34208319653601, + "IsEmpty": false + }, + "Timestamp": 637316491357366740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 960.18154885878073, + "Y": 575.28666307886158, + "IsEmpty": false + }, + "Timestamp": 637316491357425480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 960.89104413069947, + "Y": 579.1759143617677, + "IsEmpty": false + }, + "Timestamp": 637316491357569260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 961.36405623168775, + "Y": 581.06155648787058, + "IsEmpty": false + }, + "Timestamp": 637316491357739710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 962.72394886235634, + "Y": 587.54361145329574, + "IsEmpty": false + }, + "Timestamp": 637316491357907650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 962.72394886235634, + "Y": 591.55073824864689, + "IsEmpty": false + }, + "Timestamp": 637316491358084230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 963.61085227160027, + "Y": 595.85237078860109, + "IsEmpty": false + }, + "Timestamp": 637316491358262120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 963.61085227160027, + "Y": 596.79528336990757, + "IsEmpty": false + }, + "Timestamp": 637316491358420770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 963.84735832209446, + "Y": 597.67916667673649, + "IsEmpty": false + }, + "Timestamp": 637316491358585830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 963.61085227160027, + "Y": 599.56480880283948, + "IsEmpty": false + }, + "Timestamp": 637316491358754940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 963.90647911482711, + "Y": 603.04158731044231, + "IsEmpty": false + }, + "Timestamp": 637316491358928730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 964.20210595805383, + "Y": 605.16298046143561, + "IsEmpty": false + }, + "Timestamp": 637316491359090500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 964.26122675078648, + "Y": 605.98792601204195, + "IsEmpty": false + }, + "Timestamp": 637316491359268440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 964.02472070029228, + "Y": 604.51475666124213, + "IsEmpty": false + }, + "Timestamp": 637316491359942160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 964.08386437258866, + "Y": 603.6898111106359, + "IsEmpty": false + }, + "Timestamp": 637316491360111240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.512932003, + "Position": { + "X": 964.02472070029228, + "Y": 599.74162207150721, + "IsEmpty": false + }, + "Timestamp": 637316491360280800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510734737, + "Position": { + "X": 963.84735832209446, + "Y": 597.67916667673649, + "IsEmpty": false + }, + "Timestamp": 637316491360451250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.491203159, + "Position": { + "X": 963.84735832209446, + "Y": 593.49531813097246, + "IsEmpty": false + }, + "Timestamp": 637316491360622010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.409903109, + "Position": { + "X": 963.72909385706555, + "Y": 590.25429064825994, + "IsEmpty": false + }, + "Timestamp": 637316491360698060, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "485f10f1-8226-4502-b8ec-181590e8bb5e", + "Points": [ + { + "Pressure": 0.227527276, + "Position": { + "X": 970.17383225401272, + "Y": 558.1977338767249, + "IsEmpty": false + }, + "Timestamp": 637316491362568420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.252185851, + "Position": { + "X": 970.64684435500101, + "Y": 558.13879612050232, + "IsEmpty": false + }, + "Timestamp": 637316491362641930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.368398577, + "Position": { + "X": 969.28695172433243, + "Y": 561.91017189096317, + "IsEmpty": false + }, + "Timestamp": 637316491363372080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.3857328, + "Position": { + "X": 969.28695172433243, + "Y": 564.56191332970491, + "IsEmpty": false + }, + "Timestamp": 637316491363483520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.409903109, + "Position": { + "X": 968.75479595104787, + "Y": 568.80469963169151, + "IsEmpty": false + }, + "Timestamp": 637316491363655330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.420157164, + "Position": { + "X": 968.93218120880942, + "Y": 571.92785160195888, + "IsEmpty": false + }, + "Timestamp": 637316491363823930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.424063474, + "Position": { + "X": 969.34607251706507, + "Y": 575.40453859130673, + "IsEmpty": false + }, + "Timestamp": 637316491363993710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.427969784, + "Position": { + "X": 969.93732620351852, + "Y": 578.94016333687728, + "IsEmpty": false + }, + "Timestamp": 637316491364166910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.431876093, + "Position": { + "X": 969.99644699625117, + "Y": 582.82941461978328, + "IsEmpty": false + }, + "Timestamp": 637316491364338150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.431876093, + "Position": { + "X": 970.11471146128008, + "Y": 583.24188739508645, + "IsEmpty": false + }, + "Timestamp": 637316491364499050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.431876093, + "Position": { + "X": 970.52857988997209, + "Y": 583.53657617619945, + "IsEmpty": false + }, + "Timestamp": 637316491364667130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.436026543, + "Position": { + "X": 969.81908461805335, + "Y": 584.24364621436052, + "IsEmpty": false + }, + "Timestamp": 637316491365177170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.436026543, + "Position": { + "X": 970.23295304674537, + "Y": 585.30434278985717, + "IsEmpty": false + }, + "Timestamp": 637316491365348350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.443106741, + "Position": { + "X": 970.11471146128008, + "Y": 588.60430802879239, + "IsEmpty": false + }, + "Timestamp": 637316491365521300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.449454486, + "Position": { + "X": 969.99644699625117, + "Y": 591.02038996089857, + "IsEmpty": false + }, + "Timestamp": 637316491365686950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.45482567, + "Position": { + "X": 970.05556778898381, + "Y": 593.25956710608205, + "IsEmpty": false + }, + "Timestamp": 637316491365855650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.467521161, + "Position": { + "X": 970.05556778898381, + "Y": 595.38096025707546, + "IsEmpty": false + }, + "Timestamp": 637316491366028790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.489982456, + "Position": { + "X": 970.46945909723945, + "Y": 596.79528336990757, + "IsEmpty": false + }, + "Timestamp": 637316491366197100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.502677977, + "Position": { + "X": 970.23295304674537, + "Y": 598.03270169581708, + "IsEmpty": false + }, + "Timestamp": 637316491366363350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.502677977, + "Position": { + "X": 969.58257856755927, + "Y": 598.32739047692996, + "IsEmpty": false + }, + "Timestamp": 637316491366524650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480460823, + "Position": { + "X": 969.10956646657087, + "Y": 598.32739047692996, + "IsEmpty": false + }, + "Timestamp": 637316491366703500, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "86a800d8-4536-4119-a078-f8dbc5f0755b", + "Points": [ + { + "Pressure": 0.0610208288, + "Position": { + "X": 1015.4643405312773, + "Y": 536.63026734771131, + "IsEmpty": false + }, + "Timestamp": 637316491376115880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.177477688, + "Position": { + "X": 1015.6417257890388, + "Y": 536.33557856659831, + "IsEmpty": false + }, + "Timestamp": 637316491376414920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.260730892, + "Position": { + "X": 1015.9964734249982, + "Y": 534.98028472824376, + "IsEmpty": false + }, + "Timestamp": 637316491376623460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.319813848, + "Position": { + "X": 1015.9373526322656, + "Y": 533.56596161541154, + "IsEmpty": false + }, + "Timestamp": 637316491376767850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.372304887, + "Position": { + "X": 1015.7008465817714, + "Y": 532.74101606480519, + "IsEmpty": false + }, + "Timestamp": 637316491376944470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.419668883, + "Position": { + "X": 1015.4052197385447, + "Y": 531.97491675216656, + "IsEmpty": false + }, + "Timestamp": 637316491377164730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.455313951, + "Position": { + "X": 1014.1635686933413, + "Y": 531.14997120156022, + "IsEmpty": false + }, + "Timestamp": 637316491377345390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.467765301, + "Position": { + "X": 1013.2766652840974, + "Y": 531.14997120156022, + "IsEmpty": false + }, + "Timestamp": 637316491377512310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.485099554, + "Position": { + "X": 1012.3897847544171, + "Y": 531.73925724553123, + "IsEmpty": false + }, + "Timestamp": 637316491377683690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.493888766, + "Position": { + "X": 1011.20727738151, + "Y": 533.03561332766321, + "IsEmpty": false + }, + "Timestamp": 637316491377852810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49974823, + "Position": { + "X": 1010.0247471290393, + "Y": 534.03746366519226, + "IsEmpty": false + }, + "Timestamp": 637316491378024430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.505119383, + "Position": { + "X": 1009.6699994930799, + "Y": 534.39099868427286, + "IsEmpty": false + }, + "Timestamp": 637316491378183490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 1008.1918423973824, + "Y": 535.98204354751783, + "IsEmpty": false + }, + "Timestamp": 637316491378363540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514885187, + "Position": { + "X": 1007.7188302963941, + "Y": 536.98380236679191, + "IsEmpty": false + }, + "Timestamp": 637316491378537110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521721244, + "Position": { + "X": 1006.8910705594465, + "Y": 538.33909620514646, + "IsEmpty": false + }, + "Timestamp": 637316491378689110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526115835, + "Position": { + "X": 1006.5954437162197, + "Y": 538.75166049870461, + "IsEmpty": false + }, + "Timestamp": 637316491378867180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532463551, + "Position": { + "X": 1005.9450463574699, + "Y": 540.16589209328185, + "IsEmpty": false + }, + "Timestamp": 637316491379030310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.549797833, + "Position": { + "X": 1005.7676839792721, + "Y": 541.63906144408156, + "IsEmpty": false + }, + "Timestamp": 637316491379207820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58129245, + "Position": { + "X": 1005.8268047720046, + "Y": 542.11047197560731, + "IsEmpty": false + }, + "Timestamp": 637316491379376810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54442662, + "Position": { + "X": 1006.4180584584582, + "Y": 544.11398961415546, + "IsEmpty": false + }, + "Timestamp": 637316491379546480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54833293, + "Position": { + "X": 1007.6005887109289, + "Y": 545.76397223362301, + "IsEmpty": false + }, + "Timestamp": 637316491379753520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552239239, + "Position": { + "X": 1008.4874692406091, + "Y": 546.4121960338166, + "IsEmpty": false + }, + "Timestamp": 637316491379876650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554192424, + "Position": { + "X": 1010.2612531795335, + "Y": 547.53183036553582, + "IsEmpty": false + }, + "Timestamp": 637316491380044420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.556145549, + "Position": { + "X": 1011.6802666029346, + "Y": 548.29792967817446, + "IsEmpty": false + }, + "Timestamp": 637316491380212190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558098733, + "Position": { + "X": 1013.0993029058995, + "Y": 548.88712420389038, + "IsEmpty": false + }, + "Timestamp": 637316491380393030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1014.3409539511028, + "Y": 548.94606196011296, + "IsEmpty": false + }, + "Timestamp": 637316491380569350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1015.9964734249982, + "Y": 548.1800541657293, + "IsEmpty": false + }, + "Timestamp": 637316491380720500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1017.1198600051727, + "Y": 546.58900930248433, + "IsEmpty": false + }, + "Timestamp": 637316491380890340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1018.4206318431086, + "Y": 543.40691957599438, + "IsEmpty": false + }, + "Timestamp": 637316491381064340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1018.9527647368295, + "Y": 540.99083764388809, + "IsEmpty": false + }, + "Timestamp": 637316491381234800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1019.1301499945911, + "Y": 538.81050673667221, + "IsEmpty": false + }, + "Timestamp": 637316491381402780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1019.0710292018584, + "Y": 537.10167787923706, + "IsEmpty": false + }, + "Timestamp": 637316491381567500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1018.5388963081375, + "Y": 534.62665819090819, + "IsEmpty": false + }, + "Timestamp": 637316491381736500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1018.2432694649108, + "Y": 533.97852590896969, + "IsEmpty": false + }, + "Timestamp": 637316491381911570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1017.5337513134283, + "Y": 533.56596161541154, + "IsEmpty": false + }, + "Timestamp": 637316491382079100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1016.6468479041843, + "Y": 533.68383712785669, + "IsEmpty": false + }, + "Timestamp": 637316491382247660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1015.3460760662483, + "Y": 534.68559594713076, + "IsEmpty": false + }, + "Timestamp": 637316491382416370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1014.5774371220333, + "Y": 535.39275750354693, + "IsEmpty": false + }, + "Timestamp": 637316491382587650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560051858, + "Position": { + "X": 1014.1635686933413, + "Y": 535.74629252262741, + "IsEmpty": false + }, + "Timestamp": 637316491382751580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.313954383, + "Position": { + "X": 1013.8088210573819, + "Y": 536.04098130374041, + "IsEmpty": false + }, + "Timestamp": 637316491382925760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.302723736, + "Position": { + "X": 1014.1635686933413, + "Y": 535.86416803507257, + "IsEmpty": false + }, + "Timestamp": 637316491383932310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.291248947, + "Position": { + "X": 1014.4591955365681, + "Y": 535.62850852843724, + "IsEmpty": false + }, + "Timestamp": 637316491384102300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.282703906, + "Position": { + "X": 1015.0504492230216, + "Y": 534.98028472824376, + "IsEmpty": false + }, + "Timestamp": 637316491384270720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.290760666, + "Position": { + "X": 1015.7599673745041, + "Y": 534.50887419671801, + "IsEmpty": false + }, + "Timestamp": 637316491384448030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.332753479, + "Position": { + "X": 1016.8833539546785, + "Y": 534.80347145957592, + "IsEmpty": false + }, + "Timestamp": 637316491384611820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.361074239, + "Position": { + "X": 1018.5388963081375, + "Y": 536.39451632282089, + "IsEmpty": false + }, + "Timestamp": 637316491384776950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.372793168, + "Position": { + "X": 1019.4257768378178, + "Y": 538.81050673667221, + "IsEmpty": false + }, + "Timestamp": 637316491384953790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.153063253, + "Position": { + "X": 1021.613429205434, + "Y": 541.52118593163641, + "IsEmpty": false + }, + "Timestamp": 637316491385075130, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "952796ab-79b0-4053-9ea3-fceb07d70da1", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 1034.0298938983401, + "Y": 555.1923659006477, + "IsEmpty": false + }, + "Timestamp": 637316491386775460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.237048909, + "Position": { + "X": 1033.9707731056076, + "Y": 553.0121265116868, + "IsEmpty": false + }, + "Timestamp": 637316491386781090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.309315622, + "Position": { + "X": 1031.7831207379913, + "Y": 550.83179560447093, + "IsEmpty": false + }, + "Timestamp": 637316491387140320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.317128241, + "Position": { + "X": 1031.3692294297357, + "Y": 550.71392009202577, + "IsEmpty": false + }, + "Timestamp": 637316491387144270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.345449001, + "Position": { + "X": 1028.8268065465963, + "Y": 550.83179560447093, + "IsEmpty": false + }, + "Timestamp": 637316491387529610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.372793168, + "Position": { + "X": 1025.2201178760151, + "Y": 551.833554423745, + "IsEmpty": false + }, + "Timestamp": 637316491387676980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.379140913, + "Position": { + "X": 1023.0324655083989, + "Y": 552.65849997435134, + "IsEmpty": false + }, + "Timestamp": 637316491387820160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.386953533, + "Position": { + "X": 1021.5543084127014, + "Y": 553.18884826209967, + "IsEmpty": false + }, + "Timestamp": 637316491387985730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.388906687, + "Position": { + "X": 1020.4900426252595, + "Y": 553.42459928698997, + "IsEmpty": false + }, + "Timestamp": 637316491388157840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.394766152, + "Position": { + "X": 1020.2535365747655, + "Y": 553.42459928698997, + "IsEmpty": false + }, + "Timestamp": 637316491388326700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.4142977, + "Position": { + "X": 1020.0170305242713, + "Y": 553.30672377454482, + "IsEmpty": false + }, + "Timestamp": 637316491388493140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.420157164, + "Position": { + "X": 1020.5491634179922, + "Y": 553.12991050587698, + "IsEmpty": false + }, + "Timestamp": 637316491388671820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.422110319, + "Position": { + "X": 1023.0324655083989, + "Y": 552.95318875546423, + "IsEmpty": false + }, + "Timestamp": 637316491388830390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.427969784, + "Position": { + "X": 1025.5748883915383, + "Y": 553.0709727496544, + "IsEmpty": false + }, + "Timestamp": 637316491389004680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.427969784, + "Position": { + "X": 1028.2355528601427, + "Y": 553.0121265116868, + "IsEmpty": false + }, + "Timestamp": 637316491389177620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.427969784, + "Position": { + "X": 1028.9450710116253, + "Y": 552.89425099924165, + "IsEmpty": false + }, + "Timestamp": 637316491389347200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.421377897, + "Position": { + "X": 1028.4720589106369, + "Y": 552.12815168660302, + "IsEmpty": false + }, + "Timestamp": 637316491389674730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.431631953, + "Position": { + "X": 1025.8113944420325, + "Y": 551.36214389221925, + "IsEmpty": false + }, + "Timestamp": 637316491389853000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.447257191, + "Position": { + "X": 1023.6237191948525, + "Y": 551.36214389221925, + "IsEmpty": false + }, + "Timestamp": 637316491390025850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.461173415, + "Position": { + "X": 1021.4360668272362, + "Y": 551.36214389221925, + "IsEmpty": false + }, + "Timestamp": 637316491390192490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.468986034, + "Position": { + "X": 1019.6031620955794, + "Y": 551.59780339885469, + "IsEmpty": false + }, + "Timestamp": 637316491390356490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480704963, + "Position": { + "X": 1018.0658842071492, + "Y": 551.833554423745, + "IsEmpty": false + }, + "Timestamp": 637316491390533730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.496330202, + "Position": { + "X": 1017.7111136916261, + "Y": 551.89249217996758, + "IsEmpty": false + }, + "Timestamp": 637316491390696210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506096005, + "Position": { + "X": 1018.2432694649108, + "Y": 552.71743773057392, + "IsEmpty": false + }, + "Timestamp": 637316491391375250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506096005, + "Position": { + "X": 1018.7754023586317, + "Y": 552.89425099924165, + "IsEmpty": false + }, + "Timestamp": 637316491391543170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.500480652, + "Position": { + "X": 1019.3075352523526, + "Y": 552.83531324301907, + "IsEmpty": false + }, + "Timestamp": 637316491391883500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.489738315, + "Position": { + "X": 1017.2381244702016, + "Y": 552.24602719904817, + "IsEmpty": false + }, + "Timestamp": 637316491392382530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.485832006, + "Position": { + "X": 1013.2766652840974, + "Y": 550.8907333606935, + "IsEmpty": false + }, + "Timestamp": 637316491392552660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.485832006, + "Position": { + "X": 1010.1429887145044, + "Y": 549.88888302316445, + "IsEmpty": false + }, + "Timestamp": 637316491392721190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.485832006, + "Position": { + "X": 1007.068455817208, + "Y": 549.53534800408397, + "IsEmpty": false + }, + "Timestamp": 637316491392889460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.485832006, + "Position": { + "X": 1004.112141625813, + "Y": 549.77109902897428, + "IsEmpty": false + }, + "Timestamp": 637316491393063290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.489738315, + "Position": { + "X": 1000.8011026780223, + "Y": 551.2442683797741, + "IsEmpty": false + }, + "Timestamp": 637316491393235170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49169147, + "Position": { + "X": 999.55945163281899, + "Y": 552.95318875546423, + "IsEmpty": false + }, + "Timestamp": 637316491393398960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49559778, + "Position": { + "X": 998.67254822357495, + "Y": 554.66201761289938, + "IsEmpty": false + }, + "Timestamp": 637316491393564120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.497550935, + "Position": { + "X": 998.43604217308086, + "Y": 555.42811692553812, + "IsEmpty": false + }, + "Timestamp": 637316491393737530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.493888766, + "Position": { + "X": 998.79081268860398, + "Y": 556.19421623817686, + "IsEmpty": false + }, + "Timestamp": 637316491393905770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.482658118, + "Position": { + "X": 999.38206637505743, + "Y": 556.31200023236704, + "IsEmpty": false + }, + "Timestamp": 637316491394071740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.417715728, + "Position": { + "X": 1001.8062247931678, + "Y": 556.19421623817686, + "IsEmpty": false + }, + "Timestamp": 637316491394146590, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e2000baf-5185-4a25-9a75-8ab216e75594", + "Points": [ + { + "Pressure": 0.0458838791, + "Position": { + "X": 1025.6340091842708, + "Y": 553.12991050587698, + "IsEmpty": false + }, + "Timestamp": 637316491395501540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.238269627, + "Position": { + "X": 1026.2252628707242, + "Y": 552.54062446190608, + "IsEmpty": false + }, + "Timestamp": 637316491395858680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.325673312, + "Position": { + "X": 1028.0581676023812, + "Y": 552.30496495527075, + "IsEmpty": false + }, + "Timestamp": 637316491395977410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.360097647, + "Position": { + "X": 1029.654566283544, + "Y": 552.48177822393848, + "IsEmpty": false + }, + "Timestamp": 637316491396099680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.38597697, + "Position": { + "X": 1030.777975743282, + "Y": 552.59956221812865, + "IsEmpty": false + }, + "Timestamp": 637316491396271340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.404776067, + "Position": { + "X": 1031.5466146874971, + "Y": 552.59956221812865, + "IsEmpty": false + }, + "Timestamp": 637316491396553470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.413321137, + "Position": { + "X": 1031.8422415307239, + "Y": 552.59956221812865, + "IsEmpty": false + }, + "Timestamp": 637316491396625230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.415274292, + "Position": { + "X": 1032.1378683739506, + "Y": 552.83531324301907, + "IsEmpty": false + }, + "Timestamp": 637316491396785050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.415274292, + "Position": { + "X": 1032.4334952171773, + "Y": 553.6602587936253, + "IsEmpty": false + }, + "Timestamp": 637316491396941500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.417471588, + "Position": { + "X": 1032.5517368026426, + "Y": 554.13166932515105, + "IsEmpty": false + }, + "Timestamp": 637316491397119390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.423331052, + "Position": { + "X": 1032.6700012676715, + "Y": 555.13351966268021, + "IsEmpty": false + }, + "Timestamp": 637316491397290330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.427237362, + "Position": { + "X": 1032.5517368026426, + "Y": 555.60493019420585, + "IsEmpty": false + }, + "Timestamp": 637316491397460740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.431143671, + "Position": { + "X": 1032.3743744244448, + "Y": 556.54775125725735, + "IsEmpty": false + }, + "Timestamp": 637316491397623620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.435538262, + "Position": { + "X": 1032.3743744244448, + "Y": 557.01916178878309, + "IsEmpty": false + }, + "Timestamp": 637316491397792300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.451163501, + "Position": { + "X": 1032.610880474939, + "Y": 557.37269680786369, + "IsEmpty": false + }, + "Timestamp": 637316491397966860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.47118333, + "Position": { + "X": 1033.7342670551134, + "Y": 558.13879612050232, + "IsEmpty": false + }, + "Timestamp": 637316491398126420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.492423892, + "Position": { + "X": 1034.9759181003167, + "Y": 558.7870199206958, + "IsEmpty": false + }, + "Timestamp": 637316491398300550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51586175, + "Position": { + "X": 1035.3897865290087, + "Y": 559.02267942733124, + "IsEmpty": false + }, + "Timestamp": 637316491398467210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521721244, + "Position": { + "X": 1035.8627986299971, + "Y": 559.19949269599897, + "IsEmpty": false + }, + "Timestamp": 637316491398642240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523674369, + "Position": { + "X": 1035.5671717867701, + "Y": 558.90480391488609, + "IsEmpty": false + }, + "Timestamp": 637316491399149400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523674369, + "Position": { + "X": 1035.094159685782, + "Y": 558.7870199206958, + "IsEmpty": false + }, + "Timestamp": 637316491399319890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523674369, + "Position": { + "X": 1034.6211475847936, + "Y": 558.90480391488609, + "IsEmpty": false + }, + "Timestamp": 637316491399487700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523674369, + "Position": { + "X": 1033.6751462623808, + "Y": 559.25843045222155, + "IsEmpty": false + }, + "Timestamp": 637316491399653810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523674369, + "Position": { + "X": 1032.610880474939, + "Y": 560.14231375905047, + "IsEmpty": false + }, + "Timestamp": 637316491399814990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523674369, + "Position": { + "X": 1030.9553381214798, + "Y": 562.14583139759861, + "IsEmpty": false + }, + "Timestamp": 637316491399985450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523674369, + "Position": { + "X": 1029.5954454908112, + "Y": 564.56191332970491, + "IsEmpty": false + }, + "Timestamp": 637316491400154020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523674369, + "Position": { + "X": 1028.1764320674101, + "Y": 567.33143876263671, + "IsEmpty": false + }, + "Timestamp": 637316491400326140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 1027.171287072701, + "Y": 570.10105571382348, + "IsEmpty": false + }, + "Timestamp": 637316491400500810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 1025.7522507697361, + "Y": 575.1688790846714, + "IsEmpty": false + }, + "Timestamp": 637316491400665750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 1024.8062494473231, + "Y": 579.29378987421285, + "IsEmpty": false + }, + "Timestamp": 637316491400834910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 1023.6237191948525, + "Y": 583.35976290753172, + "IsEmpty": false + }, + "Timestamp": 637316491401003170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 1022.0864413064223, + "Y": 587.72042472196347, + "IsEmpty": false + }, + "Timestamp": 637316491401169450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 1020.2535365747655, + "Y": 591.37392497997917, + "IsEmpty": false + }, + "Timestamp": 637316491401344470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 1018.8936439440969, + "Y": 593.61319364341762, + "IsEmpty": false + }, + "Timestamp": 637316491401508020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 1018.1250049998819, + "Y": 595.67564903818834, + "IsEmpty": false + }, + "Timestamp": 637316491401673770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 1017.7111136916261, + "Y": 597.97376393959439, + "IsEmpty": false + }, + "Timestamp": 637316491401852160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 1017.5928721061609, + "Y": 601.15585366608445, + "IsEmpty": false + }, + "Timestamp": 637316491402019340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 1017.4746305206957, + "Y": 602.45230126647141, + "IsEmpty": false + }, + "Timestamp": 637316491402183180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 1017.1789807979052, + "Y": 603.98440837349381, + "IsEmpty": false + }, + "Timestamp": 637316491402353250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 1016.5877271114517, + "Y": 606.28261479315495, + "IsEmpty": false + }, + "Timestamp": 637316491402522250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 1016.1738586827597, + "Y": 607.57897087528693, + "IsEmpty": false + }, + "Timestamp": 637316491402697580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 1015.8782089599692, + "Y": 608.46294570037082, + "IsEmpty": false + }, + "Timestamp": 637316491402860890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 1015.6417257890388, + "Y": 609.4647045196449, + "IsEmpty": false + }, + "Timestamp": 637316491403035810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 1015.5234613240099, + "Y": 609.87717729494796, + "IsEmpty": false + }, + "Timestamp": 637316491403204940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 1015.4052197385447, + "Y": 610.23071231402855, + "IsEmpty": false + }, + "Timestamp": 637316491403373720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 1015.3460760662483, + "Y": 610.64318508933172, + "IsEmpty": false + }, + "Timestamp": 637316491403535110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 1015.2278344807831, + "Y": 611.46822215819293, + "IsEmpty": false + }, + "Timestamp": 637316491403705560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531486988, + "Position": { + "X": 1015.1687136880505, + "Y": 611.8806949334961, + "IsEmpty": false + }, + "Timestamp": 637316491403878720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531486988, + "Position": { + "X": 1015.1095700157542, + "Y": 612.29316770879927, + "IsEmpty": false + }, + "Timestamp": 637316491404051000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.52806896, + "Position": { + "X": 1014.7548223797949, + "Y": 611.93963268971868, + "IsEmpty": false + }, + "Timestamp": 637316491404556890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.45091936, + "Position": { + "X": 1014.2226894860739, + "Y": 610.87893611422203, + "IsEmpty": false + }, + "Timestamp": 637316491404663680, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8fea62f1-e8c2-46b2-aeab-65c8f8bdd6c8", + "Points": [ + { + "Pressure": 0.240222782, + "Position": { + "X": 992.93732797811026, + "Y": 555.54599243798327, + "IsEmpty": false + }, + "Timestamp": 637316491407492320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.287586778, + "Position": { + "X": 993.05559244313918, + "Y": 556.01740296950902, + "IsEmpty": false + }, + "Timestamp": 637316491407932680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.340077817, + "Position": { + "X": 993.88335218008683, + "Y": 558.66914440825065, + "IsEmpty": false + }, + "Timestamp": 637316491408102660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.363759816, + "Position": { + "X": 994.71111191703449, + "Y": 561.61548310985029, + "IsEmpty": false + }, + "Timestamp": 637316491408266100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.383291364, + "Position": { + "X": 995.7162569117437, + "Y": 565.09226161745323, + "IsEmpty": false + }, + "Timestamp": 637316491408434130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.406485081, + "Position": { + "X": 997.60828243613321, + "Y": 570.3368067387139, + "IsEmpty": false + }, + "Timestamp": 637316491408604620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412344545, + "Position": { + "X": 998.79081268860398, + "Y": 572.75279715256511, + "IsEmpty": false + }, + "Timestamp": 637316491408779740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412344545, + "Position": { + "X": 999.50033084008635, + "Y": 573.93136924050691, + "IsEmpty": false + }, + "Timestamp": 637316491408949650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412344545, + "Position": { + "X": 1000.1507053192724, + "Y": 572.39926213348463, + "IsEmpty": false + }, + "Timestamp": 637316491409283450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412344545, + "Position": { + "X": 999.97332006151089, + "Y": 570.51352848912666, + "IsEmpty": false + }, + "Timestamp": 637316491409453290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.407705814, + "Position": { + "X": 999.67769321828416, + "Y": 568.45107309435593, + "IsEmpty": false + }, + "Timestamp": 637316491409616020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.405752659, + "Position": { + "X": 999.14556032456323, + "Y": 566.50649321203036, + "IsEmpty": false + }, + "Timestamp": 637316491409786070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.399893194, + "Position": { + "X": 998.79081268860398, + "Y": 565.79933165561431, + "IsEmpty": false + }, + "Timestamp": 637316491409959420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.39794004, + "Position": { + "X": 998.55430663810978, + "Y": 565.50473439275629, + "IsEmpty": false + }, + "Timestamp": 637316491410128350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.408194095, + "Position": { + "X": 998.49518584537714, + "Y": 565.97614492428204, + "IsEmpty": false + }, + "Timestamp": 637316491410289840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.425284207, + "Position": { + "X": 999.02731873909806, + "Y": 568.03860031905276, + "IsEmpty": false + }, + "Timestamp": 637316491410459540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.45482567, + "Position": { + "X": 1000.2689697843015, + "Y": 571.39750331421055, + "IsEmpty": false + }, + "Timestamp": 637316491410634390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.470450908, + "Position": { + "X": 1001.5697416222374, + "Y": 574.52065528447793, + "IsEmpty": false + }, + "Timestamp": 637316491410822860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480704963, + "Position": { + "X": 1003.5208879393595, + "Y": 578.40981504912895, + "IsEmpty": false + }, + "Timestamp": 637316491410969130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.494132906, + "Position": { + "X": 1005.8268047720046, + "Y": 583.12410340089627, + "IsEmpty": false + }, + "Timestamp": 637316491411144060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.511711299, + "Position": { + "X": 1008.250963190115, + "Y": 588.60430802879239, + "IsEmpty": false + }, + "Timestamp": 637316491411308680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523674369, + "Position": { + "X": 1009.9065055435741, + "Y": 592.55249706792097, + "IsEmpty": false + }, + "Timestamp": 637316491411487220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 1010.8525068659869, + "Y": 594.90954972554971, + "IsEmpty": false + }, + "Timestamp": 637316491411646490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 1011.5620250174694, + "Y": 596.73634561368499, + "IsEmpty": false + }, + "Timestamp": 637316491411819160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 1012.4489055471497, + "Y": 599.80055982772978, + "IsEmpty": false + }, + "Timestamp": 637316491412065160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 1012.9810384408705, + "Y": 601.98089073494566, + "IsEmpty": false + }, + "Timestamp": 637316491412152090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 1013.3949297491263, + "Y": 604.04334612971638, + "IsEmpty": false + }, + "Timestamp": 637316491412318350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 1013.8088210573819, + "Y": 606.28261479315495, + "IsEmpty": false + }, + "Timestamp": 637316491412492210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 1014.4591955365681, + "Y": 609.52364227586747, + "IsEmpty": false + }, + "Timestamp": 637316491412667510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531486988, + "Position": { + "X": 1014.8139431725274, + "Y": 610.93787387044461, + "IsEmpty": false + }, + "Timestamp": 637316491412833440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537346482, + "Position": { + "X": 1014.9913284302889, + "Y": 612.35210546502185, + "IsEmpty": false + }, + "Timestamp": 637316491412997340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537346482, + "Position": { + "X": 1014.9913284302889, + "Y": 612.8235159965476, + "IsEmpty": false + }, + "Timestamp": 637316491413173950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537346482, + "Position": { + "X": 1014.9913284302889, + "Y": 613.29492652807335, + "IsEmpty": false + }, + "Timestamp": 637316491413343470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521721244, + "Position": { + "X": 1014.8730868448238, + "Y": 613.7074908216315, + "IsEmpty": false + }, + "Timestamp": 637316491413512470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.214831769, + "Position": { + "X": 1014.5774371220333, + "Y": 613.94315032826682, + "IsEmpty": false + }, + "Timestamp": 637316491413600880, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7c7b03f0-ddc8-4fe6-919e-53fb82c24567", + "Points": [ + { + "Pressure": 0.107896544, + "Position": { + "X": 889.39549022539313, + "Y": 570.92109393097087, + "IsEmpty": false + }, + "Timestamp": 637316491508435350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.262928218, + "Position": { + "X": 888.26458852962105, + "Y": 570.83256473073084, + "IsEmpty": false + }, + "Timestamp": 637316491508806040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.301503003, + "Position": { + "X": 887.34224484390973, + "Y": 570.74128760687336, + "IsEmpty": false + }, + "Timestamp": 637316491509155180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.322011143, + "Position": { + "X": 886.89570952206475, + "Y": 570.71209232861429, + "IsEmpty": false + }, + "Timestamp": 637316491509320400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.374746323, + "Position": { + "X": 886.65770822357536, + "Y": 570.680718852376, + "IsEmpty": false + }, + "Timestamp": 637316491509485290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.401358038, + "Position": { + "X": 885.97311437687574, + "Y": 570.61983498412496, + "IsEmpty": false + }, + "Timestamp": 637316491509831520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533684313, + "Position": { + "X": 886.65770822357536, + "Y": 570.680718852376, + "IsEmpty": false + }, + "Timestamp": 637316491510670880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547600508, + "Position": { + "X": 886.89570952206475, + "Y": 570.71209232861429, + "IsEmpty": false + }, + "Timestamp": 637316491510837890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.565178931, + "Position": { + "X": 887.34224484390973, + "Y": 570.74128760687336, + "IsEmpty": false + }, + "Timestamp": 637316491511017070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.574944675, + "Position": { + "X": 888.71113795695157, + "Y": 570.86147607185808, + "IsEmpty": false + }, + "Timestamp": 637316491511177960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 889.6332182758174, + "Y": 570.95176724987596, + "IsEmpty": false + }, + "Timestamp": 637316491511343660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605706871, + "Position": { + "X": 891.68565856773523, + "Y": 571.12817379849582, + "IsEmpty": false + }, + "Timestamp": 637316491511520550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620355546, + "Position": { + "X": 894.42121550293848, + "Y": 571.35886882160798, + "IsEmpty": false + }, + "Timestamp": 637316491511680810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625238419, + "Position": { + "X": 896.47203668917234, + "Y": 571.5284724086016, + "IsEmpty": false + }, + "Timestamp": 637316491511851640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629144728, + "Position": { + "X": 898.52206892698757, + "Y": 571.69511878468552, + "IsEmpty": false + }, + "Timestamp": 637316491512019180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 900.8076675843738, + "Y": 571.88639035433516, + "IsEmpty": false + }, + "Timestamp": 637316491512187180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.639642954, + "Position": { + "X": 904.45639704986274, + "Y": 572.17802983959791, + "IsEmpty": false + }, + "Timestamp": 637316491512364090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641596079, + "Position": { + "X": 907.86598369821547, + "Y": 572.43375250616975, + "IsEmpty": false + }, + "Timestamp": 637316491512530010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641596079, + "Position": { + "X": 910.14531836400317, + "Y": 572.60784152325175, + "IsEmpty": false + }, + "Timestamp": 637316491512700420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643549263, + "Position": { + "X": 912.86881834530618, + "Y": 572.80128132946857, + "IsEmpty": false + }, + "Timestamp": 637316491512862640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652338445, + "Position": { + "X": 916.2700537132273, + "Y": 573.03516794516531, + "IsEmpty": false + }, + "Timestamp": 637316491513033970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 918.5427197615677, + "Y": 573.19347424795728, + "IsEmpty": false + }, + "Timestamp": 637316491513198890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 920.57995281008687, + "Y": 573.32571362777071, + "IsEmpty": false + }, + "Timestamp": 637316491513372140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 922.84863627715595, + "Y": 573.47552943295102, + "IsEmpty": false + }, + "Timestamp": 637316491513544820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 926.46979253757252, + "Y": 573.70178180675202, + "IsEmpty": false + }, + "Timestamp": 637316491513714190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 928.73236717395685, + "Y": 573.83950162874658, + "IsEmpty": false + }, + "Timestamp": 637316491513878380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 930.08508293258365, + "Y": 573.91650997279726, + "IsEmpty": false + }, + "Timestamp": 637316491514047520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 932.78818174300295, + "Y": 574.06601174827642, + "IsEmpty": false + }, + "Timestamp": 637316491514223680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 934.81339820015, + "Y": 574.17415837219232, + "IsEmpty": false + }, + "Timestamp": 637316491514392140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 936.39268459059997, + "Y": 574.26060834174427, + "IsEmpty": false + }, + "Timestamp": 637316491514558800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 938.41434684867329, + "Y": 574.36236682588731, + "IsEmpty": false + }, + "Timestamp": 637316491514726120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 939.76102923535029, + "Y": 574.42827116085084, + "IsEmpty": false + }, + "Timestamp": 637316491514899940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 942.0083080156387, + "Y": 574.53852670055551, + "IsEmpty": false + }, + "Timestamp": 637316491515063970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 943.58094597208878, + "Y": 574.6137524052433, + "IsEmpty": false + }, + "Timestamp": 637316491515231790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 944.9238472169875, + "Y": 574.67329792462851, + "IsEmpty": false + }, + "Timestamp": 637316491515400690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 946.93639430600319, + "Y": 574.75963952546272, + "IsEmpty": false + }, + "Timestamp": 637316491515568830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 948.50418840917564, + "Y": 574.82709610153347, + "IsEmpty": false + }, + "Timestamp": 637316491515743820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 949.84335228889609, + "Y": 574.8806089077832, + "IsEmpty": false + }, + "Timestamp": 637316491515905770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 951.18149383779121, + "Y": 574.9325074448509, + "IsEmpty": false + }, + "Timestamp": 637316491516078510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 951.85017595784666, + "Y": 574.95784904822324, + "IsEmpty": false + }, + "Timestamp": 637316491516251730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 953.41283793606055, + "Y": 575.01739825055165, + "IsEmpty": false + }, + "Timestamp": 637316491516415010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 954.08056928828785, + "Y": 575.04129016773049, + "IsEmpty": false + }, + "Timestamp": 637316491516580460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655512333, + "Position": { + "X": 955.4152225199698, + "Y": 575.08784419529991, + "IsEmpty": false + }, + "Timestamp": 637316491517097860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594232082, + "Position": { + "X": 954.74803152030177, + "Y": 575.06477245787573, + "IsEmpty": false + }, + "Timestamp": 637316491518450150, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c4f131ca-c371-42dd-bb21-58e802250720", + "Points": [ + { + "Pressure": 0.113756008, + "Position": { + "X": 985.11270604949857, + "Y": 572.70226050713279, + "IsEmpty": false + }, + "Timestamp": 637316491527044650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.211657897, + "Position": { + "X": 984.45636008459576, + "Y": 572.69864567446916, + "IsEmpty": false + }, + "Timestamp": 637316491527562250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.251453429, + "Position": { + "X": 983.61464117400828, + "Y": 572.69667601234823, + "IsEmpty": false + }, + "Timestamp": 637316491527742470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.322743565, + "Position": { + "X": 983.14261642434508, + "Y": 572.69011738741938, + "IsEmpty": false + }, + "Timestamp": 637316491527911960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534660876, + "Position": { + "X": 984.45636008459576, + "Y": 572.69864567446916, + "IsEmpty": false + }, + "Timestamp": 637316491529092640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567132056, + "Position": { + "X": 985.11270604949857, + "Y": 572.70226050713279, + "IsEmpty": false + }, + "Timestamp": 637316491529262730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593011379, + "Position": { + "X": 987.26358274170707, + "Y": 572.70711016246332, + "IsEmpty": false + }, + "Timestamp": 637316491529424830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611078024, + "Position": { + "X": 988.75613382162555, + "Y": 572.7059323803187, + "IsEmpty": false + }, + "Timestamp": 637316491529592960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632318616, + "Position": { + "X": 991.36925789065992, + "Y": 572.7055106675441, + "IsEmpty": false + }, + "Timestamp": 637316491529770500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 994.3397743903605, + "Y": 572.6856761450108, + "IsEmpty": false + }, + "Timestamp": 637316491529931180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655756474, + "Position": { + "X": 995.64031214690704, + "Y": 572.67834610040211, + "IsEmpty": false + }, + "Timestamp": 637316491530099020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66234839, + "Position": { + "X": 996.29000060736155, + "Y": 572.67400790392776, + "IsEmpty": false + }, + "Timestamp": 637316491530275230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 996.4708362473956, + "Y": 572.66682877422068, + "IsEmpty": false + }, + "Timestamp": 637316491530450890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 997.11994411652097, + "Y": 572.66181365896296, + "IsEmpty": false + }, + "Timestamp": 637316491530783600, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "ec672582-9f94-4627-82be-0e637e88b5a5", + "Points": [ + { + "Pressure": 0.106919967, + "Position": { + "X": 1030.3456861450391, + "Y": 572.40116009514065, + "IsEmpty": false + }, + "Timestamp": 637316491539331630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.158678561, + "Position": { + "X": 1029.6814734731543, + "Y": 572.41473371248389, + "IsEmpty": false + }, + "Timestamp": 637316491539752950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.226062402, + "Position": { + "X": 1028.8301023126035, + "Y": 572.43046534067753, + "IsEmpty": false + }, + "Timestamp": 637316491539902170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.306630045, + "Position": { + "X": 1028.1666588523065, + "Y": 572.44300675297166, + "IsEmpty": false + }, + "Timestamp": 637316491540077580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 1027.5035255446132, + "Y": 572.45513341157584, + "IsEmpty": false + }, + "Timestamp": 637316491540408850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.601800561, + "Position": { + "X": 1027.3165339222564, + "Y": 572.45708405915502, + "IsEmpty": false + }, + "Timestamp": 637316491542264900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1026.8407044770847, + "Y": 572.46684443157392, + "IsEmpty": false + }, + "Timestamp": 637316491542604230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669428527, + "Position": { + "X": 1028.1666588523065, + "Y": 572.44300675297166, + "IsEmpty": false + }, + "Timestamp": 637316491543461400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1029.6814734731543, + "Y": 572.41473371248389, + "IsEmpty": false + }, + "Timestamp": 637316491543620460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685542047, + "Position": { + "X": 1031.863254779536, + "Y": 572.36918355263356, + "IsEmpty": false + }, + "Timestamp": 637316491543788260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699458301, + "Position": { + "X": 1035.8592641014955, + "Y": 572.27301480416418, + "IsEmpty": false + }, + "Timestamp": 637316491543958910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 1038.7188827293783, + "Y": 572.1949956838555, + "IsEmpty": false + }, + "Timestamp": 637316491544126050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709712386, + "Position": { + "X": 1041.5842250460444, + "Y": 572.10878321734299, + "IsEmpty": false + }, + "Timestamp": 637316491544292070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714106977, + "Position": { + "X": 1045.1258049720398, + "Y": 571.99164626870424, + "IsEmpty": false + }, + "Timestamp": 637316491544467620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 1050.0201965322051, + "Y": 571.8115222036688, + "IsEmpty": false + }, + "Timestamp": 637316491544633810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722163737, + "Position": { + "X": 1052.9060099140506, + "Y": 571.69431178050877, + "IsEmpty": false + }, + "Timestamp": 637316491544807230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724116862, + "Position": { + "X": 1056.4715883011165, + "Y": 571.53978090193391, + "IsEmpty": false + }, + "Timestamp": 637316491544970530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726070046, + "Position": { + "X": 1060.0440299081367, + "Y": 571.373805367042, + "IsEmpty": false + }, + "Timestamp": 637316491545141040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 1065.6559618978595, + "Y": 571.09350231112546, + "IsEmpty": false + }, + "Timestamp": 637316491545315040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 1069.2443227801577, + "Y": 570.89911255408595, + "IsEmpty": false + }, + "Timestamp": 637316491545487900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 1072.6414664067604, + "Y": 570.71027285310242, + "IsEmpty": false + }, + "Timestamp": 637316491545654880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 1076.240295147398, + "Y": 570.49524275798854, + "IsEmpty": false + }, + "Timestamp": 637316491545821800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 1079.8441942008667, + "Y": 570.26958135027155, + "IsEmpty": false + }, + "Timestamp": 637316491545986480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 1084.1353644359465, + "Y": 569.98889305608077, + "IsEmpty": false + }, + "Timestamp": 637316491546157000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 1086.8668075085459, + "Y": 569.80733260548027, + "IsEmpty": false + }, + "Timestamp": 637316491546322880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 1089.6002764016821, + "Y": 569.62040735797041, + "IsEmpty": false + }, + "Timestamp": 637316491546502800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 1092.5353856449096, + "Y": 569.40649977189639, + "IsEmpty": false + }, + "Timestamp": 637316491546663580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736812413, + "Position": { + "X": 1094.1038772391107, + "Y": 569.28593191046923, + "IsEmpty": false + }, + "Timestamp": 637316491546829600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736812413, + "Position": { + "X": 1095.2728193737917, + "Y": 569.20837274150654, + "IsEmpty": false + }, + "Timestamp": 637316491546998060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619378984, + "Position": { + "X": 1095.4729581811487, + "Y": 569.18589702140673, + "IsEmpty": false + }, + "Timestamp": 637316491547165900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619378984, + "Position": { + "X": 1096.157649839542, + "Y": 569.13539340016393, + "IsEmpty": false + }, + "Timestamp": 637316491547457250, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "1ea85214-136b-46eb-a7e2-0bc0cd5fd7bb", + "Points": [ + { + "Pressure": 0.121568628, + "Position": { + "X": 889.34861592378525, + "Y": 570.04211795760091, + "IsEmpty": false + }, + "Timestamp": 637316491664432450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.183581293, + "Position": { + "X": 889.34861592378525, + "Y": 570.3368067387139, + "IsEmpty": false + }, + "Timestamp": 637316491664776990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.239002064, + "Position": { + "X": 889.34861592378525, + "Y": 570.80821727023954, + "IsEmpty": false + }, + "Timestamp": 637316491664953230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.287342638, + "Position": { + "X": 889.34861592378525, + "Y": 571.16175228932013, + "IsEmpty": false + }, + "Timestamp": 637316491665125150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.309315622, + "Position": { + "X": 889.34861592378525, + "Y": 571.57422506462331, + "IsEmpty": false + }, + "Timestamp": 637316491665290020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.331776917, + "Position": { + "X": 889.34861592378525, + "Y": 572.10457335237163, + "IsEmpty": false + }, + "Timestamp": 637316491665454180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.363027394, + "Position": { + "X": 889.34861592378525, + "Y": 572.98854817745553, + "IsEmpty": false + }, + "Timestamp": 637316491665632250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.439200431, + "Position": { + "X": 889.34861592378525, + "Y": 573.93136924050691, + "IsEmpty": false + }, + "Timestamp": 637316491665794190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.536614001, + "Position": { + "X": 889.34861592378525, + "Y": 572.22244886481678, + "IsEmpty": false + }, + "Timestamp": 637316491666476530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.559563577, + "Position": { + "X": 889.34861592378525, + "Y": 571.04387677687498, + "IsEmpty": false + }, + "Timestamp": 637316491666641480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579095125, + "Position": { + "X": 889.34861592378525, + "Y": 569.57070742607516, + "IsEmpty": false + }, + "Timestamp": 637316491666809320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595452785, + "Position": { + "X": 889.34861592378525, + "Y": 567.56718978752701, + "IsEmpty": false + }, + "Timestamp": 637316491666986470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.616205096, + "Position": { + "X": 889.34861592378525, + "Y": 564.03156504195658, + "IsEmpty": false + }, + "Timestamp": 637316491667144130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628412306, + "Position": { + "X": 889.34861592378525, + "Y": 561.37982360321485, + "IsEmpty": false + }, + "Timestamp": 637316491667315290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638666332, + "Position": { + "X": 889.34861592378525, + "Y": 558.49233113958292, + "IsEmpty": false + }, + "Timestamp": 637316491667480940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646478951, + "Position": { + "X": 889.34861592378525, + "Y": 555.42811692553812, + "IsEmpty": false + }, + "Timestamp": 637316491667656980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 889.34861592378525, + "Y": 550.83179560447093, + "IsEmpty": false + }, + "Timestamp": 637316491667825830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656488895, + "Position": { + "X": 889.34861592378525, + "Y": 547.53183036553582, + "IsEmpty": false + }, + "Timestamp": 637316491667991570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660395205, + "Position": { + "X": 889.34861592378525, + "Y": 544.58549166393618, + "IsEmpty": false + }, + "Timestamp": 637316491668159490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664545655, + "Position": { + "X": 889.34861592378525, + "Y": 541.52118593163641, + "IsEmpty": false + }, + "Timestamp": 637316491668330270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669184387, + "Position": { + "X": 889.34861592378525, + "Y": 536.98380236679191, + "IsEmpty": false + }, + "Timestamp": 637316491668501020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 889.34861592378525, + "Y": 533.91958815274711, + "IsEmpty": false + }, + "Timestamp": 637316491668670850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675043881, + "Position": { + "X": 889.34861592378525, + "Y": 530.79643618247974, + "IsEmpty": false + }, + "Timestamp": 637316491668831250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677241147, + "Position": { + "X": 889.34861592378525, + "Y": 527.67328421221237, + "IsEmpty": false + }, + "Timestamp": 637316491669000660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681391597, + "Position": { + "X": 889.34861592378525, + "Y": 523.13580912911277, + "IsEmpty": false + }, + "Timestamp": 637316491669174330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683344781, + "Position": { + "X": 889.34861592378525, + "Y": 520.66088095903888, + "IsEmpty": false + }, + "Timestamp": 637316491669340990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683344781, + "Position": { + "X": 889.34861592378525, + "Y": 518.30373678315527, + "IsEmpty": false + }, + "Timestamp": 637316491669509230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685297906, + "Position": { + "X": 889.34861592378525, + "Y": 515.71093310063623, + "IsEmpty": false + }, + "Timestamp": 637316491669682230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687251091, + "Position": { + "X": 889.34861592378525, + "Y": 511.05567402334646, + "IsEmpty": false + }, + "Timestamp": 637316491669854200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691401541, + "Position": { + "X": 889.34861592378525, + "Y": 507.69677102818872, + "IsEmpty": false + }, + "Timestamp": 637316491670022580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 889.34861592378525, + "Y": 504.45583506373117, + "IsEmpty": false + }, + "Timestamp": 637316491670186730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 889.34861592378525, + "Y": 501.33259157520877, + "IsEmpty": false + }, + "Timestamp": 637316491670355880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702876329, + "Position": { + "X": 889.34861592378525, + "Y": 497.85590458586086, + "IsEmpty": false + }, + "Timestamp": 637316491670530430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704829454, + "Position": { + "X": 889.34861592378525, + "Y": 494.73275261559348, + "IsEmpty": false + }, + "Timestamp": 637316491670692430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 889.34861592378525, + "Y": 492.13994893307444, + "IsEmpty": false + }, + "Timestamp": 637316491670864350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 889.34861592378525, + "Y": 489.84174251341335, + "IsEmpty": false + }, + "Timestamp": 637316491671032370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71117723, + "Position": { + "X": 889.34861592378525, + "Y": 486.77752829936861, + "IsEmpty": false + }, + "Timestamp": 637316491671207400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 889.34861592378525, + "Y": 485.00967016745585, + "IsEmpty": false + }, + "Timestamp": 637316491671374190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 889.34861592378525, + "Y": 483.47756306043345, + "IsEmpty": false + }, + "Timestamp": 637316491671539990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717036724, + "Position": { + "X": 889.34861592378525, + "Y": 482.18120697830142, + "IsEmpty": false + }, + "Timestamp": 637316491671703810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718989849, + "Position": { + "X": 889.34861592378525, + "Y": 479.52946553955979, + "IsEmpty": false + }, + "Timestamp": 637316491671881540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720943034, + "Position": { + "X": 889.34861592378525, + "Y": 477.64373189520182, + "IsEmpty": false + }, + "Timestamp": 637316491672049730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720943034, + "Position": { + "X": 889.34861592378525, + "Y": 475.81702752532152, + "IsEmpty": false + }, + "Timestamp": 637316491672217510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722896159, + "Position": { + "X": 889.34861592378525, + "Y": 474.63845543737966, + "IsEmpty": false + }, + "Timestamp": 637316491672382720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726802468, + "Position": { + "X": 889.34861592378525, + "Y": 472.39918677394115, + "IsEmpty": false + }, + "Timestamp": 637316491672557890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 889.34861592378525, + "Y": 470.74924991360109, + "IsEmpty": false + }, + "Timestamp": 637316491672720270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 889.34861592378525, + "Y": 468.92249978459324, + "IsEmpty": false + }, + "Timestamp": 637316491672887950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 889.34861592378525, + "Y": 466.56540136783707, + "IsEmpty": false + }, + "Timestamp": 637316491673060860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737544835, + "Position": { + "X": 889.34861592378525, + "Y": 462.67615008493101, + "IsEmpty": false + }, + "Timestamp": 637316491673229240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741695285, + "Position": { + "X": 889.34861592378525, + "Y": 460.61369469016029, + "IsEmpty": false + }, + "Timestamp": 637316491673397360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746822298, + "Position": { + "X": 889.34861592378525, + "Y": 458.84588231737501, + "IsEmpty": false + }, + "Timestamp": 637316491673564360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753658354, + "Position": { + "X": 889.34861592378525, + "Y": 457.43160496367034, + "IsEmpty": false + }, + "Timestamp": 637316491673732590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762447536, + "Position": { + "X": 889.34861592378525, + "Y": 455.19238205935937, + "IsEmpty": false + }, + "Timestamp": 637316491673907280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.767818749, + "Position": { + "X": 889.34861592378525, + "Y": 454.42628274672063, + "IsEmpty": false + }, + "Timestamp": 637316491674068240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.772701621, + "Position": { + "X": 889.34861592378525, + "Y": 454.07274772764009, + "IsEmpty": false + }, + "Timestamp": 637316491674238370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.779537678, + "Position": { + "X": 889.34861592378525, + "Y": 453.48346168366919, + "IsEmpty": false + }, + "Timestamp": 637316491674411810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789059281, + "Position": { + "X": 889.34861592378525, + "Y": 453.18881866168374, + "IsEmpty": false + }, + "Timestamp": 637316491674583000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793698013, + "Position": { + "X": 889.34861592378525, + "Y": 452.89417563969829, + "IsEmpty": false + }, + "Timestamp": 637316491674745620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.81274128, + "Position": { + "X": 889.34861592378525, + "Y": 452.59953261771278, + "IsEmpty": false + }, + "Timestamp": 637316491674916440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705806077, + "Position": { + "X": 889.34861592378525, + "Y": 453.07098890836602, + "IsEmpty": false + }, + "Timestamp": 637316491675497120, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "85cbdd8b-47f3-4dea-b156-94d1b6a83dc7", + "Points": [ + { + "Pressure": 0.0280613415, + "Position": { + "X": 1097.2947247357777, + "Y": 570.80821727023954, + "IsEmpty": false + }, + "Timestamp": 637316491696849750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0512550548, + "Position": { + "X": 1097.2947247357777, + "Y": 570.74927951401696, + "IsEmpty": false + }, + "Timestamp": 637316491696884800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.265369654, + "Position": { + "X": 1097.2947247357777, + "Y": 570.39574449493648, + "IsEmpty": false + }, + "Timestamp": 637316491697400210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.310536355, + "Position": { + "X": 1097.2947247357777, + "Y": 569.98318020137833, + "IsEmpty": false + }, + "Timestamp": 637316491697575590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.337880522, + "Position": { + "X": 1097.2947247357777, + "Y": 569.57070742607516, + "IsEmpty": false + }, + "Timestamp": 637316491697730990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.359609365, + "Position": { + "X": 1097.2947247357777, + "Y": 568.39213533813336, + "IsEmpty": false + }, + "Timestamp": 637316491697898190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.385488659, + "Position": { + "X": 1097.2947247357777, + "Y": 566.27074218714006, + "IsEmpty": false + }, + "Timestamp": 637316491698065530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.409170657, + "Position": { + "X": 1097.2947247357777, + "Y": 564.91544834878539, + "IsEmpty": false + }, + "Timestamp": 637316491698244760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.428458065, + "Position": { + "X": 1097.2947247357777, + "Y": 563.20652797309526, + "IsEmpty": false + }, + "Timestamp": 637316491698405590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.439932853, + "Position": { + "X": 1097.2947247357777, + "Y": 561.49769911566011, + "IsEmpty": false + }, + "Timestamp": 637316491698573710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.462394148, + "Position": { + "X": 1097.2947247357777, + "Y": 558.37445562713776, + "IsEmpty": false + }, + "Timestamp": 637316491698750270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.468986034, + "Position": { + "X": 1097.2947247357777, + "Y": 555.4870546817607, + "IsEmpty": false + }, + "Timestamp": 637316491698917830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.479728401, + "Position": { + "X": 1097.2947247357777, + "Y": 552.06921393038033, + "IsEmpty": false + }, + "Timestamp": 637316491699082830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.482658118, + "Position": { + "X": 1097.2947247357777, + "Y": 547.944303140839, + "IsEmpty": false + }, + "Timestamp": 637316491699253740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498039216, + "Position": { + "X": 1097.2947247357777, + "Y": 541.16765091255593, + "IsEmpty": false + }, + "Timestamp": 637316491699420680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.502189696, + "Position": { + "X": 1097.2947247357777, + "Y": 536.27664081037574, + "IsEmpty": false + }, + "Timestamp": 637316491699595070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.50804913, + "Position": { + "X": 1097.2947247357777, + "Y": 531.32678447022806, + "IsEmpty": false + }, + "Timestamp": 637316491699759970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51586175, + "Position": { + "X": 1097.2947247357777, + "Y": 526.3768366118253, + "IsEmpty": false + }, + "Timestamp": 637316491699926990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521721244, + "Position": { + "X": 1097.2947247357777, + "Y": 518.71630107671342, + "IsEmpty": false + }, + "Timestamp": 637316491700098110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523918509, + "Position": { + "X": 1097.2947247357777, + "Y": 514.17882599361383, + "IsEmpty": false + }, + "Timestamp": 637316491700270240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529045522, + "Position": { + "X": 1097.2947247357777, + "Y": 510.52532573559813, + "IsEmpty": false + }, + "Timestamp": 637316491700435690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 1097.2947247357777, + "Y": 507.34323600910813, + "IsEmpty": false + }, + "Timestamp": 637316491700609340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.548088789, + "Position": { + "X": 1097.2947247357777, + "Y": 502.80585244426356, + "IsEmpty": false + }, + "Timestamp": 637316491700772970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 1097.2947247357777, + "Y": 499.32907393666068, + "IsEmpty": false + }, + "Timestamp": 637316491700943490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554924846, + "Position": { + "X": 1097.2947247357777, + "Y": 496.38273523506109, + "IsEmpty": false + }, + "Timestamp": 637316491701109110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55687803, + "Position": { + "X": 1097.2947247357777, + "Y": 493.78993155254204, + "IsEmpty": false + }, + "Timestamp": 637316491701282040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558831155, + "Position": { + "X": 1097.2947247357777, + "Y": 489.7238670009682, + "IsEmpty": false + }, + "Timestamp": 637316491701450090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1097.2947247357777, + "Y": 487.30787658711694, + "IsEmpty": false + }, + "Timestamp": 637316491701622080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1097.2947247357777, + "Y": 485.00967016745585, + "IsEmpty": false + }, + "Timestamp": 637316491701784650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1097.2947247357777, + "Y": 482.65261750982717, + "IsEmpty": false + }, + "Timestamp": 637316491701954040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566643775, + "Position": { + "X": 1097.2947247357777, + "Y": 477.93842067631482, + "IsEmpty": false + }, + "Timestamp": 637316491702122390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566643775, + "Position": { + "X": 1097.2947247357777, + "Y": 474.4027044124893, + "IsEmpty": false + }, + "Timestamp": 637316491702296240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 1097.2947247357777, + "Y": 471.04389293558654, + "IsEmpty": false + }, + "Timestamp": 637316491702462550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 1097.2947247357777, + "Y": 467.74392769665144, + "IsEmpty": false + }, + "Timestamp": 637316491702635120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 1097.2947247357777, + "Y": 464.62077572638407, + "IsEmpty": false + }, + "Timestamp": 637316491702798710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570550084, + "Position": { + "X": 1097.2947247357777, + "Y": 463.73684666042766, + "IsEmpty": false + }, + "Timestamp": 637316491702972950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 1097.2947247357777, + "Y": 462.55832033161334, + "IsEmpty": false + }, + "Timestamp": 637316491703134930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 1097.2947247357777, + "Y": 461.26191849035382, + "IsEmpty": false + }, + "Timestamp": 637316491703310930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 1097.2947247357777, + "Y": 458.96371207069274, + "IsEmpty": false + }, + "Timestamp": 637316491703482860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 1097.2947247357777, + "Y": 457.43160496367034, + "IsEmpty": false + }, + "Timestamp": 637316491703646490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 1097.2947247357777, + "Y": 456.25307863485602, + "IsEmpty": false + }, + "Timestamp": 637316491703810570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573723972, + "Position": { + "X": 1097.2947247357777, + "Y": 455.84056010042536, + "IsEmpty": false + }, + "Timestamp": 637316491703986680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573723972, + "Position": { + "X": 1097.2947247357777, + "Y": 455.48697932221728, + "IsEmpty": false + }, + "Timestamp": 637316491704290850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589837492, + "Position": { + "X": 1097.2947247357777, + "Y": 455.25127405645446, + "IsEmpty": false + }, + "Timestamp": 637316491704665390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592034817, + "Position": { + "X": 1097.2947247357777, + "Y": 454.42628274672063, + "IsEmpty": false + }, + "Timestamp": 637316491705686320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593987942, + "Position": { + "X": 1097.2947247357777, + "Y": 453.30669417412889, + "IsEmpty": false + }, + "Timestamp": 637316491705843980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1097.2947247357777, + "Y": 452.59953261771278, + "IsEmpty": false + }, + "Timestamp": 637316491706011820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1097.2947247357777, + "Y": 451.53883604221613, + "IsEmpty": false + }, + "Timestamp": 637316491706183660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1097.2947247357777, + "Y": 451.18530102313559, + "IsEmpty": false + }, + "Timestamp": 637316491706353770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1097.2947247357777, + "Y": 450.83172024492757, + "IsEmpty": false + }, + "Timestamp": 637316491706518240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1097.2947247357777, + "Y": 450.47813946671948, + "IsEmpty": false + }, + "Timestamp": 637316491706690550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1097.2947247357777, + "Y": 450.12460444763894, + "IsEmpty": false + }, + "Timestamp": 637316491706858220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1097.2947247357777, + "Y": 449.29961313790517, + "IsEmpty": false + }, + "Timestamp": 637316491707028240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1097.2947247357777, + "Y": 448.2978543186311, + "IsEmpty": false + }, + "Timestamp": 637316491707195030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1097.2947247357777, + "Y": 447.82639802797786, + "IsEmpty": false + }, + "Timestamp": 637316491707360840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1097.2947247357777, + "Y": 447.5318007651199, + "IsEmpty": false + }, + "Timestamp": 637316491707536040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599847436, + "Position": { + "X": 1097.2947247357777, + "Y": 450.36030971340182, + "IsEmpty": false + }, + "Timestamp": 637316491707875170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.601800561, + "Position": { + "X": 1097.2947247357777, + "Y": 453.71916694943206, + "IsEmpty": false + }, + "Timestamp": 637316491708040550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.601800561, + "Position": { + "X": 1097.2947247357777, + "Y": 459.3762306051234, + "IsEmpty": false + }, + "Timestamp": 637316491708207940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.601800561, + "Position": { + "X": 1097.2947247357777, + "Y": 464.14936519485832, + "IsEmpty": false + }, + "Timestamp": 637316491708377250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.603753746, + "Position": { + "X": 1097.2947247357777, + "Y": 470.33673137917043, + "IsEmpty": false + }, + "Timestamp": 637316491708544960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.603753746, + "Position": { + "X": 1097.2947247357777, + "Y": 477.52594790101165, + "IsEmpty": false + }, + "Timestamp": 637316491708712400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.607660055, + "Position": { + "X": 1097.2947247357777, + "Y": 488.48644867505874, + "IsEmpty": false + }, + "Timestamp": 637316491708882270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.60961318, + "Position": { + "X": 1097.2947247357777, + "Y": 495.08628763467402, + "IsEmpty": false + }, + "Timestamp": 637316491709050230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611566365, + "Position": { + "X": 1097.2947247357777, + "Y": 501.33259157520877, + "IsEmpty": false + }, + "Timestamp": 637316491709219170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61351949, + "Position": { + "X": 1097.2947247357777, + "Y": 507.1664227404404, + "IsEmpty": false + }, + "Timestamp": 637316491709395590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615472674, + "Position": { + "X": 1097.2947247357777, + "Y": 515.00386306247515, + "IsEmpty": false + }, + "Timestamp": 637316491709557620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 519.71805989598749, + "IsEmpty": false + }, + "Timestamp": 637316491709725890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 524.255443460832, + "IsEmpty": false + }, + "Timestamp": 637316491709895060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 528.61610527526386, + "IsEmpty": false + }, + "Timestamp": 637316491710070000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 534.68559594713076, + "IsEmpty": false + }, + "Timestamp": 637316491710239030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 537.98556118606598, + "IsEmpty": false + }, + "Timestamp": 637316491710401220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 540.99083764388809, + "IsEmpty": false + }, + "Timestamp": 637316491710569860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 543.52479508843953, + "IsEmpty": false + }, + "Timestamp": 637316491710740870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 546.70688481492948, + "IsEmpty": false + }, + "Timestamp": 637316491710910860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 548.65146469725505, + "IsEmpty": false + }, + "Timestamp": 637316491711083700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 550.00675853560972, + "IsEmpty": false + }, + "Timestamp": 637316491711255210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 550.8907333606935, + "IsEmpty": false + }, + "Timestamp": 637316491711420150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 552.12815168660302, + "IsEmpty": false + }, + "Timestamp": 637316491711593170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 552.95318875546423, + "IsEmpty": false + }, + "Timestamp": 637316491711754290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 553.77813430607057, + "IsEmpty": false + }, + "Timestamp": 637316491711922070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 555.01564415023495, + "IsEmpty": false + }, + "Timestamp": 637316491712099090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 556.19421623817686, + "IsEmpty": false + }, + "Timestamp": 637316491712266470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 557.66738558897657, + "IsEmpty": false + }, + "Timestamp": 637316491712434270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 559.55302771507957, + "IsEmpty": false + }, + "Timestamp": 637316491712598400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 560.73159980302137, + "IsEmpty": false + }, + "Timestamp": 637316491712768670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 563.02980622268251, + "IsEmpty": false + }, + "Timestamp": 637316491712944530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 563.97262728573389, + "IsEmpty": false + }, + "Timestamp": 637316491713111930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 565.32792112408856, + "IsEmpty": false + }, + "Timestamp": 637316491713272710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 566.15295819294988, + "IsEmpty": false + }, + "Timestamp": 637316491713452700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1097.2947247357777, + "Y": 566.56543096825294, + "IsEmpty": false + }, + "Timestamp": 637316491713622180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615228474, + "Position": { + "X": 1097.2947247357777, + "Y": 566.91896598733354, + "IsEmpty": false + }, + "Timestamp": 637316491713792240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615228474, + "Position": { + "X": 1097.2947247357777, + "Y": 567.27259252466911, + "IsEmpty": false + }, + "Timestamp": 637316491714127800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.613275349, + "Position": { + "X": 1097.2947247357777, + "Y": 567.62612754374959, + "IsEmpty": false + }, + "Timestamp": 637316491714289450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49169147, + "Position": { + "X": 1097.2947247357777, + "Y": 565.68154766142413, + "IsEmpty": false + }, + "Timestamp": 637316491714924410, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "2c796b10-b8a7-4632-bdc1-ce7b6b41c4db", + "Points": [ + { + "Pressure": 0.0764019191, + "Position": { + "X": 886.31278051348011, + "Y": 466.0403051300741, + "IsEmpty": false + }, + "Timestamp": 637316491757364870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.18455787, + "Position": { + "X": 885.63444709376461, + "Y": 466.07122875645962, + "IsEmpty": false + }, + "Timestamp": 637316491757640250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.247058824, + "Position": { + "X": 884.95574161095544, + "Y": 466.10229639849626, + "IsEmpty": false + }, + "Timestamp": 637316491757889910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.344716549, + "Position": { + "X": 883.59722773725764, + "Y": 466.16486199157748, + "IsEmpty": false + }, + "Timestamp": 637316491758060150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.456778824, + "Position": { + "X": 884.27666738535288, + "Y": 466.1335076216975, + "IsEmpty": false + }, + "Timestamp": 637316491758567010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498527497, + "Position": { + "X": 885.17266492171154, + "Y": 466.10229639849626, + "IsEmpty": false + }, + "Timestamp": 637316491758734910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 885.63444709376461, + "Y": 466.07122875645962, + "IsEmpty": false + }, + "Timestamp": 637316491758900890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.545159101, + "Position": { + "X": 887.20649253743807, + "Y": 466.00952595382574, + "IsEmpty": false + }, + "Timestamp": 637316491759073420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571038365, + "Position": { + "X": 888.56047947957438, + "Y": 465.94840268968596, + "IsEmpty": false + }, + "Timestamp": 637316491759244730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589593351, + "Position": { + "X": 890.5885462842466, + "Y": 465.85781203166204, + "IsEmpty": false + }, + "Timestamp": 637316491759415020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600335717, + "Position": { + "X": 891.26377830899321, + "Y": 465.82790868044867, + "IsEmpty": false + }, + "Timestamp": 637316491759583460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 892.61303707146715, + "Y": 465.76854488713121, + "IsEmpty": false + }, + "Timestamp": 637316491759741410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615960956, + "Position": { + "X": 892.82517346570467, + "Y": 465.76854488713121, + "IsEmpty": false + }, + "Timestamp": 637316491759918350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627679884, + "Position": { + "X": 891.9386096781667, + "Y": 465.79815282077629, + "IsEmpty": false + }, + "Timestamp": 637316491760426190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627679884, + "Position": { + "X": 889.2368935492367, + "Y": 465.91805947076705, + "IsEmpty": false + }, + "Timestamp": 637316491760591020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630121291, + "Position": { + "X": 886.99073854980099, + "Y": 466.00952595382574, + "IsEmpty": false + }, + "Timestamp": 637316491760764920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630121291, + "Position": { + "X": 884.95574161095544, + "Y": 466.10229639849626, + "IsEmpty": false + }, + "Timestamp": 637316491760927790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 883.59722773725764, + "Y": 466.16486199157748, + "IsEmpty": false + }, + "Timestamp": 637316491761101310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 882.9174259869701, + "Y": 466.19635907364949, + "IsEmpty": false + }, + "Timestamp": 637316491761272180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 884.95574161095544, + "Y": 466.10229639849626, + "IsEmpty": false + }, + "Timestamp": 637316491761774820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 887.66831788242712, + "Y": 465.97889166220097, + "IsEmpty": false + }, + "Timestamp": 637316491761942530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6340276, + "Position": { + "X": 890.5885462842466, + "Y": 465.85781203166204, + "IsEmpty": false + }, + "Timestamp": 637316491762116020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 894.17197680301467, + "Y": 465.70977453586789, + "IsEmpty": false + }, + "Timestamp": 637316491762276170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645746529, + "Position": { + "X": 898.20229736092983, + "Y": 465.53705889330269, + "IsEmpty": false + }, + "Timestamp": 637316491762446500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 902.42266758576386, + "Y": 465.3698093612652, + "IsEmpty": false + }, + "Timestamp": 637316491762616230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66234839, + "Position": { + "X": 909.4734381604394, + "Y": 465.10346195208689, + "IsEmpty": false + }, + "Timestamp": 637316491762790660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664545655, + "Position": { + "X": 914.28911373660787, + "Y": 464.92644081065242, + "IsEmpty": false + }, + "Timestamp": 637316491762953810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668696105, + "Position": { + "X": 918.41838131966108, + "Y": 464.78101410929304, + "IsEmpty": false + }, + "Timestamp": 637316491763124200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67064929, + "Position": { + "X": 925.3045258587731, + "Y": 464.55183753928145, + "IsEmpty": false + }, + "Timestamp": 637316491763297900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672602415, + "Position": { + "X": 930.18622874719495, + "Y": 464.4014305796988, + "IsEmpty": false + }, + "Timestamp": 637316491763471150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6745556, + "Position": { + "X": 934.20611640922141, + "Y": 464.27920576838005, + "IsEmpty": false + }, + "Timestamp": 637316491763635100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6745556, + "Position": { + "X": 938.54338221170474, + "Y": 464.16326042585183, + "IsEmpty": false + }, + "Timestamp": 637316491763804640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6745556, + "Position": { + "X": 942.83131151016948, + "Y": 464.05368840114409, + "IsEmpty": false + }, + "Timestamp": 637316491763974440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678461909, + "Position": { + "X": 950.32116812336653, + "Y": 463.86967073274803, + "IsEmpty": false + }, + "Timestamp": 637316491764143810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680415034, + "Position": { + "X": 956.29508028479188, + "Y": 463.73568281158356, + "IsEmpty": false + }, + "Timestamp": 637316491764309270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680415034, + "Position": { + "X": 962.59328313880337, + "Y": 463.61694988356135, + "IsEmpty": false + }, + "Timestamp": 637316491764475030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682368219, + "Position": { + "X": 970.86378358782031, + "Y": 463.4829167548744, + "IsEmpty": false + }, + "Timestamp": 637316491764651320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682368219, + "Position": { + "X": 976.98946163342555, + "Y": 463.40101057937375, + "IsEmpty": false + }, + "Timestamp": 637316491764818560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 982.33234841408148, + "Y": 463.34188825454743, + "IsEmpty": false + }, + "Timestamp": 637316491764985100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.686518669, + "Position": { + "X": 986.47392811523082, + "Y": 463.30613778181419, + "IsEmpty": false + }, + "Timestamp": 637316491765150840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690669119, + "Position": { + "X": 989.97631155726583, + "Y": 463.28204663111529, + "IsEmpty": false + }, + "Timestamp": 637316491765320370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 995.94152588471991, + "Y": 463.25192531042683, + "IsEmpty": false + }, + "Timestamp": 637316491765491890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 999.37239084644125, + "Y": 463.2426446381466, + "IsEmpty": false + }, + "Timestamp": 637316491765665830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694575429, + "Position": { + "X": 1003.909729515294, + "Y": 463.25192531042683, + "IsEmpty": false + }, + "Timestamp": 637316491765827470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694575429, + "Position": { + "X": 1010.1798898460249, + "Y": 463.28204663111529, + "IsEmpty": false + }, + "Timestamp": 637316491766003390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 1014.8858575407245, + "Y": 463.31722943800372, + "IsEmpty": false + }, + "Timestamp": 637316491766165450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 1020.3131959124564, + "Y": 463.36982457071082, + "IsEmpty": false + }, + "Timestamp": 637316491766335040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 1025.7585569755022, + "Y": 463.43541847341612, + "IsEmpty": false + }, + "Timestamp": 637316491766501810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 1033.2976748551589, + "Y": 463.54642600945385, + "IsEmpty": false + }, + "Timestamp": 637316491766679160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 1037.8623628192079, + "Y": 463.62937924976973, + "IsEmpty": false + }, + "Timestamp": 637316491766842710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 1042.1925246809872, + "Y": 463.70796823191301, + "IsEmpty": false + }, + "Timestamp": 637316491767026480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 1046.2961459699484, + "Y": 463.79336849401864, + "IsEmpty": false + }, + "Timestamp": 637316491767188730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 1051.6921116807396, + "Y": 463.91766862634455, + "IsEmpty": false + }, + "Timestamp": 637316491767353710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 1053.8800268748471, + "Y": 463.96731459466389, + "IsEmpty": false + }, + "Timestamp": 637316491767523600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700434864, + "Position": { + "X": 1056.0838844906473, + "Y": 464.01859690657739, + "IsEmpty": false + }, + "Timestamp": 637316491767691350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700434864, + "Position": { + "X": 1057.9642604236681, + "Y": 464.07150383095615, + "IsEmpty": false + }, + "Timestamp": 637316491767862420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700434864, + "Position": { + "X": 1061.4566177882953, + "Y": 464.16326042585183, + "IsEmpty": false + }, + "Timestamp": 637316491768028650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700434864, + "Position": { + "X": 1063.3564357487471, + "Y": 464.22044229795279, + "IsEmpty": false + }, + "Timestamp": 637316491768194050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700434864, + "Position": { + "X": 1066.2536475521383, + "Y": 464.29914303054812, + "IsEmpty": false + }, + "Timestamp": 637316491768358560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700434864, + "Position": { + "X": 1068.9908574403592, + "Y": 464.3806276863815, + "IsEmpty": false + }, + "Timestamp": 637316491768592450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702388048, + "Position": { + "X": 1072.5713029576161, + "Y": 464.48635603581693, + "IsEmpty": false + }, + "Timestamp": 637316491768697970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702388048, + "Position": { + "X": 1074.6954741412269, + "Y": 464.55183753928145, + "IsEmpty": false + }, + "Timestamp": 637316491768868380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1076.6399830638175, + "Y": 464.61883807505228, + "IsEmpty": false + }, + "Timestamp": 637316491769045540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1077.4783406844522, + "Y": 464.64150712210795, + "IsEmpty": false + }, + "Timestamp": 637316491769211550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1079.4311938915632, + "Y": 464.71051478586435, + "IsEmpty": false + }, + "Timestamp": 637316491769378850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1081.3890359671468, + "Y": 464.78101410929304, + "IsEmpty": false + }, + "Timestamp": 637316491769552690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1083.5458459910785, + "Y": 464.85299336126548, + "IsEmpty": false + }, + "Timestamp": 637316491769714020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1085.053534705057, + "Y": 464.90179591862108, + "IsEmpty": false + }, + "Timestamp": 637316491769884580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1087.0271471873561, + "Y": 464.97621564899083, + "IsEmpty": false + }, + "Timestamp": 637316491770059020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1087.6860499123839, + "Y": 465.00134472632539, + "IsEmpty": false + }, + "Timestamp": 637316491770226160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1089.0053832870283, + "Y": 465.05208402489393, + "IsEmpty": false + }, + "Timestamp": 637316491770396170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1089.6658072960438, + "Y": 465.07769337715553, + "IsEmpty": false + }, + "Timestamp": 637316491770563560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1089.865168429191, + "Y": 465.07769337715553, + "IsEmpty": false + }, + "Timestamp": 637316491770734490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1090.5265618395606, + "Y": 465.10346195208689, + "IsEmpty": false + }, + "Timestamp": 637316491770901690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1090.7268588372181, + "Y": 465.10346195208689, + "IsEmpty": false + }, + "Timestamp": 637316491771073940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1091.1884503536164, + "Y": 465.12938931520182, + "IsEmpty": false + }, + "Timestamp": 637316491771242390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1092.5136994115842, + "Y": 465.18171866803738, + "IsEmpty": false + }, + "Timestamp": 637316491771408620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70702678, + "Position": { + "X": 1092.7153849804458, + "Y": 465.18171866803738, + "IsEmpty": false + }, + "Timestamp": 637316491771751420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651117742, + "Position": { + "X": 1091.850830651058, + "Y": 465.15547503201407, + "IsEmpty": false + }, + "Timestamp": 637316491772997830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651117742, + "Position": { + "X": 1092.7153849804458, + "Y": 465.18171866803738, + "IsEmpty": false + }, + "Timestamp": 637316491773036440, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e677f715-2e51-40d1-a934-4667ecac37bb", + "Points": [ + { + "Pressure": 0.0764019191, + "Position": { + "X": 886.47358323845174, + "Y": 466.43202373530812, + "IsEmpty": false + }, + "Timestamp": 637316491802956090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.190661475, + "Position": { + "X": 886.98743885305316, + "Y": 466.56723639920119, + "IsEmpty": false + }, + "Timestamp": 637316491803342200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.208484009, + "Position": { + "X": 887.32288668630531, + "Y": 466.67456060655763, + "IsEmpty": false + }, + "Timestamp": 637316491803517060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.250965118, + "Position": { + "X": 888.01257962004036, + "Y": 466.83734841742825, + "IsEmpty": false + }, + "Timestamp": 637316491803685770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.325429171, + "Position": { + "X": 888.52386028494061, + "Y": 466.97224548363886, + "IsEmpty": false + }, + "Timestamp": 637316491803856620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51610589, + "Position": { + "X": 888.85761851116035, + "Y": 467.07931601494607, + "IsEmpty": false + }, + "Timestamp": 637316491804189700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533684313, + "Position": { + "X": 888.52386028494061, + "Y": 466.97224548363886, + "IsEmpty": false + }, + "Timestamp": 637316491805199430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546379805, + "Position": { + "X": 888.01257962004036, + "Y": 466.83734841742825, + "IsEmpty": false + }, + "Timestamp": 637316491805372580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.557854593, + "Position": { + "X": 887.50043839483033, + "Y": 466.70234500792861, + "IsEmpty": false + }, + "Timestamp": 637316491805543990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571526647, + "Position": { + "X": 886.98743885305316, + "Y": 466.56723639920119, + "IsEmpty": false + }, + "Timestamp": 637316491805716150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 885.95887379476801, + "Y": 466.2967081603108, + "IsEmpty": false + }, + "Timestamp": 637316491805878860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582269013, + "Position": { + "X": 884.07086017825816, + "Y": 465.7823485829777, + "IsEmpty": false + }, + "Timestamp": 637316491806048010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 882.51238031502567, + "Y": 465.3746818753329, + "IsEmpty": false + }, + "Timestamp": 637316491806218110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.59740597, + "Position": { + "X": 879.19097348326977, + "Y": 464.52876132293108, + "IsEmpty": false + }, + "Timestamp": 637316491806382080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602288842, + "Position": { + "X": 876.02015101676329, + "Y": 463.70768072760416, + "IsEmpty": false + }, + "Timestamp": 637316491806557150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611322165, + "Position": { + "X": 872.28408475173842, + "Y": 462.74612935888007, + "IsEmpty": false + }, + "Timestamp": 637316491806721770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615960956, + "Position": { + "X": 867.42356482363584, + "Y": 461.50471839902877, + "IsEmpty": false + }, + "Timestamp": 637316491806889580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622308671, + "Position": { + "X": 860.29269485110285, + "Y": 459.70296071085477, + "IsEmpty": false + }, + "Timestamp": 637316491807066410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.626703262, + "Position": { + "X": 854.72160537118145, + "Y": 458.31147370190405, + "IsEmpty": false + }, + "Timestamp": 637316491807230980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631586194, + "Position": { + "X": 849.07837106398608, + "Y": 456.91644554644438, + "IsEmpty": false + }, + "Timestamp": 637316491807398610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631586194, + "Position": { + "X": 843.93963081339234, + "Y": 455.65883809324384, + "IsEmpty": false + }, + "Timestamp": 637316491807569630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635980785, + "Position": { + "X": 835.63493098863489, + "Y": 453.67187265094236, + "IsEmpty": false + }, + "Timestamp": 637316491807737060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635980785, + "Position": { + "X": 830.35685995032395, + "Y": 452.41310152111441, + "IsEmpty": false + }, + "Timestamp": 637316491807909410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.63793391, + "Position": { + "X": 825.62258608142622, + "Y": 451.29504288399272, + "IsEmpty": false + }, + "Timestamp": 637316491808071550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.639887094, + "Position": { + "X": 821.44810651904322, + "Y": 450.31787758648153, + "IsEmpty": false + }, + "Timestamp": 637316491808249360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.639887094, + "Position": { + "X": 815.03995725540835, + "Y": 448.81410916604909, + "IsEmpty": false + }, + "Timestamp": 637316491808409810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641840219, + "Position": { + "X": 811.79858797251825, + "Y": 448.09051359352884, + "IsEmpty": false + }, + "Timestamp": 637316491808582190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643793404, + "Position": { + "X": 808.35516824486217, + "Y": 447.28674214885223, + "IsEmpty": false + }, + "Timestamp": 637316491808748140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645746529, + "Position": { + "X": 805.08127741958242, + "Y": 446.56609515217116, + "IsEmpty": false + }, + "Timestamp": 637316491808915960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 801.60453192815851, + "Y": 445.76602642997256, + "IsEmpty": false + }, + "Timestamp": 637316491809092760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 798.2995589557197, + "Y": 445.04904775688613, + "IsEmpty": false + }, + "Timestamp": 637316491809252970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649896979, + "Position": { + "X": 797.27575475848221, + "Y": 444.80245805147126, + "IsEmpty": false + }, + "Timestamp": 637316491809272130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649896979, + "Position": { + "X": 793.32865076160977, + "Y": 443.95123979513778, + "IsEmpty": false + }, + "Timestamp": 637316491809422000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651850164, + "Position": { + "X": 790.20584608417425, + "Y": 443.26775892155194, + "IsEmpty": false + }, + "Timestamp": 637316491809591510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653803289, + "Position": { + "X": 785.81388758807554, + "Y": 442.31462949134925, + "IsEmpty": false + }, + "Timestamp": 637316491809759960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653803289, + "Position": { + "X": 783.2939673596868, + "Y": 441.77207937356536, + "IsEmpty": false + }, + "Timestamp": 637316491809937680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653803289, + "Position": { + "X": 780.98740335417551, + "Y": 441.25901452418856, + "IsEmpty": false + }, + "Timestamp": 637316491810099200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655756474, + "Position": { + "X": 779.08785204854883, + "Y": 440.85435501436979, + "IsEmpty": false + }, + "Timestamp": 637316491810272070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655756474, + "Position": { + "X": 775.91318838812526, + "Y": 440.18211255829107, + "IsEmpty": false + }, + "Timestamp": 637316491810440280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657709599, + "Position": { + "X": 774.41801444189628, + "Y": 439.88635541398611, + "IsEmpty": false + }, + "Timestamp": 637316491810609090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657709599, + "Position": { + "X": 773.78077723277465, + "Y": 439.75250098912829, + "IsEmpty": false + }, + "Timestamp": 637316491810777920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657709599, + "Position": { + "X": 773.36574867330773, + "Y": 439.64637202012636, + "IsEmpty": false + }, + "Timestamp": 637316491810950320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663569093, + "Position": { + "X": 773.14311991399529, + "Y": 439.61876468509064, + "IsEmpty": false + }, + "Timestamp": 637316491811115540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668451965, + "Position": { + "X": 772.72783677766904, + "Y": 439.51273161758502, + "IsEmpty": false + }, + "Timestamp": 637316491811453450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 774.00324202591526, + "Y": 439.78013145952929, + "IsEmpty": false + }, + "Timestamp": 637316491812471370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721675456, + "Position": { + "X": 775.05482929761695, + "Y": 440.02032681560223, + "IsEmpty": false + }, + "Timestamp": 637316491812642270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 776.96271730695094, + "Y": 440.42293144038462, + "IsEmpty": false + }, + "Timestamp": 637316491812802370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725825906, + "Position": { + "X": 777.1843521124963, + "Y": 440.45067416730956, + "IsEmpty": false + }, + "Timestamp": 637316491812985710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.430167079, + "Position": { + "X": 777.59782031164434, + "Y": 440.55735930841774, + "IsEmpty": false + }, + "Timestamp": 637316491813111260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.430167079, + "Position": { + "X": 778.4239585135723, + "Y": 440.77099714220969, + "IsEmpty": false + }, + "Timestamp": 637316491813141550, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "763a10aa-b8d0-4e60-99d6-2080fbc26b1e", + "Points": [ + { + "Pressure": 0.488273442, + "Position": { + "X": 887.02286202613209, + "Y": 571.22919099469004, + "IsEmpty": false + }, + "Timestamp": 637316491841054670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624994278, + "Position": { + "X": 885.60981222612895, + "Y": 572.03878147120054, + "IsEmpty": false + }, + "Timestamp": 637316491843587850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630853713, + "Position": { + "X": 884.18914166532068, + "Y": 572.84979463344712, + "IsEmpty": false + }, + "Timestamp": 637316491843868230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645746529, + "Position": { + "X": 879.3988030870496, + "Y": 575.5626750812296, + "IsEmpty": false + }, + "Timestamp": 637316491844064360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655268192, + "Position": { + "X": 874.52479733544692, + "Y": 578.28846922737284, + "IsEmpty": false + }, + "Timestamp": 637316491844240010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664789796, + "Position": { + "X": 869.42737540580765, + "Y": 581.12151840329193, + "IsEmpty": false + }, + "Timestamp": 637316491844405040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 863.87708488411693, + "Y": 584.14163663652266, + "IsEmpty": false + }, + "Timestamp": 637316491844568930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675288022, + "Position": { + "X": 855.10634786564867, + "Y": 588.82215972151721, + "IsEmpty": false + }, + "Timestamp": 637316491844739230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677241147, + "Position": { + "X": 849.30782507198421, + "Y": 591.85473237180429, + "IsEmpty": false + }, + "Timestamp": 637316491844916220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679194331, + "Position": { + "X": 843.41361188049359, + "Y": 594.88694536229491, + "IsEmpty": false + }, + "Timestamp": 637316491845100620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679194331, + "Position": { + "X": 837.81667267276396, + "Y": 597.73775962766035, + "IsEmpty": false + }, + "Timestamp": 637316491845245490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681147456, + "Position": { + "X": 832.85162575351831, + "Y": 600.2117792291258, + "IsEmpty": false + }, + "Timestamp": 637316491845421820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683100641, + "Position": { + "X": 826.13495932758497, + "Y": 603.50130538380142, + "IsEmpty": false + }, + "Timestamp": 637316491845592230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683100641, + "Position": { + "X": 821.5964455208408, + "Y": 605.68678121480093, + "IsEmpty": false + }, + "Timestamp": 637316491845753660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683100641, + "Position": { + "X": 817.41990832063823, + "Y": 607.68903826248334, + "IsEmpty": false + }, + "Timestamp": 637316491845921790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683100641, + "Position": { + "X": 811.62442778507113, + "Y": 610.40054041176427, + "IsEmpty": false + }, + "Timestamp": 637316491846091560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685053766, + "Position": { + "X": 808.69893824852124, + "Y": 611.75066835192354, + "IsEmpty": false + }, + "Timestamp": 637316491846269390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.68700695, + "Position": { + "X": 806.51596296444211, + "Y": 612.73282332095835, + "IsEmpty": false + }, + "Timestamp": 637316491846430530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692133963, + "Position": { + "X": 805.16411055252649, + "Y": 613.36535929428214, + "IsEmpty": false + }, + "Timestamp": 637316491846608300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697749317, + "Position": { + "X": 804.5724125221725, + "Y": 613.63386392087546, + "IsEmpty": false + }, + "Timestamp": 637316491846769210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702143908, + "Position": { + "X": 802.79294522766043, + "Y": 614.43828665513809, + "IsEmpty": false + }, + "Timestamp": 637316491846946250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706538498, + "Position": { + "X": 802.19833431281847, + "Y": 614.70605643107638, + "IsEmpty": false + }, + "Timestamp": 637316491847109940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708735764, + "Position": { + "X": 801.00693441018961, + "Y": 615.24102592317104, + "IsEmpty": false + }, + "Timestamp": 637316491847285750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710933089, + "Position": { + "X": 799.8126355792582, + "Y": 615.77522049493643, + "IsEmpty": false + }, + "Timestamp": 637316491847444840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 796.81424639614704, + "Y": 617.10719977802444, + "IsEmpty": false + }, + "Timestamp": 637316491847614410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 794.83091066077816, + "Y": 617.99756428311343, + "IsEmpty": false + }, + "Timestamp": 637316491847788660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 793.01603730711361, + "Y": 618.79208888489188, + "IsEmpty": false + }, + "Timestamp": 637316491847957630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 791.97946017818913, + "Y": 619.22736661198337, + "IsEmpty": false + }, + "Timestamp": 637316491848241810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 791.80254766634664, + "Y": 619.32065846699049, + "IsEmpty": false + }, + "Timestamp": 637316491848416460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 791.37189480119139, + "Y": 619.49138879355496, + "IsEmpty": false + }, + "Timestamp": 637316491848967520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.419913024, + "Position": { + "X": 791.80254766634664, + "Y": 619.32065846699049, + "IsEmpty": false + }, + "Timestamp": 637316491849344540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.419913024, + "Position": { + "X": 792.33253679841937, + "Y": 619.04055163794646, + "IsEmpty": false + }, + "Timestamp": 637316491849371690, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7dc2a646-babe-48ba-a05d-ce3a03edc39b", + "Points": [ + { + "Pressure": 0.0561379418, + "Position": { + "X": 1092.3280200323927, + "Y": 569.40025209912756, + "IsEmpty": false + }, + "Timestamp": 637316491861004790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480460823, + "Position": { + "X": 1092.0371041386954, + "Y": 569.17951587428524, + "IsEmpty": false + }, + "Timestamp": 637316491861148800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521721244, + "Position": { + "X": 1092.4627717057801, + "Y": 569.472439222508, + "IsEmpty": false + }, + "Timestamp": 637316491862633320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532463551, + "Position": { + "X": 1091.6123390628322, + "Y": 568.88686503749477, + "IsEmpty": false + }, + "Timestamp": 637316491863500080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562249184, + "Position": { + "X": 1091.7468326279572, + "Y": 568.95898463660183, + "IsEmpty": false + }, + "Timestamp": 637316491863837480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 1092.1718558120824, + "Y": 569.25170299766569, + "IsEmpty": false + }, + "Timestamp": 637316491864187690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617181659, + "Position": { + "X": 1093.8809653856879, + "Y": 570.42527080477748, + "IsEmpty": false + }, + "Timestamp": 637316491864521640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628412306, + "Position": { + "X": 1095.6044769769394, + "Y": 571.60303168120174, + "IsEmpty": false + }, + "Timestamp": 637316491864826290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655512333, + "Position": { + "X": 1105.7924919203322, + "Y": 578.44864684141589, + "IsEmpty": false + }, + "Timestamp": 637316491865189590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665278077, + "Position": { + "X": 1113.6243934886634, + "Y": 583.57667195564886, + "IsEmpty": false + }, + "Timestamp": 637316491865520320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671381712, + "Position": { + "X": 1120.2646774659379, + "Y": 587.83369850702786, + "IsEmpty": false + }, + "Timestamp": 637316491865845570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677241147, + "Position": { + "X": 1136.0805057106941, + "Y": 597.64121585195835, + "IsEmpty": false + }, + "Timestamp": 637316491866201310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683344781, + "Position": { + "X": 1149.5751111161983, + "Y": 605.64442942552807, + "IsEmpty": false + }, + "Timestamp": 637316491866537100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1160.1743666161001, + "Y": 611.71694592780659, + "IsEmpty": false + }, + "Timestamp": 637316491866871590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 1173.7007820794704, + "Y": 619.13038792992438, + "IsEmpty": false + }, + "Timestamp": 637316491867210940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 1182.1129013856978, + "Y": 623.60611954502531, + "IsEmpty": false + }, + "Timestamp": 637316491867556310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 1186.7663184303171, + "Y": 626.01826305253803, + "IsEmpty": false + }, + "Timestamp": 637316491867889850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 1190.1112558880027, + "Y": 627.74590250439701, + "IsEmpty": false + }, + "Timestamp": 637316491868246150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 1191.471281097474, + "Y": 628.41844808504152, + "IsEmpty": false + }, + "Timestamp": 637316491868527020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.695551991, + "Position": { + "X": 1192.6555446156344, + "Y": 629.0164784423763, + "IsEmpty": false + }, + "Timestamp": 637316491868926480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.695551991, + "Position": { + "X": 1193.8430089671026, + "Y": 629.61366313564235, + "IsEmpty": false + }, + "Timestamp": 637316491869186390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697505176, + "Position": { + "X": 1194.4379401573212, + "Y": 629.9119322170385, + "IsEmpty": false + }, + "Timestamp": 637316491869617060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.283924609, + "Position": { + "X": 1192.4757698084263, + "Y": 628.9430004533375, + "IsEmpty": false + }, + "Timestamp": 637316491870015000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.283924609, + "Position": { + "X": 1191.8834392853607, + "Y": 628.64403602092375, + "IsEmpty": false + }, + "Timestamp": 637316491870035140, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "b273e8f7-62e9-4d2c-ace7-2ef331ff2346", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 1089.6317083948386, + "Y": 466.30118708628595, + "IsEmpty": false + }, + "Timestamp": 637316491899778720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.238269627, + "Position": { + "X": 1090.1051792165176, + "Y": 466.14206797576952, + "IsEmpty": false + }, + "Timestamp": 637316491900133140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.378408492, + "Position": { + "X": 1091.0549981287827, + "Y": 465.82326266906711, + "IsEmpty": false + }, + "Timestamp": 637316491900537780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.428946376, + "Position": { + "X": 1091.5313414784828, + "Y": 465.66357930650491, + "IsEmpty": false + }, + "Timestamp": 637316491900807860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.493400484, + "Position": { + "X": 1092.9660786565389, + "Y": 465.18342338371883, + "IsEmpty": false + }, + "Timestamp": 637316491901182550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523918509, + "Position": { + "X": 1094.4093267487274, + "Y": 464.70163846133221, + "IsEmpty": false + }, + "Timestamp": 637316491901481920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.561272621, + "Position": { + "X": 1095.3761888232432, + "Y": 464.37956240412234, + "IsEmpty": false + }, + "Timestamp": 637316491901840510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582269013, + "Position": { + "X": 1098.2991105104886, + "Y": 463.40920558896983, + "IsEmpty": false + }, + "Timestamp": 637316491902122040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602532983, + "Position": { + "X": 1103.7524264186982, + "Y": 461.61009196867087, + "IsEmpty": false + }, + "Timestamp": 637316491902509020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647699714, + "Position": { + "X": 1123.9344183182377, + "Y": 455.10020646264735, + "IsEmpty": false + }, + "Timestamp": 637316491902868330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663813233, + "Position": { + "X": 1130.9403573617092, + "Y": 452.89397833877194, + "IsEmpty": false + }, + "Timestamp": 637316491903188590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675043881, + "Position": { + "X": 1149.8612653396078, + "Y": 447.0739862278042, + "IsEmpty": false + }, + "Timestamp": 637316491903502530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691645682, + "Position": { + "X": 1171.3547939428061, + "Y": 440.7066997806362, + "IsEmpty": false + }, + "Timestamp": 637316491903902220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 1180.3126876126005, + "Y": 438.13001798191254, + "IsEmpty": false + }, + "Timestamp": 637316491904053990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 1185.1368564663996, + "Y": 436.76248860198325, + "IsEmpty": false + }, + "Timestamp": 637316491904344130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.695551991, + "Position": { + "X": 1197.3478468923872, + "Y": 433.3613372189551, + "IsEmpty": false + }, + "Timestamp": 637316491904691540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699458301, + "Position": { + "X": 1211.6486492134877, + "Y": 429.48808357052576, + "IsEmpty": false + }, + "Timestamp": 637316491905018990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699458301, + "Position": { + "X": 1223.0095092451877, + "Y": 426.4986896228404, + "IsEmpty": false + }, + "Timestamp": 637316491905316990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 1233.2198147187032, + "Y": 423.87993411365403, + "IsEmpty": false + }, + "Timestamp": 637316491905706970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 1239.641493793984, + "Y": 422.26761957044664, + "IsEmpty": false + }, + "Timestamp": 637316491906009340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 1246.0972666715188, + "Y": 420.67338870347152, + "IsEmpty": false + }, + "Timestamp": 637316491906374250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 1251.2848395735343, + "Y": 419.41197635438482, + "IsEmpty": false + }, + "Timestamp": 637316491906692880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705317795, + "Position": { + "X": 1263.0380889625167, + "Y": 416.61856111453102, + "IsEmpty": false + }, + "Timestamp": 637316491907094200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705317795, + "Position": { + "X": 1266.3012196252316, + "Y": 415.86150130581808, + "IsEmpty": false + }, + "Timestamp": 637316491907368260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705317795, + "Position": { + "X": 1268.9267371661394, + "Y": 415.25644484139679, + "IsEmpty": false + }, + "Timestamp": 637316491907761580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 1269.597094183878, + "Y": 415.10123344718971, + "IsEmpty": false + }, + "Timestamp": 637316491908088350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 1270.2543091470141, + "Y": 414.95083059122283, + "IsEmpty": false + }, + "Timestamp": 637316491908437670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1269.5837081477032, + "Y": 415.10578866650792, + "IsEmpty": false + }, + "Timestamp": 637316491909090230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624750137, + "Position": { + "X": 1266.957239311771, + "Y": 415.7098752586067, + "IsEmpty": false + }, + "Timestamp": 637316491909409500, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7389295b-5246-4335-9e32-2752d9095ba8", + "Points": [ + { + "Pressure": 0.0771343559, + "Position": { + "X": 793.26887373450359, + "Y": 445.64611287988947, + "IsEmpty": false + }, + "Timestamp": 637316491953239500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.427969784, + "Position": { + "X": 793.26887373450359, + "Y": 445.17470234836372, + "IsEmpty": false + }, + "Timestamp": 637316491954240390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.463370711, + "Position": { + "X": 793.26887373450359, + "Y": 444.76218381393306, + "IsEmpty": false + }, + "Timestamp": 637316491954409370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510002315, + "Position": { + "X": 793.26887373450359, + "Y": 443.99613026042186, + "IsEmpty": false + }, + "Timestamp": 637316491954578120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544670761, + "Position": { + "X": 793.26887373450359, + "Y": 443.64254948221384, + "IsEmpty": false + }, + "Timestamp": 637316491954746000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629388869, + "Position": { + "X": 793.26887373450359, + "Y": 443.34790646022839, + "IsEmpty": false + }, + "Timestamp": 637316491955264190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661127627, + "Position": { + "X": 793.26887373450359, + "Y": 444.88005932637827, + "IsEmpty": false + }, + "Timestamp": 637316491955769290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675288022, + "Position": { + "X": 793.26887373450359, + "Y": 447.00145247737157, + "IsEmpty": false + }, + "Timestamp": 637316491955930400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6828565, + "Position": { + "X": 793.26887373450359, + "Y": 448.71032709393427, + "IsEmpty": false + }, + "Timestamp": 637316491956107050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 793.26887373450359, + "Y": 451.36206853267589, + "IsEmpty": false + }, + "Timestamp": 637316491956266190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693110526, + "Position": { + "X": 793.26887373450359, + "Y": 454.60309601538842, + "IsEmpty": false + }, + "Timestamp": 637316491956438370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699458301, + "Position": { + "X": 793.26887373450359, + "Y": 460.26011391195226, + "IsEmpty": false + }, + "Timestamp": 637316491956612530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 793.26887373450359, + "Y": 464.26719494817598, + "IsEmpty": false + }, + "Timestamp": 637316491956775390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708247483, + "Position": { + "X": 793.26887373450359, + "Y": 468.21533822817713, + "IsEmpty": false + }, + "Timestamp": 637316491956942020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708247483, + "Position": { + "X": 793.26887373450359, + "Y": 472.04565175486061, + "IsEmpty": false + }, + "Timestamp": 637316491957119310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 793.26887373450359, + "Y": 478.23301793917278, + "IsEmpty": false + }, + "Timestamp": 637316491957279860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 793.26887373450359, + "Y": 482.59367975360459, + "IsEmpty": false + }, + "Timestamp": 637316491957454250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714106977, + "Position": { + "X": 793.26887373450359, + "Y": 487.19000107467173, + "IsEmpty": false + }, + "Timestamp": 637316491957620850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716060102, + "Position": { + "X": 793.26887373450359, + "Y": 491.72747615777132, + "IsEmpty": false + }, + "Timestamp": 637316491957795660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 793.26887373450359, + "Y": 497.79696682963828, + "IsEmpty": false + }, + "Timestamp": 637316491957964310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 793.26887373450359, + "Y": 502.39328815070542, + "IsEmpty": false + }, + "Timestamp": 637316491958204670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 793.26887373450359, + "Y": 507.34323600910813, + "IsEmpty": false + }, + "Timestamp": 637316491958293520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 793.26887373450359, + "Y": 514.47351477472682, + "IsEmpty": false + }, + "Timestamp": 637316491958469340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 793.26887373450359, + "Y": 518.59842556426815, + "IsEmpty": false + }, + "Timestamp": 637316491958636870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 793.26887373450359, + "Y": 522.1340503098387, + "IsEmpty": false + }, + "Timestamp": 637316491958801270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 793.26887373450359, + "Y": 525.66967505540924, + "IsEmpty": false + }, + "Timestamp": 637316491958975730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 793.26887373450359, + "Y": 529.20539131923476, + "IsEmpty": false + }, + "Timestamp": 637316491959139190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 793.26887373450359, + "Y": 534.33206092805028, + "IsEmpty": false + }, + "Timestamp": 637316491959316520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 793.26887373450359, + "Y": 537.57308841076281, + "IsEmpty": false + }, + "Timestamp": 637316491959477080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 793.26887373450359, + "Y": 540.6373026248076, + "IsEmpty": false + }, + "Timestamp": 637316491959650340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 793.26887373450359, + "Y": 543.9372678637427, + "IsEmpty": false + }, + "Timestamp": 637316491959816100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 793.26887373450359, + "Y": 547.17829534645523, + "IsEmpty": false + }, + "Timestamp": 637316491959993470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 793.26887373450359, + "Y": 549.7121612727517, + "IsEmpty": false + }, + "Timestamp": 637316491960156560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 793.26887373450359, + "Y": 552.36390271149332, + "IsEmpty": false + }, + "Timestamp": 637316491960327440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 793.26887373450359, + "Y": 554.8977686377898, + "IsEmpty": false + }, + "Timestamp": 637316491960495200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 793.26887373450359, + "Y": 558.07985836427974, + "IsEmpty": false + }, + "Timestamp": 637316491960663270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 793.26887373450359, + "Y": 560.02443824660531, + "IsEmpty": false + }, + "Timestamp": 637316491960833060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 793.26887373450359, + "Y": 561.96910964718586, + "IsEmpty": false + }, + "Timestamp": 637316491960999060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725825906, + "Position": { + "X": 793.26887373450359, + "Y": 564.85651059256281, + "IsEmpty": false + }, + "Timestamp": 637316491961173210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 566.68330648069821, + "IsEmpty": false + }, + "Timestamp": 637316491961343770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 568.15647583149791, + "IsEmpty": false + }, + "Timestamp": 637316491961504800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 570.10105571382348, + "IsEmpty": false + }, + "Timestamp": 637316491961681210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 571.39750331421055, + "IsEmpty": false + }, + "Timestamp": 637316491961848090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 573.636771977649, + "IsEmpty": false + }, + "Timestamp": 637316491962020110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 575.34560083508416, + "IsEmpty": false + }, + "Timestamp": 637316491962185510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 577.11345896699697, + "IsEmpty": false + }, + "Timestamp": 637316491962353290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 579.64732489329333, + "IsEmpty": false + }, + "Timestamp": 637316491962524560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 581.00271024990298, + "IsEmpty": false + }, + "Timestamp": 637316491962694810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 581.8865935567319, + "IsEmpty": false + }, + "Timestamp": 637316491962861870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 583.59551393242202, + "IsEmpty": false + }, + "Timestamp": 637316491963029220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 585.95256659005065, + "IsEmpty": false + }, + "Timestamp": 637316491963206010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 587.83830023440862, + "IsEmpty": false + }, + "Timestamp": 637316491963363060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 589.54712909184377, + "IsEmpty": false + }, + "Timestamp": 637316491963532690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 591.13817395508875, + "IsEmpty": false + }, + "Timestamp": 637316491963715040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 593.31850486230474, + "IsEmpty": false + }, + "Timestamp": 637316491963869080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 594.61495246269169, + "IsEmpty": false + }, + "Timestamp": 637316491964050150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 595.49883576952061, + "IsEmpty": false + }, + "Timestamp": 637316491964212090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 596.85422112613026, + "IsEmpty": false + }, + "Timestamp": 637316491964381620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 598.56304998356541, + "IsEmpty": false + }, + "Timestamp": 637316491964554770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 600.50772138414595, + "IsEmpty": false + }, + "Timestamp": 637316491964724380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 601.92195297872308, + "IsEmpty": false + }, + "Timestamp": 637316491964887930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 602.805836285552, + "IsEmpty": false + }, + "Timestamp": 637316491965059050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 604.63263217368728, + "IsEmpty": false + }, + "Timestamp": 637316491965236890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 606.16473928070968, + "IsEmpty": false + }, + "Timestamp": 637316491965399560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 606.98968483131603, + "IsEmpty": false + }, + "Timestamp": 637316491965563100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 607.81472190017723, + "IsEmpty": false + }, + "Timestamp": 637316491965738660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 608.580729694561, + "IsEmpty": false + }, + "Timestamp": 637316491965900090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 609.4647045196449, + "IsEmpty": false + }, + "Timestamp": 637316491966074750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 610.23071231402855, + "IsEmpty": false + }, + "Timestamp": 637316491966237130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 611.05574938288987, + "IsEmpty": false + }, + "Timestamp": 637316491966416890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 612.29316770879927, + "IsEmpty": false + }, + "Timestamp": 637316491966575610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 612.64679424613485, + "IsEmpty": false + }, + "Timestamp": 637316491966749530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 613.4128020405185, + "IsEmpty": false + }, + "Timestamp": 637316491966919780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 613.76642857785407, + "IsEmpty": false + }, + "Timestamp": 637316491967090400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 614.53243637223773, + "IsEmpty": false + }, + "Timestamp": 637316491967259860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 614.88597139131832, + "IsEmpty": false + }, + "Timestamp": 637316491967429920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 615.23959792865389, + "IsEmpty": false + }, + "Timestamp": 637316491967594780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 615.41631967906665, + "IsEmpty": false + }, + "Timestamp": 637316491968105750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 615.5341951915118, + "IsEmpty": false + }, + "Timestamp": 637316491968443690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 793.26887373450359, + "Y": 615.65207070395695, + "IsEmpty": false + }, + "Timestamp": 637316491969119560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655268192, + "Position": { + "X": 793.26887373450359, + "Y": 616.06454347926012, + "IsEmpty": false + }, + "Timestamp": 637316491969741830, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "6848cc05-2956-4281-95ab-a5b2c1f3dee4", + "Points": [ + { + "Pressure": 0.119859613, + "Position": { + "X": 791.74334407326899, + "Y": 617.20944710147501, + "IsEmpty": false + }, + "Timestamp": 637316492073659540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.468009472, + "Position": { + "X": 792.41652689366708, + "Y": 617.38622485922951, + "IsEmpty": false + }, + "Timestamp": 637316492074892520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534172595, + "Position": { + "X": 793.09008441328581, + "Y": 617.56260832597832, + "IsEmpty": false + }, + "Timestamp": 637316492075069520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620599687, + "Position": { + "X": 792.41652689366708, + "Y": 617.38622485922951, + "IsEmpty": false + }, + "Timestamp": 637316492076072890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632806897, + "Position": { + "X": 791.33476947406393, + "Y": 617.08690993034588, + "IsEmpty": false + }, + "Timestamp": 637316492076246260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651361883, + "Position": { + "X": 789.05439043478327, + "Y": 616.49842913858049, + "IsEmpty": false + }, + "Timestamp": 637316492076414960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663813233, + "Position": { + "X": 787.04168464244151, + "Y": 615.96111375738678, + "IsEmpty": false + }, + "Timestamp": 637316492076582510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678217769, + "Position": { + "X": 784.36350150532655, + "Y": 615.23938304775379, + "IsEmpty": false + }, + "Timestamp": 637316492076749560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691157401, + "Position": { + "X": 781.69160780438517, + "Y": 614.51168907253646, + "IsEmpty": false + }, + "Timestamp": 637316492076919910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 777.29422238472773, + "Y": 613.28126502091754, + "IsEmpty": false + }, + "Timestamp": 637316492077096920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708247483, + "Position": { + "X": 773.31514529598758, + "Y": 612.16457794635699, + "IsEmpty": false + }, + "Timestamp": 637316492077261090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 769.35112300348555, + "Y": 611.03555436967326, + "IsEmpty": false + }, + "Timestamp": 637316492077434930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718501568, + "Position": { + "X": 765.40248653694437, + "Y": 609.89458285518231, + "IsEmpty": false + }, + "Timestamp": 637316492077596990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 759.50910438832932, + "Y": 608.16157318449916, + "IsEmpty": false + }, + "Timestamp": 637316492077771670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.72729075, + "Position": { + "X": 755.86069318341072, + "Y": 607.05267446239691, + "IsEmpty": false + }, + "Timestamp": 637316492077935140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729243934, + "Position": { + "X": 752.3557350941453, + "Y": 606.01004278554001, + "IsEmpty": false + }, + "Timestamp": 637316492078101100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729243934, + "Position": { + "X": 748.09195061087962, + "Y": 604.6840688471832, + "IsEmpty": false + }, + "Timestamp": 637316492078276400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733150244, + "Position": { + "X": 744.23317201485929, + "Y": 603.48482537613359, + "IsEmpty": false + }, + "Timestamp": 637316492078439960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.735103369, + "Position": { + "X": 741.67035649827926, + "Y": 602.68005998968192, + "IsEmpty": false + }, + "Timestamp": 637316492078618410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.735103369, + "Position": { + "X": 738.73533564318723, + "Y": 601.73079868800278, + "IsEmpty": false + }, + "Timestamp": 637316492078777650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737056553, + "Position": { + "X": 735.93297227014568, + "Y": 600.85459037907822, + "IsEmpty": false + }, + "Timestamp": 637316492078953860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737056553, + "Position": { + "X": 732.38687739594695, + "Y": 599.68993819683908, + "IsEmpty": false + }, + "Timestamp": 637316492079115680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739009678, + "Position": { + "X": 730.23658393644973, + "Y": 599.00976971729926, + "IsEmpty": false + }, + "Timestamp": 637316492079285730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740962863, + "Position": { + "X": 728.97639959261869, + "Y": 598.5973135696911, + "IsEmpty": false + }, + "Timestamp": 637316492079459530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742915988, + "Position": { + "X": 727.97347004577637, + "Y": 598.24762316836882, + "IsEmpty": false + }, + "Timestamp": 637316492079624560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75170517, + "Position": { + "X": 727.34507138509434, + "Y": 598.04069947696121, + "IsEmpty": false + }, + "Timestamp": 637316492079799470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762447536, + "Position": { + "X": 726.71719934795442, + "Y": 597.83356151044507, + "IsEmpty": false + }, + "Timestamp": 637316492079961680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699946582, + "Position": { + "X": 725.83511770518101, + "Y": 597.56237018887225, + "IsEmpty": false + }, + "Timestamp": 637316492080634840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699946582, + "Position": { + "X": 724.58230872250749, + "Y": 597.1469094089116, + "IsEmpty": false + }, + "Timestamp": 637316492080659090, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "fb87be01-d006-4bba-aa8c-a83259c05746", + "Points": [ + { + "Pressure": 0.25975433, + "Position": { + "X": 788.43183832856914, + "Y": 444.79249236779668, + "IsEmpty": false + }, + "Timestamp": 637316492088662380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.323231846, + "Position": { + "X": 789.10410250916345, + "Y": 444.70168694871745, + "IsEmpty": false + }, + "Timestamp": 637316492089259650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.488761723, + "Position": { + "X": 789.28715850245385, + "Y": 444.661896991932, + "IsEmpty": false + }, + "Timestamp": 637316492089431290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.516350031, + "Position": { + "X": 789.77662444802229, + "Y": 444.61104959491274, + "IsEmpty": false + }, + "Timestamp": 637316492089937450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.535637438, + "Position": { + "X": 789.95972860719701, + "Y": 444.57133526871553, + "IsEmpty": false + }, + "Timestamp": 637316492090105540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610345602, + "Position": { + "X": 790.44940207057869, + "Y": 444.52058116973808, + "IsEmpty": false + }, + "Timestamp": 637316492090443600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633051038, + "Position": { + "X": 789.95972860719701, + "Y": 444.57133526871553, + "IsEmpty": false + }, + "Timestamp": 637316492091117270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648432136, + "Position": { + "X": 789.77662444802229, + "Y": 444.61104959491274, + "IsEmpty": false + }, + "Timestamp": 637316492091290520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660151064, + "Position": { + "X": 789.28715850245385, + "Y": 444.661896991932, + "IsEmpty": false + }, + "Timestamp": 637316492091461480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67064929, + "Position": { + "X": 787.94279164925695, + "Y": 444.84352493622578, + "IsEmpty": false + }, + "Timestamp": 637316492091625530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685297906, + "Position": { + "X": 785.74540068017518, + "Y": 445.15737742974727, + "IsEmpty": false + }, + "Timestamp": 637316492091793880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 783.06325312936872, + "Y": 445.52488246764784, + "IsEmpty": false + }, + "Timestamp": 637316492091966350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703852892, + "Position": { + "X": 778.86617118891968, + "Y": 446.1218788246814, + "IsEmpty": false + }, + "Timestamp": 637316492092133410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 773.04567495986396, + "Y": 446.92541730467389, + "IsEmpty": false + }, + "Timestamp": 637316492092293930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 764.2387624769101, + "Y": 448.20851172735723, + "IsEmpty": false + }, + "Timestamp": 637316492092471220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726070046, + "Position": { + "X": 758.95876479776848, + "Y": 448.98405872613506, + "IsEmpty": false + }, + "Timestamp": 637316492092642120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728023171, + "Position": { + "X": 754.35719887562834, + "Y": 449.66944081390676, + "IsEmpty": false + }, + "Timestamp": 637316492092805730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729976356, + "Position": { + "X": 751.08131358583591, + "Y": 450.1627001848351, + "IsEmpty": false + }, + "Timestamp": 637316492092973260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 745.85959199238368, + "Y": 450.95803049220342, + "IsEmpty": false + }, + "Timestamp": 637316492093149870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 742.60872983091451, + "Y": 451.45876565115941, + "IsEmpty": false + }, + "Timestamp": 637316492093317830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742427707, + "Position": { + "X": 739.36795872713196, + "Y": 451.96218185821141, + "IsEmpty": false + }, + "Timestamp": 637316492093477010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.751216888, + "Position": { + "X": 736.60583344227507, + "Y": 452.41139860105477, + "IsEmpty": false + }, + "Timestamp": 637316492093651440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757076383, + "Position": { + "X": 732.91772697609679, + "Y": 452.97662573884367, + "IsEmpty": false + }, + "Timestamp": 637316492093821490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761959255, + "Position": { + "X": 730.81504037212335, + "Y": 453.32784282008487, + "IsEmpty": false + }, + "Timestamp": 637316492093988480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 728.89265101064609, + "Y": 453.63499894231018, + "IsEmpty": false + }, + "Timestamp": 637316492094155300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.765865564, + "Position": { + "X": 727.14963132439789, + "Y": 453.89771176808034, + "IsEmpty": false + }, + "Timestamp": 637316492094325810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.767818749, + "Position": { + "X": 724.42284818694884, + "Y": 454.35476157568883, + "IsEmpty": false + }, + "Timestamp": 637316492094501210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769771874, + "Position": { + "X": 722.68864944309826, + "Y": 454.61898944289931, + "IsEmpty": false + }, + "Timestamp": 637316492094673790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769771874, + "Position": { + "X": 721.41826365773829, + "Y": 454.82580603001958, + "IsEmpty": false + }, + "Timestamp": 637316492094834400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771725059, + "Position": { + "X": 720.14976628444435, + "Y": 455.03293762190651, + "IsEmpty": false + }, + "Timestamp": 637316492095000000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773678184, + "Position": { + "X": 718.25059730204896, + "Y": 455.3442105349535, + "IsEmpty": false + }, + "Timestamp": 637316492095168990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.775631368, + "Position": { + "X": 717.61850316019718, + "Y": 455.44811819260474, + "IsEmpty": false + }, + "Timestamp": 637316492095341770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.777584493, + "Position": { + "X": 717.44492322332223, + "Y": 455.49388845049316, + "IsEmpty": false + }, + "Timestamp": 637316492095512720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781490803, + "Position": { + "X": 716.98689356876366, + "Y": 455.55209942131461, + "IsEmpty": false + }, + "Timestamp": 637316492095682380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.778316915, + "Position": { + "X": 718.25059730204896, + "Y": 455.3442105349535, + "IsEmpty": false + }, + "Timestamp": 637316492095852270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.778316915, + "Position": { + "X": 717.61850316019718, + "Y": 455.44811819260474, + "IsEmpty": false + }, + "Timestamp": 637316492095946310, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "a3a88dfb-2b5a-47c6-b474-02d31dca57b9", + "Points": [ + { + "Pressure": 0.146471351, + "Position": { + "X": 733.61075444721098, + "Y": 459.61193587088621, + "IsEmpty": false + }, + "Timestamp": 637316492125141440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.168932632, + "Position": { + "X": 733.61075444721098, + "Y": 458.72800680492986, + "IsEmpty": false + }, + "Timestamp": 637316492125418140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.226794839, + "Position": { + "X": 733.61075444721098, + "Y": 457.43160496367034, + "IsEmpty": false + }, + "Timestamp": 637316492125594730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.327626467, + "Position": { + "X": 733.61075444721098, + "Y": 457.01913218836722, + "IsEmpty": false + }, + "Timestamp": 637316492125924690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.406729221, + "Position": { + "X": 733.61075444721098, + "Y": 456.60661365393656, + "IsEmpty": false + }, + "Timestamp": 637316492126097010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.454581529, + "Position": { + "X": 733.61075444721098, + "Y": 456.19414087863339, + "IsEmpty": false + }, + "Timestamp": 637316492126266520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.494132906, + "Position": { + "X": 733.61075444721098, + "Y": 455.36914956889962, + "IsEmpty": false + }, + "Timestamp": 637316492126431650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528801382, + "Position": { + "X": 733.61075444721098, + "Y": 454.95663103446896, + "IsEmpty": false + }, + "Timestamp": 637316492126609320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.563714027, + "Position": { + "X": 733.61075444721098, + "Y": 454.13168548386267, + "IsEmpty": false + }, + "Timestamp": 637316492126776990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667475402, + "Position": { + "X": 733.61075444721098, + "Y": 453.71916694943206, + "IsEmpty": false + }, + "Timestamp": 637316492126947460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680903316, + "Position": { + "X": 733.61075444721098, + "Y": 454.54415825916584, + "IsEmpty": false + }, + "Timestamp": 637316492127788590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 733.61075444721098, + "Y": 456.01732760996561, + "IsEmpty": false + }, + "Timestamp": 637316492127961550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711909652, + "Position": { + "X": 733.61075444721098, + "Y": 458.72800680492986, + "IsEmpty": false + }, + "Timestamp": 637316492128128960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725093484, + "Position": { + "X": 733.61075444721098, + "Y": 460.96727546836837, + "IsEmpty": false + }, + "Timestamp": 637316492128299150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736079931, + "Position": { + "X": 733.61075444721098, + "Y": 463.91365992909545, + "IsEmpty": false + }, + "Timestamp": 637316492128457500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 733.61075444721098, + "Y": 467.39034691844336, + "IsEmpty": false + }, + "Timestamp": 637316492128624290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750240326, + "Position": { + "X": 733.61075444721098, + "Y": 472.63493779883152, + "IsEmpty": false + }, + "Timestamp": 637316492128802550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754146636, + "Position": { + "X": 733.61075444721098, + "Y": 476.5240975634826, + "IsEmpty": false + }, + "Timestamp": 637316492128967840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758052945, + "Position": { + "X": 733.61075444721098, + "Y": 481.06157264658219, + "IsEmpty": false + }, + "Timestamp": 637316492129131300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76025027, + "Position": { + "X": 733.61075444721098, + "Y": 486.12930449917508, + "IsEmpty": false + }, + "Timestamp": 637316492129311230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764400721, + "Position": { + "X": 733.61075444721098, + "Y": 493.3773672589839, + "IsEmpty": false + }, + "Timestamp": 637316492129480620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764400721, + "Position": { + "X": 733.61075444721098, + "Y": 497.56130732300289, + "IsEmpty": false + }, + "Timestamp": 637316492129649170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.766353846, + "Position": { + "X": 733.61075444721098, + "Y": 502.21656640029266, + "IsEmpty": false + }, + "Timestamp": 637316492129811690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.766353846, + "Position": { + "X": 733.61075444721098, + "Y": 506.93076323380501, + "IsEmpty": false + }, + "Timestamp": 637316492129986100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76830703, + "Position": { + "X": 733.61075444721098, + "Y": 512.82353215525916, + "IsEmpty": false + }, + "Timestamp": 637316492130153770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76830703, + "Position": { + "X": 733.61075444721098, + "Y": 518.1859527889651, + "IsEmpty": false + }, + "Timestamp": 637316492130319920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 733.61075444721098, + "Y": 522.07511255361612, + "IsEmpty": false + }, + "Timestamp": 637316492130487170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 733.61075444721098, + "Y": 525.55189106121907, + "IsEmpty": false + }, + "Timestamp": 637316492130661420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 733.61075444721098, + "Y": 531.97491675216656, + "IsEmpty": false + }, + "Timestamp": 637316492130831130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 733.61075444721098, + "Y": 536.39451632282089, + "IsEmpty": false + }, + "Timestamp": 637316492131000050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 733.61075444721098, + "Y": 540.28376760572701, + "IsEmpty": false + }, + "Timestamp": 637316492131161280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.77221334, + "Position": { + "X": 733.61075444721098, + "Y": 543.46585733221696, + "IsEmpty": false + }, + "Timestamp": 637316492131336800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.77221334, + "Position": { + "X": 733.61075444721098, + "Y": 547.64970587798098, + "IsEmpty": false + }, + "Timestamp": 637316492131506760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.77221334, + "Position": { + "X": 733.61075444721098, + "Y": 550.36038507294518, + "IsEmpty": false + }, + "Timestamp": 637316492131670440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.77221334, + "Position": { + "X": 733.61075444721098, + "Y": 553.30672377454482, + "IsEmpty": false + }, + "Timestamp": 637316492131844700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 733.61075444721098, + "Y": 556.31200023236704, + "IsEmpty": false + }, + "Timestamp": 637316492132008450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 733.61075444721098, + "Y": 560.43700254016346, + "IsEmpty": false + }, + "Timestamp": 637316492132178330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 733.61075444721098, + "Y": 562.97086846645993, + "IsEmpty": false + }, + "Timestamp": 637316492132342980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 733.61075444721098, + "Y": 565.09226161745323, + "IsEmpty": false + }, + "Timestamp": 637316492132512760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 733.61075444721098, + "Y": 566.56543096825294, + "IsEmpty": false + }, + "Timestamp": 637316492132689600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 733.61075444721098, + "Y": 568.62788636302366, + "IsEmpty": false + }, + "Timestamp": 637316492132859180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 733.61075444721098, + "Y": 570.57246624534923, + "IsEmpty": false + }, + "Timestamp": 637316492133022400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 733.61075444721098, + "Y": 572.04572711440403, + "IsEmpty": false + }, + "Timestamp": 637316492133189840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 733.61075444721098, + "Y": 573.51889646520385, + "IsEmpty": false + }, + "Timestamp": 637316492133360460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 733.61075444721098, + "Y": 576.1117001477229, + "IsEmpty": false + }, + "Timestamp": 637316492133530940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 577.99734227382578, + "IsEmpty": false + }, + "Timestamp": 637316492133696010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 579.88307591818375, + "IsEmpty": false + }, + "Timestamp": 637316492133867650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 581.76871804428663, + "IsEmpty": false + }, + "Timestamp": 637316492134036660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 584.891870014554, + "IsEmpty": false + }, + "Timestamp": 637316492134211170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 586.54185263402167, + "IsEmpty": false + }, + "Timestamp": 637316492134374310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 588.19183525348922, + "IsEmpty": false + }, + "Timestamp": 637316492134549520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 590.31322840448252, + "IsEmpty": false + }, + "Timestamp": 637316492134712820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 591.60967600486947, + "IsEmpty": false + }, + "Timestamp": 637316492134887580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 591.96321102395007, + "IsEmpty": false + }, + "Timestamp": 637316492135053040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 592.84709433077899, + "IsEmpty": false + }, + "Timestamp": 637316492135217970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 593.78991539383037, + "IsEmpty": false + }, + "Timestamp": 637316492135390220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 733.61075444721098, + "Y": 594.73282797513684, + "IsEmpty": false + }, + "Timestamp": 637316492135562890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.767086267, + "Position": { + "X": 733.61075444721098, + "Y": 595.20423850666259, + "IsEmpty": false + }, + "Timestamp": 637316492136066660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712642074, + "Position": { + "X": 733.61075444721098, + "Y": 595.08636299421744, + "IsEmpty": false + }, + "Timestamp": 637316492137761150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.580315888, + "Position": { + "X": 733.61075444721098, + "Y": 594.96848748177229, + "IsEmpty": false + }, + "Timestamp": 637316492138202660, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "96dfe1de-26f6-4505-b268-80f28af96f68", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 1166.9451045387389, + "Y": 616.35923226037312, + "IsEmpty": false + }, + "Timestamp": 637316492242987730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.230701149, + "Position": { + "X": 1166.9451045387389, + "Y": 616.4770162545633, + "IsEmpty": false + }, + "Timestamp": 637316492243348650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.296864271, + "Position": { + "X": 1166.9451045387389, + "Y": 616.59489176700845, + "IsEmpty": false + }, + "Timestamp": 637316492243576800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.348867029, + "Position": { + "X": 1166.9451045387389, + "Y": 616.83064279189887, + "IsEmpty": false + }, + "Timestamp": 637316492243705860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.405996799, + "Position": { + "X": 1166.9451045387389, + "Y": 617.12524005475677, + "IsEmpty": false + }, + "Timestamp": 637316492243879200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.470450908, + "Position": { + "X": 1166.9451045387389, + "Y": 617.24311556720204, + "IsEmpty": false + }, + "Timestamp": 637316492244046010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.494132906, + "Position": { + "X": 1166.9451045387389, + "Y": 616.94851830434402, + "IsEmpty": false + }, + "Timestamp": 637316492244376810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523430228, + "Position": { + "X": 1166.9451045387389, + "Y": 615.29853568487647, + "IsEmpty": false + }, + "Timestamp": 637316492244554880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.540032029, + "Position": { + "X": 1166.9451045387389, + "Y": 613.64855306540892, + "IsEmpty": false + }, + "Timestamp": 637316492244721340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.555413127, + "Position": { + "X": 1166.9451045387389, + "Y": 611.82175717727353, + "IsEmpty": false + }, + "Timestamp": 637316492244885010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566399634, + "Position": { + "X": 1166.9451045387389, + "Y": 609.4647045196449, + "IsEmpty": false + }, + "Timestamp": 637316492245062880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 1166.9451045387389, + "Y": 605.5165154805162, + "IsEmpty": false + }, + "Timestamp": 637316492245232890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597894251, + "Position": { + "X": 1166.9451045387389, + "Y": 602.98264955421973, + "IsEmpty": false + }, + "Timestamp": 637316492245391930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608636618, + "Position": { + "X": 1166.9451045387389, + "Y": 600.38984587170069, + "IsEmpty": false + }, + "Timestamp": 637316492245560700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.618158221, + "Position": { + "X": 1166.9451045387389, + "Y": 597.44341565184607, + "IsEmpty": false + }, + "Timestamp": 637316492245728760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622796953, + "Position": { + "X": 1166.9451045387389, + "Y": 594.20247968738852, + "IsEmpty": false + }, + "Timestamp": 637316492245897980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631097913, + "Position": { + "X": 1166.9451045387389, + "Y": 588.60430802879239, + "IsEmpty": false + }, + "Timestamp": 637316492246068230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1166.9451045387389, + "Y": 584.71514826414125, + "IsEmpty": false + }, + "Timestamp": 637316492246237840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643793404, + "Position": { + "X": 1166.9451045387389, + "Y": 580.70802146878998, + "IsEmpty": false + }, + "Timestamp": 637316492246405550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651117742, + "Position": { + "X": 1166.9451045387389, + "Y": 574.81525254733583, + "IsEmpty": false + }, + "Timestamp": 637316492246575700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655512333, + "Position": { + "X": 1166.9451045387389, + "Y": 571.16175228932013, + "IsEmpty": false + }, + "Timestamp": 637316492246755200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 1166.9451045387389, + "Y": 567.86178705038503, + "IsEmpty": false + }, + "Timestamp": 637316492246917520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664057374, + "Position": { + "X": 1166.9451045387389, + "Y": 564.67969732389508, + "IsEmpty": false + }, + "Timestamp": 637316492247084430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668207824, + "Position": { + "X": 1166.9451045387389, + "Y": 560.3191270277182, + "IsEmpty": false + }, + "Timestamp": 637316492247255990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1166.9451045387389, + "Y": 557.90304509561201, + "IsEmpty": false + }, + "Timestamp": 637316492247427710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672358274, + "Position": { + "X": 1166.9451045387389, + "Y": 556.01740296950902, + "IsEmpty": false + }, + "Timestamp": 637316492247601480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674311459, + "Position": { + "X": 1166.9451045387389, + "Y": 554.42635810626405, + "IsEmpty": false + }, + "Timestamp": 637316492247758860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676264584, + "Position": { + "X": 1166.9451045387389, + "Y": 552.71743773057392, + "IsEmpty": false + }, + "Timestamp": 637316492247933710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678217769, + "Position": { + "X": 1166.9451045387389, + "Y": 551.42108164844183, + "IsEmpty": false + }, + "Timestamp": 637316492248095250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678217769, + "Position": { + "X": 1166.9451045387389, + "Y": 549.29968849744853, + "IsEmpty": false + }, + "Timestamp": 637316492248265150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678217769, + "Position": { + "X": 1166.9451045387389, + "Y": 547.35501709686798, + "IsEmpty": false + }, + "Timestamp": 637316492248437200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680170894, + "Position": { + "X": 1166.9451045387389, + "Y": 544.82115117057162, + "IsEmpty": false + }, + "Timestamp": 637316492248611740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680170894, + "Position": { + "X": 1166.9451045387389, + "Y": 541.52118593163641, + "IsEmpty": false + }, + "Timestamp": 637316492248775370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680170894, + "Position": { + "X": 1166.9451045387389, + "Y": 538.28015844892388, + "IsEmpty": false + }, + "Timestamp": 637316492248940200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680170894, + "Position": { + "X": 1166.9451045387389, + "Y": 534.80347145957592, + "IsEmpty": false + }, + "Timestamp": 637316492249115870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682124078, + "Position": { + "X": 1166.9451045387389, + "Y": 529.26432907545734, + "IsEmpty": false + }, + "Timestamp": 637316492249287900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682124078, + "Position": { + "X": 1166.9451045387389, + "Y": 525.4340155487738, + "IsEmpty": false + }, + "Timestamp": 637316492249455290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 1166.9451045387389, + "Y": 521.66263977831295, + "IsEmpty": false + }, + "Timestamp": 637316492249619700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.686518669, + "Position": { + "X": 1166.9451045387389, + "Y": 517.83232625162952, + "IsEmpty": false + }, + "Timestamp": 637316492249786220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691157401, + "Position": { + "X": 1166.9451045387389, + "Y": 514.00201272494598, + "IsEmpty": false + }, + "Timestamp": 637316492249956980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697749317, + "Position": { + "X": 1166.9451045387389, + "Y": 508.75746760368537, + "IsEmpty": false + }, + "Timestamp": 637316492250129930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702143908, + "Position": { + "X": 1166.9451045387389, + "Y": 505.92900441453094, + "IsEmpty": false + }, + "Timestamp": 637316492250292730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 1166.9451045387389, + "Y": 503.33620073201189, + "IsEmpty": false + }, + "Timestamp": 637316492250459630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 1166.9451045387389, + "Y": 499.15235218624787, + "IsEmpty": false + }, + "Timestamp": 637316492250636040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713618696, + "Position": { + "X": 1166.9451045387389, + "Y": 496.44167299128367, + "IsEmpty": false + }, + "Timestamp": 637316492250806800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720454693, + "Position": { + "X": 1166.9451045387389, + "Y": 493.61311828387426, + "IsEmpty": false + }, + "Timestamp": 637316492250975590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720454693, + "Position": { + "X": 1166.9451045387389, + "Y": 490.96137684513263, + "IsEmpty": false + }, + "Timestamp": 637316492251139540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720454693, + "Position": { + "X": 1166.9451045387389, + "Y": 487.66141160619748, + "IsEmpty": false + }, + "Timestamp": 637316492251307220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725093484, + "Position": { + "X": 1166.9451045387389, + "Y": 485.48108069898154, + "IsEmpty": false + }, + "Timestamp": 637316492251483930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.72753489, + "Position": { + "X": 1166.9451045387389, + "Y": 483.18296579757549, + "IsEmpty": false + }, + "Timestamp": 637316492251652890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.72753489, + "Position": { + "X": 1166.9451045387389, + "Y": 480.7668838654692, + "IsEmpty": false + }, + "Timestamp": 637316492251817890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.72753489, + "Position": { + "X": 1166.9451045387389, + "Y": 477.23125911989871, + "IsEmpty": false + }, + "Timestamp": 637316492251992040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729488075, + "Position": { + "X": 1166.9451045387389, + "Y": 475.05092821268283, + "IsEmpty": false + }, + "Timestamp": 637316492252159790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 1166.9451045387389, + "Y": 473.22422384280247, + "IsEmpty": false + }, + "Timestamp": 637316492252321970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 1166.9451045387389, + "Y": 471.45636571088971, + "IsEmpty": false + }, + "Timestamp": 637316492252490200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 1166.9451045387389, + "Y": 469.57067782565929, + "IsEmpty": false + }, + "Timestamp": 637316492252665320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737544835, + "Position": { + "X": 1166.9451045387389, + "Y": 467.27251716512569, + "IsEmpty": false + }, + "Timestamp": 637316492252834790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737544835, + "Position": { + "X": 1166.9451045387389, + "Y": 465.56359678943551, + "IsEmpty": false + }, + "Timestamp": 637316492252994640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737544835, + "Position": { + "X": 1166.9451045387389, + "Y": 463.97255192619053, + "IsEmpty": false + }, + "Timestamp": 637316492253163570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 1166.9451045387389, + "Y": 461.91009653141981, + "IsEmpty": false + }, + "Timestamp": 637316492253340140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 1166.9451045387389, + "Y": 460.55475693393771, + "IsEmpty": false + }, + "Timestamp": 637316492253508900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 1166.9451045387389, + "Y": 459.31729284890076, + "IsEmpty": false + }, + "Timestamp": 637316492253673920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 1166.9451045387389, + "Y": 457.54948047611555, + "IsEmpty": false + }, + "Timestamp": 637316492253841220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 1166.9451045387389, + "Y": 454.48522050294326, + "IsEmpty": false + }, + "Timestamp": 637316492254021060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 1166.9451045387389, + "Y": 452.71740813015799, + "IsEmpty": false + }, + "Timestamp": 637316492254185670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 1166.9451045387389, + "Y": 450.94959575737272, + "IsEmpty": false + }, + "Timestamp": 637316492254348660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 1166.9451045387389, + "Y": 449.29961313790517, + "IsEmpty": false + }, + "Timestamp": 637316492254524050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 1166.9451045387389, + "Y": 448.12104104996331, + "IsEmpty": false + }, + "Timestamp": 637316492254694950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741451144, + "Position": { + "X": 1166.9451045387389, + "Y": 446.52999618671834, + "IsEmpty": false + }, + "Timestamp": 637316492254985090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741451144, + "Position": { + "X": 1166.9451045387389, + "Y": 444.93895132347336, + "IsEmpty": false + }, + "Timestamp": 637316492255123450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745357454, + "Position": { + "X": 1166.9451045387389, + "Y": 442.34614764095431, + "IsEmpty": false + }, + "Timestamp": 637316492255539950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 1166.9451045387389, + "Y": 441.99261262187377, + "IsEmpty": false + }, + "Timestamp": 637316492255831420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753902495, + "Position": { + "X": 1166.9451045387389, + "Y": 441.22651330923509, + "IsEmpty": false + }, + "Timestamp": 637316492256169260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.314930946, + "Position": { + "X": 1166.9451045387389, + "Y": 444.11400577286707, + "IsEmpty": false + }, + "Timestamp": 637316492257010570, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "4a46d9d6-1e5b-46fa-8d4f-1a4bf2a598e9", + "Points": [ + { + "Pressure": 0.107896544, + "Position": { + "X": 1167.0367079273904, + "Y": 443.41305930594439, + "IsEmpty": false + }, + "Timestamp": 637316492302652850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480949104, + "Position": { + "X": 1167.723162552981, + "Y": 443.48607250244373, + "IsEmpty": false + }, + "Timestamp": 637316492304367460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.497795075, + "Position": { + "X": 1168.2816181208848, + "Y": 443.53558249900527, + "IsEmpty": false + }, + "Timestamp": 637316492304712560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532951832, + "Position": { + "X": 1168.4094769886588, + "Y": 443.55929164653526, + "IsEmpty": false + }, + "Timestamp": 637316492305041190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54027617, + "Position": { + "X": 1168.9677951570054, + "Y": 443.60893779760926, + "IsEmpty": false + }, + "Timestamp": 637316492305380670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 1168.4094769886588, + "Y": 443.55929164653526, + "IsEmpty": false + }, + "Timestamp": 637316492305718140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.550041974, + "Position": { + "X": 1166.9088407855409, + "Y": 443.38948895156233, + "IsEmpty": false + }, + "Timestamp": 637316492305886020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.550041974, + "Position": { + "X": 1165.663386251224, + "Y": 443.26765395442379, + "IsEmpty": false + }, + "Timestamp": 637316492306057530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.555657268, + "Position": { + "X": 1164.8486471675933, + "Y": 443.17190324994152, + "IsEmpty": false + }, + "Timestamp": 637316492306227120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567132056, + "Position": { + "X": 1165.663386251224, + "Y": 443.26765395442379, + "IsEmpty": false + }, + "Timestamp": 637316492306913050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577874422, + "Position": { + "X": 1167.723162552981, + "Y": 443.48607250244373, + "IsEmpty": false + }, + "Timestamp": 637316492307070640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600579858, + "Position": { + "X": 1172.5243055880121, + "Y": 444.00288662869991, + "IsEmpty": false + }, + "Timestamp": 637316492307237230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614007771, + "Position": { + "X": 1176.6335742310564, + "Y": 444.45369420598865, + "IsEmpty": false + }, + "Timestamp": 637316492307417860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 1181.5477820521098, + "Y": 445.01355980600169, + "IsEmpty": false + }, + "Timestamp": 637316492307578010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630121291, + "Position": { + "X": 1187.007084701871, + "Y": 445.63667407712705, + "IsEmpty": false + }, + "Timestamp": 637316492307749230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 1195.8510072950946, + "Y": 446.67407164015543, + "IsEmpty": false + }, + "Timestamp": 637316492307917780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643060982, + "Position": { + "X": 1201.4019335112534, + "Y": 447.35393459580268, + "IsEmpty": false + }, + "Timestamp": 637316492308089740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645014107, + "Position": { + "X": 1207.4850781485163, + "Y": 448.10180393100075, + "IsEmpty": false + }, + "Timestamp": 637316492308254210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649164557, + "Position": { + "X": 1213.6736743719812, + "Y": 448.89039373900539, + "IsEmpty": false + }, + "Timestamp": 637316492308422440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651117742, + "Position": { + "X": 1222.3895249907628, + "Y": 450.01145014950606, + "IsEmpty": false + }, + "Timestamp": 637316492308590950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653070867, + "Position": { + "X": 1227.7278354628913, + "Y": 450.71330101875401, + "IsEmpty": false + }, + "Timestamp": 637316492308768810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653070867, + "Position": { + "X": 1232.3820532008308, + "Y": 451.33450993918962, + "IsEmpty": false + }, + "Timestamp": 637316492308926760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660151064, + "Position": { + "X": 1236.3583438952478, + "Y": 451.87202283549669, + "IsEmpty": false + }, + "Timestamp": 637316492309095870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656977177, + "Position": { + "X": 1241.1060369646018, + "Y": 452.53449461983786, + "IsEmpty": false + }, + "Timestamp": 637316492309267900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659418643, + "Position": { + "X": 1243.7397180964299, + "Y": 452.89884903966072, + "IsEmpty": false + }, + "Timestamp": 637316492309437550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661371768, + "Position": { + "X": 1247.0234774019048, + "Y": 453.35688051556332, + "IsEmpty": false + }, + "Timestamp": 637316492309605340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658686221, + "Position": { + "X": 1250.2977301417343, + "Y": 453.81769475280947, + "IsEmpty": false + }, + "Timestamp": 637316492309774210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658686221, + "Position": { + "X": 1254.865228334399, + "Y": 454.46731940127086, + "IsEmpty": false + }, + "Timestamp": 637316492309945130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658686221, + "Position": { + "X": 1257.4663687663033, + "Y": 454.84078879464641, + "IsEmpty": false + }, + "Timestamp": 637316492310114180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658686221, + "Position": { + "X": 1260.1835451056397, + "Y": 455.24661879961195, + "IsEmpty": false + }, + "Timestamp": 637316492310283220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658686221, + "Position": { + "X": 1262.6487029154177, + "Y": 455.59240515326132, + "IsEmpty": false + }, + "Timestamp": 637316492310452440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658686221, + "Position": { + "X": 1264.7071977922353, + "Y": 455.90679961490241, + "IsEmpty": false + }, + "Timestamp": 637316492310625580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658686221, + "Position": { + "X": 1266.6394113195499, + "Y": 456.19109200011536, + "IsEmpty": false + }, + "Timestamp": 637316492310794750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658686221, + "Position": { + "X": 1268.5676485753572, + "Y": 456.4761678480416, + "IsEmpty": false + }, + "Timestamp": 637316492310959990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1270.4918545825733, + "Y": 456.7620055674459, + "IsEmpty": false + }, + "Timestamp": 637316492311127400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1272.4119743641145, + "Y": 457.04858356709309, + "IsEmpty": false + }, + "Timestamp": 637316492311300500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1273.6897569439229, + "Y": 457.24003617132092, + "IsEmpty": false + }, + "Timestamp": 637316492311464140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1274.3279529428969, + "Y": 457.33588025574767, + "IsEmpty": false + }, + "Timestamp": 637316492311632250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1274.9656826996659, + "Y": 457.43180179548256, + "IsEmpty": false + }, + "Timestamp": 637316492311801880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1275.602944178042, + "Y": 457.52779999084999, + "IsEmpty": false + }, + "Timestamp": 637316492311973840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1276.2397353418369, + "Y": 457.62387404217475, + "IsEmpty": false + }, + "Timestamp": 637316492312150730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583733857, + "Position": { + "X": 1276.3604166789253, + "Y": 457.65537953185913, + "IsEmpty": false + }, + "Timestamp": 637316492312309100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583733857, + "Position": { + "X": 1277.2706174983305, + "Y": 457.75321142744247, + "IsEmpty": false + }, + "Timestamp": 637316492312782520, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8672362a-8edd-4de5-bc50-4f6780db439a", + "Points": [ + { + "Pressure": 0.0461280234, + "Position": { + "X": 1167.944219138777, + "Y": 614.42969452428565, + "IsEmpty": false + }, + "Timestamp": 637316492328471070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.379140913, + "Position": { + "X": 1167.5132665453536, + "Y": 614.50575432944106, + "IsEmpty": false + }, + "Timestamp": 637316492329891660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.449210346, + "Position": { + "X": 1166.8315870522813, + "Y": 614.64360529000146, + "IsEmpty": false + }, + "Timestamp": 637316492330393230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.482169837, + "Position": { + "X": 1167.2625295761793, + "Y": 614.56779340173375, + "IsEmpty": false + }, + "Timestamp": 637316492331581150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.491935611, + "Position": { + "X": 1167.5132665453536, + "Y": 614.50575432944106, + "IsEmpty": false + }, + "Timestamp": 637316492331910320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.511711299, + "Position": { + "X": 1168.6257428841773, + "Y": 614.29114863822906, + "IsEmpty": false + }, + "Timestamp": 637316492332086810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527092397, + "Position": { + "X": 1169.5573118583523, + "Y": 614.08952050567927, + "IsEmpty": false + }, + "Timestamp": 637316492332255750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.542473495, + "Position": { + "X": 1171.3501419039089, + "Y": 613.73252773058107, + "IsEmpty": false + }, + "Timestamp": 637316492332423680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1172.7112973837275, + "Y": 613.45057776456883, + "IsEmpty": false + }, + "Timestamp": 637316492332585020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587884307, + "Position": { + "X": 1175.6800671596375, + "Y": 612.8170734108387, + "IsEmpty": false + }, + "Timestamp": 637316492332755840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.60155642, + "Position": { + "X": 1177.7176886596403, + "Y": 612.38515642336279, + "IsEmpty": false + }, + "Timestamp": 637316492332932310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 1180.184445604405, + "Y": 611.86906167123402, + "IsEmpty": false + }, + "Timestamp": 637316492333091620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622064531, + "Position": { + "X": 1182.8960914698594, + "Y": 611.28132363437305, + "IsEmpty": false + }, + "Timestamp": 637316492333268990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6340276, + "Position": { + "X": 1188.3093077412389, + "Y": 610.08622361663515, + "IsEmpty": false + }, + "Timestamp": 637316492333441160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 1191.6853980031906, + "Y": 609.32630038132152, + "IsEmpty": false + }, + "Timestamp": 637316492333611570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645746529, + "Position": { + "X": 1195.7290311992119, + "Y": 608.40154894618593, + "IsEmpty": false + }, + "Timestamp": 637316492333767370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 1199.7639060819674, + "Y": 607.46312013376087, + "IsEmpty": false + }, + "Timestamp": 637316492333937460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656733036, + "Position": { + "X": 1205.7989037824896, + "Y": 606.03060490564826, + "IsEmpty": false + }, + "Timestamp": 637316492334104840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658930361, + "Position": { + "X": 1209.8100973096045, + "Y": 605.0595287958846, + "IsEmpty": false + }, + "Timestamp": 637316492334284870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661127627, + "Position": { + "X": 1213.1449943411997, + "Y": 604.24078057691622, + "IsEmpty": false + }, + "Timestamp": 637316492334443420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665278077, + "Position": { + "X": 1216.4725810392601, + "Y": 603.41359766586197, + "IsEmpty": false + }, + "Timestamp": 637316492334620580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669428527, + "Position": { + "X": 1220.4557028856032, + "Y": 602.41013233848889, + "IsEmpty": false + }, + "Timestamp": 637316492334781920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673578978, + "Position": { + "X": 1223.1048786874362, + "Y": 601.73474583410189, + "IsEmpty": false + }, + "Timestamp": 637316492334953220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 1226.4091172638805, + "Y": 600.88348594669878, + "IsEmpty": false + }, + "Timestamp": 637316492335126550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 1229.7051007594484, + "Y": 600.02460943381561, + "IsEmpty": false + }, + "Timestamp": 637316492335296580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 1233.8808782723056, + "Y": 598.9058955180783, + "IsEmpty": false + }, + "Timestamp": 637316492335460900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677485287, + "Position": { + "X": 1236.5023501709234, + "Y": 598.20602207703269, + "IsEmpty": false + }, + "Timestamp": 637316492335638990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677485287, + "Position": { + "X": 1239.1180798936664, + "Y": 597.50167835254979, + "IsEmpty": false + }, + "Timestamp": 637316492335804000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677485287, + "Position": { + "X": 1241.0760361372602, + "Y": 596.97054992681069, + "IsEmpty": false + }, + "Timestamp": 637316492335966060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677485287, + "Position": { + "X": 1244.9818505718069, + "Y": 595.90110287680614, + "IsEmpty": false + }, + "Timestamp": 637316492336135350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1247.5780830663059, + "Y": 595.1829539020323, + "IsEmpty": false + }, + "Timestamp": 637316492336310990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1250.1680594423758, + "Y": 594.46077967205474, + "IsEmpty": false + }, + "Timestamp": 637316492336474700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1252.7516587723567, + "Y": 593.73468489939899, + "IsEmpty": false + }, + "Timestamp": 637316492336642850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1256.6148362766564, + "Y": 592.6384207815438, + "IsEmpty": false + }, + "Timestamp": 637316492336819190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1259.1819639329044, + "Y": 591.90298276949216, + "IsEmpty": false + }, + "Timestamp": 637316492336988190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1261.7422912962541, + "Y": 591.16399070860166, + "IsEmpty": false + }, + "Timestamp": 637316492337147240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1263.6580013810071, + "Y": 590.60747730951209, + "IsEmpty": false + }, + "Timestamp": 637316492337323290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1266.2061372496046, + "Y": 589.86251762766858, + "IsEmpty": false + }, + "Timestamp": 637316492337493310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1267.4775379253961, + "Y": 589.48880645869122, + "IsEmpty": false + }, + "Timestamp": 637316492337662320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1268.9670197495725, + "Y": 589.03005689928182, + "IsEmpty": false + }, + "Timestamp": 637316492337837970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1271.2808895272528, + "Y": 588.36290470832614, + "IsEmpty": false + }, + "Timestamp": 637316492338001250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1274.4376912514442, + "Y": 587.41938460996221, + "IsEmpty": false + }, + "Timestamp": 637316492338168400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1276.5432790275374, + "Y": 586.76582800998631, + "IsEmpty": false + }, + "Timestamp": 637316492338337580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 1279.6799951641019, + "Y": 585.81470511488283, + "IsEmpty": false + }, + "Timestamp": 637316492338505320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 1281.5562100923237, + "Y": 585.24198979095365, + "IsEmpty": false + }, + "Timestamp": 637316492338666590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689936697, + "Position": { + "X": 1283.4280016019329, + "Y": 584.6677972692703, + "IsEmpty": false + }, + "Timestamp": 637316492338852970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697260976, + "Position": { + "X": 1284.0509403055805, + "Y": 584.47607913116326, + "IsEmpty": false + }, + "Timestamp": 637316492339011730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70312047, + "Position": { + "X": 1283.4280016019329, + "Y": 584.6677972692703, + "IsEmpty": false + }, + "Timestamp": 637316492339865340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562981606, + "Position": { + "X": 1282.1806346058099, + "Y": 585.05075423529865, + "IsEmpty": false + }, + "Timestamp": 637316492339995360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562981606, + "Position": { + "X": 1283.0191438717206, + "Y": 584.77329279403057, + "IsEmpty": false + }, + "Timestamp": 637316492340035130, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d8657529-1a74-44c4-9c6b-dbccb2a8cddc", + "Points": [ + { + "Pressure": 0.16234073, + "Position": { + "X": 1242.4489919317573, + "Y": 455.7227303471077, + "IsEmpty": false + }, + "Timestamp": 637316492370621830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.170641646, + "Position": { + "X": 1242.4489919317573, + "Y": 454.95663103446896, + "IsEmpty": false + }, + "Timestamp": 637316492370777070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.230457008, + "Position": { + "X": 1242.4489919317573, + "Y": 454.54415825916584, + "IsEmpty": false + }, + "Timestamp": 637316492370942870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.372549027, + "Position": { + "X": 1242.4489919317573, + "Y": 453.36563193035153, + "IsEmpty": false + }, + "Timestamp": 637316492371112320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.407705814, + "Position": { + "X": 1242.4489919317573, + "Y": 453.12988090546111, + "IsEmpty": false + }, + "Timestamp": 637316492371456770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.47924009, + "Position": { + "X": 1242.4489919317573, + "Y": 453.01205115214344, + "IsEmpty": false + }, + "Timestamp": 637316492371790870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.490470737, + "Position": { + "X": 1242.4489919317573, + "Y": 453.36563193035153, + "IsEmpty": false + }, + "Timestamp": 637316492372302970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498283356, + "Position": { + "X": 1242.4489919317573, + "Y": 454.30845299340297, + "IsEmpty": false + }, + "Timestamp": 637316492372467200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506096005, + "Position": { + "X": 1242.4489919317573, + "Y": 455.84056010042536, + "IsEmpty": false + }, + "Timestamp": 637316492372648160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51195544, + "Position": { + "X": 1242.4489919317573, + "Y": 457.31377521035267, + "IsEmpty": false + }, + "Timestamp": 637316492372804270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.517814934, + "Position": { + "X": 1242.4489919317573, + "Y": 458.31553402962669, + "IsEmpty": false + }, + "Timestamp": 637316492372978230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525871694, + "Position": { + "X": 1242.4489919317573, + "Y": 460.31905166817484, + "IsEmpty": false + }, + "Timestamp": 637316492373140160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534660876, + "Position": { + "X": 1242.4489919317573, + "Y": 462.26367730962789, + "IsEmpty": false + }, + "Timestamp": 637316492373317550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537346482, + "Position": { + "X": 1242.4489919317573, + "Y": 464.38507046062119, + "IsEmpty": false + }, + "Timestamp": 637316492373477310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.542473495, + "Position": { + "X": 1242.4489919317573, + "Y": 467.09574965558539, + "IsEmpty": false + }, + "Timestamp": 637316492373653330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.545159101, + "Position": { + "X": 1242.4489919317573, + "Y": 471.92777624241546, + "IsEmpty": false + }, + "Timestamp": 637316492373819140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 1242.4489919317573, + "Y": 475.52233874420853, + "IsEmpty": false + }, + "Timestamp": 637316492373988990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 1242.4489919317573, + "Y": 479.11690124600165, + "IsEmpty": false + }, + "Timestamp": 637316492374157780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 1242.4489919317573, + "Y": 482.47580424115938, + "IsEmpty": false + }, + "Timestamp": 637316492374332840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 1242.4489919317573, + "Y": 487.42575209956209, + "IsEmpty": false + }, + "Timestamp": 637316492374501220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 1242.4489919317573, + "Y": 490.96137684513263, + "IsEmpty": false + }, + "Timestamp": 637316492374669880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 1242.4489919317573, + "Y": 494.26134208406773, + "IsEmpty": false + }, + "Timestamp": 637316492374832240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554924846, + "Position": { + "X": 1242.4489919317573, + "Y": 497.50236956678032, + "IsEmpty": false + }, + "Timestamp": 637316492375001010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55687803, + "Position": { + "X": 1242.4489919317573, + "Y": 502.8647902004862, + "IsEmpty": false + }, + "Timestamp": 637316492375175990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55687803, + "Position": { + "X": 1242.4489919317573, + "Y": 506.51829045850189, + "IsEmpty": false + }, + "Timestamp": 637316492375351870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55687803, + "Position": { + "X": 1242.4489919317573, + "Y": 510.11285296029496, + "IsEmpty": false + }, + "Timestamp": 637316492375506600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55687803, + "Position": { + "X": 1242.4489919317573, + "Y": 513.47166443719766, + "IsEmpty": false + }, + "Timestamp": 637316492375685430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558831155, + "Position": { + "X": 1242.4489919317573, + "Y": 518.12701503274252, + "IsEmpty": false + }, + "Timestamp": 637316492375852770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 521.36804251545504, + "IsEmpty": false + }, + "Timestamp": 637316492376022910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 524.8447295048029, + "IsEmpty": false + }, + "Timestamp": 637316492376182050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 528.20363249996069, + "IsEmpty": false + }, + "Timestamp": 637316492376357060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 532.85889157725046, + "IsEmpty": false + }, + "Timestamp": 637316492376521520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 535.62850852843724, + "IsEmpty": false + }, + "Timestamp": 637316492376796340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 538.28015844892388, + "IsEmpty": false + }, + "Timestamp": 637316492376867110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 541.16765091255593, + "IsEmpty": false + }, + "Timestamp": 637316492377025920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 545.76397223362301, + "IsEmpty": false + }, + "Timestamp": 637316492377202610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 549.00499971633565, + "IsEmpty": false + }, + "Timestamp": 637316492377372800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 552.12815168660302, + "IsEmpty": false + }, + "Timestamp": 637316492377535740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 555.1923659006477, + "IsEmpty": false + }, + "Timestamp": 637316492377708910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 559.25843045222155, + "IsEmpty": false + }, + "Timestamp": 637316492377878810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 561.67442086607286, + "IsEmpty": false + }, + "Timestamp": 637316492378043760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 564.38510006103706, + "IsEmpty": false + }, + "Timestamp": 637316492378210490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 567.27259252466911, + "IsEmpty": false + }, + "Timestamp": 637316492378388910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 570.98503053890738, + "IsEmpty": false + }, + "Timestamp": 637316492378553810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 573.40102095275859, + "IsEmpty": false + }, + "Timestamp": 637316492378724700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 575.46347634752931, + "IsEmpty": false + }, + "Timestamp": 637316492378886420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 577.17239672321955, + "IsEmpty": false + }, + "Timestamp": 637316492379062510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 578.58662831779668, + "IsEmpty": false + }, + "Timestamp": 637316492379238030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 579.94201367440633, + "IsEmpty": false + }, + "Timestamp": 637316492379407740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 580.88483473745782, + "IsEmpty": false + }, + "Timestamp": 637316492379560410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 581.70978028806405, + "IsEmpty": false + }, + "Timestamp": 637316492379738030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 582.59375511314795, + "IsEmpty": false + }, + "Timestamp": 637316492379906680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 583.47763841997687, + "IsEmpty": false + }, + "Timestamp": 637316492380075760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 583.94904895150262, + "IsEmpty": false + }, + "Timestamp": 637316492380245440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 584.77399450210885, + "IsEmpty": false + }, + "Timestamp": 637316492380415770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 586.60079039024424, + "IsEmpty": false + }, + "Timestamp": 637316492380581780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 587.48467369707305, + "IsEmpty": false + }, + "Timestamp": 637316492380743830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 588.5453702725697, + "IsEmpty": false + }, + "Timestamp": 637316492380916020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 589.48828285387617, + "IsEmpty": false + }, + "Timestamp": 637316492381087280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 589.95969338540192, + "IsEmpty": false + }, + "Timestamp": 637316492381259550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 591.43286273620174, + "IsEmpty": false + }, + "Timestamp": 637316492381425040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1242.4489919317573, + "Y": 592.43462155547581, + "IsEmpty": false + }, + "Timestamp": 637316492381593030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1242.4489919317573, + "Y": 593.37744261852731, + "IsEmpty": false + }, + "Timestamp": 637316492381766910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566643775, + "Position": { + "X": 1242.4489919317573, + "Y": 594.20247968738852, + "IsEmpty": false + }, + "Timestamp": 637316492382774020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566643775, + "Position": { + "X": 1242.4489919317573, + "Y": 594.96848748177229, + "IsEmpty": false + }, + "Timestamp": 637316492382940990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572014928, + "Position": { + "X": 1242.4489919317573, + "Y": 595.73458679441092, + "IsEmpty": false + }, + "Timestamp": 637316492383109990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579095125, + "Position": { + "X": 1242.4489919317573, + "Y": 596.44165683257211, + "IsEmpty": false + }, + "Timestamp": 637316492383281650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579095125, + "Position": { + "X": 1242.4489919317573, + "Y": 596.79528336990757, + "IsEmpty": false + }, + "Timestamp": 637316492383456520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58104831, + "Position": { + "X": 1242.4489919317573, + "Y": 597.14881838898816, + "IsEmpty": false + }, + "Timestamp": 637316492383619770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.341542691, + "Position": { + "X": 1242.4489919317573, + "Y": 597.32563165765589, + "IsEmpty": false + }, + "Timestamp": 637316492383787480, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7cae5b4d-608c-4157-9e47-203c665be496", + "Points": [ + { + "Pressure": 0.251209289, + "Position": { + "X": 1242.0064906013458, + "Y": 593.92955246675569, + "IsEmpty": false + }, + "Timestamp": 637316492460468800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.291981369, + "Position": { + "X": 1241.36539478331, + "Y": 593.7426242513269, + "IsEmpty": false + }, + "Timestamp": 637316492460822710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.330556184, + "Position": { + "X": 1240.9736413923929, + "Y": 593.64762455126277, + "IsEmpty": false + }, + "Timestamp": 637316492461019800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513664424, + "Position": { + "X": 1240.7247331601641, + "Y": 593.55546778521693, + "IsEmpty": false + }, + "Timestamp": 637316492461178070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532463551, + "Position": { + "X": 1241.36539478331, + "Y": 593.7426242513269, + "IsEmpty": false + }, + "Timestamp": 637316492462361900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54857707, + "Position": { + "X": 1242.0064906013458, + "Y": 593.92955246675569, + "IsEmpty": false + }, + "Timestamp": 637316492462538320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.563714027, + "Position": { + "X": 1243.2899774966465, + "Y": 594.30271749499434, + "IsEmpty": false + }, + "Timestamp": 637316492462705420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571526647, + "Position": { + "X": 1244.8255584992125, + "Y": 594.76642617025516, + "IsEmpty": false + }, + "Timestamp": 637316492462870650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.578606844, + "Position": { + "X": 1245.862081046088, + "Y": 595.04623538697217, + "IsEmpty": false + }, + "Timestamp": 637316492463036610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58519876, + "Position": { + "X": 1247.4020208351578, + "Y": 595.5075685374112, + "IsEmpty": false + }, + "Timestamp": 637316492463206140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.59349966, + "Position": { + "X": 1250.6319750249179, + "Y": 596.42849339774364, + "IsEmpty": false + }, + "Timestamp": 637316492463374810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600823998, + "Position": { + "X": 1253.8721336336039, + "Y": 597.34310972896105, + "IsEmpty": false + }, + "Timestamp": 637316492463550870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612054646, + "Position": { + "X": 1257.773471477657, + "Y": 598.43202944269433, + "IsEmpty": false + }, + "Timestamp": 637316492463712850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615228474, + "Position": { + "X": 1261.2918702552372, + "Y": 599.42022626426274, + "IsEmpty": false + }, + "Timestamp": 637316492463882840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619134784, + "Position": { + "X": 1266.5322219239251, + "Y": 600.8445227104429, + "IsEmpty": false + }, + "Timestamp": 637316492464059700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.621332109, + "Position": { + "X": 1270.4778184445593, + "Y": 601.90048315952549, + "IsEmpty": false + }, + "Timestamp": 637316492464222570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625482559, + "Position": { + "X": 1274.6975483513145, + "Y": 603.03066985379212, + "IsEmpty": false + }, + "Timestamp": 637316492464394330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630365431, + "Position": { + "X": 1279.0696609918703, + "Y": 604.15049365485356, + "IsEmpty": false + }, + "Timestamp": 637316492464562960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.637689769, + "Position": { + "X": 1285.0506772873593, + "Y": 605.67627251423778, + "IsEmpty": false + }, + "Timestamp": 637316492464734850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642572641, + "Position": { + "X": 1289.3184851337273, + "Y": 606.75980054674255, + "IsEmpty": false + }, + "Timestamp": 637316492464896630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642572641, + "Position": { + "X": 1293.3321345705774, + "Y": 607.7481473334542, + "IsEmpty": false + }, + "Timestamp": 637316492465066780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644525826, + "Position": { + "X": 1296.6848400392485, + "Y": 608.56187452071867, + "IsEmpty": false + }, + "Timestamp": 637316492465237910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646478951, + "Position": { + "X": 1301.3903807161125, + "Y": 609.68556102685966, + "IsEmpty": false + }, + "Timestamp": 637316492465411290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648432136, + "Position": { + "X": 1304.7595648831978, + "Y": 610.47681762750631, + "IsEmpty": false + }, + "Timestamp": 637316492465575150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650385261, + "Position": { + "X": 1308.5386403761468, + "Y": 611.33726026734143, + "IsEmpty": false + }, + "Timestamp": 637316492465743130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650385261, + "Position": { + "X": 1311.9207419692584, + "Y": 612.10785498324435, + "IsEmpty": false + }, + "Timestamp": 637316492465919410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652338445, + "Position": { + "X": 1317.6195860295113, + "Y": 613.3932132243558, + "IsEmpty": false + }, + "Timestamp": 637316492466089280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656488895, + "Position": { + "X": 1320.7416342951381, + "Y": 614.06336671031602, + "IsEmpty": false + }, + "Timestamp": 637316492466253750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661127627, + "Position": { + "X": 1324.1442026719794, + "Y": 614.79643817238343, + "IsEmpty": false + }, + "Timestamp": 637316492466419610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.666010499, + "Position": { + "X": 1326.1882345257877, + "Y": 615.23106180542823, + "IsEmpty": false + }, + "Timestamp": 637316492466590700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667963684, + "Position": { + "X": 1330.2816718443812, + "Y": 616.0883562789686, + "IsEmpty": false + }, + "Timestamp": 637316492466763880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1333.0144517914905, + "Y": 616.65088791179915, + "IsEmpty": false + }, + "Timestamp": 637316492466934750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1336.1540728652492, + "Y": 617.27599247052387, + "IsEmpty": false + }, + "Timestamp": 637316492467094360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1339.1737067276595, + "Y": 617.88964887879388, + "IsEmpty": false + }, + "Timestamp": 637316492467271890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1344.3772127626676, + "Y": 618.8937141452617, + "IsEmpty": false + }, + "Timestamp": 637316492467440920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1348.4971769618724, + "Y": 619.67655853870883, + "IsEmpty": false + }, + "Timestamp": 637316492467606610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672114134, + "Position": { + "X": 1352.2191259215417, + "Y": 620.37761882989548, + "IsEmpty": false + }, + "Timestamp": 637316492467772860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672114134, + "Position": { + "X": 1356.0633239055253, + "Y": 621.06522351634499, + "IsEmpty": false + }, + "Timestamp": 637316492467946000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674067318, + "Position": { + "X": 1360.8858996764643, + "Y": 621.91671637083061, + "IsEmpty": false + }, + "Timestamp": 637316492468109560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674067318, + "Position": { + "X": 1364.046055226903, + "Y": 622.45123138160807, + "IsEmpty": false + }, + "Timestamp": 637316492468281310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674067318, + "Position": { + "X": 1366.4038482395181, + "Y": 622.85831692467423, + "IsEmpty": false + }, + "Timestamp": 637316492468445070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674067318, + "Position": { + "X": 1368.8760777937523, + "Y": 623.26011796649891, + "IsEmpty": false + }, + "Timestamp": 637316492468623740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676020443, + "Position": { + "X": 1372.3287176350793, + "Y": 623.82160276177149, + "IsEmpty": false + }, + "Timestamp": 637316492468793520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1373.7103259490195, + "Y": 624.04234105493401, + "IsEmpty": false + }, + "Timestamp": 637316492468952960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 1375.0922279308743, + "Y": 624.26085618211664, + "IsEmpty": false + }, + "Timestamp": 637316492469122980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 1376.1836490745418, + "Y": 624.42370559070969, + "IsEmpty": false + }, + "Timestamp": 637316492469289980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1377.1655994821967, + "Y": 624.58443134041318, + "IsEmpty": false + }, + "Timestamp": 637316492469465870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1379.2395493751296, + "Y": 624.90292955628752, + "IsEmpty": false + }, + "Timestamp": 637316492469631060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 1381.0220867684909, + "Y": 625.16481761332807, + "IsEmpty": false + }, + "Timestamp": 637316492469797070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 1383.7881289222842, + "Y": 625.57573489953882, + "IsEmpty": false + }, + "Timestamp": 637316492469973800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 1385.1714352786564, + "Y": 625.77772068714114, + "IsEmpty": false + }, + "Timestamp": 637316492470143490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 1386.5549122868404, + "Y": 625.97737350287514, + "IsEmpty": false + }, + "Timestamp": 637316492470311690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1387.938545295955, + "Y": 626.17468004559089, + "IsEmpty": false + }, + "Timestamp": 637316492470482110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1389.3223196551219, + "Y": 626.36962701413859, + "IsEmpty": false + }, + "Timestamp": 637316492470658030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1390.7062207134607, + "Y": 626.56220110736854, + "IsEmpty": false + }, + "Timestamp": 637316492470811750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1391.39821417642, + "Y": 626.65759416912988, + "IsEmpty": false + }, + "Timestamp": 637316492470986030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1392.4877055107138, + "Y": 626.79968176665966, + "IsEmpty": false + }, + "Timestamp": 637316492471149570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689692557, + "Position": { + "X": 1393.1796108122796, + "Y": 626.89356876483589, + "IsEmpty": false + }, + "Timestamp": 637316492471463530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.695551991, + "Position": { + "X": 1396.6394166788107, + "Y": 627.35393478453284, + "IsEmpty": false + }, + "Timestamp": 637316492471839700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.695551991, + "Position": { + "X": 1397.7277423998187, + "Y": 627.48898762206375, + "IsEmpty": false + }, + "Timestamp": 637316492472270030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697505176, + "Position": { + "X": 1398.0234352074308, + "Y": 627.53381796984308, + "IsEmpty": false + }, + "Timestamp": 637316492472633310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 1399.4074867208792, + "Y": 627.71124507624654, + "IsEmpty": false + }, + "Timestamp": 637316492472979820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 1401.1871119931297, + "Y": 627.92942547319842, + "IsEmpty": false + }, + "Timestamp": 637316492473179500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 1402.5708689294779, + "Y": 628.10126161583935, + "IsEmpty": false + }, + "Timestamp": 637316492473457040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 1404.6464682989549, + "Y": 628.35432533747974, + "IsEmpty": false + }, + "Timestamp": 637316492473612440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 1408.499324667315, + "Y": 628.80314605725835, + "IsEmpty": false + }, + "Timestamp": 637316492473998960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 1414.7227747745485, + "Y": 629.49629460903589, + "IsEmpty": false + }, + "Timestamp": 637316492474320640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1417.1880349367621, + "Y": 629.75096438073217, + "IsEmpty": false + }, + "Timestamp": 637316492474458170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1419.2609601059701, + "Y": 629.96335120416211, + "IsEmpty": false + }, + "Timestamp": 637316492474632890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1422.714826569221, + "Y": 630.30401139638252, + "IsEmpty": false + }, + "Timestamp": 637316492474982110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1423.7948153486568, + "Y": 630.40203017225417, + "IsEmpty": false + }, + "Timestamp": 637316492475151650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1426.5557803979732, + "Y": 630.65834684941865, + "IsEmpty": false + }, + "Timestamp": 637316492475498440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1427.9358563326855, + "Y": 630.78241828144292, + "IsEmpty": false + }, + "Timestamp": 637316492475640280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1433.1500913900579, + "Y": 631.22193660735206, + "IsEmpty": false + }, + "Timestamp": 637316492476058910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1437.6683127664023, + "Y": 631.57063892327051, + "IsEmpty": false + }, + "Timestamp": 637316492476384940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1439.3490278002062, + "Y": 631.6988310998729, + "IsEmpty": false + }, + "Timestamp": 637316492476706340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1442.4845413307312, + "Y": 631.91415454440721, + "IsEmpty": false + }, + "Timestamp": 637316492476904430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1446.3029081463155, + "Y": 632.15753445963878, + "IsEmpty": false + }, + "Timestamp": 637316492477264780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1448.0570503008757, + "Y": 632.25966553628041, + "IsEmpty": false + }, + "Timestamp": 637316492477403650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1452.857956659182, + "Y": 632.52665816792046, + "IsEmpty": false + }, + "Timestamp": 637316492477749090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1454.6064919813812, + "Y": 632.61088730594088, + "IsEmpty": false + }, + "Timestamp": 637316492477909190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1458.4050776612305, + "Y": 632.78209398987804, + "IsEmpty": false + }, + "Timestamp": 637316492478282710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1459.7723049642082, + "Y": 632.83957941143126, + "IsEmpty": false + }, + "Timestamp": 637316492478542640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 1464.2438918933165, + "Y": 633.00241419097642, + "IsEmpty": false + }, + "Timestamp": 637316492478933870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717036724, + "Position": { + "X": 1465.6078740905912, + "Y": 633.04682308560177, + "IsEmpty": false + }, + "Timestamp": 637316492479251100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 1471.7972139178225, + "Y": 633.20140513075421, + "IsEmpty": false + }, + "Timestamp": 637316492479623190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 1473.1562676666051, + "Y": 633.22851158773938, + "IsEmpty": false + }, + "Timestamp": 637316492479916670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 1480.3053433619273, + "Y": 633.31455438350372, + "IsEmpty": false + }, + "Timestamp": 637316492480309970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716304243, + "Position": { + "X": 1482.6997583432521, + "Y": 633.32058174650194, + "IsEmpty": false + }, + "Timestamp": 637316492480568570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 1488.1490503433274, + "Y": 633.29677165677595, + "IsEmpty": false + }, + "Timestamp": 637316492480952290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 1490.1688187092977, + "Y": 633.27745248458541, + "IsEmpty": false + }, + "Timestamp": 637316492481298680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 1491.8734721353371, + "Y": 633.25069086571671, + "IsEmpty": false + }, + "Timestamp": 637316492481621320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 1492.1863788143924, + "Y": 633.25060673726489, + "IsEmpty": false + }, + "Timestamp": 637316492481959080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.417959869, + "Position": { + "X": 1492.5453828675343, + "Y": 633.24046531525778, + "IsEmpty": false + }, + "Timestamp": 637316492482317970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.417959869, + "Position": { + "X": 1492.1863788143924, + "Y": 633.25060673726489, + "IsEmpty": false + }, + "Timestamp": 637316492483050760, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "b242a41c-2135-46ca-a2e4-3a62be9f0fa5", + "Points": [ + { + "Pressure": 0.0991073474, + "Position": { + "X": 1242.3388521526324, + "Y": 450.19842930942929, + "IsEmpty": false + }, + "Timestamp": 637316492587478900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.140123591, + "Position": { + "X": 1242.9879258960082, + "Y": 450.09536404661799, + "IsEmpty": false + }, + "Timestamp": 637316492587745960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.242908373, + "Position": { + "X": 1243.1871788639746, + "Y": 450.04598683975041, + "IsEmpty": false + }, + "Timestamp": 637316492587920530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.591546476, + "Position": { + "X": 1243.836757521522, + "Y": 449.94308688065217, + "IsEmpty": false + }, + "Timestamp": 637316492590278130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600823998, + "Position": { + "X": 1246.2392372190618, + "Y": 449.58172187794059, + "IsEmpty": false + }, + "Timestamp": 637316492590457060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615472674, + "Position": { + "X": 1251.6620017204214, + "Y": 448.71730971660344, + "IsEmpty": false + }, + "Timestamp": 637316492590625930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622552812, + "Position": { + "X": 1257.3647846847284, + "Y": 447.85760726576353, + "IsEmpty": false + }, + "Timestamp": 637316492590788810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629144728, + "Position": { + "X": 1263.4989242367474, + "Y": 446.91235265848758, + "IsEmpty": false + }, + "Timestamp": 637316492590959890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6340276, + "Position": { + "X": 1270.1224545455434, + "Y": 445.92873489837422, + "IsEmpty": false + }, + "Timestamp": 637316492591133890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640619516, + "Position": { + "X": 1280.1157002145467, + "Y": 444.48132351959993, + "IsEmpty": false + }, + "Timestamp": 637316492591303170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650385261, + "Position": { + "X": 1286.3471205649466, + "Y": 443.58523369522004, + "IsEmpty": false + }, + "Timestamp": 637316492591464760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655512333, + "Position": { + "X": 1292.3956297418044, + "Y": 442.74848133025188, + "IsEmpty": false + }, + "Timestamp": 637316492591635890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660883486, + "Position": { + "X": 1297.7886439062263, + "Y": 442.0167630995582, + "IsEmpty": false + }, + "Timestamp": 637316492591807790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667231262, + "Position": { + "X": 1304.0789571913829, + "Y": 441.16526255456824, + "IsEmpty": false + }, + "Timestamp": 637316492591976540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667231262, + "Position": { + "X": 1308.1448492828292, + "Y": 440.63512164526446, + "IsEmpty": false + }, + "Timestamp": 637316492592137460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669184387, + "Position": { + "X": 1311.5384483815535, + "Y": 440.19878903701982, + "IsEmpty": false + }, + "Timestamp": 637316492592307970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 1315.8232780131063, + "Y": 439.64119223152272, + "IsEmpty": false + }, + "Timestamp": 637316492592483660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677485287, + "Position": { + "X": 1320.589259312748, + "Y": 439.0483699085936, + "IsEmpty": false + }, + "Timestamp": 637316492592649660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682368219, + "Position": { + "X": 1324.680485715417, + "Y": 438.54860800788964, + "IsEmpty": false + }, + "Timestamp": 637316492592825590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.68676281, + "Position": { + "X": 1329.6668758815174, + "Y": 437.93712625241949, + "IsEmpty": false + }, + "Timestamp": 637316492592984650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690669119, + "Position": { + "X": 1335.1369651336665, + "Y": 437.29675930120322, + "IsEmpty": false + }, + "Timestamp": 637316492593154190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.69481957, + "Position": { + "X": 1343.561912624763, + "Y": 436.3284074727091, + "IsEmpty": false + }, + "Timestamp": 637316492593329030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699702442, + "Position": { + "X": 1349.0476858255256, + "Y": 435.72731627127354, + "IsEmpty": false + }, + "Timestamp": 637316492593491640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 1354.0579767891404, + "Y": 435.18054430220991, + "IsEmpty": false + }, + "Timestamp": 637316492593667720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706294358, + "Position": { + "X": 1359.5509199650178, + "Y": 434.61112701869695, + "IsEmpty": false + }, + "Timestamp": 637316492593834720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 1367.313377721571, + "Y": 433.82465894394818, + "IsEmpty": false + }, + "Timestamp": 637316492594013030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 1372.8098194224067, + "Y": 433.29751652603329, + "IsEmpty": false + }, + "Timestamp": 637316492594164850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 1378.5113863169545, + "Y": 432.75947496989801, + "IsEmpty": false + }, + "Timestamp": 637316492594343930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 1385.583946431356, + "Y": 432.12343174767477, + "IsEmpty": false + }, + "Timestamp": 637316492594514230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 1394.0227912865851, + "Y": 431.40908071095032, + "IsEmpty": false + }, + "Timestamp": 637316492594678170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 1399.228584568898, + "Y": 430.98061649592864, + "IsEmpty": false + }, + "Timestamp": 637316492594850520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 1404.7067642550867, + "Y": 430.56772290566028, + "IsEmpty": false + }, + "Timestamp": 637316492595018310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 1409.6970596280644, + "Y": 430.20203667386437, + "IsEmpty": false + }, + "Timestamp": 637316492595190400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 1416.0452579450584, + "Y": 429.76509616125179, + "IsEmpty": false + }, + "Timestamp": 637316492595359710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714106977, + "Position": { + "X": 1420.1365967677445, + "Y": 429.50329058959397, + "IsEmpty": false + }, + "Timestamp": 637316492595517530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714106977, + "Position": { + "X": 1423.7421424777704, + "Y": 429.27688004454495, + "IsEmpty": false + }, + "Timestamp": 637316492595689850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716060102, + "Position": { + "X": 1428.0221440825489, + "Y": 429.02259023683808, + "IsEmpty": false + }, + "Timestamp": 637316492595866470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716060102, + "Position": { + "X": 1432.97272203077, + "Y": 428.74756982226211, + "IsEmpty": false + }, + "Timestamp": 637316492596039400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716060102, + "Position": { + "X": 1437.2356590367719, + "Y": 428.52618808337286, + "IsEmpty": false + }, + "Timestamp": 637316492596194410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718013287, + "Position": { + "X": 1440.1384907035751, + "Y": 428.38302249272272, + "IsEmpty": false + }, + "Timestamp": 637316492596361540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 1443.0368593278815, + "Y": 428.24750015944954, + "IsEmpty": false + }, + "Timestamp": 637316492596537720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 1446.6043269400802, + "Y": 428.09164253909165, + "IsEmpty": false + }, + "Timestamp": 637316492596707810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 1449.2969536219455, + "Y": 427.98322109680174, + "IsEmpty": false + }, + "Timestamp": 637316492596877750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 1451.9857396062525, + "Y": 427.88096410797317, + "IsEmpty": false + }, + "Timestamp": 637316492597038190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 1456.8751866371517, + "Y": 427.70932995514568, + "IsEmpty": false + }, + "Timestamp": 637316492597209970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 1461.2743085309714, + "Y": 427.57301159436639, + "IsEmpty": false + }, + "Timestamp": 637316492597378680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 1464.8018007679345, + "Y": 427.47789425994188, + "IsEmpty": false + }, + "Timestamp": 637316492597552950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725825906, + "Position": { + "X": 1466.990467502035, + "Y": 427.42517338377081, + "IsEmpty": false + }, + "Timestamp": 637316492597715060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725825906, + "Position": { + "X": 1469.6491560890415, + "Y": 427.36684635223685, + "IsEmpty": false + }, + "Timestamp": 637316492597892060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 1472.4926452233706, + "Y": 427.31294380732305, + "IsEmpty": false + }, + "Timestamp": 637316492598065180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 1474.6682751426208, + "Y": 427.27781594589561, + "IsEmpty": false + }, + "Timestamp": 637316492598236070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 1477.3119387648717, + "Y": 427.23950288345515, + "IsEmpty": false + }, + "Timestamp": 637316492598389880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73168534, + "Position": { + "X": 1480.9836520021327, + "Y": 427.20295216397989, + "IsEmpty": false + }, + "Timestamp": 637316492598565430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73168534, + "Position": { + "X": 1484.4567596632808, + "Y": 427.17979278879056, + "IsEmpty": false + }, + "Timestamp": 637316492598732960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73168534, + "Position": { + "X": 1486.6096485497837, + "Y": 427.17355458160904, + "IsEmpty": false + }, + "Timestamp": 637316492598896660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73168534, + "Position": { + "X": 1488.5733334508745, + "Y": 427.16871998097872, + "IsEmpty": false + }, + "Timestamp": 637316492599069190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.735835791, + "Position": { + "X": 1490.2491652622696, + "Y": 427.17695963115, + "IsEmpty": false + }, + "Timestamp": 637316492599238540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738277256, + "Position": { + "X": 1492.2062339878585, + "Y": 427.18007909546031, + "IsEmpty": false + }, + "Timestamp": 637316492599410340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738277256, + "Position": { + "X": 1493.0410850846529, + "Y": 427.18787541938997, + "IsEmpty": false + }, + "Timestamp": 637316492599574290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738277256, + "Position": { + "X": 1493.5090641345814, + "Y": 427.18438274684308, + "IsEmpty": false + }, + "Timestamp": 637316492599744100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738277256, + "Position": { + "X": 1494.3427784038254, + "Y": 427.19352425173145, + "IsEmpty": false + }, + "Timestamp": 637316492599918720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738277256, + "Position": { + "X": 1495.6429350203814, + "Y": 427.20096586981163, + "IsEmpty": false + }, + "Timestamp": 637316492600081210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.302479595, + "Position": { + "X": 1496.2924318416437, + "Y": 427.20536119347975, + "IsEmpty": false + }, + "Timestamp": 637316492600250400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.302479595, + "Position": { + "X": 1496.94153821901, + "Y": 427.21020737755373, + "IsEmpty": false + }, + "Timestamp": 637316492600424560, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "ed40b821-159c-4741-a450-8660259aaabb", + "Points": [ + { + "Pressure": 0.0698100254, + "Position": { + "X": 1487.7805885308321, + "Y": 632.57353600604256, + "IsEmpty": false + }, + "Timestamp": 637316492866682130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.181628138, + "Position": { + "X": 1487.4788130603724, + "Y": 632.57129474617136, + "IsEmpty": false + }, + "Timestamp": 637316492867074990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.214587629, + "Position": { + "X": 1487.1090495659457, + "Y": 632.57810234210433, + "IsEmpty": false + }, + "Timestamp": 637316492867247840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.236072332, + "Position": { + "X": 1486.8073830049179, + "Y": 632.57547673910915, + "IsEmpty": false + }, + "Timestamp": 637316492867407590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.294422835, + "Position": { + "X": 1486.4372626024865, + "Y": 632.58184378986402, + "IsEmpty": false + }, + "Timestamp": 637316492867919820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.3085832, + "Position": { + "X": 1485.7652294908692, + "Y": 632.58476200327561, + "IsEmpty": false + }, + "Timestamp": 637316492868258240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.395986885, + "Position": { + "X": 1486.4372626024865, + "Y": 632.58184378986402, + "IsEmpty": false + }, + "Timestamp": 637316492869098250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.417471588, + "Position": { + "X": 1487.4788130603724, + "Y": 632.57129474617136, + "IsEmpty": false + }, + "Timestamp": 637316492869271460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.437491417, + "Position": { + "X": 1488.4518776467303, + "Y": 632.5681431277244, + "IsEmpty": false + }, + "Timestamp": 637316492869436820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.460196853, + "Position": { + "X": 1490.1620199520619, + "Y": 632.54629267443147, + "IsEmpty": false + }, + "Timestamp": 637316492869611590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473624766, + "Position": { + "X": 1492.1717343125731, + "Y": 632.51880700491847, + "IsEmpty": false + }, + "Timestamp": 637316492869783030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.493400484, + "Position": { + "X": 1494.5448263142885, + "Y": 632.47207446799416, + "IsEmpty": false + }, + "Timestamp": 637316492869944900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.509513974, + "Position": { + "X": 1496.9128700649208, + "Y": 632.41459675449471, + "IsEmpty": false + }, + "Timestamp": 637316492870109480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 1498.6096952716134, + "Y": 632.36525815897448, + "IsEmpty": false + }, + "Timestamp": 637316492870285530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531975269, + "Position": { + "X": 1502.4201208445425, + "Y": 632.39779567672304, + "IsEmpty": false + }, + "Timestamp": 637316492870456100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547112226, + "Position": { + "X": 1506.7923987631125, + "Y": 632.49716110196005, + "IsEmpty": false + }, + "Timestamp": 637316492870626470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.555901408, + "Position": { + "X": 1509.1678159096232, + "Y": 632.53796536172786, + "IsEmpty": false + }, + "Timestamp": 637316492870787960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567620337, + "Position": { + "X": 1511.8500063667709, + "Y": 632.56628699718897, + "IsEmpty": false + }, + "Timestamp": 637316492870962710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 1514.9070479184911, + "Y": 632.58685863629364, + "IsEmpty": false + }, + "Timestamp": 637316492871132840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58129245, + "Position": { + "X": 1518.644956908483, + "Y": 632.58794991193281, + "IsEmpty": false + }, + "Timestamp": 637316492871304600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 1521.7171453874553, + "Y": 632.57089723871263, + "IsEmpty": false + }, + "Timestamp": 637316492871464860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593011379, + "Position": { + "X": 1525.0957984410986, + "Y": 632.52846794040966, + "IsEmpty": false + }, + "Timestamp": 637316492871638380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597161829, + "Position": { + "X": 1529.2365926129307, + "Y": 632.45785247900074, + "IsEmpty": false + }, + "Timestamp": 637316492871808700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.601068139, + "Position": { + "X": 1533.0093024854887, + "Y": 632.3648518730671, + "IsEmpty": false + }, + "Timestamp": 637316492871970190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606195152, + "Position": { + "X": 1535.7278093021844, + "Y": 632.28030143079286, + "IsEmpty": false + }, + "Timestamp": 637316492872137950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611810505, + "Position": { + "X": 1538.4492475682212, + "Y": 632.1834425563959, + "IsEmpty": false + }, + "Timestamp": 637316492872308650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.616205096, + "Position": { + "X": 1541.5578540269516, + "Y": 632.06222323081579, + "IsEmpty": false + }, + "Timestamp": 637316492872475710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620355546, + "Position": { + "X": 1545.3544530007805, + "Y": 631.89234515470457, + "IsEmpty": false + }, + "Timestamp": 637316492872652550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624750137, + "Position": { + "X": 1546.7203407694733, + "Y": 631.82418381332172, + "IsEmpty": false + }, + "Timestamp": 637316492872814610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.63378346, + "Position": { + "X": 1547.4035143159915, + "Y": 631.78898821734003, + "IsEmpty": false + }, + "Timestamp": 637316492872992460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 1548.4743034476328, + "Y": 631.73652493231566, + "IsEmpty": false + }, + "Timestamp": 637316492873152200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645014107, + "Position": { + "X": 1551.2101559041992, + "Y": 631.58383793194639, + "IsEmpty": false + }, + "Timestamp": 637316492873327090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645014107, + "Position": { + "X": 1552.9682793608577, + "Y": 631.48384412206633, + "IsEmpty": false + }, + "Timestamp": 637316492873490920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646967292, + "Position": { + "X": 1555.0232416438362, + "Y": 631.35611584104458, + "IsEmpty": false + }, + "Timestamp": 637316492873660180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646967292, + "Position": { + "X": 1557.079366445065, + "Y": 631.22188233098086, + "IsEmpty": false + }, + "Timestamp": 637316492873838200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648920417, + "Position": { + "X": 1560.2147545243838, + "Y": 631.00941328182205, + "IsEmpty": false + }, + "Timestamp": 637316492874006330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650873601, + "Position": { + "X": 1562.2741343930193, + "Y": 630.85904817569349, + "IsEmpty": false + }, + "Timestamp": 637316492874167070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650873601, + "Position": { + "X": 1565.4155956137529, + "Y": 630.62225820654157, + "IsEmpty": false + }, + "Timestamp": 637316492874342440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650873601, + "Position": { + "X": 1569.5410405938953, + "Y": 630.28359260685249, + "IsEmpty": false + }, + "Timestamp": 637316492874504440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650873601, + "Position": { + "X": 1574.0667400818315, + "Y": 629.88898968924025, + "IsEmpty": false + }, + "Timestamp": 637316492874681400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652826726, + "Position": { + "X": 1577.5105158900294, + "Y": 629.56568487878621, + "IsEmpty": false + }, + "Timestamp": 637316492874846360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.654779911, + "Position": { + "X": 1581.3553126860695, + "Y": 629.1905956762705, + "IsEmpty": false + }, + "Timestamp": 637316492875015430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656733036, + "Position": { + "X": 1586.1827107029121, + "Y": 628.68443344282491, + "IsEmpty": false + }, + "Timestamp": 637316492875186380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661127627, + "Position": { + "X": 1590.0340153019963, + "Y": 628.26388468352638, + "IsEmpty": false + }, + "Timestamp": 637316492875355740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669672668, + "Position": { + "X": 1592.7949488777622, + "Y": 627.94619274818115, + "IsEmpty": false + }, + "Timestamp": 637316492875519680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 1594.1755762292491, + "Y": 627.78354541133695, + "IsEmpty": false + }, + "Timestamp": 637316492875689570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1596.246676326647, + "Y": 627.53485990857735, + "IsEmpty": false + }, + "Timestamp": 637316492875857350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689936697, + "Position": { + "X": 1598.721967369444, + "Y": 627.23671483672069, + "IsEmpty": false + }, + "Timestamp": 637316492876032900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691889822, + "Position": { + "X": 1600.7937890521735, + "Y": 626.97586318022127, + "IsEmpty": false + }, + "Timestamp": 637316492876199050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693843007, + "Position": { + "X": 1602.175025033356, + "Y": 626.79889233103313, + "IsEmpty": false + }, + "Timestamp": 637316492876368810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697749317, + "Position": { + "X": 1605.6280823865416, + "Y": 626.34581758173522, + "IsEmpty": false + }, + "Timestamp": 637316492876532130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699946582, + "Position": { + "X": 1607.009253429193, + "Y": 626.16036336452498, + "IsEmpty": false + }, + "Timestamp": 637316492876707560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702143908, + "Position": { + "X": 1609.0809081271289, + "Y": 625.87769733311188, + "IsEmpty": false + }, + "Timestamp": 637316492876873070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 1610.8686374763136, + "Y": 625.63670564482527, + "IsEmpty": false + }, + "Timestamp": 637316492877039650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 1612.9403851300456, + "Y": 625.3442326214639, + "IsEmpty": false + }, + "Timestamp": 637316492877215680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713618696, + "Position": { + "X": 1615.0118695096689, + "Y": 625.04649988391202, + "IsEmpty": false + }, + "Timestamp": 637316492877377330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 1615.7022971622494, + "Y": 624.9460945311389, + "IsEmpty": false + }, + "Timestamp": 637316492877550330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723628581, + "Position": { + "X": 1616.3926881604916, + "Y": 624.84511138149514, + "IsEmpty": false + }, + "Timestamp": 637316492877719070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730220497, + "Position": { + "X": 1617.0830406539797, + "Y": 624.74355208893496, + "IsEmpty": false + }, + "Timestamp": 637316492878059130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732173622, + "Position": { + "X": 1616.3926881604916, + "Y": 624.84511138149514, + "IsEmpty": false + }, + "Timestamp": 637316492878568420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732173622, + "Position": { + "X": 1615.0118695096689, + "Y": 625.04649988391202, + "IsEmpty": false + }, + "Timestamp": 637316492878897110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.299305707, + "Position": { + "X": 1612.9403851300456, + "Y": 625.3442326214639, + "IsEmpty": false + }, + "Timestamp": 637316492879042680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.299305707, + "Position": { + "X": 1613.6309116431521, + "Y": 625.24557058302867, + "IsEmpty": false + }, + "Timestamp": 637316492879063780, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c48450a9-403f-48ca-a3a2-e5200857dc2a", + "Points": [ + { + "Pressure": 0.134264126, + "Position": { + "X": 1492.8288867471558, + "Y": 428.84851801419836, + "IsEmpty": false + }, + "Timestamp": 637316492898239290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.167467758, + "Position": { + "X": 1492.994481402432, + "Y": 428.85382030215709, + "IsEmpty": false + }, + "Timestamp": 637316492898669900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.23753719, + "Position": { + "X": 1493.4826954172127, + "Y": 428.8501766098023, + "IsEmpty": false + }, + "Timestamp": 637316492898846270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.260975063, + "Position": { + "X": 1493.6481204134639, + "Y": 428.85568307651823, + "IsEmpty": false + }, + "Timestamp": 637316492899176290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.377920181, + "Position": { + "X": 1492.3404721667341, + "Y": 428.85239171680985, + "IsEmpty": false + }, + "Timestamp": 637316492900022720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.388906687, + "Position": { + "X": 1489.3877431261537, + "Y": 428.84262919796771, + "IsEmpty": false + }, + "Timestamp": 637316492900197430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.390859842, + "Position": { + "X": 1488.5646555852968, + "Y": 428.84007882033569, + "IsEmpty": false + }, + "Timestamp": 637316492900358630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.396719307, + "Position": { + "X": 1487.418196520186, + "Y": 428.8473108316233, + "IsEmpty": false + }, + "Timestamp": 637316492900536680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.434073389, + "Position": { + "X": 1487.2509422300927, + "Y": 428.8440287225734, + "IsEmpty": false + }, + "Timestamp": 637316492900695980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.458731979, + "Position": { + "X": 1488.0750670964446, + "Y": 428.84532265521045, + "IsEmpty": false + }, + "Timestamp": 637316492901212290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.476310372, + "Position": { + "X": 1490.2099772992815, + "Y": 428.84621293599781, + "IsEmpty": false + }, + "Timestamp": 637316492901373240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498771638, + "Position": { + "X": 1493.4826954172127, + "Y": 428.8501766098023, + "IsEmpty": false + }, + "Timestamp": 637316492901549950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.508537412, + "Position": { + "X": 1495.7715349797018, + "Y": 428.87021230135105, + "IsEmpty": false + }, + "Timestamp": 637316492901720910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.518547356, + "Position": { + "X": 1498.3770963523878, + "Y": 428.8881065494856, + "IsEmpty": false + }, + "Timestamp": 637316492901887870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 1501.1363447043923, + "Y": 428.88631996080306, + "IsEmpty": false + }, + "Timestamp": 637316492902057100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546379805, + "Position": { + "X": 1505.8638675414643, + "Y": 428.85226986724297, + "IsEmpty": false + }, + "Timestamp": 637316492902222130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.556389689, + "Position": { + "X": 1509.9564555723646, + "Y": 428.841925648553, + "IsEmpty": false + }, + "Timestamp": 637316492902388780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566155493, + "Position": { + "X": 1513.4064428870613, + "Y": 428.84664323359539, + "IsEmpty": false + }, + "Timestamp": 637316492902557530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570794225, + "Position": { + "X": 1517.0354795043108, + "Y": 428.86249114535462, + "IsEmpty": false + }, + "Timestamp": 637316492902724440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576653719, + "Position": { + "X": 1522.4928097011043, + "Y": 428.91861666627591, + "IsEmpty": false + }, + "Timestamp": 637316492902899650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 1525.9795103799433, + "Y": 428.96928996688405, + "IsEmpty": false + }, + "Timestamp": 637316492903067240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 1529.6473927972124, + "Y": 429.03480660969677, + "IsEmpty": false + }, + "Timestamp": 637316492903232000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 1533.1533188054773, + "Y": 429.1110597647442, + "IsEmpty": false + }, + "Timestamp": 637316492903399440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 1538.6763362611755, + "Y": 429.25468097692931, + "IsEmpty": false + }, + "Timestamp": 637316492903576840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 1542.0290389126408, + "Y": 429.35477012222407, + "IsEmpty": false + }, + "Timestamp": 637316492903739100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 1545.0663638808294, + "Y": 429.45623654227194, + "IsEmpty": false + }, + "Timestamp": 637316492903914630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593011379, + "Position": { + "X": 1548.6078168743575, + "Y": 429.58378270261625, + "IsEmpty": false + }, + "Timestamp": 637316492904079650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594964504, + "Position": { + "X": 1552.6548852576434, + "Y": 429.74031052772557, + "IsEmpty": false + }, + "Timestamp": 637316492904248650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594964504, + "Position": { + "X": 1555.0360510533499, + "Y": 429.8439921013599, + "IsEmpty": false + }, + "Timestamp": 637316492904415920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596917689, + "Position": { + "X": 1558.4192244622504, + "Y": 429.9919215696363, + "IsEmpty": false + }, + "Timestamp": 637316492904589610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596917689, + "Position": { + "X": 1561.9861385439726, + "Y": 430.16110497793596, + "IsEmpty": false + }, + "Timestamp": 637316492904760240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.598870814, + "Position": { + "X": 1567.7775666640703, + "Y": 430.4598098199387, + "IsEmpty": false + }, + "Timestamp": 637316492904930190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600823998, + "Position": { + "X": 1571.8606593238367, + "Y": 430.68007861679303, + "IsEmpty": false + }, + "Timestamp": 637316492905096680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600823998, + "Position": { + "X": 1575.4485489051608, + "Y": 430.88890489067836, + "IsEmpty": false + }, + "Timestamp": 637316492905259210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1577.6760897703966, + "Y": 431.02571106306078, + "IsEmpty": false + }, + "Timestamp": 637316492905429390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1581.7735123432085, + "Y": 431.27671387498276, + "IsEmpty": false + }, + "Timestamp": 637316492905600140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1584.6898868665221, + "Y": 431.46879234207512, + "IsEmpty": false + }, + "Timestamp": 637316492905767910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1587.6090234310584, + "Y": 431.66752675448993, + "IsEmpty": false + }, + "Timestamp": 637316492905937350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1591.0329715551006, + "Y": 431.90053296550582, + "IsEmpty": false + }, + "Timestamp": 637316492906103810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1595.3285371411964, + "Y": 432.21134552127353, + "IsEmpty": false + }, + "Timestamp": 637316492906276130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1598.2558943471015, + "Y": 432.43307009021504, + "IsEmpty": false + }, + "Timestamp": 637316492906447380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1601.0012563707619, + "Y": 432.63906784956913, + "IsEmpty": false + }, + "Timestamp": 637316492906610510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1603.2452443125896, + "Y": 432.81926297271582, + "IsEmpty": false + }, + "Timestamp": 637316492906785680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1607.367143844885, + "Y": 433.14385240491339, + "IsEmpty": false + }, + "Timestamp": 637316492906956090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1610.1162638469611, + "Y": 433.36627777340954, + "IsEmpty": false + }, + "Timestamp": 637316492907127560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1612.3635700199086, + "Y": 433.56060299649971, + "IsEmpty": false + }, + "Timestamp": 637316492907287920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1615.1141949165174, + "Y": 433.79186203219467, + "IsEmpty": false + }, + "Timestamp": 637316492907462250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1617.1775326564866, + "Y": 433.96836618167612, + "IsEmpty": false + }, + "Timestamp": 637316492907632370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1618.7386570005519, + "Y": 434.11319091108993, + "IsEmpty": false + }, + "Timestamp": 637316492907798930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1620.3000983788086, + "Y": 434.25981677729078, + "IsEmpty": false + }, + "Timestamp": 637316492907963090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1621.6761481567737, + "Y": 434.38173747013423, + "IsEmpty": false + }, + "Timestamp": 637316492908131930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1622.8665357419732, + "Y": 434.47816770139053, + "IsEmpty": false + }, + "Timestamp": 637316492908299540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1623.554565965532, + "Y": 434.53998645914407, + "IsEmpty": false + }, + "Timestamp": 637316492908478480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1623.740325855749, + "Y": 434.56673547569949, + "IsEmpty": false + }, + "Timestamp": 637316492908649850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1624.2426050626527, + "Y": 434.60208556340228, + "IsEmpty": false + }, + "Timestamp": 637316492908808870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514641047, + "Position": { + "X": 1623.0522556531328, + "Y": 434.50478836594766, + "IsEmpty": false + }, + "Timestamp": 637316492909008380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514641047, + "Position": { + "X": 1623.554565965532, + "Y": 434.53998645914407, + "IsEmpty": false + }, + "Timestamp": 637316492909036280, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "56ab0a6c-aa0f-4c21-8588-0511f4fa034f", + "Points": [ + { + "Pressure": 0.030502785, + "Position": { + "X": 1596.0224029202814, + "Y": 441.40332657790287, + "IsEmpty": false + }, + "Timestamp": 637316492941162790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.111802854, + "Position": { + "X": 1596.0224029202814, + "Y": 440.04798698042072, + "IsEmpty": false + }, + "Timestamp": 637316492941422640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.193835348, + "Position": { + "X": 1596.0224029202814, + "Y": 438.16229909519029, + "IsEmpty": false + }, + "Timestamp": 637316492941600530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.250232697, + "Position": { + "X": 1596.0224029202814, + "Y": 436.04090594419699, + "IsEmpty": false + }, + "Timestamp": 637316492941766280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.32884717, + "Position": { + "X": 1596.0224029202814, + "Y": 432.50528119862651, + "IsEmpty": false + }, + "Timestamp": 637316492941929790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.368642718, + "Position": { + "X": 1596.0224029202814, + "Y": 429.91247751610746, + "IsEmpty": false + }, + "Timestamp": 637316492942102710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.397451729, + "Position": { + "X": 1596.0224029202814, + "Y": 427.61427109644637, + "IsEmpty": false + }, + "Timestamp": 637316492942273790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.420401305, + "Position": { + "X": 1596.0224029202814, + "Y": 425.72858321121589, + "IsEmpty": false + }, + "Timestamp": 637316492942438120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.457511246, + "Position": { + "X": 1596.0224029202814, + "Y": 425.37504819213535, + "IsEmpty": false + }, + "Timestamp": 637316492942603340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480460823, + "Position": { + "X": 1596.0224029202814, + "Y": 425.02146741392733, + "IsEmpty": false + }, + "Timestamp": 637316492942773000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596917689, + "Position": { + "X": 1596.0224029202814, + "Y": 426.67145003339488, + "IsEmpty": false + }, + "Timestamp": 637316492943795290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620599687, + "Position": { + "X": 1596.0224029202814, + "Y": 430.32495029141057, + "IsEmpty": false + }, + "Timestamp": 637316492943965460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632806897, + "Position": { + "X": 1596.0224029202814, + "Y": 433.62491553034573, + "IsEmpty": false + }, + "Timestamp": 637316492944130730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644525826, + "Position": { + "X": 1596.0224029202814, + "Y": 437.92659382942742, + "IsEmpty": false + }, + "Timestamp": 637316492944292390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 1596.0224029202814, + "Y": 443.34795221935588, + "IsEmpty": false + }, + "Timestamp": 637316492944461000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667719543, + "Position": { + "X": 1596.0224029202814, + "Y": 452.54064062061769, + "IsEmpty": false + }, + "Timestamp": 637316492944639160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676997006, + "Position": { + "X": 1596.0224029202814, + "Y": 458.25659627340411, + "IsEmpty": false + }, + "Timestamp": 637316492944799860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6828565, + "Position": { + "X": 1596.0224029202814, + "Y": 464.73865123882922, + "IsEmpty": false + }, + "Timestamp": 637316492944975800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690669119, + "Position": { + "X": 1596.0224029202814, + "Y": 471.92782200154295, + "IsEmpty": false + }, + "Timestamp": 637316492945145680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 1596.0224029202814, + "Y": 481.88656395631597, + "IsEmpty": false + }, + "Timestamp": 637316492945314580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705561936, + "Position": { + "X": 1596.0224029202814, + "Y": 489.60608300677802, + "IsEmpty": false + }, + "Timestamp": 637316492945479170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.707759202, + "Position": { + "X": 1596.0224029202814, + "Y": 497.79701258876577, + "IsEmpty": false + }, + "Timestamp": 637316492945651130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709956527, + "Position": { + "X": 1596.0224029202814, + "Y": 504.39689730750854, + "IsEmpty": false + }, + "Timestamp": 637316492945816350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 1596.0224029202814, + "Y": 514.8270497938073, + "IsEmpty": false + }, + "Timestamp": 637316492945984110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718501568, + "Position": { + "X": 1596.0224029202814, + "Y": 521.48582650964522, + "IsEmpty": false + }, + "Timestamp": 637316492946153110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720454693, + "Position": { + "X": 1596.0224029202814, + "Y": 526.90718489957362, + "IsEmpty": false + }, + "Timestamp": 637316492946326080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720454693, + "Position": { + "X": 1596.0224029202814, + "Y": 531.03209568911507, + "IsEmpty": false + }, + "Timestamp": 637316492946493820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724361002, + "Position": { + "X": 1596.0224029202814, + "Y": 537.86768567362071, + "IsEmpty": false + }, + "Timestamp": 637316492946665550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724361002, + "Position": { + "X": 1596.0224029202814, + "Y": 542.87657128824605, + "IsEmpty": false + }, + "Timestamp": 637316492946827490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726314187, + "Position": { + "X": 1596.0224029202814, + "Y": 547.64970587798098, + "IsEmpty": false + }, + "Timestamp": 637316492947004620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726314187, + "Position": { + "X": 1596.0224029202814, + "Y": 552.30496495527075, + "IsEmpty": false + }, + "Timestamp": 637316492947168010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728267312, + "Position": { + "X": 1596.0224029202814, + "Y": 559.67090322752472, + "IsEmpty": false + }, + "Timestamp": 637316492947409950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728267312, + "Position": { + "X": 1596.0224029202814, + "Y": 565.09226161745323, + "IsEmpty": false + }, + "Timestamp": 637316492947558060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730220497, + "Position": { + "X": 1596.0224029202814, + "Y": 570.04220947585588, + "IsEmpty": false + }, + "Timestamp": 637316492947676770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732417762, + "Position": { + "X": 1596.0224029202814, + "Y": 575.40453859130673, + "IsEmpty": false + }, + "Timestamp": 637316492947840910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 1596.0224029202814, + "Y": 580.11873542481908, + "IsEmpty": false + }, + "Timestamp": 637316492948017080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 1596.0224029202814, + "Y": 584.2437377326155, + "IsEmpty": false + }, + "Timestamp": 637316492948183450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736568272, + "Position": { + "X": 1596.0224029202814, + "Y": 588.42758627837952, + "IsEmpty": false + }, + "Timestamp": 637316492948356570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 1596.0224029202814, + "Y": 592.43462155547581, + "IsEmpty": false + }, + "Timestamp": 637316492948526450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 1596.0224029202814, + "Y": 596.85422112613026, + "IsEmpty": false + }, + "Timestamp": 637316492948696160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 1596.0224029202814, + "Y": 599.15233602753631, + "IsEmpty": false + }, + "Timestamp": 637316492948860860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 1596.0224029202814, + "Y": 601.27372917852961, + "IsEmpty": false + }, + "Timestamp": 637316492949033280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742427707, + "Position": { + "X": 1596.0224029202814, + "Y": 603.6898111106359, + "IsEmpty": false + }, + "Timestamp": 637316492949202780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 1596.0224029202814, + "Y": 607.52012463731933, + "IsEmpty": false + }, + "Timestamp": 637316492949370450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 1596.0224029202814, + "Y": 610.23071231402855, + "IsEmpty": false + }, + "Timestamp": 637316492949533640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 1596.0224029202814, + "Y": 612.64679424613485, + "IsEmpty": false + }, + "Timestamp": 637316492949699960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 1596.0224029202814, + "Y": 614.9449091475409, + "IsEmpty": false + }, + "Timestamp": 637316492949869930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 1596.0224029202814, + "Y": 617.89133936739552, + "IsEmpty": false + }, + "Timestamp": 637316492950041490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 1596.0224029202814, + "Y": 619.06991145533732, + "IsEmpty": false + }, + "Timestamp": 637316492950206570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 1596.0224029202814, + "Y": 620.42520529369199, + "IsEmpty": false + }, + "Timestamp": 637316492950377820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750240326, + "Position": { + "X": 1596.0224029202814, + "Y": 622.36978517601744, + "IsEmpty": false + }, + "Timestamp": 637316492950554340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750240326, + "Position": { + "X": 1596.0224029202814, + "Y": 624.13764330793026, + "IsEmpty": false + }, + "Timestamp": 637316492950717800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750240326, + "Position": { + "X": 1596.0224029202814, + "Y": 624.96268037679147, + "IsEmpty": false + }, + "Timestamp": 637316492950891560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752193511, + "Position": { + "X": 1596.0224029202814, + "Y": 625.31621539587206, + "IsEmpty": false + }, + "Timestamp": 637316492951232160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754146636, + "Position": { + "X": 1596.0224029202814, + "Y": 625.02152661475907, + "IsEmpty": false + }, + "Timestamp": 637316492951417310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 1596.0224029202814, + "Y": 624.60905383945601, + "IsEmpty": false + }, + "Timestamp": 637316492951559740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76025027, + "Position": { + "X": 1596.0224029202814, + "Y": 624.19658106415284, + "IsEmpty": false + }, + "Timestamp": 637316492951730520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76025027, + "Position": { + "X": 1596.0224029202814, + "Y": 623.60729502018194, + "IsEmpty": false + }, + "Timestamp": 637316492952410950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76025027, + "Position": { + "X": 1596.0224029202814, + "Y": 622.01625015693696, + "IsEmpty": false + }, + "Timestamp": 637316492952577400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728999794, + "Position": { + "X": 1596.0224029202814, + "Y": 619.36450871819534, + "IsEmpty": false + }, + "Timestamp": 637316492952751980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661371768, + "Position": { + "X": 1596.0224029202814, + "Y": 616.47710777281827, + "IsEmpty": false + }, + "Timestamp": 637316492952915400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.586175323, + "Position": { + "X": 1596.0224029202814, + "Y": 613.17714253388317, + "IsEmpty": false + }, + "Timestamp": 637316492953090500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.499992371, + "Position": { + "X": 1596.0224029202814, + "Y": 610.58433885136412, + "IsEmpty": false + }, + "Timestamp": 637316492953156160, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "57c7872c-dac2-4b79-ae75-c0e26815ab1d", + "Points": [ + { + "Pressure": 0.313710243, + "Position": { + "X": 1595.5689845744246, + "Y": 624.03236253635282, + "IsEmpty": false + }, + "Timestamp": 637316493005697220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.378164351, + "Position": { + "X": 1595.4458272542895, + "Y": 623.87005214000146, + "IsEmpty": false + }, + "Timestamp": 637316493006484950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.559075296, + "Position": { + "X": 1595.162459320157, + "Y": 623.59850427306719, + "IsEmpty": false + }, + "Timestamp": 637316493006653370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.578850985, + "Position": { + "X": 1595.4458272542895, + "Y": 623.87005214000146, + "IsEmpty": false + }, + "Timestamp": 637316493007666250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612542927, + "Position": { + "X": 1595.5689845744246, + "Y": 624.03236253635282, + "IsEmpty": false + }, + "Timestamp": 637316493007830340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 1595.8529995102297, + "Y": 624.30402021788541, + "IsEmpty": false + }, + "Timestamp": 637316493008177170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643793404, + "Position": { + "X": 1596.2609492778524, + "Y": 624.73793724702546, + "IsEmpty": false + }, + "Timestamp": 637316493008682930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 1596.6696771271586, + "Y": 625.17180090908698, + "IsEmpty": false + }, + "Timestamp": 637316493008853440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649896979, + "Position": { + "X": 1597.2028626360675, + "Y": 625.76728364779296, + "IsEmpty": false + }, + "Timestamp": 637316493009194130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649896979, + "Position": { + "X": 1597.4894693508197, + "Y": 626.03935885863609, + "IsEmpty": false + }, + "Timestamp": 637316493009358370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649896979, + "Position": { + "X": 1597.6132792626211, + "Y": 626.20087434855452, + "IsEmpty": false + }, + "Timestamp": 637316493009521100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649896979, + "Position": { + "X": 1598.4364530391001, + "Y": 627.06787202921782, + "IsEmpty": false + }, + "Timestamp": 637316493009698780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657953739, + "Position": { + "X": 1600.0921786455447, + "Y": 628.80106759373462, + "IsEmpty": false + }, + "Timestamp": 637316493009861960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671137571, + "Position": { + "X": 1602.1794665288878, + "Y": 630.96587116775822, + "IsEmpty": false + }, + "Timestamp": 637316493010032480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684077203, + "Position": { + "X": 1605.2610419254408, + "Y": 634.15138224037582, + "IsEmpty": false + }, + "Timestamp": 637316493010196320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699702442, + "Position": { + "X": 1609.679217925237, + "Y": 638.62189600683405, + "IsEmpty": false + }, + "Timestamp": 637316493010362890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721675456, + "Position": { + "X": 1618.6328436109557, + "Y": 647.35950444662478, + "IsEmpty": false + }, + "Timestamp": 637316493010540880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726558328, + "Position": { + "X": 1625.7301038047933, + "Y": 654.0520041363751, + "IsEmpty": false + }, + "Timestamp": 637316493010711920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733882666, + "Position": { + "X": 1633.4952061599274, + "Y": 661.10750860129519, + "IsEmpty": false + }, + "Timestamp": 637316493010872730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 1641.6205271924816, + "Y": 668.23267855284598, + "IsEmpty": false + }, + "Timestamp": 637316493011042560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753414214, + "Position": { + "X": 1654.8224944937747, + "Y": 679.22403023003881, + "IsEmpty": false + }, + "Timestamp": 637316493011216470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1663.6901062655409, + "Y": 686.23128325513062, + "IsEmpty": false + }, + "Timestamp": 637316493011391400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1672.0229299159671, + "Y": 692.59084426041545, + "IsEmpty": false + }, + "Timestamp": 637316493011550960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758785367, + "Position": { + "X": 1680.254087197985, + "Y": 698.57642482320921, + "IsEmpty": false + }, + "Timestamp": 637316493011717420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 1693.122411720743, + "Y": 707.4669221826706, + "IsEmpty": false + }, + "Timestamp": 637316493011890880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764889002, + "Position": { + "X": 1702.0061693578227, + "Y": 713.27735497709068, + "IsEmpty": false + }, + "Timestamp": 637316493012062670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769771874, + "Position": { + "X": 1710.6625133536591, + "Y": 718.70818874854706, + "IsEmpty": false + }, + "Timestamp": 637316493012227460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769771874, + "Position": { + "X": 1719.9502310479572, + "Y": 724.24593889931157, + "IsEmpty": false + }, + "Timestamp": 637316493012396420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773922324, + "Position": { + "X": 1732.6450956049762, + "Y": 731.41936012813676, + "IsEmpty": false + }, + "Timestamp": 637316493012566630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773922324, + "Position": { + "X": 1736.7860833822581, + "Y": 733.64289529947132, + "IsEmpty": false + }, + "Timestamp": 637316493012736830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.775875509, + "Position": { + "X": 1747.0161610924686, + "Y": 738.95108203167752, + "IsEmpty": false + }, + "Timestamp": 637316493012898570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.777828634, + "Position": { + "X": 1754.4657925313179, + "Y": 742.629949169464, + "IsEmpty": false + }, + "Timestamp": 637316493013074520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.779781818, + "Position": { + "X": 1766.4488541105425, + "Y": 748.22144816564753, + "IsEmpty": false + }, + "Timestamp": 637316493013242590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781734943, + "Position": { + "X": 1773.5220574342491, + "Y": 751.35270960829337, + "IsEmpty": false + }, + "Timestamp": 637316493013409510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781734943, + "Position": { + "X": 1781.2022998834827, + "Y": 754.59636288877653, + "IsEmpty": false + }, + "Timestamp": 637316493013575980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.783688128, + "Position": { + "X": 1791.0036636599459, + "Y": 758.53731529676315, + "IsEmpty": false + }, + "Timestamp": 637316493013754840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785885394, + "Position": { + "X": 1801.3170227148719, + "Y": 762.41904328085479, + "IsEmpty": false + }, + "Timestamp": 637316493013918320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790279984, + "Position": { + "X": 1807.0154477959732, + "Y": 764.45905073431607, + "IsEmpty": false + }, + "Timestamp": 637316493014088300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794918716, + "Position": { + "X": 1810.3565333550441, + "Y": 765.62186328571852, + "IsEmpty": false + }, + "Timestamp": 637316493014258780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.792965591, + "Position": { + "X": 1811.2966905135263, + "Y": 765.94663092311873, + "IsEmpty": false + }, + "Timestamp": 637316493014425650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781490803, + "Position": { + "X": 1809.6207432324466, + "Y": 765.37017980090081, + "IsEmpty": false + }, + "Timestamp": 637316493014757900, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e2fcd137-82a3-4f35-b89e-db2b174f9e95", + "Points": [ + { + "Pressure": 0.112779431, + "Position": { + "X": 1590.7622342317088, + "Y": 429.92716342971499, + "IsEmpty": false + }, + "Timestamp": 637316493044828470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.470939189, + "Position": { + "X": 1590.4446933373956, + "Y": 430.16872252454044, + "IsEmpty": false + }, + "Timestamp": 637316493045150610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.489494175, + "Position": { + "X": 1590.7622342317088, + "Y": 429.92716342971499, + "IsEmpty": false + }, + "Timestamp": 637316493046192800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.545403242, + "Position": { + "X": 1590.866328121419, + "Y": 429.87129046875452, + "IsEmpty": false + }, + "Timestamp": 637316493046582490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605706871, + "Position": { + "X": 1592.5619336621346, + "Y": 428.67879118596187, + "IsEmpty": false + }, + "Timestamp": 637316493046932170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623041093, + "Position": { + "X": 1593.4151696012018, + "Y": 428.08091383453933, + "IsEmpty": false + }, + "Timestamp": 637316493047057860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644037545, + "Position": { + "X": 1595.1324887480025, + "Y": 426.88200349953536, + "IsEmpty": false + }, + "Timestamp": 637316493047365180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 1599.9294685077368, + "Y": 423.56447137820101, + "IsEmpty": false + }, + "Timestamp": 637316493047739640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681635737, + "Position": { + "X": 1602.5917958536124, + "Y": 421.74310854074844, + "IsEmpty": false + }, + "Timestamp": 637316493047876640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712642074, + "Position": { + "X": 1609.8484430236031, + "Y": 416.85024961528711, + "IsEmpty": false + }, + "Timestamp": 637316493048219050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 1616.0268447556548, + "Y": 412.78372825055834, + "IsEmpty": false + }, + "Timestamp": 637316493048506040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741695285, + "Position": { + "X": 1621.1583803489716, + "Y": 409.43143667533201, + "IsEmpty": false + }, + "Timestamp": 637316493048654370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 1643.8433660315118, + "Y": 395.31487741740546, + "IsEmpty": false + }, + "Timestamp": 637316493049060510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770748436, + "Position": { + "X": 1657.1306134230713, + "Y": 387.4904712784753, + "IsEmpty": false + }, + "Timestamp": 637316493049406910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.772701621, + "Position": { + "X": 1666.5994902271452, + "Y": 382.13155096001981, + "IsEmpty": false + }, + "Timestamp": 637316493049569280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774654746, + "Position": { + "X": 1673.7689608879944, + "Y": 378.15630253482709, + "IsEmpty": false + }, + "Timestamp": 637316493049866050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.778805196, + "Position": { + "X": 1680.6334956276739, + "Y": 374.4535114280643, + "IsEmpty": false + }, + "Timestamp": 637316493050011280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.79247731, + "Position": { + "X": 1700.1184974144944, + "Y": 364.40811878393919, + "IsEmpty": false + }, + "Timestamp": 637316493050371160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795162916, + "Position": { + "X": 1708.0363004056237, + "Y": 360.52054685307775, + "IsEmpty": false + }, + "Timestamp": 637316493050511930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 1730.0222164923016, + "Y": 350.30641060734285, + "IsEmpty": false + }, + "Timestamp": 637316493050933750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.798580885, + "Position": { + "X": 1742.3603840506473, + "Y": 344.94432200069934, + "IsEmpty": false + }, + "Timestamp": 637316493051227370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801510632, + "Position": { + "X": 1760.3733651877762, + "Y": 337.58753777593324, + "IsEmpty": false + }, + "Timestamp": 637316493051427880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801510632, + "Position": { + "X": 1772.6908106413157, + "Y": 332.87610777534906, + "IsEmpty": false + }, + "Timestamp": 637316493051702070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803463817, + "Position": { + "X": 1780.8790882998258, + "Y": 329.87602470208776, + "IsEmpty": false + }, + "Timestamp": 637316493051873680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803463817, + "Position": { + "X": 1805.2697641602845, + "Y": 321.64898551371891, + "IsEmpty": false + }, + "Timestamp": 637316493052266560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.805416942, + "Position": { + "X": 1816.9662703981362, + "Y": 318.05090869639281, + "IsEmpty": false + }, + "Timestamp": 637316493052565690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.807370126, + "Position": { + "X": 1824.9489034161261, + "Y": 315.7171651688318, + "IsEmpty": false + }, + "Timestamp": 637316493052698160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.807370126, + "Position": { + "X": 1840.7440291406667, + "Y": 311.42615836171058, + "IsEmpty": false + }, + "Timestamp": 637316493053027570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.807370126, + "Position": { + "X": 1847.012890355506, + "Y": 309.84396127919666, + "IsEmpty": false + }, + "Timestamp": 637316493053192530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809323251, + "Position": { + "X": 1865.4115655822818, + "Y": 305.54241721129625, + "IsEmpty": false + }, + "Timestamp": 637316493053627440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809323251, + "Position": { + "X": 1873.4391114763866, + "Y": 303.84757347763451, + "IsEmpty": false + }, + "Timestamp": 637316493053949030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811276436, + "Position": { + "X": 1890.3343240154725, + "Y": 300.61365157463717, + "IsEmpty": false + }, + "Timestamp": 637316493054293810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811276436, + "Position": { + "X": 1898.4026124161421, + "Y": 299.22897716764493, + "IsEmpty": false + }, + "Timestamp": 637316493054628150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811276436, + "Position": { + "X": 1913.0947066591159, + "Y": 296.97669599113107, + "IsEmpty": false + }, + "Timestamp": 637316493054996380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811276436, + "Position": { + "X": 1918.6886018247467, + "Y": 296.20574052063324, + "IsEmpty": false + }, + "Timestamp": 637316493055256350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811276436, + "Position": { + "X": 1928.0019434338483, + "Y": 295.04555058605075, + "IsEmpty": false + }, + "Timestamp": 637316493055602260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811276436, + "Position": { + "X": 1938.9005122055962, + "Y": 293.8587636223113, + "IsEmpty": false + }, + "Timestamp": 637316493055937960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811276436, + "Position": { + "X": 1944.1481603943973, + "Y": 293.35887144179969, + "IsEmpty": false + }, + "Timestamp": 637316493056316730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813229561, + "Position": { + "X": 1947.5395228176403, + "Y": 293.05656889549971, + "IsEmpty": false + }, + "Timestamp": 637316493056671910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813229561, + "Position": { + "X": 1948.2081199683241, + "Y": 292.99538112867214, + "IsEmpty": false + }, + "Timestamp": 637316493057027100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.309559762, + "Position": { + "X": 1947.5395228176403, + "Y": 293.05656889549971, + "IsEmpty": false + }, + "Timestamp": 637316493057291820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.309559762, + "Position": { + "X": 1947.358744283853, + "Y": 293.06844065483546, + "IsEmpty": false + }, + "Timestamp": 637316493057320460, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c0bdd097-3ed5-426c-bda3-bae1c41a7417", + "Points": [ + { + "Pressure": 0.193102926, + "Position": { + "X": 1799.4057547312295, + "Y": 763.88052760377673, + "IsEmpty": false + }, + "Timestamp": 637316493113512370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.347158015, + "Position": { + "X": 1799.4057547312295, + "Y": 763.82158984755415, + "IsEmpty": false + }, + "Timestamp": 637316493114120590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.428213924, + "Position": { + "X": 1799.4057547312295, + "Y": 763.64477657888631, + "IsEmpty": false + }, + "Timestamp": 637316493114293550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.468009472, + "Position": { + "X": 1799.4057547312295, + "Y": 763.40911707225098, + "IsEmpty": false + }, + "Timestamp": 637316493114459460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 1799.4057547312295, + "Y": 762.17160722808649, + "IsEmpty": false + }, + "Timestamp": 637316493114796600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56908524, + "Position": { + "X": 1799.4057547312295, + "Y": 758.63598248251606, + "IsEmpty": false + }, + "Timestamp": 637316493114967760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595208645, + "Position": { + "X": 1799.4057547312295, + "Y": 754.98248222450036, + "IsEmpty": false + }, + "Timestamp": 637316493115132320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622796953, + "Position": { + "X": 1799.4057547312295, + "Y": 749.79678334120717, + "IsEmpty": false + }, + "Timestamp": 637316493115302720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652826726, + "Position": { + "X": 1799.4057547312295, + "Y": 740.36838967418248, + "IsEmpty": false + }, + "Timestamp": 637316493115474920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671381712, + "Position": { + "X": 1799.4057547312295, + "Y": 732.64891638284803, + "IsEmpty": false + }, + "Timestamp": 637316493115644340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1799.4057547312295, + "Y": 723.80980875979424, + "IsEmpty": false + }, + "Timestamp": 637316493115807220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697260976, + "Position": { + "X": 1799.4057547312295, + "Y": 714.14566406787912, + "IsEmpty": false + }, + "Timestamp": 637316493115978620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 1799.4057547312295, + "Y": 697.82274266012621, + "IsEmpty": false + }, + "Timestamp": 637316493116148250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722896159, + "Position": { + "X": 1799.4057547312295, + "Y": 686.27295584210822, + "IsEmpty": false + }, + "Timestamp": 637316493116316070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 1799.4057547312295, + "Y": 673.603534692371, + "IsEmpty": false + }, + "Timestamp": 637316493116482300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730708778, + "Position": { + "X": 1799.4057547312295, + "Y": 660.69836251774336, + "IsEmpty": false + }, + "Timestamp": 637316493116654710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 1799.4057547312295, + "Y": 643.78615506601943, + "IsEmpty": false + }, + "Timestamp": 637316493116832040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 1799.4057547312295, + "Y": 634.18094813032701, + "IsEmpty": false + }, + "Timestamp": 637316493116996940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742427707, + "Position": { + "X": 1799.4057547312295, + "Y": 625.16502723860538, + "IsEmpty": false + }, + "Timestamp": 637316493117158900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746822298, + "Position": { + "X": 1799.4057547312295, + "Y": 615.79557132780337, + "IsEmpty": false + }, + "Timestamp": 637316493117326650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754146636, + "Position": { + "X": 1799.4057547312295, + "Y": 601.24050805196316, + "IsEmpty": false + }, + "Timestamp": 637316493117502230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1799.4057547312295, + "Y": 592.3423711544317, + "IsEmpty": false + }, + "Timestamp": 637316493117673380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76025027, + "Position": { + "X": 1799.4057547312295, + "Y": 585.094308394623, + "IsEmpty": false + }, + "Timestamp": 637316493117836070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762447536, + "Position": { + "X": 1799.4057547312295, + "Y": 578.61225342919784, + "IsEmpty": false + }, + "Timestamp": 637316493118003290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.766842127, + "Position": { + "X": 1799.4057547312295, + "Y": 568.53568172110715, + "IsEmpty": false + }, + "Timestamp": 637316493118181590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769039452, + "Position": { + "X": 1799.4057547312295, + "Y": 561.11080569263061, + "IsEmpty": false + }, + "Timestamp": 637316493118342900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770992577, + "Position": { + "X": 1799.4057547312295, + "Y": 552.86093835442023, + "IsEmpty": false + }, + "Timestamp": 637316493118512050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770992577, + "Position": { + "X": 1799.4057547312295, + "Y": 544.25753599712925, + "IsEmpty": false + }, + "Timestamp": 637316493118686460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.772945762, + "Position": { + "X": 1799.4057547312295, + "Y": 529.82030247460682, + "IsEmpty": false + }, + "Timestamp": 637316493118851140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.772945762, + "Position": { + "X": 1799.4057547312295, + "Y": 519.74368500738854, + "IsEmpty": false + }, + "Timestamp": 637316493119026050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.772945762, + "Position": { + "X": 1799.4057547312295, + "Y": 508.72424647711887, + "IsEmpty": false + }, + "Timestamp": 637316493119186270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.777096212, + "Position": { + "X": 1799.4057547312295, + "Y": 498.58869125367806, + "IsEmpty": false + }, + "Timestamp": 637316493119363720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.779537678, + "Position": { + "X": 1799.4057547312295, + "Y": 488.98348431798564, + "IsEmpty": false + }, + "Timestamp": 637316493119533050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.779537678, + "Position": { + "X": 1799.4057547312295, + "Y": 476.49087643691615, + "IsEmpty": false + }, + "Timestamp": 637316493119694460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.779537678, + "Position": { + "X": 1799.4057547312295, + "Y": 469.77311620572817, + "IsEmpty": false + }, + "Timestamp": 637316493119863010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781490803, + "Position": { + "X": 1799.4057547312295, + "Y": 462.70182095545965, + "IsEmpty": false + }, + "Timestamp": 637316493120032490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.783443987, + "Position": { + "X": 1799.4057547312295, + "Y": 453.09661401976717, + "IsEmpty": false + }, + "Timestamp": 637316493120208710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785397112, + "Position": { + "X": 1799.4057547312295, + "Y": 445.37714072843261, + "IsEmpty": false + }, + "Timestamp": 637316493120377290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 1799.4057547312295, + "Y": 440.78077364823798, + "IsEmpty": false + }, + "Timestamp": 637316493120538540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789303422, + "Position": { + "X": 1799.4057547312295, + "Y": 437.12727339022229, + "IsEmpty": false + }, + "Timestamp": 637316493120709840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 1799.4057547312295, + "Y": 434.59336170479833, + "IsEmpty": false + }, + "Timestamp": 637316493120879090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797116041, + "Position": { + "X": 1799.4057547312295, + "Y": 432.47196855380503, + "IsEmpty": false + }, + "Timestamp": 637316493121054370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.322743565, + "Position": { + "X": 1799.4057547312295, + "Y": 435.94870130228043, + "IsEmpty": false + }, + "Timestamp": 637316493121531220, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "030a50cb-b301-44a0-9891-6681c02afe7c", + "Points": [ + { + "Pressure": 0.136949718, + "Position": { + "X": 1801.061251325561, + "Y": 439.42552556901086, + "IsEmpty": false + }, + "Timestamp": 637316493143497290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.136949718, + "Position": { + "X": 1801.061251325561, + "Y": 439.83799834431397, + "IsEmpty": false + }, + "Timestamp": 637316493143688840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.164538026, + "Position": { + "X": 1801.061251325561, + "Y": 440.30940887583972, + "IsEmpty": false + }, + "Timestamp": 637316493143864790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.202380404, + "Position": { + "X": 1801.061251325561, + "Y": 440.72188165114289, + "IsEmpty": false + }, + "Timestamp": 637316493144027760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.253650725, + "Position": { + "X": 1801.061251325561, + "Y": 441.13444594470104, + "IsEmpty": false + }, + "Timestamp": 637316493144199600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.371084154, + "Position": { + "X": 1801.061251325561, + "Y": 441.60585647622673, + "IsEmpty": false + }, + "Timestamp": 637316493144373460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.439444572, + "Position": { + "X": 1801.061251325561, + "Y": 441.37010545133637, + "IsEmpty": false + }, + "Timestamp": 637316493145046380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480460823, + "Position": { + "X": 1801.061251325561, + "Y": 438.77730176881732, + "IsEmpty": false + }, + "Timestamp": 637316493145209590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506828427, + "Position": { + "X": 1801.061251325561, + "Y": 436.83272188649181, + "IsEmpty": false + }, + "Timestamp": 637316493145384810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529289663, + "Position": { + "X": 1801.061251325561, + "Y": 434.53451546683073, + "IsEmpty": false + }, + "Timestamp": 637316493145547460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.551018536, + "Position": { + "X": 1801.061251325561, + "Y": 431.76489851564389, + "IsEmpty": false + }, + "Timestamp": 637316493145722510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.574456394, + "Position": { + "X": 1801.061251325561, + "Y": 427.93467650721544, + "IsEmpty": false + }, + "Timestamp": 637316493145890790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 1801.061251325561, + "Y": 425.87222111244472, + "IsEmpty": false + }, + "Timestamp": 637316493146058100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597650111, + "Position": { + "X": 1801.061251325561, + "Y": 423.51507693656106, + "IsEmpty": false + }, + "Timestamp": 637316493146229680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605706871, + "Position": { + "X": 1801.061251325561, + "Y": 420.45086272251626, + "IsEmpty": false + }, + "Timestamp": 637316493146402700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1801.061251325561, + "Y": 415.3830393516684, + "IsEmpty": false + }, + "Timestamp": 637316493146570630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625238419, + "Position": { + "X": 1801.061251325561, + "Y": 411.90635236232043, + "IsEmpty": false + }, + "Timestamp": 637316493146729400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631097913, + "Position": { + "X": 1801.061251325561, + "Y": 408.48851161094012, + "IsEmpty": false + }, + "Timestamp": 637316493146907580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633051038, + "Position": { + "X": 1801.061251325561, + "Y": 403.18502873345687, + "IsEmpty": false + }, + "Timestamp": 637316493147078310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.637689769, + "Position": { + "X": 1801.061251325561, + "Y": 399.17799345636058, + "IsEmpty": false + }, + "Timestamp": 637316493147245980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642572641, + "Position": { + "X": 1801.061251325561, + "Y": 394.99414491059656, + "IsEmpty": false + }, + "Timestamp": 637316493147406990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647455573, + "Position": { + "X": 1801.061251325561, + "Y": 390.81029636483254, + "IsEmpty": false + }, + "Timestamp": 637316493147581040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652338445, + "Position": { + "X": 1801.061251325561, + "Y": 386.74432333151373, + "IsEmpty": false + }, + "Timestamp": 637316493147744670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656244755, + "Position": { + "X": 1801.061251325561, + "Y": 381.08721391669491, + "IsEmpty": false + }, + "Timestamp": 637316493147920410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656244755, + "Position": { + "X": 1801.061251325561, + "Y": 377.37477590245663, + "IsEmpty": false + }, + "Timestamp": 637316493148080830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65819788, + "Position": { + "X": 1801.061251325561, + "Y": 373.9570266693313, + "IsEmpty": false + }, + "Timestamp": 637316493148260890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65819788, + "Position": { + "X": 1801.061251325561, + "Y": 369.41955158623171, + "IsEmpty": false + }, + "Timestamp": 637316493148430360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.662104189, + "Position": { + "X": 1801.061251325561, + "Y": 365.70711357199343, + "IsEmpty": false + }, + "Timestamp": 637316493148599580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.662104189, + "Position": { + "X": 1801.061251325561, + "Y": 363.23218540191959, + "IsEmpty": false + }, + "Timestamp": 637316493148759470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.662104189, + "Position": { + "X": 1801.061251325561, + "Y": 360.58044396317791, + "IsEmpty": false + }, + "Timestamp": 637316493148926790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.662104189, + "Position": { + "X": 1801.061251325561, + "Y": 357.7518892557685, + "IsEmpty": false + }, + "Timestamp": 637316493149101170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669916809, + "Position": { + "X": 1801.061251325561, + "Y": 352.74309515939819, + "IsEmpty": false + }, + "Timestamp": 637316493149275650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667719543, + "Position": { + "X": 1801.061251325561, + "Y": 349.91454045198878, + "IsEmpty": false + }, + "Timestamp": 637316493149438590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1801.061251325561, + "Y": 347.32173676946974, + "IsEmpty": false + }, + "Timestamp": 637316493149608460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1801.061251325561, + "Y": 344.43429006496524, + "IsEmpty": false + }, + "Timestamp": 637316493149783480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 1801.061251325561, + "Y": 343.55040675813638, + "IsEmpty": false + }, + "Timestamp": 637316493149941800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1801.061251325561, + "Y": 341.9593618948914, + "IsEmpty": false + }, + "Timestamp": 637316493150111770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1801.061251325561, + "Y": 339.8379687438981, + "IsEmpty": false + }, + "Timestamp": 637316493150289650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1801.061251325561, + "Y": 336.9505220393936, + "IsEmpty": false + }, + "Timestamp": 637316493150454170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1801.061251325561, + "Y": 333.00237875939246, + "IsEmpty": false + }, + "Timestamp": 637316493150626270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 1801.061251325561, + "Y": 330.70417233973137, + "IsEmpty": false + }, + "Timestamp": 637316493150791870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 1801.061251325561, + "Y": 329.40777049847185, + "IsEmpty": false + }, + "Timestamp": 637316493150963570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 1801.061251325561, + "Y": 329.05423547939131, + "IsEmpty": false + }, + "Timestamp": 637316493151134890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692133963, + "Position": { + "X": 1801.061251325561, + "Y": 328.46494943542035, + "IsEmpty": false + }, + "Timestamp": 637316493151632390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694087148, + "Position": { + "X": 1801.061251325561, + "Y": 327.34531510370113, + "IsEmpty": false + }, + "Timestamp": 637316493151804890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696040273, + "Position": { + "X": 1801.061251325561, + "Y": 326.6381993064125, + "IsEmpty": false + }, + "Timestamp": 637316493151977180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696040273, + "Position": { + "X": 1801.061251325561, + "Y": 325.57750273091585, + "IsEmpty": false + }, + "Timestamp": 637316493152142680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696040273, + "Position": { + "X": 1801.061251325561, + "Y": 323.98645786767088, + "IsEmpty": false + }, + "Timestamp": 637316493152309860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697993457, + "Position": { + "X": 1801.061251325561, + "Y": 322.51324275774357, + "IsEmpty": false + }, + "Timestamp": 637316493152476190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699946582, + "Position": { + "X": 1801.061251325561, + "Y": 322.15970773866303, + "IsEmpty": false + }, + "Timestamp": 637316493152654960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701899767, + "Position": { + "X": 1801.061251325561, + "Y": 321.51148393846955, + "IsEmpty": false + }, + "Timestamp": 637316493152820510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703852892, + "Position": { + "X": 1801.061251325561, + "Y": 320.50972511919548, + "IsEmpty": false + }, + "Timestamp": 637316493152984340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703852892, + "Position": { + "X": 1801.061251325561, + "Y": 319.3900907874762, + "IsEmpty": false + }, + "Timestamp": 637316493153153270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708735764, + "Position": { + "X": 1801.061251325561, + "Y": 317.50440290224577, + "IsEmpty": false + }, + "Timestamp": 637316493153325240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 1801.061251325561, + "Y": 316.26693881720882, + "IsEmpty": false + }, + "Timestamp": 637316493153492030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720943034, + "Position": { + "X": 1801.061251325561, + "Y": 315.85446604190571, + "IsEmpty": false + }, + "Timestamp": 637316493153667690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611322165, + "Position": { + "X": 1801.061251325561, + "Y": 315.20624224171218, + "IsEmpty": false + }, + "Timestamp": 637316493154036050, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "6dfdc5de-9916-4cbc-a74c-2543a1b63d17", + "Points": [ + { + "Pressure": 0.231433585, + "Position": { + "X": 1796.6994003771867, + "Y": 327.49068421355713, + "IsEmpty": false + }, + "Timestamp": 637316493373548640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.298329145, + "Position": { + "X": 1797.0235199198432, + "Y": 327.69768708460919, + "IsEmpty": false + }, + "Timestamp": 637316493374009630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.332021058, + "Position": { + "X": 1797.316566271933, + "Y": 327.84278529597572, + "IsEmpty": false + }, + "Timestamp": 637316493374177110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.358632803, + "Position": { + "X": 1797.9327648458036, + "Y": 328.19526048121907, + "IsEmpty": false + }, + "Timestamp": 637316493374347580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.407461673, + "Position": { + "X": 1799.4840884502403, + "Y": 329.10918357326574, + "IsEmpty": false + }, + "Timestamp": 637316493374694940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.429434657, + "Position": { + "X": 1800.0968137839238, + "Y": 329.46297370331644, + "IsEmpty": false + }, + "Timestamp": 637316493374859730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.458243698, + "Position": { + "X": 1800.7085726959974, + "Y": 329.81712428423481, + "IsEmpty": false + }, + "Timestamp": 637316493375027760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.517814934, + "Position": { + "X": 1801.3193653354394, + "Y": 330.17163233987776, + "IsEmpty": false + }, + "Timestamp": 637316493375362830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.563225746, + "Position": { + "X": 1801.9291918512279, + "Y": 330.52649489410163, + "IsEmpty": false + }, + "Timestamp": 637316493376046290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622796953, + "Position": { + "X": 1802.2190823925498, + "Y": 330.67281166097592, + "IsEmpty": false + }, + "Timestamp": 637316493377064240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624994278, + "Position": { + "X": 1803.4350471526413, + "Y": 331.38388071187217, + "IsEmpty": false + }, + "Timestamp": 637316493378572610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 1804.041580711558, + "Y": 331.73993323747874, + "IsEmpty": false + }, + "Timestamp": 637316493379087640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643793404, + "Position": { + "X": 1804.9638377896083, + "Y": 332.30602097891955, + "IsEmpty": false + }, + "Timestamp": 637316493379587610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685297906, + "Position": { + "X": 1805.8553878915302, + "Y": 332.81012710121138, + "IsEmpty": false + }, + "Timestamp": 637316493382804950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689936697, + "Position": { + "X": 1806.7730414034024, + "Y": 333.37780013960713, + "IsEmpty": false + }, + "Timestamp": 637316493382974570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692133963, + "Position": { + "X": 1807.6605079548785, + "Y": 333.88331289630253, + "IsEmpty": false + }, + "Timestamp": 637316493383133620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697260976, + "Position": { + "X": 1809.4569449240159, + "Y": 334.95941026688109, + "IsEmpty": false + }, + "Timestamp": 637316493383310230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 1811.8386941330755, + "Y": 336.39859699171973, + "IsEmpty": false + }, + "Timestamp": 637316493383478730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703608751, + "Position": { + "X": 1812.7410318258774, + "Y": 336.97124732404865, + "IsEmpty": false + }, + "Timestamp": 637316493383648370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708003342, + "Position": { + "X": 1814.7941974902797, + "Y": 338.20436827282953, + "IsEmpty": false + }, + "Timestamp": 637316493383819370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 1817.4460599120782, + "Y": 339.86760046018287, + "IsEmpty": false + }, + "Timestamp": 637316493383986040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714106977, + "Position": { + "X": 1822.6656195630526, + "Y": 343.14689376398661, + "IsEmpty": false + }, + "Timestamp": 637316493384154470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718013287, + "Position": { + "X": 1826.6714689230366, + "Y": 345.71141834734715, + "IsEmpty": false + }, + "Timestamp": 637316493384324430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722163737, + "Position": { + "X": 1831.4828112753207, + "Y": 348.87268010625428, + "IsEmpty": false + }, + "Timestamp": 637316493384485340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722163737, + "Position": { + "X": 1835.0971439854534, + "Y": 351.24289519437144, + "IsEmpty": false + }, + "Timestamp": 637316493384654670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726070046, + "Position": { + "X": 1841.1390239023933, + "Y": 355.32588816412419, + "IsEmpty": false + }, + "Timestamp": 637316493384837580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728023171, + "Position": { + "X": 1845.2006385850036, + "Y": 358.15298257006941, + "IsEmpty": false + }, + "Timestamp": 637316493385003740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732173622, + "Position": { + "X": 1849.464238158336, + "Y": 361.14161200145861, + "IsEmpty": false + }, + "Timestamp": 637316493385167640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732173622, + "Position": { + "X": 1854.1878635584064, + "Y": 364.51160498939032, + "IsEmpty": false + }, + "Timestamp": 637316493385336960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734126806, + "Position": { + "X": 1860.3661018988105, + "Y": 369.01412618203875, + "IsEmpty": false + }, + "Timestamp": 637316493385506350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734126806, + "Position": { + "X": 1864.6653030008404, + "Y": 372.23998324964998, + "IsEmpty": false + }, + "Timestamp": 637316493385668000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736079931, + "Position": { + "X": 1869.1360378228728, + "Y": 375.62201244935068, + "IsEmpty": false + }, + "Timestamp": 637316493385850760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738033116, + "Position": { + "X": 1873.0456017254762, + "Y": 378.62750626001321, + "IsEmpty": false + }, + "Timestamp": 637316493386009120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738033116, + "Position": { + "X": 1878.5633689110678, + "Y": 382.97605187763116, + "IsEmpty": false + }, + "Timestamp": 637316493386181540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738033116, + "Position": { + "X": 1881.8581248849687, + "Y": 385.59883889690457, + "IsEmpty": false + }, + "Timestamp": 637316493386350680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738033116, + "Position": { + "X": 1884.6454160694661, + "Y": 387.84342344736433, + "IsEmpty": false + }, + "Timestamp": 637316493386519730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738033116, + "Position": { + "X": 1886.9422449065355, + "Y": 389.71093843870005, + "IsEmpty": false + }, + "Timestamp": 637316493386686260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 1891.6866429891518, + "Y": 393.59004057321022, + "IsEmpty": false + }, + "Timestamp": 637316493386859330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 1894.7938942725443, + "Y": 396.18838168734061, + "IsEmpty": false + }, + "Timestamp": 637316493387031570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 1897.4206238145098, + "Y": 398.40871473462022, + "IsEmpty": false + }, + "Timestamp": 637316493387191390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 1900.0135762149494, + "Y": 400.62207708664022, + "IsEmpty": false + }, + "Timestamp": 637316493387362020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 1902.9960397254843, + "Y": 403.19466535439352, + "IsEmpty": false + }, + "Timestamp": 637316493387537540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 1905.5159187121553, + "Y": 405.39071921110843, + "IsEmpty": false + }, + "Timestamp": 637316493387705390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742671847, + "Position": { + "X": 1908.0021224584107, + "Y": 407.57776669049417, + "IsEmpty": false + }, + "Timestamp": 637316493387873790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1910.6579410233639, + "Y": 409.96724129598124, + "IsEmpty": false + }, + "Timestamp": 637316493388035480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1912.673541114061, + "Y": 411.77301799454182, + "IsEmpty": false + }, + "Timestamp": 637316493388211980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1914.4676093279718, + "Y": 413.36097331261567, + "IsEmpty": false + }, + "Timestamp": 637316493388375480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1916.2428807876788, + "Y": 415.00410736086144, + "IsEmpty": false + }, + "Timestamp": 637316493388540450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1918.1932466911758, + "Y": 416.78777024642972, + "IsEmpty": false + }, + "Timestamp": 637316493388719370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1920.502980859128, + "Y": 418.91677486731828, + "IsEmpty": false + }, + "Timestamp": 637316493388893040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1922.2124363198798, + "Y": 420.53500842934767, + "IsEmpty": false + }, + "Timestamp": 637316493389051880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1923.9048436407613, + "Y": 422.08564308500917, + "IsEmpty": false + }, + "Timestamp": 637316493389219090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1925.576412003531, + "Y": 423.68804664331788, + "IsEmpty": false + }, + "Timestamp": 637316493389395050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 1926.6810392491027, + "Y": 424.7319218989586, + "IsEmpty": false + }, + "Timestamp": 637316493389562730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 1927.7773242075391, + "Y": 425.77209448697243, + "IsEmpty": false + }, + "Timestamp": 637316493389725760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 1928.8652709012524, + "Y": 426.80848405148856, + "IsEmpty": false + }, + "Timestamp": 637316493389892340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 1929.9448833526542, + "Y": 427.8410102366355, + "IsEmpty": false + }, + "Timestamp": 637316493390072480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 1931.1954996965101, + "Y": 429.01164795839912, + "IsEmpty": false + }, + "Timestamp": 637316493390234980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739009678, + "Position": { + "X": 1930.6599968386818, + "Y": 428.52717502295019, + "IsEmpty": false + }, + "Timestamp": 637316493391254340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.4428626, + "Position": { + "X": 1930.3029028111732, + "Y": 428.18431321426687, + "IsEmpty": false + }, + "Timestamp": 637316493391365350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.4428626, + "Position": { + "X": 1930.8363953914916, + "Y": 428.72735858335056, + "IsEmpty": false + }, + "Timestamp": 637316493391389740, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "ef312e20-1ddd-4d06-9652-03d416215e0b", + "Points": [ + { + "Pressure": 0.31273365, + "Position": { + "X": 1798.382118638847, + "Y": 756.37195689640441, + "IsEmpty": false + }, + "Timestamp": 637316493400531600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.435294122, + "Position": { + "X": 1798.3458281457831, + "Y": 756.40516332627556, + "IsEmpty": false + }, + "Timestamp": 637316493401217540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638178051, + "Position": { + "X": 1797.8140910146958, + "Y": 756.77151105534222, + "IsEmpty": false + }, + "Timestamp": 637316493401556250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 1798.3095202561758, + "Y": 756.43825486046887, + "IsEmpty": false + }, + "Timestamp": 637316493402231250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 1799.7926757845696, + "Y": 755.43452557523574, + "IsEmpty": false + }, + "Timestamp": 637316493402403040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725337625, + "Position": { + "X": 1802.2903645729589, + "Y": 753.71443451391417, + "IsEmpty": false + }, + "Timestamp": 637316493402569110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1804.7749187052805, + "Y": 751.97658313855902, + "IsEmpty": false + }, + "Timestamp": 637316493402741050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76806289, + "Position": { + "X": 1811.1165166080932, + "Y": 747.43354123301401, + "IsEmpty": false + }, + "Timestamp": 637316493402906920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781734943, + "Position": { + "X": 1814.5119019530193, + "Y": 744.92270577315844, + "IsEmpty": false + }, + "Timestamp": 637316493403073640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.79272145, + "Position": { + "X": 1817.882366693877, + "Y": 742.37791058256846, + "IsEmpty": false + }, + "Timestamp": 637316493403244870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801022351, + "Position": { + "X": 1821.6635670464423, + "Y": 739.47315721832513, + "IsEmpty": false + }, + "Timestamp": 637316493403420710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.807614267, + "Position": { + "X": 1828.2398072730427, + "Y": 734.24803827296523, + "IsEmpty": false + }, + "Timestamp": 637316493403589200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812497139, + "Position": { + "X": 1834.2278572636883, + "Y": 729.31857257207594, + "IsEmpty": false + }, + "Timestamp": 637316493403754040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817624152, + "Position": { + "X": 1840.5858480194684, + "Y": 723.88733847627668, + "IsEmpty": false + }, + "Timestamp": 637316493403924050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.819577336, + "Position": { + "X": 1846.8166581790094, + "Y": 718.37623647518853, + "IsEmpty": false + }, + "Timestamp": 637316493404089110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.823727787, + "Position": { + "X": 1856.0106122012501, + "Y": 709.85553204098585, + "IsEmpty": false + }, + "Timestamp": 637316493404265320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.827634096, + "Position": { + "X": 1861.5547344798867, + "Y": 704.51299880159183, + "IsEmpty": false + }, + "Timestamp": 637316493404426660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832761109, + "Position": { + "X": 1866.9900538026641, + "Y": 699.12246861290782, + "IsEmpty": false + }, + "Timestamp": 637316493404602150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.834714293, + "Position": { + "X": 1872.3181181455504, + "Y": 693.68898748460356, + "IsEmpty": false + }, + "Timestamp": 637316493404764080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838620603, + "Position": { + "X": 1878.4315095091108, + "Y": 687.21365808877931, + "IsEmpty": false + }, + "Timestamp": 637316493404934080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838620603, + "Position": { + "X": 1884.0455679143081, + "Y": 681.06521234298543, + "IsEmpty": false + }, + "Timestamp": 637316493405107620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838620603, + "Position": { + "X": 1888.7790409865079, + "Y": 675.73213108103982, + "IsEmpty": false + }, + "Timestamp": 637316493405269270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838620603, + "Position": { + "X": 1892.2993519105482, + "Y": 671.6650321246052, + "IsEmpty": false + }, + "Timestamp": 637316493405439120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838620603, + "Position": { + "X": 1896.5394385815425, + "Y": 666.66689750117439, + "IsEmpty": false + }, + "Timestamp": 637316493405610670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840573728, + "Position": { + "X": 1899.2433508099971, + "Y": 663.39563628032829, + "IsEmpty": false + }, + "Timestamp": 637316493405785340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840573728, + "Position": { + "X": 1902.2480041995309, + "Y": 659.73996598087615, + "IsEmpty": false + }, + "Timestamp": 637316493405951450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733638525, + "Position": { + "X": 1904.493737121448, + "Y": 656.96068033720519, + "IsEmpty": false + }, + "Timestamp": 637316493406084360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733638525, + "Position": { + "X": 1904.777578310187, + "Y": 656.66510064491627, + "IsEmpty": false + }, + "Timestamp": 637316493406110420, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "15322d18-c459-4dcd-9481-77675d78bfab", + "Points": [ + { + "Pressure": 0.0900740027, + "Position": { + "X": 1891.4857995427362, + "Y": 679.14668263688407, + "IsEmpty": false + }, + "Timestamp": 637316493446663660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.200183108, + "Position": { + "X": 1891.4857995427362, + "Y": 681.00601617438929, + "IsEmpty": false + }, + "Timestamp": 637316493447189570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.26390478, + "Position": { + "X": 1891.4857995427362, + "Y": 683.74032020812047, + "IsEmpty": false + }, + "Timestamp": 637316493447352730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.294178694, + "Position": { + "X": 1891.4857995427362, + "Y": 685.709046290679, + "IsEmpty": false + }, + "Timestamp": 637316493447519100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.319081396, + "Position": { + "X": 1891.4857995427362, + "Y": 687.56837982818422, + "IsEmpty": false + }, + "Timestamp": 637316493447687440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.336171508, + "Position": { + "X": 1891.4857995427362, + "Y": 689.42771336568944, + "IsEmpty": false + }, + "Timestamp": 637316493447861660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.378408492, + "Position": { + "X": 1891.4857995427362, + "Y": 690.3026838619154, + "IsEmpty": false + }, + "Timestamp": 637316493448028000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.45897612, + "Position": { + "X": 1891.4857995427362, + "Y": 684.94346833950635, + "IsEmpty": false + }, + "Timestamp": 637316493448704850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.495109469, + "Position": { + "X": 1891.4857995427362, + "Y": 680.45905344912285, + "IsEmpty": false + }, + "Timestamp": 637316493448877740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523430228, + "Position": { + "X": 1891.4857995427362, + "Y": 674.99044538166049, + "IsEmpty": false + }, + "Timestamp": 637316493449038810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.551995099, + "Position": { + "X": 1891.4857995427362, + "Y": 668.09990409270563, + "IsEmpty": false + }, + "Timestamp": 637316493449207860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594720364, + "Position": { + "X": 1891.4857995427362, + "Y": 655.08439946596877, + "IsEmpty": false + }, + "Timestamp": 637316493449377570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619134784, + "Position": { + "X": 1891.4857995427362, + "Y": 646.11573954940218, + "IsEmpty": false + }, + "Timestamp": 637316493449545100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635492504, + "Position": { + "X": 1891.4857995427362, + "Y": 637.25647217788878, + "IsEmpty": false + }, + "Timestamp": 637316493449711490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 1891.4857995427362, + "Y": 627.74101940025616, + "IsEmpty": false + }, + "Timestamp": 637316493449884910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669672668, + "Position": { + "X": 1891.4857995427362, + "Y": 613.52253650633372, + "IsEmpty": false + }, + "Timestamp": 637316493450057200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678950191, + "Position": { + "X": 1891.4857995427362, + "Y": 604.55387658976713, + "IsEmpty": false + }, + "Timestamp": 637316493450222220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.68676281, + "Position": { + "X": 1891.4857995427362, + "Y": 596.13200953426656, + "IsEmpty": false + }, + "Timestamp": 637316493450390930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 1891.4857995427362, + "Y": 588.36649774908585, + "IsEmpty": false + }, + "Timestamp": 637316493450557890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 1891.4857995427362, + "Y": 576.88231888889459, + "IsEmpty": false + }, + "Timestamp": 637316493450729090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 1891.4857995427362, + "Y": 569.33559219382039, + "IsEmpty": false + }, + "Timestamp": 637316493450894880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 1891.4857995427362, + "Y": 561.56991054443927, + "IsEmpty": false + }, + "Timestamp": 637316493451062770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 1891.4857995427362, + "Y": 553.58578353335224, + "IsEmpty": false + }, + "Timestamp": 637316493451234450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71532768, + "Position": { + "X": 1891.4857995427362, + "Y": 542.75779007928043, + "IsEmpty": false + }, + "Timestamp": 637316493451400310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 1891.4857995427362, + "Y": 535.32028606505912, + "IsEmpty": false + }, + "Timestamp": 637316493451573100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 1891.4857995427362, + "Y": 527.44538173482511, + "IsEmpty": false + }, + "Timestamp": 637316493451739620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 1891.4857995427362, + "Y": 519.7892624946976, + "IsEmpty": false + }, + "Timestamp": 637316493451909740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722163737, + "Position": { + "X": 1891.4857995427362, + "Y": 508.52386872461301, + "IsEmpty": false + }, + "Timestamp": 637316493452085890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724116862, + "Position": { + "X": 1891.4857995427362, + "Y": 501.52393489060489, + "IsEmpty": false + }, + "Timestamp": 637316493452245860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726070046, + "Position": { + "X": 1891.4857995427362, + "Y": 494.30521596649021, + "IsEmpty": false + }, + "Timestamp": 637316493452418970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 1891.4857995427362, + "Y": 487.4146746775354, + "IsEmpty": false + }, + "Timestamp": 637316493452593490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.731197059, + "Position": { + "X": 1891.4857995427362, + "Y": 477.68043680979616, + "IsEmpty": false + }, + "Timestamp": 637316493452757170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.731197059, + "Position": { + "X": 1891.4857995427362, + "Y": 472.1024361972805, + "IsEmpty": false + }, + "Timestamp": 637316493452924300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728267312, + "Position": { + "X": 1891.4857995427362, + "Y": 466.30565049465821, + "IsEmpty": false + }, + "Timestamp": 637316493453098430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730220497, + "Position": { + "X": 1891.4857995427362, + "Y": 460.61808747288887, + "IsEmpty": false + }, + "Timestamp": 637316493453265070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730220497, + "Position": { + "X": 1891.4857995427362, + "Y": 451.43081233041607, + "IsEmpty": false + }, + "Timestamp": 637316493453437940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730220497, + "Position": { + "X": 1891.4857995427362, + "Y": 445.7434191728471, + "IsEmpty": false + }, + "Timestamp": 637316493453601770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730220497, + "Position": { + "X": 1891.4857995427362, + "Y": 440.05585615107776, + "IsEmpty": false + }, + "Timestamp": 637316493453775230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730220497, + "Position": { + "X": 1891.4857995427362, + "Y": 435.02481826382859, + "IsEmpty": false + }, + "Timestamp": 637316493453944830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732173622, + "Position": { + "X": 1891.4857995427362, + "Y": 427.14991393359452, + "IsEmpty": false + }, + "Timestamp": 637316493454115240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732173622, + "Position": { + "X": 1891.4857995427362, + "Y": 421.13434314086567, + "IsEmpty": false + }, + "Timestamp": 637316493454275060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732173622, + "Position": { + "X": 1891.4857995427362, + "Y": 415.11877234813682, + "IsEmpty": false + }, + "Timestamp": 637316493454448690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732173622, + "Position": { + "X": 1891.4857995427362, + "Y": 410.08756459668723, + "IsEmpty": false + }, + "Timestamp": 637316493454615610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732173622, + "Position": { + "X": 1891.4857995427362, + "Y": 404.50956398417156, + "IsEmpty": false + }, + "Timestamp": 637316493454789830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734126806, + "Position": { + "X": 1891.4857995427362, + "Y": 400.90011959001401, + "IsEmpty": false + }, + "Timestamp": 637316493454954660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734126806, + "Position": { + "X": 1891.4857995427362, + "Y": 397.40023760511019, + "IsEmpty": false + }, + "Timestamp": 637316493455125150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736324072, + "Position": { + "X": 1891.4857995427362, + "Y": 394.00957830105921, + "IsEmpty": false + }, + "Timestamp": 637316493455289820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 1891.4857995427362, + "Y": 389.30654818476955, + "IsEmpty": false + }, + "Timestamp": 637316493455466380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743160129, + "Position": { + "X": 1891.4857995427362, + "Y": 386.46285160598507, + "IsEmpty": false + }, + "Timestamp": 637316493455627340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 1891.4857995427362, + "Y": 385.04108824869303, + "IsEmpty": false + }, + "Timestamp": 637316493455795860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752681792, + "Position": { + "X": 1891.4857995427362, + "Y": 384.05672520741376, + "IsEmpty": false + }, + "Timestamp": 637316493455967320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758541226, + "Position": { + "X": 1891.4857995427362, + "Y": 385.15031092954592, + "IsEmpty": false + }, + "Timestamp": 637316493456141710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.313466072, + "Position": { + "X": 1891.4857995427362, + "Y": 389.41594072982281, + "IsEmpty": false + }, + "Timestamp": 637316493456302580, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8eba7e7a-3854-402e-996a-a36d748e824c", + "Points": [ + { + "Pressure": 0.146715492, + "Position": { + "X": 1895.173296189236, + "Y": 674.93123360687787, + "IsEmpty": false + }, + "Timestamp": 637316493478253780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.193835348, + "Position": { + "X": 1894.4022692388905, + "Y": 674.80885247237393, + "IsEmpty": false + }, + "Timestamp": 637316493478393320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.266834527, + "Position": { + "X": 1893.6317470106469, + "Y": 674.6856461169881, + "IsEmpty": false + }, + "Timestamp": 637316493478594270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.489982456, + "Position": { + "X": 1891.3232164103954, + "Y": 674.31109798788077, + "IsEmpty": false + }, + "Timestamp": 637316493479109800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531975269, + "Position": { + "X": 1889.7867338324943, + "Y": 674.05731394502641, + "IsEmpty": false + }, + "Timestamp": 637316493479284270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659174502, + "Position": { + "X": 1888.252288747482, + "Y": 673.8002824482644, + "IsEmpty": false + }, + "Timestamp": 637316493479793340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741451144, + "Position": { + "X": 1892.861730279692, + "Y": 674.56161676695456, + "IsEmpty": false + }, + "Timestamp": 637316493481004620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760494411, + "Position": { + "X": 1899.8100136449973, + "Y": 675.64806610626647, + "IsEmpty": false + }, + "Timestamp": 637316493481262170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773922324, + "Position": { + "X": 1907.5777370482961, + "Y": 676.7752851119044, + "IsEmpty": false + }, + "Timestamp": 637316493481392580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787594438, + "Position": { + "X": 1916.7171174193154, + "Y": 677.97723955994854, + "IsEmpty": false + }, + "Timestamp": 637316493481559890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803952098, + "Position": { + "X": 1930.922068258601, + "Y": 679.59924006000733, + "IsEmpty": false + }, + "Timestamp": 637316493481730390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 1941.2758393583458, + "Y": 680.58422221539263, + "IsEmpty": false + }, + "Timestamp": 637316493481925810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 1961.9551160976762, + "Y": 682.04532681277396, + "IsEmpty": false + }, + "Timestamp": 637316493482307530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.831052125, + "Position": { + "X": 1987.0338797279983, + "Y": 682.91209888984099, + "IsEmpty": false + }, + "Timestamp": 637316493482637030, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "05d1397f-db2d-437e-af0e-94bcd68de7ec", + "Points": [ + { + "Pressure": 0.135240704, + "Position": { + "X": 1895.7379129717008, + "Y": 387.26111515307542, + "IsEmpty": false + }, + "Timestamp": 637316493495566140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.26390478, + "Position": { + "X": 1891.0639384035283, + "Y": 387.84767375690973, + "IsEmpty": false + }, + "Timestamp": 637316493495831110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.304921031, + "Position": { + "X": 1890.3956478500247, + "Y": 387.93359766974123, + "IsEmpty": false + }, + "Timestamp": 637316493496019190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.348134577, + "Position": { + "X": 1889.7272189973155, + "Y": 388.02004959027147, + "IsEmpty": false + }, + "Timestamp": 637316493496184530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.443350881, + "Position": { + "X": 1888.3899552956448, + "Y": 388.19453152250304, + "IsEmpty": false + }, + "Timestamp": 637316493496617560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.474601358, + "Position": { + "X": 1887.0521651012416, + "Y": 388.37110768975464, + "IsEmpty": false + }, + "Timestamp": 637316493496803400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 1886.3830781326169, + "Y": 388.46017740405989, + "IsEmpty": false + }, + "Timestamp": 637316493497202350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700923145, + "Position": { + "X": 1888.3899552956448, + "Y": 388.19453152250304, + "IsEmpty": false + }, + "Timestamp": 637316493498727120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718989849, + "Position": { + "X": 1894.3128594867417, + "Y": 387.44061194164692, + "IsEmpty": false + }, + "Timestamp": 637316493499084550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728999794, + "Position": { + "X": 1900.3134156885637, + "Y": 386.71478001937635, + "IsEmpty": false + }, + "Timestamp": 637316493499227540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 1912.841966042138, + "Y": 385.34216089239601, + "IsEmpty": false + }, + "Timestamp": 637316493499662690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760982692, + "Position": { + "X": 1935.5954270317907, + "Y": 383.36802600415865, + "IsEmpty": false + }, + "Timestamp": 637316493499981590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.766842127, + "Position": { + "X": 1947.7654352439151, + "Y": 382.60904415398295, + "IsEmpty": false + }, + "Timestamp": 637316493500194740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.783443987, + "Position": { + "X": 1989.3128567216368, + "Y": 381.82859033381914, + "IsEmpty": false + }, + "Timestamp": 637316493500636820, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c921d510-f1d7-430b-a724-e269fc063e7b", + "Points": [ + { + "Pressure": 0.0788433626, + "Position": { + "X": 1984.2500309150696, + "Y": 684.1057889659395, + "IsEmpty": false + }, + "Timestamp": 637316493552007430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.221423671, + "Position": { + "X": 1982.8853638103826, + "Y": 684.08157932949234, + "IsEmpty": false + }, + "Timestamp": 637316493552564670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.392324716, + "Position": { + "X": 1982.0612643805246, + "Y": 684.06305628655161, + "IsEmpty": false + }, + "Timestamp": 637316493553207770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.407949954, + "Position": { + "X": 1981.2375937392792, + "Y": 684.04345743428621, + "IsEmpty": false + }, + "Timestamp": 637316493553377590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.574700534, + "Position": { + "X": 1980.4143526476355, + "Y": 684.02278501170144, + "IsEmpty": false + }, + "Timestamp": 637316493553629430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.613275349, + "Position": { + "X": 1983.709891267865, + "Y": 684.09902432410342, + "IsEmpty": false + }, + "Timestamp": 637316493554990630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627679884, + "Position": { + "X": 1985.3602272217495, + "Y": 684.13067121231597, + "IsEmpty": false + }, + "Timestamp": 637316493555163860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635492504, + "Position": { + "X": 1987.5531906109088, + "Y": 684.16199643750156, + "IsEmpty": false + }, + "Timestamp": 637316493555330480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642328501, + "Position": { + "X": 1989.4935043206979, + "Y": 684.19076585672008, + "IsEmpty": false + }, + "Timestamp": 637316493555502930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652094305, + "Position": { + "X": 1994.4673524792206, + "Y": 684.22668810872142, + "IsEmpty": false + }, + "Timestamp": 637316493555671130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65819788, + "Position": { + "X": 1997.5031372154274, + "Y": 684.22534301545465, + "IsEmpty": false + }, + "Timestamp": 637316493555830310, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "84ecc850-06e1-4f9b-9419-99c9f64f5289", + "Points": [ + { + "Pressure": 0.0280613415, + "Position": { + "X": 1988.6475560440865, + "Y": 378.06258516480057, + "IsEmpty": false + }, + "Timestamp": 637316493572277880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.030502785, + "Position": { + "X": 1988.163705893387, + "Y": 378.05250122027007, + "IsEmpty": false + }, + "Timestamp": 637316493572443000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0554055087, + "Position": { + "X": 1987.5297060682631, + "Y": 378.04410878806368, + "IsEmpty": false + }, + "Timestamp": 637316493572558470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.169909209, + "Position": { + "X": 1985.7747351600819, + "Y": 378.02185918114549, + "IsEmpty": false + }, + "Timestamp": 637316493572728260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.190905616, + "Position": { + "X": 1985.1390300769015, + "Y": 378.01634556666539, + "IsEmpty": false + }, + "Timestamp": 637316493572905450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.197985813, + "Position": { + "X": 1984.9895693936965, + "Y": 378.01821739369336, + "IsEmpty": false + }, + "Timestamp": 637316493573072390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.202136263, + "Position": { + "X": 1982.5921556492851, + "Y": 378.00191223717889, + "IsEmpty": false + }, + "Timestamp": 637316493573237590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.204333559, + "Position": { + "X": 1981.3163157622932, + "Y": 377.99924686254985, + "IsEmpty": false + }, + "Timestamp": 637316493573407530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.211657897, + "Position": { + "X": 1979.5486180921364, + "Y": 377.99753006645898, + "IsEmpty": false + }, + "Timestamp": 637316493573583680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.362294942, + "Position": { + "X": 1978.2687498126634, + "Y": 378.00201501129538, + "IsEmpty": false + }, + "Timestamp": 637316493574084200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.426016629, + "Position": { + "X": 1978.4177112489442, + "Y": 377.99845558519024, + "IsEmpty": false + }, + "Timestamp": 637316493574596560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.429922938, + "Position": { + "X": 1978.9088771746588, + "Y": 377.99939816185412, + "IsEmpty": false + }, + "Timestamp": 637316493575943160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.447989613, + "Position": { + "X": 1979.5486180921364, + "Y": 377.99753006645898, + "IsEmpty": false + }, + "Timestamp": 637316493576621100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.463858992, + "Position": { + "X": 1980.8269320838963, + "Y": 377.9960462483632, + "IsEmpty": false + }, + "Timestamp": 637316493576788010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.489738315, + "Position": { + "X": 1982.7414515523838, + "Y": 377.9994743675407, + "IsEmpty": false + }, + "Timestamp": 637316493576952570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520988762, + "Position": { + "X": 1985.7747351600819, + "Y": 378.02185918114549, + "IsEmpty": false + }, + "Timestamp": 637316493577124390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562005043, + "Position": { + "X": 1989.4304494395383, + "Y": 378.07160027849272, + "IsEmpty": false + }, + "Timestamp": 637316493577290910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576653719, + "Position": { + "X": 1992.9203237393158, + "Y": 378.14685986539865, + "IsEmpty": false + }, + "Timestamp": 637316493577459900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592278957, + "Position": { + "X": 1996.5437558397223, + "Y": 378.24742715317899, + "IsEmpty": false + }, + "Timestamp": 637316493577637060, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "3a89b21d-8463-43ef-84cd-8420460aa441", + "Points": [ + { + "Pressure": 0.0280613415, + "Position": { + "X": 10.088405740570252, + "Y": 377.73358515519931, + "IsEmpty": false + }, + "Timestamp": 637316493786979700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.185778588, + "Position": { + "X": 8.8218188871757519, + "Y": 377.75672916695265, + "IsEmpty": false + }, + "Timestamp": 637316493787220420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.254871428, + "Position": { + "X": 8.1891587800833321, + "Y": 377.76947041010828, + "IsEmpty": false + }, + "Timestamp": 637316493787370830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.311024636, + "Position": { + "X": 5.6627899096039869, + "Y": 377.82826603969261, + "IsEmpty": false + }, + "Timestamp": 637316493787721860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.342275113, + "Position": { + "X": 4.5574758334319654, + "Y": 377.86133890205014, + "IsEmpty": false + }, + "Timestamp": 637316493787844740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.36156252, + "Position": { + "X": 3.9278890415702961, + "Y": 377.87938121795537, + "IsEmpty": false + }, + "Timestamp": 637316493788010930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.379140913, + "Position": { + "X": 3.2987419275522001, + "Y": 377.89821538732116, + "IsEmpty": false + }, + "Timestamp": 637316493788178100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.482169837, + "Position": { + "X": 5.1875001848290481, + "Y": 377.84408690781521, + "IsEmpty": false + }, + "Timestamp": 637316493788747650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498771638, + "Position": { + "X": 8.6668664731999456, + "Y": 377.75657142801458, + "IsEmpty": false + }, + "Timestamp": 637316493788868830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.516594172, + "Position": { + "X": 11.836744722806998, + "Y": 377.70354358116953, + "IsEmpty": false + }, + "Timestamp": 637316493789025660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.539787889, + "Position": { + "X": 17.898783839570527, + "Y": 377.64963169286261, + "IsEmpty": false + }, + "Timestamp": 637316493789193960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.551018536, + "Position": { + "X": 22.228429627695832, + "Y": 377.65442285265948, + "IsEmpty": false + }, + "Timestamp": 637316493789444110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566643775, + "Position": { + "X": 32.887547664316514, + "Y": 377.81012832279538, + "IsEmpty": false + }, + "Timestamp": 637316493789859650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 46.114827236577511, + "Y": 378.26840528868678, + "IsEmpty": false + }, + "Timestamp": 637316493790043080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570550084, + "Position": { + "X": 51.212948740263471, + "Y": 378.52001656557701, + "IsEmpty": false + }, + "Timestamp": 637316493790209670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 55.162326230362808, + "Y": 378.74466760264585, + "IsEmpty": false + }, + "Timestamp": 637316493790378520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573968112, + "Position": { + "X": 60.953889901558256, + "Y": 379.1131850754436, + "IsEmpty": false + }, + "Timestamp": 637316493790545580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573968112, + "Position": { + "X": 63.451380557388504, + "Y": 379.28536238620421, + "IsEmpty": false + }, + "Timestamp": 637316493790720380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573968112, + "Position": { + "X": 65.439925831023444, + "Y": 379.43143465021166, + "IsEmpty": false + }, + "Timestamp": 637316493790883450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 68.609072145139152, + "Y": 379.67250317953557, + "IsEmpty": false + }, + "Timestamp": 637316493791053000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 73.116048971190821, + "Y": 380.0407914892441, + "IsEmpty": false + }, + "Timestamp": 637316493791229060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 75.930780593941378, + "Y": 380.29071484899526, + "IsEmpty": false + }, + "Timestamp": 637316493791396270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 79.118350849905781, + "Y": 380.57901203126124, + "IsEmpty": false + }, + "Timestamp": 637316493791558380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 82.459726422188183, + "Y": 380.89964145501284, + "IsEmpty": false + }, + "Timestamp": 637316493791729270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 87.667378601555527, + "Y": 381.42454945103827, + "IsEmpty": false + }, + "Timestamp": 637316493791897400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 90.872785416455883, + "Y": 381.76327890171194, + "IsEmpty": false + }, + "Timestamp": 637316493792071710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 93.558163347136301, + "Y": 382.0604533804381, + "IsEmpty": false + }, + "Timestamp": 637316493792239110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 96.918114123343173, + "Y": 382.44502122769256, + "IsEmpty": false + }, + "Timestamp": 637316493792407330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 101.48127490525548, + "Y": 382.9850227220179, + "IsEmpty": false + }, + "Timestamp": 637316493792576810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 104.1753850555277, + "Y": 383.31831748734407, + "IsEmpty": false + }, + "Timestamp": 637316493792749980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 107.5454927406539, + "Y": 383.74749331539789, + "IsEmpty": false + }, + "Timestamp": 637316493792911700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 109.56877300482248, + "Y": 384.0116225510539, + "IsEmpty": false + }, + "Timestamp": 637316493793084830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 113.61780184578683, + "Y": 384.55459142917744, + "IsEmpty": false + }, + "Timestamp": 637316493793248980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 115.6434360339405, + "Y": 384.83334835498403, + "IsEmpty": false + }, + "Timestamp": 637316493793425580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 118.87666618905449, + "Y": 385.28251628913944, + "IsEmpty": false + }, + "Timestamp": 637316493793589740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 121.58017964581177, + "Y": 385.67160935538777, + "IsEmpty": false + }, + "Timestamp": 637316493793758630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 124.9608064791319, + "Y": 386.16964602938987, + "IsEmpty": false + }, + "Timestamp": 637316493793932360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 126.98973957359662, + "Y": 386.47461868983936, + "IsEmpty": false + }, + "Timestamp": 637316493794099380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 130.37203946844969, + "Y": 386.9930247955337, + "IsEmpty": false + }, + "Timestamp": 637316493794262950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 133.07839712981314, + "Y": 387.41674589565906, + "IsEmpty": false + }, + "Timestamp": 637316493794440970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 135.64284321940107, + "Y": 387.81912374553474, + "IsEmpty": false + }, + "Timestamp": 637316493794601960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 136.99643067271288, + "Y": 388.03760362740695, + "IsEmpty": false + }, + "Timestamp": 637316493794778580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 137.81519547797473, + "Y": 388.17718519885244, + "IsEmpty": false + }, + "Timestamp": 637316493794948710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 137.67323605189461, + "Y": 388.1475708805873, + "IsEmpty": false + }, + "Timestamp": 637316493795276290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 134.28930096154582, + "Y": 387.60259357491407, + "IsEmpty": false + }, + "Timestamp": 637316493795449600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 127.66613072764791, + "Y": 386.57729216192371, + "IsEmpty": false + }, + "Timestamp": 637316493795614610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573968112, + "Position": { + "X": 119.55245374585282, + "Y": 385.3790054057954, + "IsEmpty": false + }, + "Timestamp": 637316493795791840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572014928, + "Position": { + "X": 105.66895611990901, + "Y": 383.51170204872273, + "IsEmpty": false + }, + "Timestamp": 637316493795964340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.574456394, + "Position": { + "X": 95.573718192636932, + "Y": 382.28945817814127, + "IsEmpty": false + }, + "Timestamp": 637316493796122920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576653719, + "Position": { + "X": 84.987986687553132, + "Y": 381.14808701308402, + "IsEmpty": false + }, + "Timestamp": 637316493796332390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584466338, + "Position": { + "X": 74.597670883453944, + "Y": 380.17264714792822, + "IsEmpty": false + }, + "Timestamp": 637316493796458850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599603236, + "Position": { + "X": 60.292573331420343, + "Y": 379.06824662878057, + "IsEmpty": false + }, + "Timestamp": 637316493796628340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606683433, + "Position": { + "X": 51.870488798341157, + "Y": 378.55576766514815, + "IsEmpty": false + }, + "Timestamp": 637316493796796500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611566365, + "Position": { + "X": 43.649248657158779, + "Y": 378.16280271749224, + "IsEmpty": false + }, + "Timestamp": 637316493796968730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615472674, + "Position": { + "X": 36.132394709082334, + "Y": 377.89811563286935, + "IsEmpty": false + }, + "Timestamp": 637316493797140620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.621332109, + "Position": { + "X": 26.730833150862949, + "Y": 377.69838110853414, + "IsEmpty": false + }, + "Timestamp": 637316493797304950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 22.382307152664325, + "Y": 377.6582928984455, + "IsEmpty": false + }, + "Timestamp": 637316493797474170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 18.69229595598334, + "Y": 377.65151378677029, + "IsEmpty": false + }, + "Timestamp": 637316493797649330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 15.499793196337635, + "Y": 377.66326421938675, + "IsEmpty": false + }, + "Timestamp": 637316493797816460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625238419, + "Position": { + "X": 11.201935568800323, + "Y": 377.71259753109479, + "IsEmpty": false + }, + "Timestamp": 637316493797985120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627191603, + "Position": { + "X": 8.3441111940591384, + "Y": 377.76962814904641, + "IsEmpty": false + }, + "Timestamp": 637316493798149660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627191603, + "Position": { + "X": 5.8179599774533832, + "Y": 377.82762370346063, + "IsEmpty": false + }, + "Timestamp": 637316493798321870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627191603, + "Position": { + "X": 4.0831668095893292, + "Y": 377.87833642628379, + "IsEmpty": false + }, + "Timestamp": 637316493798491200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627191603, + "Position": { + "X": 2.1972131160939057, + "Y": 377.93661391644457, + "IsEmpty": false + }, + "Timestamp": 637316493798665280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627191603, + "Position": { + "X": 1.0976272629417139, + "Y": 377.9775887145812, + "IsEmpty": false + }, + "Timestamp": 637316493798836180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627191603, + "Position": { + "X": 0.62630667422325814, + "Y": 377.99814329868985, + "IsEmpty": false + }, + "Timestamp": 637316493799162660, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "bf2fceeb-c1e1-4614-a23a-d2488e6c3e20", + "Points": [ + { + "Pressure": 0.174059659, + "Position": { + "X": 2.4839663306681814, + "Y": 682.22575162787575, + "IsEmpty": false + }, + "Timestamp": 637316493816148220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.385244519, + "Position": { + "X": 3.3111595714000686, + "Y": 682.2271996761433, + "IsEmpty": false + }, + "Timestamp": 637316493817590000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.394766152, + "Position": { + "X": 5.7903417135365487, + "Y": 682.22491815665694, + "IsEmpty": false + }, + "Timestamp": 637316493817753430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.408194095, + "Position": { + "X": 9.0902942920174468, + "Y": 682.20649907471091, + "IsEmpty": false + }, + "Timestamp": 637316493817923700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.41820401, + "Position": { + "X": 13.206126537187401, + "Y": 682.15896176976344, + "IsEmpty": false + }, + "Timestamp": 637316493818097020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.429922938, + "Position": { + "X": 19.518860384183654, + "Y": 682.03715900733118, + "IsEmpty": false + }, + "Timestamp": 637316493818256830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.435782403, + "Position": { + "X": 24.425724089972078, + "Y": 681.89555155301514, + "IsEmpty": false + }, + "Timestamp": 637316493818427890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.435782403, + "Position": { + "X": 29.068420801089587, + "Y": 681.73023159582453, + "IsEmpty": false + }, + "Timestamp": 637316493818598470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.441641867, + "Position": { + "X": 33.382308817820103, + "Y": 681.53822005010443, + "IsEmpty": false + }, + "Timestamp": 637316493818767360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.449454486, + "Position": { + "X": 38.808449651814811, + "Y": 681.26417909888346, + "IsEmpty": false + }, + "Timestamp": 637316493818941150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.457267106, + "Position": { + "X": 42.041324917443241, + "Y": 681.07633146881858, + "IsEmpty": false + }, + "Timestamp": 637316493819109820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.465079725, + "Position": { + "X": 42.848454427122888, + "Y": 681.02686217900964, + "IsEmpty": false + }, + "Timestamp": 637316493819278090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.472892344, + "Position": { + "X": 43.655146646742153, + "Y": 680.97639437346447, + "IsEmpty": false + }, + "Timestamp": 637316493819441450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.478751808, + "Position": { + "X": 45.267216081060653, + "Y": 680.87247208952704, + "IsEmpty": false + }, + "Timestamp": 637316493819609190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498283356, + "Position": { + "X": 46.072591728390435, + "Y": 680.81902204831601, + "IsEmpty": false + }, + "Timestamp": 637316493819786680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.500236511, + "Position": { + "X": 44.461400792616388, + "Y": 680.92493027077342, + "IsEmpty": false + }, + "Timestamp": 637316493820457880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.502189696, + "Position": { + "X": 43.655146646742153, + "Y": 680.97639437346447, + "IsEmpty": false + }, + "Timestamp": 637316493820634200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.504142821, + "Position": { + "X": 41.233758901387816, + "Y": 681.12480002430107, + "IsEmpty": false + }, + "Timestamp": 637316493820794870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506096005, + "Position": { + "X": 35.81607008775606, + "Y": 681.41912928491638, + "IsEmpty": false + }, + "Timestamp": 637316493820969960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506096005, + "Position": { + "X": 31.757660107391672, + "Y": 681.61249557267251, + "IsEmpty": false + }, + "Timestamp": 637316493821130240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.50804913, + "Position": { + "X": 26.873505194101241, + "Y": 681.81055896414091, + "IsEmpty": false + }, + "Timestamp": 637316493821306420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510002315, + "Position": { + "X": 20.337712212206682, + "Y": 682.01620012253261, + "IsEmpty": false + }, + "Timestamp": 637316493821476990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51195544, + "Position": { + "X": 16.239314353349243, + "Y": 682.11035116315975, + "IsEmpty": false + }, + "Timestamp": 637316493821649470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513908625, + "Position": { + "X": 11.561013588636657, + "Y": 682.18122962194457, + "IsEmpty": false + }, + "Timestamp": 637316493821806610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513908625, + "Position": { + "X": 7.1867631602100346, + "Y": 682.22284549912365, + "IsEmpty": false + }, + "Timestamp": 637316493821978360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51586175, + "Position": { + "X": 1.6563747994008793, + "Y": 682.22319560457595, + "IsEmpty": false + }, + "Timestamp": 637316493822149140, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "9a6bbc92-bf2a-4be0-babb-fab919cc1db5", + "Points": [ + { + "Pressure": 0.0764019191, + "Position": { + "X": 18.707249897758516, + "Y": 682.29917190123251, + "IsEmpty": false + }, + "Timestamp": 637316493835461310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.112535283, + "Position": { + "X": 17.887083179162957, + "Y": 682.31809774510089, + "IsEmpty": false + }, + "Timestamp": 637316493835681470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.261219203, + "Position": { + "X": 17.066501458703698, + "Y": 682.33595590429741, + "IsEmpty": false + }, + "Timestamp": 637316493835830620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.311512917, + "Position": { + "X": 16.245505517298966, + "Y": 682.35274415774302, + "IsEmpty": false + }, + "Timestamp": 637316493836001520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.345449001, + "Position": { + "X": 14.858772872900943, + "Y": 682.37482137996994, + "IsEmpty": false + }, + "Timestamp": 637316493836178640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.509758115, + "Position": { + "X": 14.602274095326706, + "Y": 682.38310206306687, + "IsEmpty": false + }, + "Timestamp": 637316493836349340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.516350031, + "Position": { + "X": 16.501591494613095, + "Y": 682.34374824337885, + "IsEmpty": false + }, + "Timestamp": 637316493837183540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 21.165252233179004, + "Y": 682.23601047238208, + "IsEmpty": false + }, + "Timestamp": 637316493837352420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543938339, + "Position": { + "X": 26.885920179169744, + "Y": 682.05167944290588, + "IsEmpty": false + }, + "Timestamp": 637316493837530720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 34.21052857555317, + "Y": 681.73967481475529, + "IsEmpty": false + }, + "Timestamp": 637316493837689260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587884307, + "Position": { + "X": 46.8971846464256, + "Y": 681.00307279097274, + "IsEmpty": false + }, + "Timestamp": 637316493837866130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.60155642, + "Position": { + "X": 54.92628555940577, + "Y": 680.40341416800118, + "IsEmpty": false + }, + "Timestamp": 637316493838030050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608392477, + "Position": { + "X": 62.91030344206952, + "Y": 679.70712937526639, + "IsEmpty": false + }, + "Timestamp": 637316493838204810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620111406, + "Position": { + "X": 74.558902852067845, + "Y": 678.51883841544691, + "IsEmpty": false + }, + "Timestamp": 637316493838366350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624994278, + "Position": { + "X": 81.644068293793524, + "Y": 677.69025819710191, + "IsEmpty": false + }, + "Timestamp": 637316493838546300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627191603, + "Position": { + "X": 87.909555266578039, + "Y": 676.89307066958645, + "IsEmpty": false + }, + "Timestamp": 637316493838704420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631097913, + "Position": { + "X": 93.908050235016077, + "Y": 676.079494089729, + "IsEmpty": false + }, + "Timestamp": 637316493838875060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631097913, + "Position": { + "X": 103.43700825062305, + "Y": 674.65794700830145, + "IsEmpty": false + }, + "Timestamp": 637316493839051880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633051038, + "Position": { + "X": 109.36071521940363, + "Y": 673.71511937909031, + "IsEmpty": false + }, + "Timestamp": 637316493839219870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633051038, + "Position": { + "X": 115.48553668301301, + "Y": 672.67739914970082, + "IsEmpty": false + }, + "Timestamp": 637316493839381420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635004222, + "Position": { + "X": 120.81791252767665, + "Y": 671.72764326042761, + "IsEmpty": false + }, + "Timestamp": 637316493839552440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635004222, + "Position": { + "X": 129.14607214775705, + "Y": 670.15834553584364, + "IsEmpty": false + }, + "Timestamp": 637316493839718670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635004222, + "Position": { + "X": 133.66196489223782, + "Y": 669.26369506397987, + "IsEmpty": false + }, + "Timestamp": 637316493839894460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635004222, + "Position": { + "X": 137.41063285434009, + "Y": 668.49774950776532, + "IsEmpty": false + }, + "Timestamp": 637316493840059740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635004222, + "Position": { + "X": 140.39995629230248, + "Y": 667.87183794410157, + "IsEmpty": false + }, + "Timestamp": 637316493840234900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635004222, + "Position": { + "X": 143.3806825361755, + "Y": 667.23438693639241, + "IsEmpty": false + }, + "Timestamp": 637316493840404500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635004222, + "Position": { + "X": 145.08920914691097, + "Y": 666.85436737838938, + "IsEmpty": false + }, + "Timestamp": 637316493840572640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 147.83554283449831, + "Y": 666.25688491826622, + "IsEmpty": false + }, + "Timestamp": 637316493840732770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 150.05562421956733, + "Y": 665.75866736435603, + "IsEmpty": false + }, + "Timestamp": 637316493840907630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 153.00806441673919, + "Y": 665.08469488029959, + "IsEmpty": false + }, + "Timestamp": 637316493841069380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 155.95169501003048, + "Y": 664.39978708561318, + "IsEmpty": false + }, + "Timestamp": 637316493841240180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 157.63781185206454, + "Y": 663.99236306859962, + "IsEmpty": false + }, + "Timestamp": 637316493841408510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 159.61876860664867, + "Y": 663.5284911168585, + "IsEmpty": false + }, + "Timestamp": 637316493841585390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 164.00084659173544, + "Y": 662.46106596842856, + "IsEmpty": false + }, + "Timestamp": 637316493841753280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 166.91099604701583, + "Y": 661.73641677375804, + "IsEmpty": false + }, + "Timestamp": 637316493841920170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 169.30170997460252, + "Y": 661.12179917678395, + "IsEmpty": false + }, + "Timestamp": 637316493842084860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 172.19509448213736, + "Y": 660.37844896983552, + "IsEmpty": false + }, + "Timestamp": 637316493842251600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 177.23650388488176, + "Y": 659.05361057373716, + "IsEmpty": false + }, + "Timestamp": 637316493842437270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 180.82023228891273, + "Y": 658.08897057202671, + "IsEmpty": false + }, + "Timestamp": 637316493842615700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 184.38945146933168, + "Y": 657.109372838436, + "IsEmpty": false + }, + "Timestamp": 637316493842766880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 187.02592733697151, + "Y": 656.38454988178728, + "IsEmpty": false + }, + "Timestamp": 637316493842931410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 188.65322486903719, + "Y": 655.91450226190318, + "IsEmpty": false + }, + "Timestamp": 637316493843104400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 190.06977932636423, + "Y": 655.51159735894612, + "IsEmpty": false + }, + "Timestamp": 637316493843276320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 189.36179696768306, + "Y": 655.7133356385898, + "IsEmpty": false + }, + "Timestamp": 637316493844111690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 187.94406381134507, + "Y": 656.11509500780744, + "IsEmpty": false + }, + "Timestamp": 637316493844279680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 183.67677305664697, + "Y": 657.30647567723213, + "IsEmpty": false + }, + "Timestamp": 637316493844456600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645258248, + "Position": { + "X": 177.95440561806677, + "Y": 658.86189251841802, + "IsEmpty": false + }, + "Timestamp": 637316493844623340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65014112, + "Position": { + "X": 167.12570618110291, + "Y": 661.67266421715397, + "IsEmpty": false + }, + "Timestamp": 637316493844789070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655024052, + "Position": { + "X": 155.21661599528562, + "Y": 664.57203144588084, + "IsEmpty": false + }, + "Timestamp": 637316493844962960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664789796, + "Position": { + "X": 133.13557537967029, + "Y": 669.36152842526781, + "IsEmpty": false + }, + "Timestamp": 637316493845132270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674067318, + "Position": { + "X": 118.00324868078917, + "Y": 672.2270490346425, + "IsEmpty": false + }, + "Timestamp": 637316493845305410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 103.43700825062305, + "Y": 674.65794700830145, + "IsEmpty": false + }, + "Timestamp": 637316493845463790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 91.809795114667025, + "Y": 676.36636028109092, + "IsEmpty": false + }, + "Timestamp": 637316493845633370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 77.71260170497996, + "Y": 678.15959910764786, + "IsEmpty": false + }, + "Timestamp": 637316493845807500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 71.397679847840223, + "Y": 678.86349402122028, + "IsEmpty": false + }, + "Timestamp": 637316493845976360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71117723, + "Position": { + "X": 67.435646394307156, + "Y": 679.27358864228722, + "IsEmpty": false + }, + "Timestamp": 637316493846139150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71532768, + "Position": { + "X": 65.052861300535625, + "Y": 679.50848553053459, + "IsEmpty": false + }, + "Timestamp": 637316493846315420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.294666976, + "Position": { + "X": 64.501628334149643, + "Y": 679.55647273127636, + "IsEmpty": false + }, + "Timestamp": 637316493846487270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.294666976, + "Position": { + "X": 65.052861300535625, + "Y": 679.50848553053459, + "IsEmpty": false + }, + "Timestamp": 637316493846702900, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "53a56ff5-b072-4d83-b7c4-e46f69f5594c", + "Points": [ + { + "Pressure": 0.0917830169, + "Position": { + "X": 130.17887106793759, + "Y": 390.86178802822775, + "IsEmpty": false + }, + "Timestamp": 637316493870193400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.15819028, + "Position": { + "X": 130.17887106793759, + "Y": 387.41562125060466, + "IsEmpty": false + }, + "Timestamp": 637316493870479600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.266834527, + "Position": { + "X": 130.17887106793759, + "Y": 385.69256971941854, + "IsEmpty": false + }, + "Timestamp": 637316493870642390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.327626467, + "Position": { + "X": 130.17887106793759, + "Y": 384.54384746021083, + "IsEmpty": false + }, + "Timestamp": 637316493870822160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.372549027, + "Position": { + "X": 130.17887106793759, + "Y": 384.05151971619296, + "IsEmpty": false + }, + "Timestamp": 637316493870979220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.408926517, + "Position": { + "X": 130.17887106793759, + "Y": 383.47719044421461, + "IsEmpty": false + }, + "Timestamp": 637316493871146090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.549309552, + "Position": { + "X": 130.17887106793759, + "Y": 384.13358495940446, + "IsEmpty": false + }, + "Timestamp": 637316493871831160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594720364, + "Position": { + "X": 130.17887106793759, + "Y": 384.7899794745943, + "IsEmpty": false + }, + "Timestamp": 637316493872000430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619134784, + "Position": { + "X": 130.17887106793759, + "Y": 385.77457124737907, + "IsEmpty": false + }, + "Timestamp": 637316493872166400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635492504, + "Position": { + "X": 130.17887106793759, + "Y": 386.26689899139694, + "IsEmpty": false + }, + "Timestamp": 637316493872332690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 130.17887106793759, + "Y": 386.92329350658679, + "IsEmpty": false + }, + "Timestamp": 637316493872505920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672358274, + "Position": { + "X": 130.17887106793759, + "Y": 387.4976864938161, + "IsEmpty": false + }, + "Timestamp": 637316493872675360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6828565, + "Position": { + "X": 130.17887106793759, + "Y": 388.15408100900595, + "IsEmpty": false + }, + "Timestamp": 637316493872844410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691401541, + "Position": { + "X": 130.17887106793759, + "Y": 388.81047552419579, + "IsEmpty": false + }, + "Timestamp": 637316493873010350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699946582, + "Position": { + "X": 130.17887106793759, + "Y": 389.22073802500216, + "IsEmpty": false + }, + "Timestamp": 637316493873516510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 130.17887106793759, + "Y": 388.48227826660087, + "IsEmpty": false + }, + "Timestamp": 637316493874026820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 130.17887106793759, + "Y": 386.26689899139694, + "IsEmpty": false + }, + "Timestamp": 637316493874192820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 130.17887106793759, + "Y": 384.13358495940446, + "IsEmpty": false + }, + "Timestamp": 637316493874359160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 130.17887106793759, + "Y": 382.73873068581327, + "IsEmpty": false + }, + "Timestamp": 637316493874537070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 130.17887106793759, + "Y": 381.09768068258774, + "IsEmpty": false + }, + "Timestamp": 637316493874706280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 130.17887106793759, + "Y": 383.31305995779167, + "IsEmpty": false + }, + "Timestamp": 637316493875549530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 130.17887106793759, + "Y": 385.28230721861217, + "IsEmpty": false + }, + "Timestamp": 637316493875711980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 130.17887106793759, + "Y": 388.97460601061874, + "IsEmpty": false + }, + "Timestamp": 637316493875880270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 130.17887106793759, + "Y": 395.45661334980764, + "IsEmpty": false + }, + "Timestamp": 637316493876059760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 130.17887106793759, + "Y": 400.62583165861685, + "IsEmpty": false + }, + "Timestamp": 637316493876223980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 130.17887106793759, + "Y": 406.77964174021082, + "IsEmpty": false + }, + "Timestamp": 637316493876396140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710444808, + "Position": { + "X": 130.17887106793759, + "Y": 413.26171279465063, + "IsEmpty": false + }, + "Timestamp": 637316493876566090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 130.17887106793759, + "Y": 423.76421618344102, + "IsEmpty": false + }, + "Timestamp": 637316493876734790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 130.17887106793759, + "Y": 431.88727352585551, + "IsEmpty": false + }, + "Timestamp": 637316493876905080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 130.17887106793759, + "Y": 440.42059336907636, + "IsEmpty": false + }, + "Timestamp": 637316493877071160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 130.17887106793759, + "Y": 448.29745498185645, + "IsEmpty": false + }, + "Timestamp": 637316493877233070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 130.17887106793759, + "Y": 458.30769434187988, + "IsEmpty": false + }, + "Timestamp": 637316493877410000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 130.17887106793759, + "Y": 464.46150442347385, + "IsEmpty": false + }, + "Timestamp": 637316493877569250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 130.17887106793759, + "Y": 470.8615739499532, + "IsEmpty": false + }, + "Timestamp": 637316493877739440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 130.17887106793759, + "Y": 477.34358128914209, + "IsEmpty": false + }, + "Timestamp": 637316493877906260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 130.17887106793759, + "Y": 486.53323193230187, + "IsEmpty": false + }, + "Timestamp": 637316493878087560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 130.17887106793759, + "Y": 492.11277645716837, + "IsEmpty": false + }, + "Timestamp": 637316493878254450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 130.17887106793759, + "Y": 497.19992952276613, + "IsEmpty": false + }, + "Timestamp": 637316493878412790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 130.17887106793759, + "Y": 501.79469112909504, + "IsEmpty": false + }, + "Timestamp": 637316493878584280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 130.17887106793759, + "Y": 508.11269541236288, + "IsEmpty": false + }, + "Timestamp": 637316493878757200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 130.17887106793759, + "Y": 511.88705944758095, + "IsEmpty": false + }, + "Timestamp": 637316493878932070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 130.17887106793759, + "Y": 515.66142348279902, + "IsEmpty": false + }, + "Timestamp": 637316493879094330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 130.17887106793759, + "Y": 519.76392106036099, + "IsEmpty": false + }, + "Timestamp": 637316493879268340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 525.99986010041744, + "IsEmpty": false + }, + "Timestamp": 637316493879431350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 530.02029243476795, + "IsEmpty": false + }, + "Timestamp": 637316493879606570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 533.87672171319741, + "IsEmpty": false + }, + "Timestamp": 637316493879768510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 537.89715404754804, + "IsEmpty": false + }, + "Timestamp": 637316493879944710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 544.13309308760449, + "IsEmpty": false + }, + "Timestamp": 637316493880105470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 548.0715876092454, + "IsEmpty": false + }, + "Timestamp": 637316493880281850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 551.92788945717302, + "IsEmpty": false + }, + "Timestamp": 637316493880442800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 555.45618519325853, + "IsEmpty": false + }, + "Timestamp": 637316493880621260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 560.70734131477741, + "IsEmpty": false + }, + "Timestamp": 637316493880783260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 564.15357180765147, + "IsEmpty": false + }, + "Timestamp": 637316493880950320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721187174, + "Position": { + "X": 130.17887106793759, + "Y": 567.68174011323504, + "IsEmpty": false + }, + "Timestamp": 637316493881133090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 571.45610414845305, + "IsEmpty": false + }, + "Timestamp": 637316493881299220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 576.54325721405087, + "IsEmpty": false + }, + "Timestamp": 637316493881456560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 578.75863648925474, + "IsEmpty": false + }, + "Timestamp": 637316493881645190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 581.63041027964857, + "IsEmpty": false + }, + "Timestamp": 637316493881796400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 584.6663145564653, + "IsEmpty": false + }, + "Timestamp": 637316493881967470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 588.68674689081581, + "IsEmpty": false + }, + "Timestamp": 637316493882130880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 590.73812311009874, + "IsEmpty": false + }, + "Timestamp": 637316493882298370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 593.28163592764668, + "IsEmpty": false + }, + "Timestamp": 637316493882468280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 596.07134447482895, + "IsEmpty": false + }, + "Timestamp": 637316493882641950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 599.43550972449157, + "IsEmpty": false + }, + "Timestamp": 637316493882811420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 601.732954242907, + "IsEmpty": false + }, + "Timestamp": 637316493882977670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 603.53800730205364, + "IsEmpty": false + }, + "Timestamp": 637316493883148260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 606.32771584923591, + "IsEmpty": false + }, + "Timestamp": 637316493883318000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 611.08673537248967, + "IsEmpty": false + }, + "Timestamp": 637316493883486750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 614.45077319165046, + "IsEmpty": false + }, + "Timestamp": 637316493883662160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 617.89700368452441, + "IsEmpty": false + }, + "Timestamp": 637316493883823700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 620.85084271812968, + "IsEmpty": false + }, + "Timestamp": 637316493883989860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 623.72261650852352, + "IsEmpty": false + }, + "Timestamp": 637316493884158940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 626.26612932607145, + "IsEmpty": false + }, + "Timestamp": 637316493884333960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 628.15337505893137, + "IsEmpty": false + }, + "Timestamp": 637316493884497310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 629.95842811807802, + "IsEmpty": false + }, + "Timestamp": 637316493884666710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 632.66619885255079, + "IsEmpty": false + }, + "Timestamp": 637316493884837800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 635.04558118367572, + "IsEmpty": false + }, + "Timestamp": 637316493885015500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 636.8507616733242, + "IsEmpty": false + }, + "Timestamp": 637316493885182180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 639.23027143495108, + "IsEmpty": false + }, + "Timestamp": 637316493885342400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 643.00450803966726, + "IsEmpty": false + }, + "Timestamp": 637316493885519520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 644.80968852931574, + "IsEmpty": false + }, + "Timestamp": 637316493885688860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 646.04041231648398, + "IsEmpty": false + }, + "Timestamp": 637316493885860530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 647.02506780451972, + "IsEmpty": false + }, + "Timestamp": 637316493886025520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 648.91218610687781, + "IsEmpty": false + }, + "Timestamp": 637316493886198140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 650.5532361101034, + "IsEmpty": false + }, + "Timestamp": 637316493886357730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 651.70202208456203, + "IsEmpty": false + }, + "Timestamp": 637316493886526560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 652.19428611332887, + "IsEmpty": false + }, + "Timestamp": 637316493886702790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 652.68655014209583, + "IsEmpty": false + }, + "Timestamp": 637316493886871570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 653.9174013597659, + "IsEmpty": false + }, + "Timestamp": 637316493887041820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 654.57379587495575, + "IsEmpty": false + }, + "Timestamp": 637316493887203320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 655.88658490533544, + "IsEmpty": false + }, + "Timestamp": 637316493887371490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 657.69163796448208, + "IsEmpty": false + }, + "Timestamp": 637316493887542210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 658.92248918215216, + "IsEmpty": false + }, + "Timestamp": 637316493887710150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 660.07114772610896, + "IsEmpty": false + }, + "Timestamp": 637316493887885000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 660.4814739421663, + "IsEmpty": false + }, + "Timestamp": 637316493888047720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 662.28652700131295, + "IsEmpty": false + }, + "Timestamp": 637316493888223580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 664.17377273417287, + "IsEmpty": false + }, + "Timestamp": 637316493888385110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 665.89676055010807, + "IsEmpty": false + }, + "Timestamp": 637316493888559590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 667.20967701098959, + "IsEmpty": false + }, + "Timestamp": 637316493888740060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 130.17887106793759, + "Y": 666.38915200937686, + "IsEmpty": false + }, + "Timestamp": 637316493889577990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718013287, + "Position": { + "X": 130.17887106793759, + "Y": 665.65069225097557, + "IsEmpty": false + }, + "Timestamp": 637316493889752930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.29222554, + "Position": { + "X": 130.17887106793759, + "Y": 662.77891846058174, + "IsEmpty": false + }, + "Timestamp": 637316493889892800, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "b68d616c-c645-435d-9dac-c4eac89de7be", + "Points": [ + { + "Pressure": 0.0458838791, + "Position": { + "X": 909.47940153410457, + "Y": 398.79674564954087, + "IsEmpty": false + }, + "Timestamp": 637316495255099870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.60155642, + "Position": { + "X": 909.63712858488577, + "Y": 398.57667729016583, + "IsEmpty": false + }, + "Timestamp": 637316495256109160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648187995, + "Position": { + "X": 909.82641081144834, + "Y": 398.32516361829084, + "IsEmpty": false + }, + "Timestamp": 637316495256290680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691401541, + "Position": { + "X": 909.9525826864483, + "Y": 397.75924564954084, + "IsEmpty": false + }, + "Timestamp": 637316495256452010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 909.9525826864483, + "Y": 397.06757084485332, + "IsEmpty": false + }, + "Timestamp": 637316495256630420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 909.92103971769825, + "Y": 396.65885502454086, + "IsEmpty": false + }, + "Timestamp": 637316495256808390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750972748, + "Position": { + "X": 909.79485563566709, + "Y": 396.43876225110336, + "IsEmpty": false + }, + "Timestamp": 637316495256956250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758052945, + "Position": { + "X": 909.66867155363582, + "Y": 396.09293705579086, + "IsEmpty": false + }, + "Timestamp": 637316495257124000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 909.32167448332325, + "Y": 395.84139896985334, + "IsEmpty": false + }, + "Timestamp": 637316495257297050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76806289, + "Position": { + "X": 908.9115792684795, + "Y": 395.77853275891584, + "IsEmpty": false + }, + "Timestamp": 637316495257469050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770504296, + "Position": { + "X": 908.3122140341045, + "Y": 395.90428959485337, + "IsEmpty": false + }, + "Timestamp": 637316495257639350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770504296, + "Position": { + "X": 907.3342965536358, + "Y": 396.50165287610332, + "IsEmpty": false + }, + "Timestamp": 637316495257801110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.77245748, + "Position": { + "X": 906.54564909269834, + "Y": 397.25619389172834, + "IsEmpty": false + }, + "Timestamp": 637316495257973440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774410605, + "Position": { + "X": 905.66237272551075, + "Y": 398.26227299329082, + "IsEmpty": false + }, + "Timestamp": 637316495258136980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776607931, + "Position": { + "X": 904.6529000692608, + "Y": 399.36266361829087, + "IsEmpty": false + }, + "Timestamp": 637316495258306250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.782711506, + "Position": { + "X": 903.64343962004205, + "Y": 400.74603764172832, + "IsEmpty": false + }, + "Timestamp": 637316495258474310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786861956, + "Position": { + "X": 903.35952848722957, + "Y": 401.15475346204084, + "IsEmpty": false + }, + "Timestamp": 637316495258651970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.792233169, + "Position": { + "X": 903.26488737394834, + "Y": 401.37482182141582, + "IsEmpty": false + }, + "Timestamp": 637316495258812020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797360182, + "Position": { + "X": 903.2333444051983, + "Y": 401.90929447766587, + "IsEmpty": false + }, + "Timestamp": 637316495258982660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811520576, + "Position": { + "X": 903.42261442472955, + "Y": 402.66385990735336, + "IsEmpty": false + }, + "Timestamp": 637316495259154740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.816159308, + "Position": { + "X": 903.58035368254207, + "Y": 403.16688725110333, + "IsEmpty": false + }, + "Timestamp": 637316495259331590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.82104218, + "Position": { + "X": 903.8327096395733, + "Y": 403.57560307141586, + "IsEmpty": false + }, + "Timestamp": 637316495259489060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.826413393, + "Position": { + "X": 904.14817594816702, + "Y": 403.89000736829087, + "IsEmpty": false + }, + "Timestamp": 637316495259659460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8371557, + "Position": { + "X": 905.0314523153545, + "Y": 404.17296635266587, + "IsEmpty": false + }, + "Timestamp": 637316495259831750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.841062009, + "Position": { + "X": 905.50463346769834, + "Y": 404.26730229016584, + "IsEmpty": false + }, + "Timestamp": 637316495260003380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.846921504, + "Position": { + "X": 906.26173795988575, + "Y": 404.23585697766583, + "IsEmpty": false + }, + "Timestamp": 637316495260171380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.854734123, + "Position": { + "X": 907.39738249113577, + "Y": 404.14152104016586, + "IsEmpty": false + }, + "Timestamp": 637316495260340450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.866453052, + "Position": { + "X": 908.50148405363575, + "Y": 404.14152104016586, + "IsEmpty": false + }, + "Timestamp": 637316495260501810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.874265671, + "Position": { + "X": 909.22703337004202, + "Y": 404.26730229016584, + "IsEmpty": false + }, + "Timestamp": 637316495260680630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.881101727, + "Position": { + "X": 909.9525826864483, + "Y": 404.45592533704087, + "IsEmpty": false + }, + "Timestamp": 637316495260849340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.885008037, + "Position": { + "X": 910.80432829191705, + "Y": 404.92753178235336, + "IsEmpty": false + }, + "Timestamp": 637316495261012370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.888914347, + "Position": { + "X": 912.03460172941709, + "Y": 405.65065189954083, + "IsEmpty": false + }, + "Timestamp": 637316495261182360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.888914347, + "Position": { + "X": 912.85479215910459, + "Y": 407.00255619641587, + "IsEmpty": false + }, + "Timestamp": 637316495261356470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.888914347, + "Position": { + "X": 912.88634733488584, + "Y": 408.35448490735337, + "IsEmpty": false + }, + "Timestamp": 637316495261524210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.888914347, + "Position": { + "X": 913.20180143644825, + "Y": 409.95790287610333, + "IsEmpty": false + }, + "Timestamp": 637316495261685560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.888914347, + "Position": { + "X": 913.07561735441709, + "Y": 412.03292729016584, + "IsEmpty": false + }, + "Timestamp": 637316495261857770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.888914347, + "Position": { + "X": 912.47625212004209, + "Y": 413.10189701672834, + "IsEmpty": false + }, + "Timestamp": 637316495262032730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.888914347, + "Position": { + "X": 911.93997282316707, + "Y": 413.69926029797836, + "IsEmpty": false + }, + "Timestamp": 637316495262199540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.888914347, + "Position": { + "X": 911.08823942472952, + "Y": 414.35948979016587, + "IsEmpty": false + }, + "Timestamp": 637316495262363940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.886961162, + "Position": { + "X": 909.38476042082334, + "Y": 414.73676029797832, + "IsEmpty": false + }, + "Timestamp": 637316495262532230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.886961162, + "Position": { + "X": 908.02830290129202, + "Y": 414.57955814954084, + "IsEmpty": false + }, + "Timestamp": 637316495262707300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.886961162, + "Position": { + "X": 906.76647428801084, + "Y": 414.32804447766586, + "IsEmpty": false + }, + "Timestamp": 637316495262872420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.886961162, + "Position": { + "X": 905.59927458097957, + "Y": 414.29659916516584, + "IsEmpty": false + }, + "Timestamp": 637316495263040800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.886961162, + "Position": { + "X": 904.30590299894834, + "Y": 414.42235600110337, + "IsEmpty": false + }, + "Timestamp": 637316495263207010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.886961162, + "Position": { + "X": 903.80116667082325, + "Y": 414.48524662610333, + "IsEmpty": false + }, + "Timestamp": 637316495263380020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.707759202, + "Position": { + "X": 903.58035368254207, + "Y": 414.51669193860334, + "IsEmpty": false + }, + "Timestamp": 637316495263720060, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "64b8ca69-dc81-400f-9bd9-9de3857a3efc", + "Points": [ + { + "Pressure": 0.244373232, + "Position": { + "X": 918.94312223722955, + "Y": 397.79066654797833, + "IsEmpty": false + }, + "Timestamp": 637316495268361950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.331044465, + "Position": { + "X": 918.9115792684795, + "Y": 397.35052982922832, + "IsEmpty": false + }, + "Timestamp": 637316495268622900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.425772488, + "Position": { + "X": 918.84849333097952, + "Y": 397.13043705579082, + "IsEmpty": false + }, + "Timestamp": 637316495268790340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641107798, + "Position": { + "X": 918.72230924894825, + "Y": 396.97323490735334, + "IsEmpty": false + }, + "Timestamp": 637316495269127410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.68676281, + "Position": { + "X": 918.62766813566702, + "Y": 397.69635502454082, + "IsEmpty": false + }, + "Timestamp": 637316495269459520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718989849, + "Position": { + "X": 918.62766813566702, + "Y": 398.45092045422837, + "IsEmpty": false + }, + "Timestamp": 637316495269628360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746089876, + "Position": { + "X": 918.78539518644834, + "Y": 399.55131107922836, + "IsEmpty": false + }, + "Timestamp": 637316495269799880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.775875509, + "Position": { + "X": 918.9115792684795, + "Y": 400.99755131360337, + "IsEmpty": false + }, + "Timestamp": 637316495269964540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789059281, + "Position": { + "X": 919.06930631926082, + "Y": 402.25514408704083, + "IsEmpty": false + }, + "Timestamp": 637316495270134720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.798092604, + "Position": { + "X": 919.132404463792, + "Y": 403.60704838391587, + "IsEmpty": false + }, + "Timestamp": 637316495270301730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802975535, + "Position": { + "X": 919.38476042082334, + "Y": 404.99039799329086, + "IsEmpty": false + }, + "Timestamp": 637316495270473500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809811532, + "Position": { + "X": 919.66867155363582, + "Y": 407.63136479016583, + "IsEmpty": false + }, + "Timestamp": 637316495270643320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811764717, + "Position": { + "X": 919.76331266691705, + "Y": 409.45487553235336, + "IsEmpty": false + }, + "Timestamp": 637316495270808890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811764717, + "Position": { + "X": 919.76331266691705, + "Y": 410.90109135266584, + "IsEmpty": false + }, + "Timestamp": 637316495270976510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811764717, + "Position": { + "X": 919.82641081144834, + "Y": 411.68710209485334, + "IsEmpty": false + }, + "Timestamp": 637316495271147820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813717842, + "Position": { + "X": 919.85795378019827, + "Y": 412.22157475110333, + "IsEmpty": false + }, + "Timestamp": 637316495271321570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813717842, + "Position": { + "X": 919.92103971769825, + "Y": 412.47308842297832, + "IsEmpty": false + }, + "Timestamp": 637316495271493180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.386465251, + "Position": { + "X": 920.04722379972952, + "Y": 412.19012943860332, + "IsEmpty": false + }, + "Timestamp": 637316495271970380, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8c8650e6-8386-41f6-9a98-f0219b51f8a9", + "Points": [ + { + "Pressure": 0.030502785, + "Position": { + "X": 919.9525826864483, + "Y": 406.27943607922833, + "IsEmpty": false + }, + "Timestamp": 637316495274145050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.539055467, + "Position": { + "X": 919.92103971769825, + "Y": 406.05936771985336, + "IsEmpty": false + }, + "Timestamp": 637316495274696280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622064531, + "Position": { + "X": 920.14186491301075, + "Y": 405.61920658704082, + "IsEmpty": false + }, + "Timestamp": 637316495274863270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677729428, + "Position": { + "X": 920.52041715910457, + "Y": 404.80177494641583, + "IsEmpty": false + }, + "Timestamp": 637316495275059090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71532768, + "Position": { + "X": 921.1513253622295, + "Y": 403.79569584485336, + "IsEmpty": false + }, + "Timestamp": 637316495275202800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756832242, + "Position": { + "X": 923.35952848722957, + "Y": 401.06041752454087, + "IsEmpty": false + }, + "Timestamp": 637316495275372030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.777340353, + "Position": { + "X": 925.09453825285459, + "Y": 398.45092045422837, + "IsEmpty": false + }, + "Timestamp": 637316495275540240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 926.48255094816705, + "Y": 396.43876225110336, + "IsEmpty": false + }, + "Timestamp": 637316495275716750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802731335, + "Position": { + "X": 927.1134713583233, + "Y": 395.33837162610337, + "IsEmpty": false + }, + "Timestamp": 637316495275879030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.807614267, + "Position": { + "X": 927.492023604417, + "Y": 395.05541264172837, + "IsEmpty": false + }, + "Timestamp": 637316495276056380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.419180602, + "Position": { + "X": 927.46046842863575, + "Y": 395.93573490735332, + "IsEmpty": false + }, + "Timestamp": 637316495276361730, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "ef8689b0-105c-460b-8c2c-90b0aa49f88b", + "Points": [ + { + "Pressure": 0.501701355, + "Position": { + "X": 923.07561735441709, + "Y": 403.44984623547833, + "IsEmpty": false + }, + "Timestamp": 637316495278622310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625238419, + "Position": { + "X": 923.80116667082325, + "Y": 403.60704838391587, + "IsEmpty": false + }, + "Timestamp": 637316495278801850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679438472, + "Position": { + "X": 924.46363004972955, + "Y": 404.04720951672834, + "IsEmpty": false + }, + "Timestamp": 637316495278919330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 925.18917936613582, + "Y": 404.70743900891586, + "IsEmpty": false + }, + "Timestamp": 637316495279090330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752437651, + "Position": { + "X": 927.05038542082332, + "Y": 405.87072025891587, + "IsEmpty": false + }, + "Timestamp": 637316495279257830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.777584493, + "Position": { + "X": 930.83587126066709, + "Y": 408.41735111829087, + "IsEmpty": false + }, + "Timestamp": 637316495279426660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791012406, + "Position": { + "X": 932.88634733488584, + "Y": 410.20941654797832, + "IsEmpty": false + }, + "Timestamp": 637316495279594850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794918716, + "Position": { + "X": 934.02199186613575, + "Y": 411.37269779797833, + "IsEmpty": false + }, + "Timestamp": 637316495279765840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.321522862, + "Position": { + "X": 934.30590299894834, + "Y": 411.71854740735336, + "IsEmpty": false + }, + "Timestamp": 637316495279937020, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "62fff554-3fce-4ea5-abc8-5df43a86731e", + "Points": [ + { + "Pressure": 0.268299371, + "Position": { + "X": 935.4730904989483, + "Y": 394.99252201672834, + "IsEmpty": false + }, + "Timestamp": 637316495283033220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.423331052, + "Position": { + "X": 935.4730904989483, + "Y": 395.46412846204083, + "IsEmpty": false + }, + "Timestamp": 637316495283143020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.553704143, + "Position": { + "X": 935.53618864347959, + "Y": 397.09899174329087, + "IsEmpty": false + }, + "Timestamp": 637316495283314150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612542927, + "Position": { + "X": 935.6939156942608, + "Y": 398.63954350110333, + "IsEmpty": false + }, + "Timestamp": 637316495283485230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657953739, + "Position": { + "X": 935.78854460051082, + "Y": 400.68314701672836, + "IsEmpty": false + }, + "Timestamp": 637316495283652600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6828565, + "Position": { + "X": 935.88318571379205, + "Y": 402.91537357922834, + "IsEmpty": false + }, + "Timestamp": 637316495283821920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696284413, + "Position": { + "X": 936.16709684660452, + "Y": 405.21049076672836, + "IsEmpty": false + }, + "Timestamp": 637316495283993090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 936.86110319426075, + "Y": 408.29159428235334, + "IsEmpty": false + }, + "Timestamp": 637316495284172930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 937.1134713583233, + "Y": 409.64349857922832, + "IsEmpty": false + }, + "Timestamp": 637316495284339310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705317795, + "Position": { + "X": 937.1134713583233, + "Y": 409.89503666516583, + "IsEmpty": false + }, + "Timestamp": 637316495284504090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.551018536, + "Position": { + "X": 937.08192838957325, + "Y": 409.67494389172833, + "IsEmpty": false + }, + "Timestamp": 637316495284902230, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "0e85aaa2-2eeb-468a-98b3-cca1addcb9aa", + "Points": [ + { + "Pressure": 0.403311193, + "Position": { + "X": 935.53618864347959, + "Y": 395.90428959485337, + "IsEmpty": false + }, + "Timestamp": 637316495286893040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619378984, + "Position": { + "X": 935.82009977629207, + "Y": 395.90428959485337, + "IsEmpty": false + }, + "Timestamp": 637316495287201440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.69481957, + "Position": { + "X": 937.05038542082332, + "Y": 396.15580326672836, + "IsEmpty": false + }, + "Timestamp": 637316495287366650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749019623, + "Position": { + "X": 938.72230924894825, + "Y": 396.09293705579086, + "IsEmpty": false + }, + "Timestamp": 637316495287539320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.772701621, + "Position": { + "X": 941.21441129972959, + "Y": 395.43268314954082, + "IsEmpty": false + }, + "Timestamp": 637316495287704160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781246662, + "Position": { + "X": 943.3910714559795, + "Y": 394.86676518079082, + "IsEmpty": false + }, + "Timestamp": 637316495287877610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785397112, + "Position": { + "X": 944.84218229582325, + "Y": 394.55236088391587, + "IsEmpty": false + }, + "Timestamp": 637316495288048360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649408698, + "Position": { + "X": 945.0314523153545, + "Y": 394.45804936047836, + "IsEmpty": false + }, + "Timestamp": 637316495288222580, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "6b560b21-68f5-46ba-9998-877066d4536a", + "Points": [ + { + "Pressure": 0.323231846, + "Position": { + "X": 935.4730904989483, + "Y": 404.20441166516582, + "IsEmpty": false + }, + "Timestamp": 637316495289976740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529778004, + "Position": { + "X": 935.75700163176077, + "Y": 404.23585697766583, + "IsEmpty": false + }, + "Timestamp": 637316495290359370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610589743, + "Position": { + "X": 936.26173795988575, + "Y": 404.01576420422833, + "IsEmpty": false + }, + "Timestamp": 637316495290463080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643060982, + "Position": { + "X": 936.73491911222959, + "Y": 403.76425053235334, + "IsEmpty": false + }, + "Timestamp": 637316495290593040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720698833, + "Position": { + "X": 938.50148405363575, + "Y": 402.97826420422837, + "IsEmpty": false + }, + "Timestamp": 637316495290747920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75976193, + "Position": { + "X": 940.7727731161358, + "Y": 402.44376713391586, + "IsEmpty": false + }, + "Timestamp": 637316495290918620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781979084, + "Position": { + "X": 943.29643034269827, + "Y": 401.78353764172834, + "IsEmpty": false + }, + "Timestamp": 637316495291220500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793698013, + "Position": { + "X": 945.44154753019825, + "Y": 401.31195561047832, + "IsEmpty": false + }, + "Timestamp": 637316495291266580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.782223225, + "Position": { + "X": 946.8926461630108, + "Y": 401.06041752454087, + "IsEmpty": false + }, + "Timestamp": 637316495291423400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587640166, + "Position": { + "X": 946.5141061239483, + "Y": 401.53202396985336, + "IsEmpty": false + }, + "Timestamp": 637316495291930500, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "faa5ab30-a852-4270-948c-7325367597d5", + "Points": [ + { + "Pressure": 0.0842145383, + "Position": { + "X": 937.3342965536358, + "Y": 408.95182377454086, + "IsEmpty": false + }, + "Timestamp": 637316495293662230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.15794614, + "Position": { + "X": 937.58665251066702, + "Y": 409.04615971204083, + "IsEmpty": false + }, + "Timestamp": 637316495293666260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.436026543, + "Position": { + "X": 938.12293180754205, + "Y": 409.17191654797836, + "IsEmpty": false + }, + "Timestamp": 637316495293788230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.731197059, + "Position": { + "X": 948.02830290129202, + "Y": 405.65065189954083, + "IsEmpty": false + }, + "Timestamp": 637316495294497120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746822298, + "Position": { + "X": 950.11032194426082, + "Y": 404.64457279797836, + "IsEmpty": false + }, + "Timestamp": 637316495294670650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670893431, + "Position": { + "X": 951.24596647551084, + "Y": 403.98434330579084, + "IsEmpty": false + }, + "Timestamp": 637316495294803730, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8cf39a86-9652-4159-acbc-f1344be7b9f9", + "Points": [ + { + "Pressure": 0.0458838791, + "Position": { + "X": 957.14501432707334, + "Y": 392.50878178235337, + "IsEmpty": false + }, + "Timestamp": 637316495297743230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584710479, + "Position": { + "X": 956.95574430754209, + "Y": 392.91749760266583, + "IsEmpty": false + }, + "Timestamp": 637316495298529450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.639398813, + "Position": { + "X": 956.86110319426075, + "Y": 393.42054936047833, + "IsEmpty": false + }, + "Timestamp": 637316495298689890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.688227654, + "Position": { + "X": 956.8926461630108, + "Y": 395.24406010266586, + "IsEmpty": false + }, + "Timestamp": 637316495298869540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704097033, + "Position": { + "X": 957.08192838957325, + "Y": 397.09899174329087, + "IsEmpty": false + }, + "Timestamp": 637316495299033920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715571821, + "Position": { + "X": 957.23965544035457, + "Y": 399.61420170422832, + "IsEmpty": false + }, + "Timestamp": 637316495299198340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 957.61820768644827, + "Y": 402.31801029797833, + "IsEmpty": false + }, + "Timestamp": 637316495299367230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.731929481, + "Position": { + "X": 958.37529997160459, + "Y": 405.17904545422834, + "IsEmpty": false + }, + "Timestamp": 637316495299540730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733882666, + "Position": { + "X": 958.72229704191705, + "Y": 405.99647709485333, + "IsEmpty": false + }, + "Timestamp": 637316495299832060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617181659, + "Position": { + "X": 958.7538522176983, + "Y": 405.24193607922837, + "IsEmpty": false + }, + "Timestamp": 637316495300195390, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c33ad943-603d-4edd-9a18-2a2e7f43a792", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 962.98097624113575, + "Y": 391.18829838391582, + "IsEmpty": false + }, + "Timestamp": 637316495302798010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.152086675, + "Position": { + "X": 963.20180143644825, + "Y": 391.31405521985334, + "IsEmpty": false + }, + "Timestamp": 637316495302914020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.348134577, + "Position": { + "X": 963.3910714559795, + "Y": 391.47125736829082, + "IsEmpty": false + }, + "Timestamp": 637316495303085030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.462882429, + "Position": { + "X": 963.54879850676082, + "Y": 391.65990482922837, + "IsEmpty": false + }, + "Timestamp": 637316495303400650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533440173, + "Position": { + "X": 963.58034147551075, + "Y": 391.91141850110336, + "IsEmpty": false + }, + "Timestamp": 637316495303522440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720943034, + "Position": { + "X": 956.35636686613577, + "Y": 391.97430912610332, + "IsEmpty": false + }, + "Timestamp": 637316495303921380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749263763, + "Position": { + "X": 952.44469694426084, + "Y": 391.97430912610332, + "IsEmpty": false + }, + "Timestamp": 637316495304244870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761959255, + "Position": { + "X": 946.8926461630108, + "Y": 392.00575443860333, + "IsEmpty": false + }, + "Timestamp": 637316495304574530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661860049, + "Position": { + "X": 945.22072233488575, + "Y": 392.47733646985336, + "IsEmpty": false + }, + "Timestamp": 637316495304921940, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "fa17bd6d-1451-4620-b41b-b7be707206cc", + "Points": [ + { + "Pressure": 0.162584871, + "Position": { + "X": 974.08507780363584, + "Y": 391.59701420422834, + "IsEmpty": false + }, + "Timestamp": 637316495311691510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606195152, + "Position": { + "X": 973.51725553801077, + "Y": 391.15687748547833, + "IsEmpty": false + }, + "Timestamp": 637316495312442030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645502388, + "Position": { + "X": 971.56142057707325, + "Y": 391.25118900891584, + "IsEmpty": false + }, + "Timestamp": 637316495312679020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714106977, + "Position": { + "X": 967.80747770597952, + "Y": 393.48341557141583, + "IsEmpty": false + }, + "Timestamp": 637316495313030650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758297086, + "Position": { + "X": 965.82009977629207, + "Y": 398.89108158704084, + "IsEmpty": false + }, + "Timestamp": 637316495313364730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.783199787, + "Position": { + "X": 966.98728727629202, + "Y": 402.85250736829084, + "IsEmpty": false + }, + "Timestamp": 637316495313671520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.828366518, + "Position": { + "X": 974.08507780363584, + "Y": 403.66993900891583, + "IsEmpty": false + }, + "Timestamp": 637316495314047950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.829831362, + "Position": { + "X": 978.62765592863582, + "Y": 400.80890385266582, + "IsEmpty": false + }, + "Timestamp": 637316495314378030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708003342, + "Position": { + "X": 979.63712858488577, + "Y": 398.76532475110332, + "IsEmpty": false + }, + "Timestamp": 637316495314725460, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "2b20f1f7-d4cf-4551-b1de-089febc3ecb2", + "Points": [ + { + "Pressure": 0.0949568897, + "Position": { + "X": 986.00936979582332, + "Y": 389.93070561047836, + "IsEmpty": false + }, + "Timestamp": 637316495319411350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.33690393, + "Position": { + "X": 986.00936979582332, + "Y": 389.74208256360333, + "IsEmpty": false + }, + "Timestamp": 637316495319818470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.467765301, + "Position": { + "X": 985.97782682707327, + "Y": 389.61632572766587, + "IsEmpty": false + }, + "Timestamp": 637316495319985720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.555168986, + "Position": { + "X": 985.78854460051082, + "Y": 389.74208256360333, + "IsEmpty": false + }, + "Timestamp": 637316495320159870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.621087968, + "Position": { + "X": 985.31535124113577, + "Y": 390.71671635266586, + "IsEmpty": false + }, + "Timestamp": 637316495320328400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683344781, + "Position": { + "X": 985.06300749113575, + "Y": 393.82926518079086, + "IsEmpty": false + }, + "Timestamp": 637316495320492560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.707759202, + "Position": { + "X": 984.93681120207327, + "Y": 397.31908451672837, + "IsEmpty": false + }, + "Timestamp": 637316495320661030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721675456, + "Position": { + "X": 984.8737252645733, + "Y": 401.06041752454087, + "IsEmpty": false + }, + "Timestamp": 637316495320827630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726558328, + "Position": { + "X": 985.06300749113575, + "Y": 404.07865482922836, + "IsEmpty": false + }, + "Timestamp": 637316495320999830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733882666, + "Position": { + "X": 985.63082975676082, + "Y": 406.87679936047834, + "IsEmpty": false + }, + "Timestamp": 637316495321174660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736079931, + "Position": { + "X": 985.72545866301084, + "Y": 407.06544682141583, + "IsEmpty": false + }, + "Timestamp": 637316495321388230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736079931, + "Position": { + "X": 986.13554167082327, + "Y": 406.53094975110332, + "IsEmpty": false + }, + "Timestamp": 637316495321509030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649408698, + "Position": { + "X": 986.38790983488582, + "Y": 404.83322025891584, + "IsEmpty": false + }, + "Timestamp": 637316495321670420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.265613794, + "Position": { + "X": 986.48256315519825, + "Y": 404.14152104016586, + "IsEmpty": false + }, + "Timestamp": 637316495321735770, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e90752cf-161e-4cee-8291-92a1bcf81e5e", + "Points": [ + { + "Pressure": 0.322255284, + "Position": { + "X": 992.94943327238582, + "Y": 384.49161869641586, + "IsEmpty": false + }, + "Timestamp": 637316495324037660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.405752659, + "Position": { + "X": 993.26488737394834, + "Y": 384.71168705579083, + "IsEmpty": false + }, + "Timestamp": 637316495324373130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.535637438, + "Position": { + "X": 993.54879850676082, + "Y": 385.87496830579084, + "IsEmpty": false + }, + "Timestamp": 637316495324542760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.591058195, + "Position": { + "X": 993.6118844442608, + "Y": 387.22687260266582, + "IsEmpty": false + }, + "Timestamp": 637316495324973110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667475402, + "Position": { + "X": 993.80116667082325, + "Y": 391.59701420422834, + "IsEmpty": false + }, + "Timestamp": 637316495325059970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699702442, + "Position": { + "X": 994.2743600301983, + "Y": 396.31300541516583, + "IsEmpty": false + }, + "Timestamp": 637316495325329980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712397933, + "Position": { + "X": 994.68444303801084, + "Y": 399.36266361829087, + "IsEmpty": false + }, + "Timestamp": 637316495325389790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 994.93681120207327, + "Y": 401.68922611829083, + "IsEmpty": false + }, + "Timestamp": 637316495325557090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71947813, + "Position": { + "X": 995.53617643644827, + "Y": 403.04113041516587, + "IsEmpty": false + }, + "Timestamp": 637316495325734790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 995.82008756926075, + "Y": 403.70138432141584, + "IsEmpty": false + }, + "Timestamp": 637316495325903840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 995.97782682707327, + "Y": 403.60704838391587, + "IsEmpty": false + }, + "Timestamp": 637316495326069680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715571821, + "Position": { + "X": 996.19865202238577, + "Y": 403.35553471204082, + "IsEmpty": false + }, + "Timestamp": 637316495326241620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.360830098, + "Position": { + "X": 996.2932809286358, + "Y": 402.06649662610334, + "IsEmpty": false + }, + "Timestamp": 637316495326371640, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "44904f55-1d7a-4c8a-9d46-8df4ea57a32b", + "Points": [ + { + "Pressure": 0.239002064, + "Position": { + "X": 993.39108366301082, + "Y": 394.70956303235334, + "IsEmpty": false + }, + "Timestamp": 637316495327904520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.46727702, + "Position": { + "X": 993.29643034269827, + "Y": 395.02396732922836, + "IsEmpty": false + }, + "Timestamp": 637316495327908590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.688960075, + "Position": { + "X": 991.3721383505108, + "Y": 396.28156010266582, + "IsEmpty": false + }, + "Timestamp": 637316495328303350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724361002, + "Position": { + "X": 989.47938932707325, + "Y": 396.65885502454086, + "IsEmpty": false + }, + "Timestamp": 637316495328433800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739253819, + "Position": { + "X": 987.1134713583233, + "Y": 396.91036869641584, + "IsEmpty": false + }, + "Timestamp": 637316495328602850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699702442, + "Position": { + "X": 983.92733854582332, + "Y": 396.75316654797837, + "IsEmpty": false + }, + "Timestamp": 637316495328701970, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8b211797-0b33-4582-af1e-362229c4f5c0", + "Points": [ + { + "Pressure": 0.0610208288, + "Position": { + "X": 1006.6718209676983, + "Y": 388.54735600110337, + "IsEmpty": false + }, + "Timestamp": 637316495350944570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684077203, + "Position": { + "X": 1007.9021188192607, + "Y": 389.01896244641586, + "IsEmpty": false + }, + "Timestamp": 637316495352088930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 1009.4793893270732, + "Y": 389.08182865735336, + "IsEmpty": false + }, + "Timestamp": 637316495352262690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.755611479, + "Position": { + "X": 1011.9399606161357, + "Y": 388.98751713391584, + "IsEmpty": false + }, + "Timestamp": 637316495352431510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773189902, + "Position": { + "X": 1014.7475289755108, + "Y": 388.70455814954084, + "IsEmpty": false + }, + "Timestamp": 637316495352596520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790035844, + "Position": { + "X": 1016.8611031942607, + "Y": 388.42159916516584, + "IsEmpty": false + }, + "Timestamp": 637316495352771190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 1018.8169381551983, + "Y": 388.23295170422836, + "IsEmpty": false + }, + "Timestamp": 637316495352938710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.816647589, + "Position": { + "X": 1019.1954781942608, + "Y": 388.29584232922832, + "IsEmpty": false + }, + "Timestamp": 637316495353107410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 1019.3847604208233, + "Y": 388.32728764172833, + "IsEmpty": false + }, + "Timestamp": 637316495353279430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820798039, + "Position": { + "X": 1019.1323922567608, + "Y": 388.86176029797832, + "IsEmpty": false + }, + "Timestamp": 637316495353779260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820798039, + "Position": { + "X": 1018.6591988973857, + "Y": 389.30192143079086, + "IsEmpty": false + }, + "Timestamp": 637316495353952220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820798039, + "Position": { + "X": 1018.1229440145732, + "Y": 389.67919193860337, + "IsEmpty": false + }, + "Timestamp": 637316495354125690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820798039, + "Position": { + "X": 1017.2081002645733, + "Y": 390.30800053235333, + "IsEmpty": false + }, + "Timestamp": 637316495354292850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 1016.5456490926983, + "Y": 390.87391850110333, + "IsEmpty": false + }, + "Timestamp": 637316495354459380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.82519263, + "Position": { + "X": 1015.8200875692607, + "Y": 391.59701420422834, + "IsEmpty": false + }, + "Timestamp": 637316495354629680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 1014.5898141317608, + "Y": 392.82318607922832, + "IsEmpty": false + }, + "Timestamp": 637316495354797960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 1013.7380807333233, + "Y": 393.73492924329082, + "IsEmpty": false + }, + "Timestamp": 637316495354969170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 1012.8548043661358, + "Y": 394.58380619641582, + "IsEmpty": false + }, + "Timestamp": 637316495355130240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 1012.2869821005108, + "Y": 395.24406010266586, + "IsEmpty": false + }, + "Timestamp": 637316495355305770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 1012.2238717489483, + "Y": 395.36981693860332, + "IsEmpty": false + }, + "Timestamp": 637316495355476050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.824704349, + "Position": { + "X": 1012.6655221395733, + "Y": 395.58988529797836, + "IsEmpty": false + }, + "Timestamp": 637316495355639460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.826657534, + "Position": { + "X": 1013.7380807333233, + "Y": 395.43268314954082, + "IsEmpty": false + }, + "Timestamp": 637316495355807150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.826657534, + "Position": { + "X": 1015.1260934286358, + "Y": 395.21261479016584, + "IsEmpty": false + }, + "Timestamp": 637316495355977870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.826657534, + "Position": { + "X": 1017.5866647176983, + "Y": 395.68419682141587, + "IsEmpty": false + }, + "Timestamp": 637316495356147000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.826657534, + "Position": { + "X": 1019.0062203817608, + "Y": 396.50165287610332, + "IsEmpty": false + }, + "Timestamp": 637316495356321570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.826657534, + "Position": { + "X": 1019.9525826864483, + "Y": 397.72780033704083, + "IsEmpty": false + }, + "Timestamp": 637316495356483750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.828610659, + "Position": { + "X": 1020.3942330770733, + "Y": 399.07970463391587, + "IsEmpty": false + }, + "Timestamp": 637316495356657190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.828610659, + "Position": { + "X": 1019.8264108114483, + "Y": 401.18617436047833, + "IsEmpty": false + }, + "Timestamp": 637316495356822350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.828610659, + "Position": { + "X": 1018.9115670614483, + "Y": 402.38090092297836, + "IsEmpty": false + }, + "Timestamp": 637316495356995260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.828610659, + "Position": { + "X": 1017.6497506551983, + "Y": 403.35553471204082, + "IsEmpty": false + }, + "Timestamp": 637316495357165940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.828610659, + "Position": { + "X": 1016.2932809286358, + "Y": 403.95289799329083, + "IsEmpty": false + }, + "Timestamp": 637316495357335690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.826657534, + "Position": { + "X": 1014.0535348348858, + "Y": 404.26730229016584, + "IsEmpty": false + }, + "Timestamp": 637316495357504610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.824704349, + "Position": { + "X": 1012.3816110067607, + "Y": 404.14152104016586, + "IsEmpty": false + }, + "Timestamp": 637316495357672440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822262883, + "Position": { + "X": 1010.8358590536358, + "Y": 403.89000736829087, + "IsEmpty": false + }, + "Timestamp": 637316495357847670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740718722, + "Position": { + "X": 1009.4478463583233, + "Y": 403.32408939954087, + "IsEmpty": false + }, + "Timestamp": 637316495358006530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.303212017, + "Position": { + "X": 1009.0693063192608, + "Y": 403.04113041516587, + "IsEmpty": false + }, + "Timestamp": 637316495358100410, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8155d90a-1ed6-491a-be35-2ebc93502271", + "Points": [ + { + "Pressure": 0.21092546, + "Position": { + "X": 900.62202150052997, + "Y": 388.26794656669136, + "IsEmpty": false + }, + "Timestamp": 637316495524788570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.207751587, + "Position": { + "X": 901.87962226036097, + "Y": 388.12545015355187, + "IsEmpty": false + }, + "Timestamp": 637316495525072000, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF3D00B8", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "1fece911-9919-4300-a0fb-f64cc26ab707", + "Points": [ + { + "Pressure": 0.1247425, + "Position": { + "X": 898.80796541614836, + "Y": 421.77819581327242, + "IsEmpty": false + }, + "Timestamp": 637316495579124720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.136949718, + "Position": { + "X": 898.44465242471745, + "Y": 421.79994453655434, + "IsEmpty": false + }, + "Timestamp": 637316495579223140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.150621802, + "Position": { + "X": 897.45154756623515, + "Y": 421.89651703252849, + "IsEmpty": false + }, + "Timestamp": 637316495579369660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.247058824, + "Position": { + "X": 896.77316097280868, + "Y": 421.95622391533061, + "IsEmpty": false + }, + "Timestamp": 637316495579535720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.500724792, + "Position": { + "X": 896.40982104414468, + "Y": 421.97833406601075, + "IsEmpty": false + }, + "Timestamp": 637316495579711940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.517326593, + "Position": { + "X": 897.08821560162255, + "Y": 421.91850704922138, + "IsEmpty": false + }, + "Timestamp": 637316495581225350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523186088, + "Position": { + "X": 898.12981643593605, + "Y": 421.83717399361785, + "IsEmpty": false + }, + "Timestamp": 637316495581403110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532707691, + "Position": { + "X": 899.8006050869102, + "Y": 421.68284414959436, + "IsEmpty": false + }, + "Timestamp": 637316495581568220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54027617, + "Position": { + "X": 901.83358837765149, + "Y": 421.50995281164529, + "IsEmpty": false + }, + "Timestamp": 637316495581736580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 903.5021702350482, + "Y": 421.36129034611344, + "IsEmpty": false + }, + "Timestamp": 637316495581912260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.551018536, + "Position": { + "X": 905.53277879545419, + "Y": 421.19472560890807, + "IsEmpty": false + }, + "Timestamp": 637316495582070520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.565667212, + "Position": { + "X": 909.59005352860822, + "Y": 420.8717850083803, + "IsEmpty": false + }, + "Timestamp": 637316495582253560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 912.6039225179353, + "Y": 420.6324362049499, + "IsEmpty": false + }, + "Timestamp": 637316495582411340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.574456394, + "Position": { + "X": 915.30246390001969, + "Y": 420.43200379209242, + "IsEmpty": false + }, + "Timestamp": 637316495582586300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 918.30905862814359, + "Y": 420.20850060015124, + "IsEmpty": false + }, + "Timestamp": 637316495582754680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 921.98378888236391, + "Y": 419.94829393192725, + "IsEmpty": false + }, + "Timestamp": 637316495582923410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 924.67146864199549, + "Y": 419.77060513775388, + "IsEmpty": false + }, + "Timestamp": 637316495583091630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 927.35585597904048, + "Y": 419.59940859639721, + "IsEmpty": false + }, + "Timestamp": 637316495583256390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.578362703, + "Position": { + "X": 930.34468631451182, + "Y": 419.41059973601131, + "IsEmpty": false + }, + "Timestamp": 637316495583427710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 934.66502540683859, + "Y": 419.15555085270603, + "IsEmpty": false + }, + "Timestamp": 637316495583599550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583977997, + "Position": { + "X": 936.97410941328883, + "Y": 419.02457549111716, + "IsEmpty": false + }, + "Timestamp": 637316495583768800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.59325552, + "Position": { + "X": 939.64077580204787, + "Y": 418.88512863885057, + "IsEmpty": false + }, + "Timestamp": 637316495583937400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602532983, + "Position": { + "X": 942.30336683641212, + "Y": 418.75254726712853, + "IsEmpty": false + }, + "Timestamp": 637316495584098130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608636618, + "Position": { + "X": 945.92897773478398, + "Y": 418.5795653349245, + "IsEmpty": false + }, + "Timestamp": 637316495584275350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610589743, + "Position": { + "X": 948.58109612316036, + "Y": 418.46385347896256, + "IsEmpty": false + }, + "Timestamp": 637316495584439930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.613031209, + "Position": { + "X": 951.17041018184113, + "Y": 418.35276071114805, + "IsEmpty": false + }, + "Timestamp": 637316495584606850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.618158221, + "Position": { + "X": 953.81281430939316, + "Y": 418.25190950014161, + "IsEmpty": false + }, + "Timestamp": 637316495584782540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620355546, + "Position": { + "X": 957.40838777216936, + "Y": 418.12472441897546, + "IsEmpty": false + }, + "Timestamp": 637316495584951800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622308671, + "Position": { + "X": 959.68020375296067, + "Y": 418.05153067143408, + "IsEmpty": false + }, + "Timestamp": 637316495585117840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624261856, + "Position": { + "X": 961.64998122495444, + "Y": 417.99346205126182, + "IsEmpty": false + }, + "Timestamp": 637316495585282350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.626214981, + "Position": { + "X": 963.61681027900545, + "Y": 417.9395686366363, + "IsEmpty": false + }, + "Timestamp": 637316495585448740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630121291, + "Position": { + "X": 966.53052024434351, + "Y": 417.86765767768782, + "IsEmpty": false + }, + "Timestamp": 637316495585621170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 968.78453528303066, + "Y": 417.81925020746064, + "IsEmpty": false + }, + "Timestamp": 637316495585790190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 970.73966402481517, + "Y": 417.78139850761022, + "IsEmpty": false + }, + "Timestamp": 637316495585956970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 972.98486443300862, + "Y": 417.74479327352645, + "IsEmpty": false + }, + "Timestamp": 637316495586126020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 976.16510786084871, + "Y": 417.70559492567793, + "IsEmpty": false + }, + "Timestamp": 637316495586302510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646723151, + "Position": { + "X": 978.10696309495745, + "Y": 417.68516866212025, + "IsEmpty": false + }, + "Timestamp": 637316495586466820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 980.04536981497745, + "Y": 417.66915792034035, + "IsEmpty": false + }, + "Timestamp": 637316495586632830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 982.55834189986501, + "Y": 417.66238330029739, + "IsEmpty": false + }, + "Timestamp": 637316495586810310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 987.34205974158976, + "Y": 417.66284243006288, + "IsEmpty": false + }, + "Timestamp": 637316495586979370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652582586, + "Position": { + "X": 990.5404341778551, + "Y": 417.67625219462883, + "IsEmpty": false + }, + "Timestamp": 637316495587143260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652582586, + "Position": { + "X": 994.5780968255408, + "Y": 417.73072645976441, + "IsEmpty": false + }, + "Timestamp": 637316495587309560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 998.66459322213859, + "Y": 417.7977719957276, + "IsEmpty": false + }, + "Timestamp": 637316495587479340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1003.5171182083864, + "Y": 417.75577851348339, + "IsEmpty": false + }, + "Timestamp": 637316495587655500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1006.9775632374696, + "Y": 417.70753592904953, + "IsEmpty": false + }, + "Timestamp": 637316495587821490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1009.8130785796743, + "Y": 417.67954935043025, + "IsEmpty": false + }, + "Timestamp": 637316495587988280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1012.3038698611147, + "Y": 417.6588876795758, + "IsEmpty": false + }, + "Timestamp": 637316495588162410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1015.8000323304905, + "Y": 417.65373176479522, + "IsEmpty": false + }, + "Timestamp": 637316495588332820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1017.7305605042384, + "Y": 417.65981858692356, + "IsEmpty": false + }, + "Timestamp": 637316495588490780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1019.3092710550414, + "Y": 417.66480696861959, + "IsEmpty": false + }, + "Timestamp": 637316495588663140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1021.2465152757864, + "Y": 417.67933978176444, + "IsEmpty": false + }, + "Timestamp": 637316495588832620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1024.1266742626278, + "Y": 417.70669165769658, + "IsEmpty": false + }, + "Timestamp": 637316495589006850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1026.3654755198002, + "Y": 417.73489847362748, + "IsEmpty": false + }, + "Timestamp": 637316495589168110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1028.9663012840067, + "Y": 417.77736660507844, + "IsEmpty": false + }, + "Timestamp": 637316495589344340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1031.2154647169693, + "Y": 417.81925020746064, + "IsEmpty": false + }, + "Timestamp": 637316495589510940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1034.1231735113104, + "Y": 417.88296525248506, + "IsEmpty": false + }, + "Timestamp": 637316495589681360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1036.3831897209946, + "Y": 417.9395686366363, + "IsEmpty": false + }, + "Timestamp": 637316495589842030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1038.3500187750456, + "Y": 417.99346205126182, + "IsEmpty": false + }, + "Timestamp": 637316495590021170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1040.3197962470394, + "Y": 418.05153067143408, + "IsEmpty": false + }, + "Timestamp": 637316495590188930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1043.2500193505214, + "Y": 418.14668819188279, + "IsEmpty": false + }, + "Timestamp": 637316495590353310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1044.5677653028829, + "Y": 418.1919831314728, + "IsEmpty": false + }, + "Timestamp": 637316495590520470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1045.5273329371221, + "Y": 418.22782267218884, + "IsEmpty": false + }, + "Timestamp": 637316495590693310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1046.847339921216, + "Y": 418.27644773268764, + "IsEmpty": false + }, + "Timestamp": 637316495590859270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1047.808873541723, + "Y": 418.31516111532051, + "IsEmpty": false + }, + "Timestamp": 637316495591034520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1048.8295898181589, + "Y": 418.35276071114805, + "IsEmpty": false + }, + "Timestamp": 637316495591200660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1049.7926315022626, + "Y": 418.39372287804139, + "IsEmpty": false + }, + "Timestamp": 637316495591364210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 1050.4544660386032, + "Y": 418.42080280190618, + "IsEmpty": false + }, + "Timestamp": 637316495591541250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663324952, + "Position": { + "X": 1052.4416849754227, + "Y": 418.50470637694178, + "IsEmpty": false + }, + "Timestamp": 637316495591704490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671137571, + "Position": { + "X": 1053.1046558444175, + "Y": 418.53355878752154, + "IsEmpty": false + }, + "Timestamp": 637316495591873200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 1053.767905382168, + "Y": 418.56285178309577, + "IsEmpty": false + }, + "Timestamp": 637316495592040820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635492504, + "Position": { + "X": 1054.071022265216, + "Y": 418.5795653349245, + "IsEmpty": false + }, + "Timestamp": 637316495592213870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.226062402, + "Position": { + "X": 1052.4416849754227, + "Y": 418.50470637694178, + "IsEmpty": false + }, + "Timestamp": 637316495592852500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.226062402, + "Position": { + "X": 1052.7444037034643, + "Y": 418.52082755333026, + "IsEmpty": false + }, + "Timestamp": 637316495592878990, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF3D00B8", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "3445431f-2770-4eba-854d-dfcad5da2a28", + "Points": [ + { + "Pressure": 0.308827341, + "Position": { + "X": 895.14342519091656, + "Y": 387.81577166717142, + "IsEmpty": false + }, + "Timestamp": 637316495599079020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481193244, + "Position": { + "X": 895.80986941995684, + "Y": 387.73396463475336, + "IsEmpty": false + }, + "Timestamp": 637316495600154970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.518547356, + "Position": { + "X": 897.14226978189186, + "Y": 387.57196533276039, + "IsEmpty": false + }, + "Timestamp": 637316495600327630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.556389689, + "Position": { + "X": 900.38631750545983, + "Y": 387.1891910231945, + "IsEmpty": false + }, + "Timestamp": 637316495600491140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577874422, + "Position": { + "X": 903.04539359075659, + "Y": 386.88229865330015, + "IsEmpty": false + }, + "Timestamp": 637316495600655250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584954619, + "Position": { + "X": 906.28066755909356, + "Y": 386.52320329708925, + "IsEmpty": false + }, + "Timestamp": 637316495600831240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597650111, + "Position": { + "X": 909.6797176658506, + "Y": 386.15403895760096, + "IsEmpty": false + }, + "Timestamp": 637316495600996010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.613275349, + "Position": { + "X": 917.44299297637724, + "Y": 385.37647820538126, + "IsEmpty": false + }, + "Timestamp": 637316495601171120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622064531, + "Position": { + "X": 922.71265109940941, + "Y": 384.8892698364163, + "IsEmpty": false + }, + "Timestamp": 637316495601336530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.626703262, + "Position": { + "X": 928.53585461108003, + "Y": 384.39607140589828, + "IsEmpty": false + }, + "Timestamp": 637316495601505750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631586194, + "Position": { + "X": 933.76935667540067, + "Y": 383.99028355470438, + "IsEmpty": false + }, + "Timestamp": 637316495601680260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 942.06053044843281, + "Y": 383.43073668745745, + "IsEmpty": false + }, + "Timestamp": 637316495601850740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 947.15528544726487, + "Y": 383.13617851274205, + "IsEmpty": false + }, + "Timestamp": 637316495602014420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645014107, + "Position": { + "X": 951.67111978250091, + "Y": 382.90619251835227, + "IsEmpty": false + }, + "Timestamp": 637316495602178360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645014107, + "Position": { + "X": 956.7235415430431, + "Y": 382.68837549643581, + "IsEmpty": false + }, + "Timestamp": 637316495602355190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646967292, + "Position": { + "X": 964.84847817186017, + "Y": 382.42507379285894, + "IsEmpty": false + }, + "Timestamp": 637316495602525310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651361883, + "Position": { + "X": 970.37900090515757, + "Y": 382.31033281282981, + "IsEmpty": false + }, + "Timestamp": 637316495602689920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65429157, + "Position": { + "X": 975.33409156746075, + "Y": 382.25139697787358, + "IsEmpty": false + }, + "Timestamp": 637316495602859250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65429157, + "Position": { + "X": 980.88543822509644, + "Y": 382.23787835952993, + "IsEmpty": false + }, + "Timestamp": 637316495603028200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66234839, + "Position": { + "X": 986.31047552341636, + "Y": 382.28256744917991, + "IsEmpty": false + }, + "Timestamp": 637316495603201470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66234839, + "Position": { + "X": 990.55188007341701, + "Y": 382.35627578682181, + "IsEmpty": false + }, + "Timestamp": 637316495603360900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66234839, + "Position": { + "X": 994.15510880482645, + "Y": 382.44761457180402, + "IsEmpty": false + }, + "Timestamp": 637316495603530230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66234839, + "Position": { + "X": 998.87096740945185, + "Y": 382.60948849148662, + "IsEmpty": false + }, + "Timestamp": 637316495603699690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668207824, + "Position": { + "X": 1002.8712323922144, + "Y": 382.54359018257878, + "IsEmpty": false + }, + "Timestamp": 637316495603868630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1005.8448911951735, + "Y": 382.44761457180402, + "IsEmpty": false + }, + "Timestamp": 637316495604038130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1008.215383489664, + "Y": 382.38381345540716, + "IsEmpty": false + }, + "Timestamp": 637316495604206410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1012.4498909090059, + "Y": 382.2998273747292, + "IsEmpty": false + }, + "Timestamp": 637316495604373960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1015.4640141879522, + "Y": 382.26103102962998, + "IsEmpty": false + }, + "Timestamp": 637316495604553110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1017.9547744226859, + "Y": 382.24384261193751, + "IsEmpty": false + }, + "Timestamp": 637316495604718120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1020.9020269209421, + "Y": 382.23474548156361, + "IsEmpty": false + }, + "Timestamp": 637316495604884320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1024.0374864860696, + "Y": 382.24681834859615, + "IsEmpty": false + }, + "Timestamp": 637316495605061370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1028.3576239793626, + "Y": 382.29069442392705, + "IsEmpty": false + }, + "Timestamp": 637316495605231400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1030.7982209508004, + "Y": 382.32927555688605, + "IsEmpty": false + }, + "Timestamp": 637316495605390790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1032.6990235499406, + "Y": 382.3679224274274, + "IsEmpty": false + }, + "Timestamp": 637316495605562400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1035.7875941738916, + "Y": 382.44203270708368, + "IsEmpty": false + }, + "Timestamp": 637316495605730580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1037.6981911707398, + "Y": 382.49705561929301, + "IsEmpty": false + }, + "Timestamp": 637316495605904890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675288022, + "Position": { + "X": 1039.5249014078049, + "Y": 382.55347753962559, + "IsEmpty": false + }, + "Timestamp": 637316495606068150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671381712, + "Position": { + "X": 1042.0825820314019, + "Y": 382.64423425383416, + "IsEmpty": false + }, + "Timestamp": 637316495606236060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671381712, + "Position": { + "X": 1044.004797024834, + "Y": 382.71942043624057, + "IsEmpty": false + }, + "Timestamp": 637316495606411100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1045.930334457993, + "Y": 382.80066400588601, + "IsEmpty": false + }, + "Timestamp": 637316495606573530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1047.6851579436718, + "Y": 382.87597822518342, + "IsEmpty": false + }, + "Timestamp": 637316495606743870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1048.9729561974739, + "Y": 382.93706997774126, + "IsEmpty": false + }, + "Timestamp": 637316495606918220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1050.9072839896967, + "Y": 383.03366658323648, + "IsEmpty": false + }, + "Timestamp": 637316495607083260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1052.844714552735, + "Y": 383.13617851274205, + "IsEmpty": false + }, + "Timestamp": 637316495607257080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1054.6985585667308, + "Y": 383.23763720457521, + "IsEmpty": false + }, + "Timestamp": 637316495607421190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 1056.6421287775365, + "Y": 383.35156282833145, + "IsEmpty": false + }, + "Timestamp": 637316495607590330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692378104, + "Position": { + "X": 1058.5886214132545, + "Y": 383.47128621900941, + "IsEmpty": false + }, + "Timestamp": 637316495607759820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699458301, + "Position": { + "X": 1059.8878768936802, + "Y": 383.55430310109557, + "IsEmpty": false + }, + "Timestamp": 637316495607927660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 1061.1883864604495, + "Y": 383.63986722849666, + "IsEmpty": false + }, + "Timestamp": 637316495608093820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 1062.4039312743512, + "Y": 383.71995810891116, + "IsEmpty": false + }, + "Timestamp": 637316495608262390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71117723, + "Position": { + "X": 1063.7069744999028, + "Y": 383.81038792070888, + "IsEmpty": false + }, + "Timestamp": 637316495608437230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726802468, + "Position": { + "X": 1064.3589475297003, + "Y": 383.8565458357487, + "IsEmpty": false + }, + "Timestamp": 637316495608603340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.420645446, + "Position": { + "X": 1065.0112185195671, + "Y": 383.90333045421687, + "IsEmpty": false + }, + "Timestamp": 637316495609115980, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF3D00B8", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "24efc281-6242-4c63-9c2b-60b313a0fd1b", + "Points": [ + { + "Pressure": 0.0842145383, + "Position": { + "X": 898.3122140341045, + "Y": 423.85433842297834, + "IsEmpty": false + }, + "Timestamp": 637316495636907190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0925154462, + "Position": { + "X": 898.3122140341045, + "Y": 424.10585209485333, + "IsEmpty": false + }, + "Timestamp": 637316495636995520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.133043408, + "Position": { + "X": 898.3122140341045, + "Y": 424.92328373547832, + "IsEmpty": false + }, + "Timestamp": 637316495637160160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.301503003, + "Position": { + "X": 898.3122140341045, + "Y": 425.77216068860332, + "IsEmpty": false + }, + "Timestamp": 637316495637333610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.39403373, + "Position": { + "X": 898.3122140341045, + "Y": 426.49528080579086, + "IsEmpty": false + }, + "Timestamp": 637316495637504060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.445059896, + "Position": { + "X": 898.3122140341045, + "Y": 426.68390385266582, + "IsEmpty": false + }, + "Timestamp": 637316495637666160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573479831, + "Position": { + "X": 898.3122140341045, + "Y": 425.39489018079087, + "IsEmpty": false + }, + "Timestamp": 637316495638170800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.59740597, + "Position": { + "X": 898.3122140341045, + "Y": 423.16263920422836, + "IsEmpty": false + }, + "Timestamp": 637316495638340320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617914081, + "Position": { + "X": 898.3122140341045, + "Y": 420.01866947766587, + "IsEmpty": false + }, + "Timestamp": 637316495638512230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638178051, + "Position": { + "X": 898.3122140341045, + "Y": 415.49132572766587, + "IsEmpty": false + }, + "Timestamp": 637316495638680970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667963684, + "Position": { + "X": 898.3122140341045, + "Y": 404.64457279797836, + "IsEmpty": false + }, + "Timestamp": 637316495638849380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687495232, + "Position": { + "X": 898.3122140341045, + "Y": 396.78461186047832, + "IsEmpty": false + }, + "Timestamp": 637316495639021160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 898.3122140341045, + "Y": 389.77350346204082, + "IsEmpty": false + }, + "Timestamp": 637316495639188290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 898.3122140341045, + "Y": 384.58593021985337, + "IsEmpty": false + }, + "Timestamp": 637316495639357730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 898.3122140341045, + "Y": 381.25331303235333, + "IsEmpty": false + }, + "Timestamp": 637316495639527580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.393545419, + "Position": { + "X": 898.3122140341045, + "Y": 380.62450443860337, + "IsEmpty": false + }, + "Timestamp": 637316495639695640, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF3D00B8", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "228eb7ca-3ab0-4e96-867f-12e1159ae836", + "Points": [ + { + "Pressure": 0.137682155, + "Position": { + "X": 1060.5519479208233, + "Y": 386.75529057141586, + "IsEmpty": false + }, + "Timestamp": 637316495651931410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.176989391, + "Position": { + "X": 1060.5519479208233, + "Y": 386.31512943860332, + "IsEmpty": false + }, + "Timestamp": 637316495652201150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.268543512, + "Position": { + "X": 1060.5519479208233, + "Y": 385.68632084485336, + "IsEmpty": false + }, + "Timestamp": 637316495652377640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.330556184, + "Position": { + "X": 1060.5519479208233, + "Y": 385.49769779797833, + "IsEmpty": false + }, + "Timestamp": 637316495652535040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.372304887, + "Position": { + "X": 1060.5519479208233, + "Y": 385.18329350110332, + "IsEmpty": false + }, + "Timestamp": 637316495652703360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.400137335, + "Position": { + "X": 1060.5519479208233, + "Y": 384.80602299329087, + "IsEmpty": false + }, + "Timestamp": 637316495652882010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.477042794, + "Position": { + "X": 1060.5519479208233, + "Y": 384.39730717297834, + "IsEmpty": false + }, + "Timestamp": 637316495653049030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501213074, + "Position": { + "X": 1060.5519479208233, + "Y": 385.62345463391586, + "IsEmpty": false + }, + "Timestamp": 637316495653725370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513420284, + "Position": { + "X": 1060.5519479208233, + "Y": 387.00680424329084, + "IsEmpty": false + }, + "Timestamp": 637316495653889920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522453666, + "Position": { + "X": 1060.5519479208233, + "Y": 388.64166752454082, + "IsEmpty": false + }, + "Timestamp": 637316495654060640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534416735, + "Position": { + "X": 1060.5519479208233, + "Y": 391.94286381360337, + "IsEmpty": false + }, + "Timestamp": 637316495654229070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.542229354, + "Position": { + "X": 1060.5519479208233, + "Y": 394.80389896985332, + "IsEmpty": false + }, + "Timestamp": 637316495654401290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547112226, + "Position": { + "X": 1060.5519479208233, + "Y": 398.23082768079087, + "IsEmpty": false + }, + "Timestamp": 637316495654565080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 1060.5519479208233, + "Y": 402.44376713391586, + "IsEmpty": false + }, + "Timestamp": 637316495654731040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558831155, + "Position": { + "X": 1060.5519479208233, + "Y": 409.73783451672836, + "IsEmpty": false + }, + "Timestamp": 637316495654901590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1060.5519479208233, + "Y": 414.39093510266582, + "IsEmpty": false + }, + "Timestamp": 637316495655077620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1060.5519479208233, + "Y": 418.47811771985334, + "IsEmpty": false + }, + "Timestamp": 637316495655238450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56469065, + "Position": { + "X": 1060.5519479208233, + "Y": 421.87362553235334, + "IsEmpty": false + }, + "Timestamp": 637316495655417380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566643775, + "Position": { + "X": 1060.5519479208233, + "Y": 425.01759525891583, + "IsEmpty": false + }, + "Timestamp": 637316495655576510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 1060.5519479208233, + "Y": 425.58351322766583, + "IsEmpty": false + }, + "Timestamp": 637316495655758180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 1060.5519479208233, + "Y": 425.83502689954082, + "IsEmpty": false + }, + "Timestamp": 637316495655913620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573235691, + "Position": { + "X": 1060.5519479208233, + "Y": 423.79144779797832, + "IsEmpty": false + }, + "Timestamp": 637316495656259050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573235691, + "Position": { + "X": 1060.5519479208233, + "Y": 421.62208744641583, + "IsEmpty": false + }, + "Timestamp": 637316495656430100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577386141, + "Position": { + "X": 1060.5519479208233, + "Y": 419.38986088391584, + "IsEmpty": false + }, + "Timestamp": 637316495656588930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58129245, + "Position": { + "X": 1060.5519479208233, + "Y": 416.43451420422832, + "IsEmpty": false + }, + "Timestamp": 637316495656762330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58519876, + "Position": { + "X": 1060.5519479208233, + "Y": 410.05221439954084, + "IsEmpty": false + }, + "Timestamp": 637316495656928120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 1060.5519479208233, + "Y": 404.20441166516582, + "IsEmpty": false + }, + "Timestamp": 637316495657106040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593011379, + "Position": { + "X": 1060.5519479208233, + "Y": 397.82211186047834, + "IsEmpty": false + }, + "Timestamp": 637316495657271090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594964504, + "Position": { + "X": 1060.5519479208233, + "Y": 391.75421635266582, + "IsEmpty": false + }, + "Timestamp": 637316495657445130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596917689, + "Position": { + "X": 1060.5519479208233, + "Y": 384.08290287610333, + "IsEmpty": false + }, + "Timestamp": 637316495657609700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600823998, + "Position": { + "X": 1060.5519479208233, + "Y": 380.21578861829084, + "IsEmpty": false + }, + "Timestamp": 637316495657781490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1060.5519479208233, + "Y": 377.63773686047836, + "IsEmpty": false + }, + "Timestamp": 637316495657942390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605706871, + "Position": { + "X": 1060.5519479208233, + "Y": 375.46837650891587, + "IsEmpty": false + }, + "Timestamp": 637316495658110820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.365957111, + "Position": { + "X": 1060.5519479208233, + "Y": 374.52518803235336, + "IsEmpty": false + }, + "Timestamp": 637316495658283980, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF3D00B8", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "eef3041a-73fa-46f8-bacd-84cff9237326", + "Points": [ + { + "Pressure": 0.220202938, + "Position": { + "X": 1033.5487985067607, + "Y": 392.16293217297834, + "IsEmpty": false + }, + "Timestamp": 637316495874578940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.245105669, + "Position": { + "X": 1033.7065377645733, + "Y": 392.00575443860333, + "IsEmpty": false + }, + "Timestamp": 637316495874911780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.315419227, + "Position": { + "X": 1034.0219918661357, + "Y": 391.40839115735332, + "IsEmpty": false + }, + "Timestamp": 637316495875083100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.362783253, + "Position": { + "X": 1033.8957955770734, + "Y": 390.74813725110334, + "IsEmpty": false + }, + "Timestamp": 637316495875259740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.391592264, + "Position": { + "X": 1033.5803414755107, + "Y": 389.86783939954086, + "IsEmpty": false + }, + "Timestamp": 637316495875429390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.424063474, + "Position": { + "X": 1033.2333444051983, + "Y": 389.36478764172836, + "IsEmpty": false + }, + "Timestamp": 637316495875594030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.451407641, + "Position": { + "X": 1032.5077828817607, + "Y": 389.08182865735336, + "IsEmpty": false + }, + "Timestamp": 637316495875764990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469718456, + "Position": { + "X": 1032.0346139364483, + "Y": 389.01896244641586, + "IsEmpty": false + }, + "Timestamp": 637316495875938710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.48754102, + "Position": { + "X": 1031.5298776083232, + "Y": 389.05040775891587, + "IsEmpty": false + }, + "Timestamp": 637316495876118250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.500968933, + "Position": { + "X": 1030.7096871786357, + "Y": 389.36478764172836, + "IsEmpty": false + }, + "Timestamp": 637316495876264790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525139213, + "Position": { + "X": 1029.7002145223857, + "Y": 389.93070561047836, + "IsEmpty": false + }, + "Timestamp": 637316495876435630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.538323045, + "Position": { + "X": 1029.1639352255108, + "Y": 390.24510990735337, + "IsEmpty": false + }, + "Timestamp": 637316495876602750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544182479, + "Position": { + "X": 1028.4383981161359, + "Y": 390.71671635266586, + "IsEmpty": false + }, + "Timestamp": 637316495876773110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.556389689, + "Position": { + "X": 1027.1134713583233, + "Y": 391.94286381360337, + "IsEmpty": false + }, + "Timestamp": 637316495876944740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.563714027, + "Position": { + "X": 1026.4509957723858, + "Y": 392.85463139172833, + "IsEmpty": false + }, + "Timestamp": 637316495877118480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571526647, + "Position": { + "X": 1025.9778268270734, + "Y": 393.98644291516587, + "IsEmpty": false + }, + "Timestamp": 637316495877283350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582269013, + "Position": { + "X": 1025.6308297567607, + "Y": 395.33837162610337, + "IsEmpty": false + }, + "Timestamp": 637316495877449550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592523098, + "Position": { + "X": 1025.4730904989483, + "Y": 396.65885502454086, + "IsEmpty": false + }, + "Timestamp": 637316495877618450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.603753746, + "Position": { + "X": 1025.2838082723858, + "Y": 398.67098881360334, + "IsEmpty": false + }, + "Timestamp": 637316495877789710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608636618, + "Position": { + "X": 1025.3469186239483, + "Y": 399.96002689954082, + "IsEmpty": false + }, + "Timestamp": 637316495877959550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610589743, + "Position": { + "X": 1025.5677194051982, + "Y": 401.21761967297834, + "IsEmpty": false + }, + "Timestamp": 637316495878123480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612542927, + "Position": { + "X": 1025.7885446005107, + "Y": 402.44376713391586, + "IsEmpty": false + }, + "Timestamp": 637316495878299320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.616449237, + "Position": { + "X": 1026.4509957723858, + "Y": 404.11010014172837, + "IsEmpty": false + }, + "Timestamp": 637316495878461810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620355546, + "Position": { + "X": 1026.9557321005109, + "Y": 405.08473393079083, + "IsEmpty": false + }, + "Timestamp": 637316495878631790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624505997, + "Position": { + "X": 1027.6182076864484, + "Y": 405.80785404797837, + "IsEmpty": false + }, + "Timestamp": 637316495878799530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629633009, + "Position": { + "X": 1028.3437447958233, + "Y": 406.40519291516586, + "IsEmpty": false + }, + "Timestamp": 637316495878977100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6340276, + "Position": { + "X": 1029.3847604208233, + "Y": 406.90824467297836, + "IsEmpty": false + }, + "Timestamp": 637316495879138480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638666332, + "Position": { + "X": 1030.1103219442607, + "Y": 406.87679936047834, + "IsEmpty": false + }, + "Timestamp": 637316495879321040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64599067, + "Position": { + "X": 1031.1197701864482, + "Y": 406.43663822766587, + "IsEmpty": false + }, + "Timestamp": 637316495879482640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655024052, + "Position": { + "X": 1032.2869576864482, + "Y": 405.24193607922837, + "IsEmpty": false + }, + "Timestamp": 637316495879645060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659906924, + "Position": { + "X": 1033.2964303426984, + "Y": 403.89000736829087, + "IsEmpty": false + }, + "Timestamp": 637316495879817820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659906924, + "Position": { + "X": 1033.5487985067607, + "Y": 403.35553471204082, + "IsEmpty": false + }, + "Timestamp": 637316495879983990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659906924, + "Position": { + "X": 1033.6749703817609, + "Y": 402.88392826672833, + "IsEmpty": false + }, + "Timestamp": 637316495880154130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659906924, + "Position": { + "X": 1033.6434274130108, + "Y": 402.41234623547837, + "IsEmpty": false + }, + "Timestamp": 637316495880330340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659906924, + "Position": { + "X": 1033.0756051473859, + "Y": 401.81498295422836, + "IsEmpty": false + }, + "Timestamp": 637316495880495810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.654779911, + "Position": { + "X": 1032.4131539755108, + "Y": 401.87784916516586, + "IsEmpty": false + }, + "Timestamp": 637316495880658000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.654779911, + "Position": { + "X": 1031.6560494833234, + "Y": 402.09794193860336, + "IsEmpty": false + }, + "Timestamp": 637316495880828900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656733036, + "Position": { + "X": 1030.2995797567607, + "Y": 402.53810307141583, + "IsEmpty": false + }, + "Timestamp": 637316495881006140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661127627, + "Position": { + "X": 1029.5109322958233, + "Y": 402.88392826672833, + "IsEmpty": false + }, + "Timestamp": 637316495881166490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663080812, + "Position": { + "X": 1029.0377633505109, + "Y": 403.07257572766582, + "IsEmpty": false + }, + "Timestamp": 637316495881334780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665278077, + "Position": { + "X": 1028.2491158895732, + "Y": 403.41842533704084, + "IsEmpty": false + }, + "Timestamp": 637316495881502810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656488895, + "Position": { + "X": 1027.8074654989482, + "Y": 403.63849369641582, + "IsEmpty": false + }, + "Timestamp": 637316495881675800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.320546269, + "Position": { + "X": 1027.3342965536358, + "Y": 403.79569584485336, + "IsEmpty": false + }, + "Timestamp": 637316495881842540, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "4397436e-0569-4248-ac6e-bd81494b09a3", + "Points": [ + { + "Pressure": 0.13987945, + "Position": { + "X": 1041.5929635458233, + "Y": 392.50878178235337, + "IsEmpty": false + }, + "Timestamp": 637316495885422890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.336415648, + "Position": { + "X": 1041.5298776083232, + "Y": 392.28871342297833, + "IsEmpty": false + }, + "Timestamp": 637316495886244670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.38597697, + "Position": { + "X": 1041.1197701864482, + "Y": 392.22582279797837, + "IsEmpty": false + }, + "Timestamp": 637316495886410960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.423575193, + "Position": { + "X": 1039.8894967489482, + "Y": 392.76029545422836, + "IsEmpty": false + }, + "Timestamp": 637316495886579490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.452628374, + "Position": { + "X": 1039.0693063192607, + "Y": 393.51486088391584, + "IsEmpty": false + }, + "Timestamp": 637316495886739710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.47924009, + "Position": { + "X": 1038.2175729208234, + "Y": 394.61525150891583, + "IsEmpty": false + }, + "Timestamp": 637316495886917910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.518303216, + "Position": { + "X": 1037.4604684286357, + "Y": 396.34445072766584, + "IsEmpty": false + }, + "Timestamp": 637316495887085650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554192424, + "Position": { + "X": 1037.1765572958234, + "Y": 398.60812260266584, + "IsEmpty": false + }, + "Timestamp": 637316495887255350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 1037.1134713583233, + "Y": 400.52594486829082, + "IsEmpty": false + }, + "Timestamp": 637316495887418090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.590569913, + "Position": { + "X": 1037.3973824911359, + "Y": 402.22369877454082, + "IsEmpty": false + }, + "Timestamp": 637316495887593510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.613275349, + "Position": { + "X": 1038.5961129598859, + "Y": 403.95289799329083, + "IsEmpty": false + }, + "Timestamp": 637316495887760440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629388869, + "Position": { + "X": 1039.7948678426983, + "Y": 404.51881596204083, + "IsEmpty": false + }, + "Timestamp": 637316495887932130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642572641, + "Position": { + "X": 1041.1197701864482, + "Y": 404.70743900891586, + "IsEmpty": false + }, + "Timestamp": 637316495888092190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 1042.5077828817607, + "Y": 404.55026127454084, + "IsEmpty": false + }, + "Timestamp": 637316495888269720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657465458, + "Position": { + "X": 1044.2428170614482, + "Y": 403.85856205579086, + "IsEmpty": false + }, + "Timestamp": 637316495888439640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 1045.9147408895733, + "Y": 402.66385990735336, + "IsEmpty": false + }, + "Timestamp": 637316495888608620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661615908, + "Position": { + "X": 1047.5235543661358, + "Y": 401.06041752454087, + "IsEmpty": false + }, + "Timestamp": 637316495888769770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665766358, + "Position": { + "X": 1048.9115670614483, + "Y": 399.29979740735337, + "IsEmpty": false + }, + "Timestamp": 637316495888944200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667719543, + "Position": { + "X": 1050.3311227255108, + "Y": 396.84747807141582, + "IsEmpty": false + }, + "Timestamp": 637316495889117400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667719543, + "Position": { + "X": 1050.5519479208233, + "Y": 395.11827885266587, + "IsEmpty": false + }, + "Timestamp": 637316495889284650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667719543, + "Position": { + "X": 1049.6686715536357, + "Y": 392.94894291516584, + "IsEmpty": false + }, + "Timestamp": 637316495889464410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665522218, + "Position": { + "X": 1048.3437447958233, + "Y": 390.87391850110333, + "IsEmpty": false + }, + "Timestamp": 637316495889620980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663569093, + "Position": { + "X": 1045.7885446005107, + "Y": 388.76744877454087, + "IsEmpty": false + }, + "Timestamp": 637316495889790710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663569093, + "Position": { + "X": 1043.8642526083233, + "Y": 388.42159916516584, + "IsEmpty": false + }, + "Timestamp": 637316495889957460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661615908, + "Position": { + "X": 1041.6245065145733, + "Y": 388.83031498547837, + "IsEmpty": false + }, + "Timestamp": 637316495890121170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656733036, + "Position": { + "X": 1039.3532174520733, + "Y": 389.71063725110332, + "IsEmpty": false + }, + "Timestamp": 637316495890295520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.266346216, + "Position": { + "X": 1036.9872750692607, + "Y": 390.93678471204083, + "IsEmpty": false + }, + "Timestamp": 637316495890419050, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "eb6fbc9f-44b1-4882-ad17-6b01d63569ba", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 961.78224577238575, + "Y": 560.93212162610337, + "IsEmpty": false + }, + "Timestamp": 637316495955227180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.189196616, + "Position": { + "X": 962.22388395597955, + "Y": 560.0517993604783, + "IsEmpty": false + }, + "Timestamp": 637316495955526120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.259021908, + "Position": { + "X": 962.25542692472959, + "Y": 558.85712162610332, + "IsEmpty": false + }, + "Timestamp": 637316495955686200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.39012742, + "Position": { + "X": 962.03460172941709, + "Y": 557.53661381360337, + "IsEmpty": false + }, + "Timestamp": 637316495955863650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.461661696, + "Position": { + "X": 962.98097624113575, + "Y": 559.39159428235337, + "IsEmpty": false + }, + "Timestamp": 637316495956365640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.474357218, + "Position": { + "X": 964.30590299894834, + "Y": 561.59237553235334, + "IsEmpty": false + }, + "Timestamp": 637316495956539730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.479728401, + "Position": { + "X": 965.31536344816709, + "Y": 562.81854740735332, + "IsEmpty": false + }, + "Timestamp": 637316495956700200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.485587865, + "Position": { + "X": 966.00936979582332, + "Y": 563.35302006360337, + "IsEmpty": false + }, + "Timestamp": 637316495956866800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49144733, + "Position": { + "X": 966.23019499113582, + "Y": 563.35302006360337, + "IsEmpty": false + }, + "Timestamp": 637316495957038100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498283356, + "Position": { + "X": 965.66236051847955, + "Y": 561.59237553235334, + "IsEmpty": false + }, + "Timestamp": 637316495957214650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498283356, + "Position": { + "X": 964.74754118254202, + "Y": 560.0517993604783, + "IsEmpty": false + }, + "Timestamp": 637316495957374710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498283356, + "Position": { + "X": 963.8327096395733, + "Y": 558.82567631360337, + "IsEmpty": false + }, + "Timestamp": 637316495957545980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498283356, + "Position": { + "X": 963.48571256926084, + "Y": 558.47982670422834, + "IsEmpty": false + }, + "Timestamp": 637316495957722400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501213074, + "Position": { + "X": 963.92735075285452, + "Y": 559.80028568860337, + "IsEmpty": false + }, + "Timestamp": 637316495958051810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510002315, + "Position": { + "X": 964.96836637785452, + "Y": 561.27797123547839, + "IsEmpty": false + }, + "Timestamp": 637316495958220610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513908625, + "Position": { + "X": 966.54564909269834, + "Y": 562.8813892042283, + "IsEmpty": false + }, + "Timestamp": 637316495958397460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51586175, + "Position": { + "X": 967.36583952238584, + "Y": 563.38446537610332, + "IsEmpty": false + }, + "Timestamp": 637316495958565730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.517814934, + "Position": { + "X": 966.6718331747295, + "Y": 562.91283451672837, + "IsEmpty": false + }, + "Timestamp": 637316495958897260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.515617609, + "Position": { + "X": 964.30590299894834, + "Y": 560.68060795422832, + "IsEmpty": false + }, + "Timestamp": 637316495959067720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.515617609, + "Position": { + "X": 963.07561735441709, + "Y": 559.3601489698533, + "IsEmpty": false + }, + "Timestamp": 637316495959241530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.515617609, + "Position": { + "X": 962.44469694426084, + "Y": 558.82567631360337, + "IsEmpty": false + }, + "Timestamp": 637316495959404970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531242847, + "Position": { + "X": 962.82324919035455, + "Y": 560.42909428235339, + "IsEmpty": false + }, + "Timestamp": 637316495959750330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547112226, + "Position": { + "X": 964.84218229582325, + "Y": 564.1704517042283, + "IsEmpty": false + }, + "Timestamp": 637316495959919170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 966.70337614347955, + "Y": 566.62274662610332, + "IsEmpty": false + }, + "Timestamp": 637316495960078600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 968.40684294035452, + "Y": 568.35194584485339, + "IsEmpty": false + }, + "Timestamp": 637316495960250990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 969.10084928801075, + "Y": 568.9807544386033, + "IsEmpty": false + }, + "Timestamp": 637316495960425040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554924846, + "Position": { + "X": 968.43838590910457, + "Y": 567.94320561047834, + "IsEmpty": false + }, + "Timestamp": 637316495960592230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552239239, + "Position": { + "X": 966.32482389738584, + "Y": 565.52235600110339, + "IsEmpty": false + }, + "Timestamp": 637316495960758900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.550286114, + "Position": { + "X": 963.8327096395733, + "Y": 562.66132084485332, + "IsEmpty": false + }, + "Timestamp": 637316495960927430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54833293, + "Position": { + "X": 961.5929635458233, + "Y": 560.6177173292283, + "IsEmpty": false + }, + "Timestamp": 637316495961095300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54833293, + "Position": { + "X": 960.89895719816707, + "Y": 560.7749438917283, + "IsEmpty": false + }, + "Timestamp": 637316495961269810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54833293, + "Position": { + "X": 960.9935983114483, + "Y": 562.66132084485332, + "IsEmpty": false + }, + "Timestamp": 637316495961430670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554924846, + "Position": { + "X": 962.4131539755108, + "Y": 565.67953373547834, + "IsEmpty": false + }, + "Timestamp": 637316495961607510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 965.66236051847955, + "Y": 570.26976811047837, + "IsEmpty": false + }, + "Timestamp": 637316495961768310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56469065, + "Position": { + "X": 967.492023604417, + "Y": 572.40770756360337, + "IsEmpty": false + }, + "Timestamp": 637316495961937220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56469065, + "Position": { + "X": 968.59612516691709, + "Y": 573.5080981886033, + "IsEmpty": false + }, + "Timestamp": 637316495962115080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56469065, + "Position": { + "X": 966.73491911222959, + "Y": 570.86713139172832, + "IsEmpty": false + }, + "Timestamp": 637316495962453180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562493324, + "Position": { + "X": 964.40053190519825, + "Y": 568.6977954542283, + "IsEmpty": false + }, + "Timestamp": 637316495962621680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562493324, + "Position": { + "X": 962.31851286222957, + "Y": 566.87426029797837, + "IsEmpty": false + }, + "Timestamp": 637316495962785530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56054014, + "Position": { + "X": 960.96205534269825, + "Y": 566.18260990735337, + "IsEmpty": false + }, + "Timestamp": 637316495962959320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56054014, + "Position": { + "X": 961.02514128019834, + "Y": 567.78602787610339, + "IsEmpty": false + }, + "Timestamp": 637316495963122620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572747409, + "Position": { + "X": 962.12924284269832, + "Y": 570.5212817823533, + "IsEmpty": false + }, + "Timestamp": 637316495963297990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.580804169, + "Position": { + "X": 963.4541696005108, + "Y": 573.53949467297832, + "IsEmpty": false + }, + "Timestamp": 637316495963458500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583001435, + "Position": { + "X": 965.0314523153545, + "Y": 576.36908451672832, + "IsEmpty": false + }, + "Timestamp": 637316495963630160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 967.050373213792, + "Y": 578.53846928235339, + "IsEmpty": false + }, + "Timestamp": 637316495963799120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 966.48255094816705, + "Y": 577.34374271985337, + "IsEmpty": false + }, + "Timestamp": 637316495964141760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 964.90526823332334, + "Y": 575.52020756360332, + "IsEmpty": false + }, + "Timestamp": 637316495964311540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584466338, + "Position": { + "X": 962.66552213957334, + "Y": 573.28798100110339, + "IsEmpty": false + }, + "Timestamp": 637316495964472620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582513154, + "Position": { + "X": 961.87687467863577, + "Y": 572.91073490735334, + "IsEmpty": false + }, + "Timestamp": 637316495964649520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582513154, + "Position": { + "X": 961.49833463957327, + "Y": 573.82245365735332, + "IsEmpty": false + }, + "Timestamp": 637316495964809920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582513154, + "Position": { + "X": 961.7506905966045, + "Y": 576.1804614698533, + "IsEmpty": false + }, + "Timestamp": 637316495964987240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 963.70652555754202, + "Y": 580.58202396985337, + "IsEmpty": false + }, + "Timestamp": 637316495965151400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 965.22072233488575, + "Y": 583.31732670422832, + "IsEmpty": false + }, + "Timestamp": 637316495965319060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 966.60873503019832, + "Y": 585.83251225110337, + "IsEmpty": false + }, + "Timestamp": 637316495965488180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 967.2711984091045, + "Y": 587.40448490735332, + "IsEmpty": false + }, + "Timestamp": 637316495965664360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 967.1134713583233, + "Y": 587.59315678235339, + "IsEmpty": false + }, + "Timestamp": 637316495965830160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 966.04091276457325, + "Y": 587.27875248547832, + "IsEmpty": false + }, + "Timestamp": 637316495965996520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537590623, + "Position": { + "X": 965.0314523153545, + "Y": 586.6499438917283, + "IsEmpty": false + }, + "Timestamp": 637316495966145410, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF3D00B8", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c197bce9-5849-4e19-9c42-85ab82cca7d9", + "Points": [ + { + "Pressure": 0.140611887, + "Position": { + "X": 981.71914762785457, + "Y": 559.23436771985337, + "IsEmpty": false + }, + "Timestamp": 637316495970055890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.153063253, + "Position": { + "X": 981.93997282316707, + "Y": 559.39159428235337, + "IsEmpty": false + }, + "Timestamp": 637316495970155680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.155504689, + "Position": { + "X": 982.38161100676075, + "Y": 559.7688403761033, + "IsEmpty": false + }, + "Timestamp": 637316495970257470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.244861528, + "Position": { + "X": 983.2333444051983, + "Y": 560.6177173292283, + "IsEmpty": false + }, + "Timestamp": 637316495970320420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.370840013, + "Position": { + "X": 984.0535348348858, + "Y": 561.81244389172832, + "IsEmpty": false + }, + "Timestamp": 637316495970562450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.40209049, + "Position": { + "X": 984.14817594816702, + "Y": 562.06395756360337, + "IsEmpty": false + }, + "Timestamp": 637316495970729260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.418692291, + "Position": { + "X": 983.92735075285452, + "Y": 562.00106693860334, + "IsEmpty": false + }, + "Timestamp": 637316495970901770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.43456167, + "Position": { + "X": 982.94943327238582, + "Y": 560.99501225110339, + "IsEmpty": false + }, + "Timestamp": 637316495971065790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.459708542, + "Position": { + "X": 980.9935983114483, + "Y": 558.98285404797832, + "IsEmpty": false + }, + "Timestamp": 637316495971238390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.470450908, + "Position": { + "X": 980.1103097372295, + "Y": 558.47982670422834, + "IsEmpty": false + }, + "Timestamp": 637316495971411250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481681556, + "Position": { + "X": 979.88949674894832, + "Y": 558.44838139172839, + "IsEmpty": false + }, + "Timestamp": 637316495971575890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.502677977, + "Position": { + "X": 980.1103097372295, + "Y": 559.4858813917283, + "IsEmpty": false + }, + "Timestamp": 637316495971739670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531731129, + "Position": { + "X": 981.52987760832332, + "Y": 562.06395756360337, + "IsEmpty": false + }, + "Timestamp": 637316495971910200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.542229354, + "Position": { + "X": 983.611896651292, + "Y": 565.08221928235332, + "IsEmpty": false + }, + "Timestamp": 637316495972082020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547112226, + "Position": { + "X": 985.41000456144832, + "Y": 567.09432865735334, + "IsEmpty": false + }, + "Timestamp": 637316495972254180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 986.38792204191702, + "Y": 568.1318774854783, + "IsEmpty": false + }, + "Timestamp": 637316495972418530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.561272621, + "Position": { + "X": 986.10401090910455, + "Y": 567.59740482922837, + "IsEmpty": false + }, + "Timestamp": 637316495972590910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.563714027, + "Position": { + "X": 984.68444303801084, + "Y": 565.80531498547839, + "IsEmpty": false + }, + "Timestamp": 637316495972760140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.565667212, + "Position": { + "X": 982.44469694426084, + "Y": 563.76171146985337, + "IsEmpty": false + }, + "Timestamp": 637316495972922520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.565667212, + "Position": { + "X": 979.9525826864483, + "Y": 561.9067798292283, + "IsEmpty": false + }, + "Timestamp": 637316495973144110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567620337, + "Position": { + "X": 977.68129362394825, + "Y": 560.64916264172837, + "IsEmpty": false + }, + "Timestamp": 637316495973259160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.569573522, + "Position": { + "X": 977.39738249113577, + "Y": 560.99501225110339, + "IsEmpty": false + }, + "Timestamp": 637316495973437030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579583406, + "Position": { + "X": 977.74437956144834, + "Y": 562.62987553235337, + "IsEmpty": false + }, + "Timestamp": 637316495973599060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600335717, + "Position": { + "X": 979.5109445028545, + "Y": 565.0193286573533, + "IsEmpty": false + }, + "Timestamp": 637316495973767460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615228474, + "Position": { + "X": 983.17025846769832, + "Y": 568.9807544386033, + "IsEmpty": false + }, + "Timestamp": 637316495973934100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619623125, + "Position": { + "X": 985.0314523153545, + "Y": 570.93002201672834, + "IsEmpty": false + }, + "Timestamp": 637316495974104310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62157625, + "Position": { + "X": 985.6308175497295, + "Y": 571.55883061047837, + "IsEmpty": false + }, + "Timestamp": 637316495974273340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623529434, + "Position": { + "X": 985.37844938566707, + "Y": 570.99291264172837, + "IsEmpty": false + }, + "Timestamp": 637316495974450380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625482559, + "Position": { + "X": 981.93997282316707, + "Y": 567.34584232922839, + "IsEmpty": false + }, + "Timestamp": 637316495974620960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625482559, + "Position": { + "X": 978.5330270223858, + "Y": 564.61058842297837, + "IsEmpty": false + }, + "Timestamp": 637316495974786880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625482559, + "Position": { + "X": 975.78854460051082, + "Y": 562.53558842297832, + "IsEmpty": false + }, + "Timestamp": 637316495974951660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629633009, + "Position": { + "X": 974.27434782316709, + "Y": 561.59237553235334, + "IsEmpty": false + }, + "Timestamp": 637316495975126440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629388869, + "Position": { + "X": 973.67498258879209, + "Y": 562.50414311047837, + "IsEmpty": false + }, + "Timestamp": 637316495975290700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 974.52671598722952, + "Y": 564.64203373547832, + "IsEmpty": false + }, + "Timestamp": 637316495975460000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 976.57719206144827, + "Y": 567.59740482922837, + "IsEmpty": false + }, + "Timestamp": 637316495975628490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 978.56456999113584, + "Y": 570.70995365735337, + "IsEmpty": false + }, + "Timestamp": 637316495975796870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 981.40369352629205, + "Y": 574.0740161573533, + "IsEmpty": false + }, + "Timestamp": 637316495975971340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 981.7506905966045, + "Y": 574.54559818860332, + "IsEmpty": false + }, + "Timestamp": 637316495976140230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 981.11978239347957, + "Y": 574.1997485792283, + "IsEmpty": false + }, + "Timestamp": 637316495976300620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 979.54248747160455, + "Y": 572.6592212354783, + "IsEmpty": false + }, + "Timestamp": 637316495976470930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 976.57719206144827, + "Y": 570.08114506360334, + "IsEmpty": false + }, + "Timestamp": 637316495976644300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 975.22072233488575, + "Y": 569.16937748547832, + "IsEmpty": false + }, + "Timestamp": 637316495976817750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 974.99990934660457, + "Y": 569.32655521985339, + "IsEmpty": false + }, + "Timestamp": 637316495976981370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 974.99990934660457, + "Y": 570.6785083448533, + "IsEmpty": false + }, + "Timestamp": 637316495977150340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 976.35636686613577, + "Y": 574.26263920422832, + "IsEmpty": false + }, + "Timestamp": 637316495977317590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 977.9336617880108, + "Y": 577.34374271985337, + "IsEmpty": false + }, + "Timestamp": 637316495977488490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 979.79485563566709, + "Y": 580.23622318860339, + "IsEmpty": false + }, + "Timestamp": 637316495977653390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 981.05668424894827, + "Y": 582.18549076672832, + "IsEmpty": false + }, + "Timestamp": 637316495977826150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 981.21441129972959, + "Y": 582.4055591261033, + "IsEmpty": false + }, + "Timestamp": 637316495977996490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 980.48886198332332, + "Y": 581.14794193860337, + "IsEmpty": false + }, + "Timestamp": 637316495978168830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 978.97466520597959, + "Y": 579.92181889172832, + "IsEmpty": false + }, + "Timestamp": 637316495978331000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 977.96520475676084, + "Y": 579.10438725110339, + "IsEmpty": false + }, + "Timestamp": 637316495978497080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 977.1134713583233, + "Y": 579.26156498547834, + "IsEmpty": false + }, + "Timestamp": 637316495978674440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 977.050373213792, + "Y": 580.4248462354783, + "IsEmpty": false + }, + "Timestamp": 637316495978839050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 977.61820768644827, + "Y": 582.34266850110339, + "IsEmpty": false + }, + "Timestamp": 637316495979007680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 978.5330270223858, + "Y": 584.85785404797832, + "IsEmpty": false + }, + "Timestamp": 637316495979182020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 979.85795378019827, + "Y": 587.97040287610332, + "IsEmpty": false + }, + "Timestamp": 637316495979345420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 979.98413786222955, + "Y": 588.22191654797837, + "IsEmpty": false + }, + "Timestamp": 637316495979516220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 979.03776335051077, + "Y": 587.31019779797839, + "IsEmpty": false + }, + "Timestamp": 637316495979680840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 978.05984587004207, + "Y": 585.42377201672832, + "IsEmpty": false + }, + "Timestamp": 637316495979851720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 976.48255094816705, + "Y": 583.44305912610332, + "IsEmpty": false + }, + "Timestamp": 637316495980021490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 976.2932809286358, + "Y": 583.28588139172837, + "IsEmpty": false + }, + "Timestamp": 637316495980187170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 975.59927458097957, + "Y": 583.63173100110339, + "IsEmpty": false + }, + "Timestamp": 637316495980358710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 975.31536344816709, + "Y": 584.60634037610339, + "IsEmpty": false + }, + "Timestamp": 637316495980526360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 975.34690641691702, + "Y": 587.02723881360339, + "IsEmpty": false + }, + "Timestamp": 637316495980700770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 975.4730904989483, + "Y": 588.78783451672837, + "IsEmpty": false + }, + "Timestamp": 637316495980871170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 975.59927458097957, + "Y": 590.67426029797832, + "IsEmpty": false + }, + "Timestamp": 637316495981033280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 975.59927458097957, + "Y": 592.12050053235339, + "IsEmpty": false + }, + "Timestamp": 637316495981210510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 975.18917936613582, + "Y": 593.37806889172839, + "IsEmpty": false + }, + "Timestamp": 637316495981378210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635248363, + "Position": { + "X": 974.90526823332334, + "Y": 594.16405521985337, + "IsEmpty": false + }, + "Timestamp": 637316495981542280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 974.68444303801084, + "Y": 595.39022709485334, + "IsEmpty": false + }, + "Timestamp": 637316495981708600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 974.6529000692608, + "Y": 596.93075443860334, + "IsEmpty": false + }, + "Timestamp": 637316495981887220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62182039, + "Position": { + "X": 974.62135710051075, + "Y": 598.18837162610339, + "IsEmpty": false + }, + "Timestamp": 637316495982052640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.256336302, + "Position": { + "X": 974.211261885667, + "Y": 598.6599536573533, + "IsEmpty": false + }, + "Timestamp": 637316495982160340, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF3D00B8", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e6aba4a2-90de-44c6-a05d-0349c5b204f7", + "Points": [ + { + "Pressure": 0.0458838791, + "Position": { + "X": 1017.6181954794171, + "Y": 588.81927982922832, + "IsEmpty": false + }, + "Timestamp": 637316495988409720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0659037158, + "Position": { + "X": 1017.8705636434795, + "Y": 587.90756107922834, + "IsEmpty": false + }, + "Timestamp": 637316495988643240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.144518197, + "Position": { + "X": 1017.050373213792, + "Y": 585.67528568860337, + "IsEmpty": false + }, + "Timestamp": 637316495988812040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.147203788, + "Position": { + "X": 1015.7254586630108, + "Y": 583.41161381360337, + "IsEmpty": false + }, + "Timestamp": 637316495988974550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.155504689, + "Position": { + "X": 1013.9588937216046, + "Y": 580.92787357922839, + "IsEmpty": false + }, + "Timestamp": 637316495989147050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.159655139, + "Position": { + "X": 1012.3816110067607, + "Y": 579.23011967297839, + "IsEmpty": false + }, + "Timestamp": 637316495989315200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0959334671, + "Position": { + "X": 1012.0976998739483, + "Y": 578.97860600110334, + "IsEmpty": false + }, + "Timestamp": 637316495989381040, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF3D00B8", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "3a90b123-d93b-4784-a70d-8505242ee47f", + "Points": [ + { + "Pressure": 0.126451507, + "Position": { + "X": 1014.842170088792, + "Y": 582.34266850110339, + "IsEmpty": false + }, + "Timestamp": 637316495990771070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.188220039, + "Position": { + "X": 1014.8737252645733, + "Y": 581.05365482922832, + "IsEmpty": false + }, + "Timestamp": 637316495990776200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.321034551, + "Position": { + "X": 1014.211261885667, + "Y": 579.1672778761033, + "IsEmpty": false + }, + "Timestamp": 637316495991174710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.346181422, + "Position": { + "X": 1015.4730904989483, + "Y": 579.35590092297832, + "IsEmpty": false + }, + "Timestamp": 637316495991448040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.380117506, + "Position": { + "X": 1018.6592111044171, + "Y": 580.58202396985337, + "IsEmpty": false + }, + "Timestamp": 637316495991583500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.392568856, + "Position": { + "X": 1023.8958077841046, + "Y": 581.2737231886033, + "IsEmpty": false + }, + "Timestamp": 637316495992000160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.394522011, + "Position": { + "X": 1026.1670968466046, + "Y": 581.36805912610339, + "IsEmpty": false + }, + "Timestamp": 637316495992059780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.402578771, + "Position": { + "X": 1027.523566573167, + "Y": 581.46234623547832, + "IsEmpty": false + }, + "Timestamp": 637316495992183140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.416983277, + "Position": { + "X": 1027.018830245042, + "Y": 581.21083256360339, + "IsEmpty": false + }, + "Timestamp": 637316495992352500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.421866179, + "Position": { + "X": 1024.5267159872296, + "Y": 580.77069584485332, + "IsEmpty": false + }, + "Timestamp": 637316495992524400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.421866179, + "Position": { + "X": 1018.1860299520733, + "Y": 580.17333256360337, + "IsEmpty": false + }, + "Timestamp": 637316495992695510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.424063474, + "Position": { + "X": 1013.107160323167, + "Y": 579.35590092297832, + "IsEmpty": false + }, + "Timestamp": 637316495992864580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.428946376, + "Position": { + "X": 1007.6181954794171, + "Y": 578.85287357922834, + "IsEmpty": false + }, + "Timestamp": 637316495993040050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.434073389, + "Position": { + "X": 1002.9809762411357, + "Y": 578.22406498547832, + "IsEmpty": false + }, + "Timestamp": 637316495993212590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.434073389, + "Position": { + "X": 999.79485563566709, + "Y": 577.78387943860332, + "IsEmpty": false + }, + "Timestamp": 637316495993374470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.403555363, + "Position": { + "X": 997.77593473722959, + "Y": 578.0354419386033, + "IsEmpty": false + }, + "Timestamp": 637316495993543590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.241199359, + "Position": { + "X": 997.492023604417, + "Y": 578.19261967297837, + "IsEmpty": false + }, + "Timestamp": 637316495993561170, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF3D00B8", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "0cbe2eb9-6a8f-40bf-9550-700f137225ab", + "Points": [ + { + "Pressure": 0.168688491, + "Position": { + "X": 1011.7506905966045, + "Y": 579.7331958448533, + "IsEmpty": false + }, + "Timestamp": 637316495995869370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.176012814, + "Position": { + "X": 1012.0976998739483, + "Y": 579.5759692823533, + "IsEmpty": false + }, + "Timestamp": 637316495995902540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.186999306, + "Position": { + "X": 1013.2018014364482, + "Y": 579.26156498547834, + "IsEmpty": false + }, + "Timestamp": 637316495996071940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.351552606, + "Position": { + "X": 1014.242804854417, + "Y": 578.66420170422839, + "IsEmpty": false + }, + "Timestamp": 637316495996240670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.408682376, + "Position": { + "X": 1014.5267159872295, + "Y": 578.28695561047834, + "IsEmpty": false + }, + "Timestamp": 637316495996409120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.431631953, + "Position": { + "X": 1014.7159982137921, + "Y": 577.62670170422837, + "IsEmpty": false + }, + "Timestamp": 637316495996579300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.436514825, + "Position": { + "X": 1014.9052682333233, + "Y": 577.21796146985332, + "IsEmpty": false + }, + "Timestamp": 637316495996845660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.43871215, + "Position": { + "X": 1015.3153634481671, + "Y": 576.87216068860334, + "IsEmpty": false + }, + "Timestamp": 637316495996964490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.257312894, + "Position": { + "X": 1016.5141061239483, + "Y": 576.7463794386033, + "IsEmpty": false + }, + "Timestamp": 637316495997310390, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF3D00B8", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "55dc2f5b-1d82-4c6e-81ec-8a1572779eca", + "Points": [ + { + "Pressure": 0.166979477, + "Position": { + "X": 1076.6087319784406, + "Y": 491.76439701672837, + "IsEmpty": false + }, + "Timestamp": 637316496233125860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.235339895, + "Position": { + "X": 1076.6087319784406, + "Y": 491.54432865735333, + "IsEmpty": false + }, + "Timestamp": 637316496233488850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.310536355, + "Position": { + "X": 1076.6087319784406, + "Y": 491.32426029797836, + "IsEmpty": false + }, + "Timestamp": 637316496233668130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.408194095, + "Position": { + "X": 1076.6087319784406, + "Y": 491.10419193860332, + "IsEmpty": false + }, + "Timestamp": 637316496233837300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 1076.6087319784406, + "Y": 491.63866459485337, + "IsEmpty": false + }, + "Timestamp": 637316496236363310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5688411, + "Position": { + "X": 1076.6087319784406, + "Y": 492.17313725110336, + "IsEmpty": false + }, + "Timestamp": 637316496236540300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570794225, + "Position": { + "X": 1076.6087319784406, + "Y": 493.02201420422836, + "IsEmpty": false + }, + "Timestamp": 637316496236701800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.57299155, + "Position": { + "X": 1076.6087319784406, + "Y": 494.15385014172836, + "IsEmpty": false + }, + "Timestamp": 637316496236873120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.574944675, + "Position": { + "X": 1076.6087319784406, + "Y": 495.66293217297834, + "IsEmpty": false + }, + "Timestamp": 637316496237041270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579339266, + "Position": { + "X": 1076.6087319784406, + "Y": 497.48646732922833, + "IsEmpty": false + }, + "Timestamp": 637316496237208120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58129245, + "Position": { + "X": 1076.6087319784406, + "Y": 499.27855717297837, + "IsEmpty": false + }, + "Timestamp": 637316496237375820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583245575, + "Position": { + "X": 1076.6087319784406, + "Y": 501.16493412610333, + "IsEmpty": false + }, + "Timestamp": 637316496237549290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58519876, + "Position": { + "X": 1076.6087319784406, + "Y": 504.05741459485336, + "IsEmpty": false + }, + "Timestamp": 637316496237715690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 1076.6087319784406, + "Y": 507.39003178235333, + "IsEmpty": false + }, + "Timestamp": 637316496237885610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 1076.6087319784406, + "Y": 510.21962162610333, + "IsEmpty": false + }, + "Timestamp": 637316496238058700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.591058195, + "Position": { + "X": 1076.6087319784406, + "Y": 512.98632084485337, + "IsEmpty": false + }, + "Timestamp": 637316496238230120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593011379, + "Position": { + "X": 1076.6087319784406, + "Y": 515.94164311047837, + "IsEmpty": false + }, + "Timestamp": 637316496238400170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594964504, + "Position": { + "X": 1076.6087319784406, + "Y": 520.62621342297837, + "IsEmpty": false + }, + "Timestamp": 637316496238565450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594964504, + "Position": { + "X": 1076.6087319784406, + "Y": 523.8330493604783, + "IsEmpty": false + }, + "Timestamp": 637316496238725730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596917689, + "Position": { + "X": 1076.6087319784406, + "Y": 527.00848881360332, + "IsEmpty": false + }, + "Timestamp": 637316496238899280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.598870814, + "Position": { + "X": 1076.6087319784406, + "Y": 532.10175053235332, + "IsEmpty": false + }, + "Timestamp": 637316496239065090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605218589, + "Position": { + "X": 1076.6087319784406, + "Y": 535.24574467297839, + "IsEmpty": false + }, + "Timestamp": 637316496239242550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.609857321, + "Position": { + "X": 1076.6087319784406, + "Y": 537.94955326672834, + "IsEmpty": false + }, + "Timestamp": 637316496239405050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619867265, + "Position": { + "X": 1076.6087319784406, + "Y": 540.33900639172839, + "IsEmpty": false + }, + "Timestamp": 637316496239571790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623041093, + "Position": { + "X": 1076.6087319784406, + "Y": 542.9485278761033, + "IsEmpty": false + }, + "Timestamp": 637316496239751120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625238419, + "Position": { + "X": 1076.6087319784406, + "Y": 545.30648686047834, + "IsEmpty": false + }, + "Timestamp": 637316496239921720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627191603, + "Position": { + "X": 1076.6087319784406, + "Y": 546.84706303235339, + "IsEmpty": false + }, + "Timestamp": 637316496240085230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629144728, + "Position": { + "X": 1076.6087319784406, + "Y": 548.1675220167283, + "IsEmpty": false + }, + "Timestamp": 637316496240249400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6340276, + "Position": { + "X": 1076.6087319784406, + "Y": 549.83383061047834, + "IsEmpty": false + }, + "Timestamp": 637316496240419270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 1076.6087319784406, + "Y": 550.77704350110332, + "IsEmpty": false + }, + "Timestamp": 637316496240587860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 1076.6087319784406, + "Y": 551.50013920422839, + "IsEmpty": false + }, + "Timestamp": 637316496240759710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 1076.6087319784406, + "Y": 552.34901615735339, + "IsEmpty": false + }, + "Timestamp": 637316496240925450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 1076.6087319784406, + "Y": 552.82064701672834, + "IsEmpty": false + }, + "Timestamp": 637316496241091000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 1076.6087319784406, + "Y": 554.2353931104783, + "IsEmpty": false + }, + "Timestamp": 637316496241270820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 1076.6087319784406, + "Y": 555.11571537610337, + "IsEmpty": false + }, + "Timestamp": 637316496241431150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 1076.6087319784406, + "Y": 555.8074145948533, + "IsEmpty": false + }, + "Timestamp": 637316496241603170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 1076.6087319784406, + "Y": 557.09642826672837, + "IsEmpty": false + }, + "Timestamp": 637316496241770410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 1076.6087319784406, + "Y": 557.85101811047832, + "IsEmpty": false + }, + "Timestamp": 637316496241944600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1076.6087319784406, + "Y": 558.38549076672837, + "IsEmpty": false + }, + "Timestamp": 637316496242110580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1076.6087319784406, + "Y": 559.10858646985332, + "IsEmpty": false + }, + "Timestamp": 637316496242276910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 1076.6087319784406, + "Y": 560.3347583448533, + "IsEmpty": false + }, + "Timestamp": 637316496242450050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 1076.6087319784406, + "Y": 560.83778568860339, + "IsEmpty": false + }, + "Timestamp": 637316496242621890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1076.6087319784406, + "Y": 561.34081303235337, + "IsEmpty": false + }, + "Timestamp": 637316496242786580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1076.6087319784406, + "Y": 562.0325122511033, + "IsEmpty": false + }, + "Timestamp": 637316496242954570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1076.6087319784406, + "Y": 563.03856693860337, + "IsEmpty": false + }, + "Timestamp": 637316496243121020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1076.6087319784406, + "Y": 564.26473881360334, + "IsEmpty": false + }, + "Timestamp": 637316496243295760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1076.6087319784406, + "Y": 564.95638920422834, + "IsEmpty": false + }, + "Timestamp": 637316496243459980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1076.6087319784406, + "Y": 565.61664311047832, + "IsEmpty": false + }, + "Timestamp": 637316496243631300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1076.6087319784406, + "Y": 565.8367114698533, + "IsEmpty": false + }, + "Timestamp": 637316496243805110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1076.6087319784406, + "Y": 566.02538334485337, + "IsEmpty": false + }, + "Timestamp": 637316496244140840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1076.6087319784406, + "Y": 566.46552006360332, + "IsEmpty": false + }, + "Timestamp": 637316496244307400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646723151, + "Position": { + "X": 1076.6087319784406, + "Y": 567.06288334485339, + "IsEmpty": false + }, + "Timestamp": 637316496244479290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 1076.6087319784406, + "Y": 567.6916919386033, + "IsEmpty": false + }, + "Timestamp": 637316496244652390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656488895, + "Position": { + "X": 1076.6087319784406, + "Y": 567.91176029797839, + "IsEmpty": false + }, + "Timestamp": 637316496244812500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656488895, + "Position": { + "X": 1076.6087319784406, + "Y": 568.06893803235334, + "IsEmpty": false + }, + "Timestamp": 637316496246162310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65429157, + "Position": { + "X": 1076.6087319784406, + "Y": 568.6663013136033, + "IsEmpty": false + }, + "Timestamp": 637316496246334800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644525826, + "Position": { + "X": 1076.6087319784406, + "Y": 569.2322192823533, + "IsEmpty": false + }, + "Timestamp": 637316496246504620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619378984, + "Position": { + "X": 1076.6087319784406, + "Y": 569.57806889172832, + "IsEmpty": false + }, + "Timestamp": 637316496246848730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.255115598, + "Position": { + "X": 1076.6087319784406, + "Y": 569.64095951672834, + "IsEmpty": false + }, + "Timestamp": 637316496246859100, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "24d13101-8e09-44f9-adbe-8fc18ed6214a", + "Points": [ + { + "Pressure": 0.142320901, + "Position": { + "X": 1042.1923379354716, + "Y": 495.63148686047833, + "IsEmpty": false + }, + "Timestamp": 637316496253205020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.156237125, + "Position": { + "X": 1042.1923379354716, + "Y": 495.37997318860334, + "IsEmpty": false + }, + "Timestamp": 637316496253262640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.174059659, + "Position": { + "X": 1042.1923379354716, + "Y": 495.22279545422833, + "IsEmpty": false + }, + "Timestamp": 637316496253437050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.256336302, + "Position": { + "X": 1042.1923379354716, + "Y": 494.87694584485337, + "IsEmpty": false + }, + "Timestamp": 637316496253598670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534416735, + "Position": { + "X": 1042.1923379354716, + "Y": 495.69437748547836, + "IsEmpty": false + }, + "Timestamp": 637316496254451610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568352759, + "Position": { + "X": 1042.1923379354716, + "Y": 497.67509037610336, + "IsEmpty": false + }, + "Timestamp": 637316496254612710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58934921, + "Position": { + "X": 1042.1923379354716, + "Y": 499.65580326672836, + "IsEmpty": false + }, + "Timestamp": 637316496254789510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608880758, + "Position": { + "X": 1042.1923379354716, + "Y": 502.26532475110332, + "IsEmpty": false + }, + "Timestamp": 637316496254949800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628412306, + "Position": { + "X": 1042.1923379354716, + "Y": 505.25209232922833, + "IsEmpty": false + }, + "Timestamp": 637316496255126650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650873601, + "Position": { + "X": 1042.1923379354716, + "Y": 510.09384037610334, + "IsEmpty": false + }, + "Timestamp": 637316496255291810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65844208, + "Position": { + "X": 1042.1923379354716, + "Y": 513.67797123547837, + "IsEmpty": false + }, + "Timestamp": 637316496255462280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665278077, + "Position": { + "X": 1042.1923379354716, + "Y": 517.70228764172839, + "IsEmpty": false + }, + "Timestamp": 637316496255630980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667231262, + "Position": { + "X": 1042.1923379354716, + "Y": 522.0095630323533, + "IsEmpty": false + }, + "Timestamp": 637316496255803480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671381712, + "Position": { + "X": 1042.1923379354716, + "Y": 528.26610600110337, + "IsEmpty": false + }, + "Timestamp": 637316496255973000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675776303, + "Position": { + "X": 1042.1923379354716, + "Y": 532.07030521985337, + "IsEmpty": false + }, + "Timestamp": 637316496256133560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1042.1923379354716, + "Y": 535.56014896985334, + "IsEmpty": false + }, + "Timestamp": 637316496256304580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 1042.1923379354716, + "Y": 538.64125248547839, + "IsEmpty": false + }, + "Timestamp": 637316496256470730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 1042.1923379354716, + "Y": 542.6655688917283, + "IsEmpty": false + }, + "Timestamp": 637316496256648720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 1042.1923379354716, + "Y": 545.02352787610334, + "IsEmpty": false + }, + "Timestamp": 637316496256818390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 1042.1923379354716, + "Y": 547.25575443860339, + "IsEmpty": false + }, + "Timestamp": 637316496256977440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 549.33080326672837, + "IsEmpty": false + }, + "Timestamp": 637316496257148540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 551.81454350110334, + "IsEmpty": false + }, + "Timestamp": 637316496257319050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 553.32367436047832, + "IsEmpty": false + }, + "Timestamp": 637316496257487480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 555.05287357922839, + "IsEmpty": false + }, + "Timestamp": 637316496257655620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 556.71918217297832, + "IsEmpty": false + }, + "Timestamp": 637316496257823350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 559.17147709485334, + "IsEmpty": false + }, + "Timestamp": 637316496257997140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 560.64916264172837, + "IsEmpty": false + }, + "Timestamp": 637316496258165190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 562.00106693860334, + "IsEmpty": false + }, + "Timestamp": 637316496258328630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 563.07001225110332, + "IsEmpty": false + }, + "Timestamp": 637316496258502250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 564.4219165479783, + "IsEmpty": false + }, + "Timestamp": 637316496258673550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 565.17650639172837, + "IsEmpty": false + }, + "Timestamp": 637316496258844650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 565.67953373547834, + "IsEmpty": false + }, + "Timestamp": 637316496259007900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 1042.1923379354716, + "Y": 566.15111576672837, + "IsEmpty": false + }, + "Timestamp": 637316496259173000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 1042.1923379354716, + "Y": 566.62274662610332, + "IsEmpty": false + }, + "Timestamp": 637316496259344790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 1042.1923379354716, + "Y": 567.34584232922839, + "IsEmpty": false + }, + "Timestamp": 637316496259510720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 1042.1923379354716, + "Y": 568.19471928235339, + "IsEmpty": false + }, + "Timestamp": 637316496259684660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 1042.1923379354716, + "Y": 568.63485600110334, + "IsEmpty": false + }, + "Timestamp": 637316496259854230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 1042.1923379354716, + "Y": 569.07504154797834, + "IsEmpty": false + }, + "Timestamp": 637316496260027660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1042.1923379354716, + "Y": 569.45228764172839, + "IsEmpty": false + }, + "Timestamp": 637316496260698300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1042.1923379354716, + "Y": 569.64095951672834, + "IsEmpty": false + }, + "Timestamp": 637316496261041310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1042.1923379354716, + "Y": 569.82958256360337, + "IsEmpty": false + }, + "Timestamp": 637316496261210830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1042.1923379354716, + "Y": 570.17543217297839, + "IsEmpty": false + }, + "Timestamp": 637316496261377790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1042.1923379354716, + "Y": 570.30116459485339, + "IsEmpty": false + }, + "Timestamp": 637316496261549240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.378164351, + "Position": { + "X": 1042.1923379354716, + "Y": 570.33260990735334, + "IsEmpty": false + }, + "Timestamp": 637316496261692140, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c777288a-727c-4710-b11c-05d9560ad1a9", + "Points": [ + { + "Pressure": 0.158434421, + "Position": { + "X": 1022.886344283128, + "Y": 491.38715092297832, + "IsEmpty": false + }, + "Timestamp": 637316496271264090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.315175086, + "Position": { + "X": 1022.886344283128, + "Y": 491.16703373547836, + "IsEmpty": false + }, + "Timestamp": 637316496271718770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49974823, + "Position": { + "X": 1022.886344283128, + "Y": 491.48143803235337, + "IsEmpty": false + }, + "Timestamp": 637316496272273470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.541985214, + "Position": { + "X": 1022.886344283128, + "Y": 492.70760990735334, + "IsEmpty": false + }, + "Timestamp": 637316496272478250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.563714027, + "Position": { + "X": 1022.886344283128, + "Y": 494.24813725110334, + "IsEmpty": false + }, + "Timestamp": 637316496272644820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.618646502, + "Position": { + "X": 1022.886344283128, + "Y": 503.42860600110333, + "IsEmpty": false + }, + "Timestamp": 637316496273024510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630853713, + "Position": { + "X": 1022.886344283128, + "Y": 506.79266850110332, + "IsEmpty": false + }, + "Timestamp": 637316496273347620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640619516, + "Position": { + "X": 1022.886344283128, + "Y": 510.03094975110332, + "IsEmpty": false + }, + "Timestamp": 637316496273463110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652582586, + "Position": { + "X": 1022.886344283128, + "Y": 516.9163013136033, + "IsEmpty": false + }, + "Timestamp": 637316496273862040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656488895, + "Position": { + "X": 1022.886344283128, + "Y": 522.88988529797837, + "IsEmpty": false + }, + "Timestamp": 637316496274163860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656488895, + "Position": { + "X": 1022.886344283128, + "Y": 523.92738529797839, + "IsEmpty": false + }, + "Timestamp": 637316496274294420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660395205, + "Position": { + "X": 1022.886344283128, + "Y": 527.19711186047834, + "IsEmpty": false + }, + "Timestamp": 637316496274756580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668207824, + "Position": { + "X": 1022.886344283128, + "Y": 526.97704350110337, + "IsEmpty": false + }, + "Timestamp": 637316496275173770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.541496933, + "Position": { + "X": 1022.886344283128, + "Y": 526.06527592297834, + "IsEmpty": false + }, + "Timestamp": 637316496275556260, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7126dbd7-f0d1-460e-8fe3-3ffcab72a372", + "Points": [ + { + "Pressure": 0.347646296, + "Position": { + "X": 994.49517607023733, + "Y": 492.04735600110337, + "IsEmpty": false + }, + "Timestamp": 637316496282152850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.472648203, + "Position": { + "X": 994.49517607023733, + "Y": 493.93373295422833, + "IsEmpty": false + }, + "Timestamp": 637316496282939750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.541008592, + "Position": { + "X": 994.49517607023733, + "Y": 497.07772709485334, + "IsEmpty": false + }, + "Timestamp": 637316496283116950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625482559, + "Position": { + "X": 994.49517607023733, + "Y": 506.41537357922834, + "IsEmpty": false + }, + "Timestamp": 637316496283505680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641840219, + "Position": { + "X": 994.49517607023733, + "Y": 511.72870365735332, + "IsEmpty": false + }, + "Timestamp": 637316496283822700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64623481, + "Position": { + "X": 994.49517607023733, + "Y": 514.55829350110332, + "IsEmpty": false + }, + "Timestamp": 637316496283941800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661615908, + "Position": { + "X": 994.49517607023733, + "Y": 521.94667240735339, + "IsEmpty": false + }, + "Timestamp": 637316496284367060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663569093, + "Position": { + "X": 994.49517607023733, + "Y": 523.2671313917283, + "IsEmpty": false + }, + "Timestamp": 637316496284649810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667475402, + "Position": { + "X": 994.49517607023733, + "Y": 524.9648852979783, + "IsEmpty": false + }, + "Timestamp": 637316496285015920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667475402, + "Position": { + "X": 994.49517607023733, + "Y": 527.00848881360332, + "IsEmpty": false + }, + "Timestamp": 637316496285361210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.26366064, + "Position": { + "X": 994.49517607023733, + "Y": 527.82592045422837, + "IsEmpty": false + }, + "Timestamp": 637316496285697460, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "50c2b960-b172-4ab8-8331-f7a288a5976e", + "Points": [], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "43697fb5-d000-47e9-b559-00b2a53ad8d2", + "Points": [ + { + "Pressure": 0.186022729, + "Position": { + "X": 1021.9163706796292, + "Y": 490.7272505522638, + "IsEmpty": false + }, + "Timestamp": 637316496348183370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.359365225, + "Position": { + "X": 1022.3069364843245, + "Y": 490.72930222956239, + "IsEmpty": false + }, + "Timestamp": 637316496348572160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.478751808, + "Position": { + "X": 1022.9790599196924, + "Y": 490.73140491428995, + "IsEmpty": false + }, + "Timestamp": 637316496348904000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655756474, + "Position": { + "X": 1022.3069364843245, + "Y": 490.72930222956239, + "IsEmpty": false + }, + "Timestamp": 637316496350084760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678217769, + "Position": { + "X": 1019.3184309007788, + "Y": 490.71955611850666, + "IsEmpty": false + }, + "Timestamp": 637316496350252930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.68676281, + "Position": { + "X": 1015.7667156196059, + "Y": 490.71109895035204, + "IsEmpty": false + }, + "Timestamp": 637316496350423370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 1011.5510082053701, + "Y": 490.70267112330339, + "IsEmpty": false + }, + "Timestamp": 637316496350592340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 1005.7677209651271, + "Y": 490.69359867508138, + "IsEmpty": false + }, + "Timestamp": 637316496350767400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700679004, + "Position": { + "X": 1000.512846957488, + "Y": 490.6891873848225, + "IsEmpty": false + }, + "Timestamp": 637316496350937040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708003342, + "Position": { + "X": 997.30460147164342, + "Y": 490.6904348503183, + "IsEmpty": false + }, + "Timestamp": 637316496351100350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71947813, + "Position": { + "X": 994.77821729539062, + "Y": 490.69285795216979, + "IsEmpty": false + }, + "Timestamp": 637316496351315160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729488075, + "Position": { + "X": 992.30894223877249, + "Y": 490.69614295677439, + "IsEmpty": false + }, + "Timestamp": 637316496351437380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746089876, + "Position": { + "X": 989.1672765271079, + "Y": 490.70145053267731, + "IsEmpty": false + }, + "Timestamp": 637316496351610450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750240326, + "Position": { + "X": 987.50057652444195, + "Y": 490.703944482277, + "IsEmpty": false + }, + "Timestamp": 637316496351776720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754146636, + "Position": { + "X": 986.40558141341, + "Y": 490.70664906503799, + "IsEmpty": false + }, + "Timestamp": 637316496351944370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 986.95713631523017, + "Y": 490.70527049954109, + "IsEmpty": false + }, + "Timestamp": 637316496352623210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.780758381, + "Position": { + "X": 988.24344813145012, + "Y": 490.70267112330339, + "IsEmpty": false + }, + "Timestamp": 637316496352796780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.782711506, + "Position": { + "X": 988.76644769653012, + "Y": 490.70145053267731, + "IsEmpty": false + }, + "Timestamp": 637316496352966060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76830703, + "Position": { + "X": 988.56295173698743, + "Y": 490.70145053267731, + "IsEmpty": false + }, + "Timestamp": 637316496353465750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.3168841, + "Position": { + "X": 988.24344813145012, + "Y": 490.70267112330339, + "IsEmpty": false + }, + "Timestamp": 637316496353626880, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "0b2cf9c0-22ef-4f80-9dae-9c78b18c18a0", + "Points": [], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "dbd60b0a-edee-4523-9370-7856a269f755", + "Points": [ + { + "Pressure": 0.30467689, + "Position": { + "X": 1042.0765564914896, + "Y": 490.94880645393869, + "IsEmpty": false + }, + "Timestamp": 637316496372712430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718013287, + "Position": { + "X": 1043.5251116927036, + "Y": 490.95938986649946, + "IsEmpty": false + }, + "Timestamp": 637316496373743470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745601594, + "Position": { + "X": 1044.7602012423047, + "Y": 490.96301135747171, + "IsEmpty": false + }, + "Timestamp": 637316496373917720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.765133142, + "Position": { + "X": 1046.6193083417006, + "Y": 490.97415537312304, + "IsEmpty": false + }, + "Timestamp": 637316496374083940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.77636379, + "Position": { + "X": 1048.8930157291431, + "Y": 490.9857164264447, + "IsEmpty": false + }, + "Timestamp": 637316496374255780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.78442055, + "Position": { + "X": 1053.2656868711485, + "Y": 491.01429758979515, + "IsEmpty": false + }, + "Timestamp": 637316496374420960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789303422, + "Position": { + "X": 1058.1781565856952, + "Y": 491.04509617483257, + "IsEmpty": false + }, + "Timestamp": 637316496374589730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 1062.2588699260609, + "Y": 491.07323166426352, + "IsEmpty": false + }, + "Timestamp": 637316496374762390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793209732, + "Position": { + "X": 1065.8751182088156, + "Y": 491.09788461695132, + "IsEmpty": false + }, + "Timestamp": 637316496374930700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795162916, + "Position": { + "X": 1069.6736578603379, + "Y": 491.12889594288851, + "IsEmpty": false + }, + "Timestamp": 637316496375100270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795162916, + "Position": { + "X": 1071.8247042509618, + "Y": 491.14497886948948, + "IsEmpty": false + }, + "Timestamp": 637316496375268750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795162916, + "Position": { + "X": 1073.5380693597979, + "Y": 491.16144273605772, + "IsEmpty": false + }, + "Timestamp": 637316496375436810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795162916, + "Position": { + "X": 1075.1482764185871, + "Y": 491.17262883506476, + "IsEmpty": false + }, + "Timestamp": 637316496375602710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795162916, + "Position": { + "X": 1076.3048501689934, + "Y": 491.18398207269371, + "IsEmpty": false + }, + "Timestamp": 637316496375775260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795162916, + "Position": { + "X": 1076.7700793145855, + "Y": 491.18398207269371, + "IsEmpty": false + }, + "Timestamp": 637316496375951170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795162916, + "Position": { + "X": 1077.3515641370002, + "Y": 491.18972109748773, + "IsEmpty": false + }, + "Timestamp": 637316496376107840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797116041, + "Position": { + "X": 1077.4665649075916, + "Y": 491.19550158173246, + "IsEmpty": false + }, + "Timestamp": 637316496376462820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797116041, + "Position": { + "X": 1077.9343238655017, + "Y": 491.19550158173246, + "IsEmpty": false + }, + "Timestamp": 637316496376617090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794918716, + "Position": { + "X": 1077.3515641370002, + "Y": 491.18972109748773, + "IsEmpty": false + }, + "Timestamp": 637316496377639750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.422110319, + "Position": { + "X": 1075.6109557137438, + "Y": 491.17262883506476, + "IsEmpty": false + }, + "Timestamp": 637316496377896360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.422110319, + "Position": { + "X": 1076.1898747296891, + "Y": 491.17828461575226, + "IsEmpty": false + }, + "Timestamp": 637316496377915260, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "a64278c0-f32d-4d65-9430-130a793a5218", + "Points": [ + { + "Pressure": 0.122301057, + "Position": { + "X": 1020.9342988482782, + "Y": 524.80757146896121, + "IsEmpty": false + }, + "Timestamp": 637316496385493840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.290272385, + "Position": { + "X": 1021.2406309777086, + "Y": 524.8023586019923, + "IsEmpty": false + }, + "Timestamp": 637316496385909350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.374746323, + "Position": { + "X": 1021.4198264057572, + "Y": 524.8023586019923, + "IsEmpty": false + }, + "Timestamp": 637316496386087160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.449454486, + "Position": { + "X": 1021.6002667101717, + "Y": 524.8023586019923, + "IsEmpty": false + }, + "Timestamp": 637316496386251780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673334837, + "Position": { + "X": 1020.756351607437, + "Y": 524.80757146896121, + "IsEmpty": false + }, + "Timestamp": 637316496387598220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685297906, + "Position": { + "X": 1019.2731127998755, + "Y": 524.81758505050004, + "IsEmpty": false + }, + "Timestamp": 637316496387768440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.69897002, + "Position": { + "X": 1015.9403811078186, + "Y": 524.84020104739045, + "IsEmpty": false + }, + "Timestamp": 637316496387940330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708979905, + "Position": { + "X": 1012.7683275309209, + "Y": 524.85933338871064, + "IsEmpty": false + }, + "Timestamp": 637316496388107990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718989849, + "Position": { + "X": 1009.8138657695291, + "Y": 524.87210630742425, + "IsEmpty": false + }, + "Timestamp": 637316496388276210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 1006.5815093213074, + "Y": 524.88487535997467, + "IsEmpty": false + }, + "Timestamp": 637316496388442030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 1002.6977516369769, + "Y": 524.89546058741121, + "IsEmpty": false + }, + "Timestamp": 637316496388621070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737788975, + "Position": { + "X": 1000.5122310744108, + "Y": 524.89879653571666, + "IsEmpty": false + }, + "Timestamp": 637316496388785420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 998.21026155802178, + "Y": 524.89671819508987, + "IsEmpty": false + }, + "Timestamp": 637316496388957330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 996.85985571612832, + "Y": 524.89405774724059, + "IsEmpty": false + }, + "Timestamp": 637316496389120770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 996.18212915281231, + "Y": 524.89250996889086, + "IsEmpty": false + }, + "Timestamp": 637316496389294020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742427707, + "Position": { + "X": 995.93954214811947, + "Y": 524.89250996889086, + "IsEmpty": false + }, + "Timestamp": 637316496389463150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 995.38024980844261, + "Y": 524.89081754667609, + "IsEmpty": false + }, + "Timestamp": 637316496389626040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 995.29200319361223, + "Y": 524.89081754667609, + "IsEmpty": false + }, + "Timestamp": 637316496389795280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761959255, + "Position": { + "X": 996.10275228208889, + "Y": 524.89250996889086, + "IsEmpty": false + }, + "Timestamp": 637316496390472560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769771874, + "Position": { + "X": 997.49979137048854, + "Y": 524.89546058741121, + "IsEmpty": false + }, + "Timestamp": 637316496390647780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773678184, + "Position": { + "X": 998.21026155802178, + "Y": 524.89671819508987, + "IsEmpty": false + }, + "Timestamp": 637316496390807760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.775875509, + "Position": { + "X": 998.61568079746485, + "Y": 524.89783027596286, + "IsEmpty": false + }, + "Timestamp": 637316496390976730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 998.10152138674141, + "Y": 524.89671819508987, + "IsEmpty": false + }, + "Timestamp": 637316496391664570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656000614, + "Position": { + "X": 997.92687284754686, + "Y": 524.89671819508987, + "IsEmpty": false + }, + "Timestamp": 637316496391794390, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "229674e1-660b-43e7-b69b-9a9fba44ee82", + "Points": [ + { + "Pressure": 0.0764019191, + "Position": { + "X": 1041.8137856893779, + "Y": 500.37894779797836, + "IsEmpty": false + }, + "Timestamp": 637316496521358990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.258289456, + "Position": { + "X": 1041.3721475057841, + "Y": 500.28461186047832, + "IsEmpty": false + }, + "Timestamp": 637316496521772840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.334950775, + "Position": { + "X": 1041.1513223104716, + "Y": 500.22172123547836, + "IsEmpty": false + }, + "Timestamp": 637316496521948680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.426260769, + "Position": { + "X": 1041.3721475057841, + "Y": 500.12743412610337, + "IsEmpty": false + }, + "Timestamp": 637316496522461360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.45506981, + "Position": { + "X": 1042.6970620565655, + "Y": 500.00165287610332, + "IsEmpty": false + }, + "Timestamp": 637316496522621250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.476798654, + "Position": { + "X": 1043.9273477010968, + "Y": 500.06454350110334, + "IsEmpty": false + }, + "Timestamp": 637316496522781250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.492912173, + "Position": { + "X": 1045.0314492635966, + "Y": 500.34750248547834, + "IsEmpty": false + }, + "Timestamp": 637316496522955810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510246456, + "Position": { + "X": 1046.8295571737531, + "Y": 500.44178959485333, + "IsEmpty": false + }, + "Timestamp": 637316496523126020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523186088, + "Position": { + "X": 1048.3122109823466, + "Y": 500.59901615735333, + "IsEmpty": false + }, + "Timestamp": 637316496523292860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.536614001, + "Position": { + "X": 1050.0787637167218, + "Y": 500.85052982922832, + "IsEmpty": false + }, + "Timestamp": 637316496523459460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543938339, + "Position": { + "X": 1051.245963423753, + "Y": 500.91342045422834, + "IsEmpty": false + }, + "Timestamp": 637316496523630300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56054014, + "Position": { + "X": 1054.9683633260968, + "Y": 500.88197514172833, + "IsEmpty": false + }, + "Timestamp": 637316496523798120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1056.9872842245343, + "Y": 500.88197514172833, + "IsEmpty": false + }, + "Timestamp": 637316496523972070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 1058.9431191854717, + "Y": 500.94486576672836, + "IsEmpty": false + }, + "Timestamp": 637316496524136950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 1060.7096841268781, + "Y": 501.03915287610334, + "IsEmpty": false + }, + "Timestamp": 637316496524310640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573235691, + "Position": { + "X": 1063.1071572714093, + "Y": 501.29066654797833, + "IsEmpty": false + }, + "Timestamp": 637316496524472810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573235691, + "Position": { + "X": 1064.2112588339091, + "Y": 501.51078373547836, + "IsEmpty": false + }, + "Timestamp": 637316496524650150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575188816, + "Position": { + "X": 1065.2207192831279, + "Y": 501.69940678235332, + "IsEmpty": false + }, + "Timestamp": 637316496524813610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577142, + "Position": { + "X": 1066.5141030721904, + "Y": 501.69940678235332, + "IsEmpty": false + }, + "Timestamp": 637316496524987400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582757294, + "Position": { + "X": 1068.1860269003155, + "Y": 501.51078373547836, + "IsEmpty": false + }, + "Timestamp": 637316496525156430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582757294, + "Position": { + "X": 1069.3216714315654, + "Y": 501.32211186047834, + "IsEmpty": false + }, + "Timestamp": 637316496525324340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584954619, + "Position": { + "X": 1069.5424844198467, + "Y": 501.29066654797833, + "IsEmpty": false + }, + "Timestamp": 637316496525485610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.590081632, + "Position": { + "X": 1070.0472207479718, + "Y": 501.10204350110337, + "IsEmpty": false + }, + "Timestamp": 637316496525655690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602288842, + "Position": { + "X": 1070.4257729940655, + "Y": 500.97626225110332, + "IsEmpty": false + }, + "Timestamp": 637316496525833270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611322165, + "Position": { + "X": 1070.6150430135967, + "Y": 500.91342045422834, + "IsEmpty": false + }, + "Timestamp": 637316496526000990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620843828, + "Position": { + "X": 1070.8043252401592, + "Y": 500.85052982922832, + "IsEmpty": false + }, + "Timestamp": 637316496526161920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620843828, + "Position": { + "X": 1071.2144204550029, + "Y": 500.78763920422836, + "IsEmpty": false + }, + "Timestamp": 637316496526333150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 1071.6876016073468, + "Y": 500.72474857922833, + "IsEmpty": false + }, + "Timestamp": 637316496526507780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 1071.9399697714093, + "Y": 500.69330326672832, + "IsEmpty": false + }, + "Timestamp": 637316496526669410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 1072.1607827596904, + "Y": 500.63046146985334, + "IsEmpty": false + }, + "Timestamp": 637316496526847120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 1072.3500649862531, + "Y": 500.56757084485332, + "IsEmpty": false + }, + "Timestamp": 637316496527014430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 1072.5708779745341, + "Y": 500.56757084485332, + "IsEmpty": false + }, + "Timestamp": 637316496527185820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.621087968, + "Position": { + "X": 1073.0440713339092, + "Y": 500.66190678235336, + "IsEmpty": false + }, + "Timestamp": 637316496527353070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.364492267, + "Position": { + "X": 1073.485709517503, + "Y": 500.85052982922832, + "IsEmpty": false + }, + "Timestamp": 637316496527522480, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c8739449-a537-4adc-9ddd-b54856bf6449", + "Points": [ + { + "Pressure": 0.169909209, + "Position": { + "X": 995.25227445890926, + "Y": 501.35355717297836, + "IsEmpty": false + }, + "Timestamp": 637316496533049650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.3002823, + "Position": { + "X": 994.90527128508108, + "Y": 501.19637943860334, + "IsEmpty": false + }, + "Timestamp": 637316496533435360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.496330202, + "Position": { + "X": 995.12609037687798, + "Y": 501.13348881360332, + "IsEmpty": false + }, + "Timestamp": 637316496533935100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.524895072, + "Position": { + "X": 995.91473173429983, + "Y": 501.00770756360333, + "IsEmpty": false + }, + "Timestamp": 637316496534113700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54857707, + "Position": { + "X": 996.67183012297176, + "Y": 500.88197514172833, + "IsEmpty": false + }, + "Timestamp": 637316496534274580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5688411, + "Position": { + "X": 997.52356352140919, + "Y": 500.78763920422836, + "IsEmpty": false + }, + "Timestamp": 637316496534454080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597650111, + "Position": { + "X": 999.35322050383115, + "Y": 500.69330326672832, + "IsEmpty": false + }, + "Timestamp": 637316496534615100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608880758, + "Position": { + "X": 1000.9620522909405, + "Y": 500.72474857922833, + "IsEmpty": false + }, + "Timestamp": 637316496534787800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1003.0756143026592, + "Y": 500.81908451672837, + "IsEmpty": false + }, + "Timestamp": 637316496534949040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624505997, + "Position": { + "X": 1005.4415444784405, + "Y": 501.00770756360333, + "IsEmpty": false + }, + "Timestamp": 637316496535120660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631097913, + "Position": { + "X": 1008.5645730428936, + "Y": 501.54218021985332, + "IsEmpty": false + }, + "Timestamp": 637316496535289540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633539319, + "Position": { + "X": 1010.2680459432843, + "Y": 501.91947514172836, + "IsEmpty": false + }, + "Timestamp": 637316496535460140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 1012.0661538534405, + "Y": 501.98236576672832, + "IsEmpty": false + }, + "Timestamp": 637316496535627350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643060982, + "Position": { + "X": 1013.8642556600811, + "Y": 501.98236576672832, + "IsEmpty": false + }, + "Timestamp": 637316496535794330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646967292, + "Position": { + "X": 1016.3879189901593, + "Y": 502.17098881360334, + "IsEmpty": false + }, + "Timestamp": 637316496535970630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648920417, + "Position": { + "X": 1017.9336587362529, + "Y": 502.35966068860336, + "IsEmpty": false + }, + "Timestamp": 637316496536135720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652826726, + "Position": { + "X": 1019.3216714315655, + "Y": 502.51683842297837, + "IsEmpty": false + }, + "Timestamp": 637316496536301250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652826726, + "Position": { + "X": 1020.5519570760968, + "Y": 502.51683842297837, + "IsEmpty": false + }, + "Timestamp": 637316496536472230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.654779911, + "Position": { + "X": 1021.9084268026593, + "Y": 502.54828373547832, + "IsEmpty": false + }, + "Timestamp": 637316496536647220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659174502, + "Position": { + "X": 1022.4131509237529, + "Y": 502.57972904797833, + "IsEmpty": false + }, + "Timestamp": 637316496536811280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659906924, + "Position": { + "X": 1022.949430220628, + "Y": 502.64261967297836, + "IsEmpty": false + }, + "Timestamp": 637316496536980640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659906924, + "Position": { + "X": 1023.2017983846905, + "Y": 502.67401615735332, + "IsEmpty": false + }, + "Timestamp": 637316496537153750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659906924, + "Position": { + "X": 1023.7065347128155, + "Y": 502.76835209485336, + "IsEmpty": false + }, + "Timestamp": 637316496537322720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.393545419, + "Position": { + "X": 1023.9588906698467, + "Y": 502.73690678235334, + "IsEmpty": false + }, + "Timestamp": 637316496537659530, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "21a23af5-cfa6-4e0e-a09d-c2600f463500", + "Points": [ + { + "Pressure": 0.13963531, + "Position": { + "X": 1066.5771890096905, + "Y": 501.76229740735334, + "IsEmpty": false + }, + "Timestamp": 637316496544055800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.281239033, + "Position": { + "X": 1066.7349160604717, + "Y": 501.57362553235333, + "IsEmpty": false + }, + "Timestamp": 637316496544411700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.372549027, + "Position": { + "X": 1067.1450112753155, + "Y": 501.32211186047834, + "IsEmpty": false + }, + "Timestamp": 637316496544584660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.448722064, + "Position": { + "X": 1068.9431191854717, + "Y": 500.97626225110332, + "IsEmpty": false + }, + "Timestamp": 637316496544901190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.462394148, + "Position": { + "X": 1070.0787637167218, + "Y": 501.19637943860334, + "IsEmpty": false + }, + "Timestamp": 637316496544975190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.191638052, + "Position": { + "X": 1070.6150430135967, + "Y": 501.44789311047833, + "IsEmpty": false + }, + "Timestamp": 637316496545081470, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "78325559-f36c-43ad-ae8b-c8ac1c3df45d", + "Points": [ + { + "Pressure": 0.129137099, + "Position": { + "X": 1106.7305182072582, + "Y": 539.47160980708372, + "IsEmpty": false + }, + "Timestamp": 637316496618024270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.380117506, + "Position": { + "X": 1106.2260391475156, + "Y": 539.30641500340903, + "IsEmpty": false + }, + "Timestamp": 637316496618260940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.414785981, + "Position": { + "X": 1107.2242745307758, + "Y": 539.63071291253402, + "IsEmpty": false + }, + "Timestamp": 637316496619105960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.450675219, + "Position": { + "X": 1108.2492208399035, + "Y": 539.96803901862654, + "IsEmpty": false + }, + "Timestamp": 637316496619275730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.495353639, + "Position": { + "X": 1109.7757720391196, + "Y": 540.46570560231214, + "IsEmpty": false + }, + "Timestamp": 637316496619440520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.517570734, + "Position": { + "X": 1111.8114696683149, + "Y": 541.12483445530961, + "IsEmpty": false + }, + "Timestamp": 637316496619609460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534172595, + "Position": { + "X": 1113.3797798754122, + "Y": 541.63783087978561, + "IsEmpty": false + }, + "Timestamp": 637316496619779280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.550286114, + "Position": { + "X": 1115.9711880129296, + "Y": 542.47431106610463, + "IsEmpty": false + }, + "Timestamp": 637316496619947940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570794225, + "Position": { + "X": 1120.1608213664072, + "Y": 543.81864405759939, + "IsEmpty": false + }, + "Timestamp": 637316496620121410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58519876, + "Position": { + "X": 1122.275338428673, + "Y": 544.49337031284335, + "IsEmpty": false + }, + "Timestamp": 637316496620287140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595696926, + "Position": { + "X": 1124.4151585504214, + "Y": 545.17609184260027, + "IsEmpty": false + }, + "Timestamp": 637316496620453740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1127.0800540441651, + "Y": 546.01716214256601, + "IsEmpty": false + }, + "Timestamp": 637316496620626820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611566365, + "Position": { + "X": 1130.3313249817902, + "Y": 547.04342256843893, + "IsEmpty": false + }, + "Timestamp": 637316496620796080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1132.5060071853377, + "Y": 547.72488299344172, + "IsEmpty": false + }, + "Timestamp": 637316496620968750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62157625, + "Position": { + "X": 1134.1450421318546, + "Y": 548.23673970084724, + "IsEmpty": false + }, + "Timestamp": 637316496621136760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625482559, + "Position": { + "X": 1135.8037222190228, + "Y": 548.75569376305873, + "IsEmpty": false + }, + "Timestamp": 637316496621304370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62987715, + "Position": { + "X": 1138.0087381074459, + "Y": 549.43987660985294, + "IsEmpty": false + }, + "Timestamp": 637316496621474600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631830335, + "Position": { + "X": 1139.11569361329, + "Y": 549.78232040719229, + "IsEmpty": false + }, + "Timestamp": 637316496621638740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.63378346, + "Position": { + "X": 1140.7686063544722, + "Y": 550.28988308459293, + "IsEmpty": false + }, + "Timestamp": 637316496621803730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635736644, + "Position": { + "X": 1141.8959028356878, + "Y": 550.63936651482641, + "IsEmpty": false + }, + "Timestamp": 637316496621982130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643549263, + "Position": { + "X": 1144.1331010418705, + "Y": 551.32587302849402, + "IsEmpty": false + }, + "Timestamp": 637316496622178520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645746529, + "Position": { + "X": 1145.2559917782778, + "Y": 551.66938491213682, + "IsEmpty": false + }, + "Timestamp": 637316496622313690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645746529, + "Position": { + "X": 1146.394972129528, + "Y": 552.01958924774431, + "IsEmpty": false + }, + "Timestamp": 637316496622481930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647699714, + "Position": { + "X": 1147.5102620157143, + "Y": 552.35686911659627, + "IsEmpty": false + }, + "Timestamp": 637316496622657050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647699714, + "Position": { + "X": 1148.6549392077213, + "Y": 552.70736089179945, + "IsEmpty": false + }, + "Timestamp": 637316496622833090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651606023, + "Position": { + "X": 1149.7757246032993, + "Y": 553.04489148202765, + "IsEmpty": false + }, + "Timestamp": 637316496622989140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 1150.3572178893739, + "Y": 553.22351737325789, + "IsEmpty": false + }, + "Timestamp": 637316496623156110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655512333, + "Position": { + "X": 1150.9260226349913, + "Y": 553.39562438648795, + "IsEmpty": false + }, + "Timestamp": 637316496623324190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596429408, + "Position": { + "X": 1151.4820755655885, + "Y": 553.56120673841178, + "IsEmpty": false + }, + "Timestamp": 637316496623501270, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d0a9fecc-8c81-42b5-868c-0149e03ac22b", + "Points": [ + { + "Pressure": 0.0712748915, + "Position": { + "X": 1101.8896321086713, + "Y": 485.29541570191139, + "IsEmpty": false + }, + "Timestamp": 637316496633989280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.408194095, + "Position": { + "X": 1102.8020684606602, + "Y": 485.16701047535338, + "IsEmpty": false + }, + "Timestamp": 637316496634824590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.466056317, + "Position": { + "X": 1103.4259145965555, + "Y": 485.10271085895988, + "IsEmpty": false + }, + "Timestamp": 637316496634986940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510002315, + "Position": { + "X": 1104.8591780095637, + "Y": 484.90943047113541, + "IsEmpty": false + }, + "Timestamp": 637316496635154890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537834764, + "Position": { + "X": 1106.7071338795161, + "Y": 484.65085317127881, + "IsEmpty": false + }, + "Timestamp": 637316496635324950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567620337, + "Position": { + "X": 1109.3166797838451, + "Y": 484.32628169918695, + "IsEmpty": false + }, + "Timestamp": 637316496635497390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595696926, + "Position": { + "X": 1113.3112599172546, + "Y": 483.8040066648598, + "IsEmpty": false + }, + "Timestamp": 637316496635667830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61351949, + "Position": { + "X": 1116.8209451939917, + "Y": 483.3442156822872, + "IsEmpty": false + }, + "Timestamp": 637316496635829050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635004222, + "Position": { + "X": 1119.9434446302084, + "Y": 482.94817616170212, + "IsEmpty": false + }, + "Timestamp": 637316496635998770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661371768, + "Position": { + "X": 1125.6069697836942, + "Y": 482.21787308405789, + "IsEmpty": false + }, + "Timestamp": 637316496636175950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676264584, + "Position": { + "X": 1129.3675994563037, + "Y": 481.75055608165303, + "IsEmpty": false + }, + "Timestamp": 637316496636344520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687983513, + "Position": { + "X": 1133.1669413843324, + "Y": 481.28145372846944, + "IsEmpty": false + }, + "Timestamp": 637316496636507200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 1136.8833220558688, + "Y": 480.81075106762842, + "IsEmpty": false + }, + "Timestamp": 637316496636675280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 1141.3305261887567, + "Y": 480.27108298222686, + "IsEmpty": false + }, + "Timestamp": 637316496636845860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.707515061, + "Position": { + "X": 1143.9658520968185, + "Y": 479.93297446566669, + "IsEmpty": false + }, + "Timestamp": 637316496637021980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709468246, + "Position": { + "X": 1146.2828876936871, + "Y": 479.66209076174795, + "IsEmpty": false + }, + "Timestamp": 637316496637186410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713862836, + "Position": { + "X": 1148.4885317314015, + "Y": 479.39089167036798, + "IsEmpty": false + }, + "Timestamp": 637316496637351990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716060102, + "Position": { + "X": 1151.7554878641947, + "Y": 478.98357720961235, + "IsEmpty": false + }, + "Timestamp": 637316496637521460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718013287, + "Position": { + "X": 1153.5223034467444, + "Y": 478.77971941840894, + "IsEmpty": false + }, + "Timestamp": 637316496637695300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718013287, + "Position": { + "X": 1154.7038325620351, + "Y": 478.64374983303145, + "IsEmpty": false + }, + "Timestamp": 637316496637857660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718013287, + "Position": { + "X": 1155.7632605630988, + "Y": 478.50773376984796, + "IsEmpty": false + }, + "Timestamp": 637316496638028250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 1157.5448758979373, + "Y": 478.30363197016106, + "IsEmpty": false + }, + "Timestamp": 637316496638196440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 1158.7361833229352, + "Y": 478.16751859441291, + "IsEmpty": false + }, + "Timestamp": 637316496638373120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717525005, + "Position": { + "X": 1159.3328981777952, + "Y": 478.09944987220484, + "IsEmpty": false + }, + "Timestamp": 637316496638536790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.688227654, + "Position": { + "X": 1160.4025021276464, + "Y": 477.96329105654132, + "IsEmpty": false + }, + "Timestamp": 637316496638707800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570550084, + "Position": { + "X": 1161.0011910032608, + "Y": 477.8952020420549, + "IsEmpty": false + }, + "Timestamp": 637316496638783370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570550084, + "Position": { + "X": 1160.5284368086184, + "Y": 477.96329105654132, + "IsEmpty": false + }, + "Timestamp": 637316496638805600, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "717d8b67-67ef-4d68-8648-497366389bff", + "Points": [ + { + "Pressure": 0.208728164, + "Position": { + "X": 1112.6655190878155, + "Y": 486.79691654797836, + "IsEmpty": false + }, + "Timestamp": 637316496673418700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.288807511, + "Position": { + "X": 1112.6655190878155, + "Y": 485.66508061047836, + "IsEmpty": false + }, + "Timestamp": 637316496673859070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.351308465, + "Position": { + "X": 1112.6655190878155, + "Y": 484.34462162610333, + "IsEmpty": false + }, + "Timestamp": 637316496674026030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.395986885, + "Position": { + "X": 1112.6655190878155, + "Y": 483.68436771985336, + "IsEmpty": false + }, + "Timestamp": 637316496674191330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.435538262, + "Position": { + "X": 1112.6655190878155, + "Y": 483.43285404797837, + "IsEmpty": false + }, + "Timestamp": 637316496674357090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.477286935, + "Position": { + "X": 1112.6655190878155, + "Y": 483.24418217297836, + "IsEmpty": false + }, + "Timestamp": 637316496674529080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533684313, + "Position": { + "X": 1112.6655190878155, + "Y": 483.55858646985337, + "IsEmpty": false + }, + "Timestamp": 637316496674704100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55663383, + "Position": { + "X": 1112.6655190878155, + "Y": 484.94193607922836, + "IsEmpty": false + }, + "Timestamp": 637316496674863060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 1112.6655190878155, + "Y": 486.45106693860333, + "IsEmpty": false + }, + "Timestamp": 637316496675037870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.591546476, + "Position": { + "X": 1112.6655190878155, + "Y": 489.02914311047834, + "IsEmpty": false + }, + "Timestamp": 637316496675209850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602288842, + "Position": { + "X": 1112.6655190878155, + "Y": 491.67010990735332, + "IsEmpty": false + }, + "Timestamp": 637316496675376840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611322165, + "Position": { + "X": 1112.6655190878155, + "Y": 495.25424076672834, + "IsEmpty": false + }, + "Timestamp": 637316496675540800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615960956, + "Position": { + "X": 1112.6655190878155, + "Y": 499.08988529797836, + "IsEmpty": false + }, + "Timestamp": 637316496675715140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.621332109, + "Position": { + "X": 1112.6655190878155, + "Y": 502.76835209485336, + "IsEmpty": false + }, + "Timestamp": 637316496675886170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631097913, + "Position": { + "X": 1112.6655190878155, + "Y": 508.49042240735332, + "IsEmpty": false + }, + "Timestamp": 637316496676056330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635980785, + "Position": { + "X": 1112.6655190878155, + "Y": 512.13744389172837, + "IsEmpty": false + }, + "Timestamp": 637316496676220850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640131235, + "Position": { + "X": 1112.6655190878155, + "Y": 515.81591068860337, + "IsEmpty": false + }, + "Timestamp": 637316496676388160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64208436, + "Position": { + "X": 1112.6655190878155, + "Y": 521.34930912610332, + "IsEmpty": false + }, + "Timestamp": 637316496676561380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644037545, + "Position": { + "X": 1112.6655190878155, + "Y": 524.65048100110334, + "IsEmpty": false + }, + "Timestamp": 637316496676733540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64599067, + "Position": { + "X": 1112.6655190878155, + "Y": 527.16571537610332, + "IsEmpty": false + }, + "Timestamp": 637316496676893130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64599067, + "Position": { + "X": 1112.6655190878155, + "Y": 529.24071537610337, + "IsEmpty": false + }, + "Timestamp": 637316496677061550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 1112.6655190878155, + "Y": 531.6301685011033, + "IsEmpty": false + }, + "Timestamp": 637316496677239090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 1112.6655190878155, + "Y": 533.13925053235334, + "IsEmpty": false + }, + "Timestamp": 637316496677405570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 1112.6655190878155, + "Y": 534.64838139172832, + "IsEmpty": false + }, + "Timestamp": 637316496677573380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 1112.6655190878155, + "Y": 535.84310795422834, + "IsEmpty": false + }, + "Timestamp": 637316496677739020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 1112.6655190878155, + "Y": 536.88060795422837, + "IsEmpty": false + }, + "Timestamp": 637316496677907480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651850164, + "Position": { + "X": 1112.6655190878155, + "Y": 537.16356693860337, + "IsEmpty": false + }, + "Timestamp": 637316496678083540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653803289, + "Position": { + "X": 1112.6655190878155, + "Y": 537.60375248547837, + "IsEmpty": false + }, + "Timestamp": 637316496678587710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653803289, + "Position": { + "X": 1112.6655190878155, + "Y": 538.38973881360334, + "IsEmpty": false + }, + "Timestamp": 637316496678758440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653803289, + "Position": { + "X": 1112.6655190878155, + "Y": 539.1128345167283, + "IsEmpty": false + }, + "Timestamp": 637316496678922190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.44701305, + "Position": { + "X": 1112.6655190878155, + "Y": 539.64730717297834, + "IsEmpty": false + }, + "Timestamp": 637316496679099640, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c2da6411-74f9-4015-aeb3-c5618252eebe", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 1150.2680459432843, + "Y": 480.22596928235333, + "IsEmpty": false + }, + "Timestamp": 637316496685434710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.124986649, + "Position": { + "X": 1150.2680459432843, + "Y": 479.75438725110337, + "IsEmpty": false + }, + "Timestamp": 637316496685684790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.347890437, + "Position": { + "X": 1150.2680459432843, + "Y": 479.06268803235332, + "IsEmpty": false + }, + "Timestamp": 637316496685848540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.399404883, + "Position": { + "X": 1150.2680459432843, + "Y": 479.62860600110332, + "IsEmpty": false + }, + "Timestamp": 637316496686353880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.442618459, + "Position": { + "X": 1150.2680459432843, + "Y": 480.72899662610337, + "IsEmpty": false + }, + "Timestamp": 637316496686530800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.484855413, + "Position": { + "X": 1150.2680459432843, + "Y": 482.04950443860332, + "IsEmpty": false + }, + "Timestamp": 637316496686693110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 1150.2680459432843, + "Y": 482.83549076672836, + "IsEmpty": false + }, + "Timestamp": 637316496686874150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51586175, + "Position": { + "X": 1150.2680459432843, + "Y": 483.08700443860334, + "IsEmpty": false + }, + "Timestamp": 637316496687035450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526604116, + "Position": { + "X": 1150.2680459432843, + "Y": 483.40140873547836, + "IsEmpty": false + }, + "Timestamp": 637316496687381390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528557241, + "Position": { + "X": 1150.2680459432843, + "Y": 483.52714115735336, + "IsEmpty": false + }, + "Timestamp": 637316496687539630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532463551, + "Position": { + "X": 1150.2680459432843, + "Y": 483.62147709485333, + "IsEmpty": false + }, + "Timestamp": 637316496687714750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544182479, + "Position": { + "X": 1150.2680459432843, + "Y": 484.12450443860337, + "IsEmpty": false + }, + "Timestamp": 637316496688560100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.549065411, + "Position": { + "X": 1150.2680459432843, + "Y": 486.01093021985332, + "IsEmpty": false + }, + "Timestamp": 637316496688720280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552971721, + "Position": { + "X": 1150.2680459432843, + "Y": 487.89730717297834, + "IsEmpty": false + }, + "Timestamp": 637316496688895970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554924846, + "Position": { + "X": 1150.2680459432843, + "Y": 490.34960209485337, + "IsEmpty": false + }, + "Timestamp": 637316496689062570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55687803, + "Position": { + "X": 1150.2680459432843, + "Y": 493.33641850110337, + "IsEmpty": false + }, + "Timestamp": 637316496689236530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558831155, + "Position": { + "X": 1150.2680459432843, + "Y": 498.55541264172837, + "IsEmpty": false + }, + "Timestamp": 637316496689399400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1150.2680459432843, + "Y": 502.42250248547833, + "IsEmpty": false + }, + "Timestamp": 637316496689573650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1150.2680459432843, + "Y": 506.10096928235333, + "IsEmpty": false + }, + "Timestamp": 637316496689734270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1150.2680459432843, + "Y": 509.68514896985334, + "IsEmpty": false + }, + "Timestamp": 637316496689906710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1150.2680459432843, + "Y": 515.24999271985337, + "IsEmpty": false + }, + "Timestamp": 637316496690080390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 1150.2680459432843, + "Y": 518.64550053235337, + "IsEmpty": false + }, + "Timestamp": 637316496690249690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 521.78949467297832, + "IsEmpty": false + }, + "Timestamp": 637316496690411520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 524.6819263136033, + "IsEmpty": false + }, + "Timestamp": 637316496690583860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 528.42328373547832, + "IsEmpty": false + }, + "Timestamp": 637316496690751950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 530.6240649854783, + "IsEmpty": false + }, + "Timestamp": 637316496690925700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 532.73055912610334, + "IsEmpty": false + }, + "Timestamp": 637316496691085000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 534.83700443860334, + "IsEmpty": false + }, + "Timestamp": 637316496691260990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 537.5723071729783, + "IsEmpty": false + }, + "Timestamp": 637316496691435170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 538.95565678235334, + "IsEmpty": false + }, + "Timestamp": 637316496691600240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 539.74164311047832, + "IsEmpty": false + }, + "Timestamp": 637316496691769930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 540.74769779797839, + "IsEmpty": false + }, + "Timestamp": 637316496691934790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 542.35116459485334, + "IsEmpty": false + }, + "Timestamp": 637316496692109140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 1150.2680459432843, + "Y": 543.60873295422834, + "IsEmpty": false + }, + "Timestamp": 637316496692278540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 1150.2680459432843, + "Y": 544.67767826672832, + "IsEmpty": false + }, + "Timestamp": 637316496692440070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567376196, + "Position": { + "X": 1150.2680459432843, + "Y": 545.40082279797832, + "IsEmpty": false + }, + "Timestamp": 637316496692621740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 1150.2680459432843, + "Y": 545.84095951672839, + "IsEmpty": false + }, + "Timestamp": 637316496692787330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 1150.2680459432843, + "Y": 546.62694584485337, + "IsEmpty": false + }, + "Timestamp": 637316496692953590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 1150.2680459432843, + "Y": 547.44442631360334, + "IsEmpty": false + }, + "Timestamp": 637316496693111920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 1150.2680459432843, + "Y": 548.60765873547837, + "IsEmpty": false + }, + "Timestamp": 637316496693291880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 1150.2680459432843, + "Y": 550.55697514172834, + "IsEmpty": false + }, + "Timestamp": 637316496693459780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 1150.2680459432843, + "Y": 551.72020756360337, + "IsEmpty": false + }, + "Timestamp": 637316496693629490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 1150.2680459432843, + "Y": 551.94032475110339, + "IsEmpty": false + }, + "Timestamp": 637316496693794810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 1150.2680459432843, + "Y": 552.16039311047837, + "IsEmpty": false + }, + "Timestamp": 637316496693962770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566887915, + "Position": { + "X": 1150.2680459432843, + "Y": 552.38046146985334, + "IsEmpty": false + }, + "Timestamp": 637316496694136140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571282506, + "Position": { + "X": 1150.2680459432843, + "Y": 552.82064701672834, + "IsEmpty": false + }, + "Timestamp": 637316496694304360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571282506, + "Position": { + "X": 1150.2680459432843, + "Y": 553.00927006360337, + "IsEmpty": false + }, + "Timestamp": 637316496694475150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.341786832, + "Position": { + "X": 1150.2680459432843, + "Y": 552.72631107922837, + "IsEmpty": false + }, + "Timestamp": 637316496694848760, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "fab7f234-da4f-4228-8db9-9d523f678528", + "Points": [], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "4316731f-b517-43c9-b86e-f954f95c469e", + "Points": [ + { + "Pressure": 0.199694812, + "Position": { + "X": 1116.6824947628279, + "Y": 498.44096967391278, + "IsEmpty": false + }, + "Timestamp": 637316496751353500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.283680469, + "Position": { + "X": 1115.4139909869257, + "Y": 498.4535294657025, + "IsEmpty": false + }, + "Timestamp": 637316496751756660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.36546883, + "Position": { + "X": 1114.1499160836042, + "Y": 498.46606866440817, + "IsEmpty": false + }, + "Timestamp": 637316496751927360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.429434657, + "Position": { + "X": 1114.1101848415733, + "Y": 498.47233041205044, + "IsEmpty": false + }, + "Timestamp": 637316496752097790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593011379, + "Position": { + "X": 1114.7415974726555, + "Y": 498.4660686644084, + "IsEmpty": false + }, + "Timestamp": 637316496753271140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612054646, + "Position": { + "X": 1116.0476921063073, + "Y": 498.44725211808242, + "IsEmpty": false + }, + "Timestamp": 637316496753450070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631586194, + "Position": { + "X": 1117.3585324396856, + "Y": 498.42838970281213, + "IsEmpty": false + }, + "Timestamp": 637316496753619040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648187995, + "Position": { + "X": 1119.3133562325345, + "Y": 498.40317087776913, + "IsEmpty": false + }, + "Timestamp": 637316496753778630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663324952, + "Position": { + "X": 1121.8811721757459, + "Y": 498.37787630075866, + "IsEmpty": false + }, + "Timestamp": 637316496753951620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.68261236, + "Position": { + "X": 1126.4562601673217, + "Y": 498.32707313157027, + "IsEmpty": false + }, + "Timestamp": 637316496754122320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 1129.8087379206991, + "Y": 498.28240347688211, + "IsEmpty": false + }, + "Timestamp": 637316496754285560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 1132.5263474303706, + "Y": 498.24396820935794, + "IsEmpty": false + }, + "Timestamp": 637316496754455890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 1135.2181433274063, + "Y": 498.21184370556358, + "IsEmpty": false + }, + "Timestamp": 637316496754634190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705317795, + "Position": { + "X": 1139.2206465750687, + "Y": 498.17318983592514, + "IsEmpty": false + }, + "Timestamp": 637316496754798270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 1141.2771064256622, + "Y": 498.14736244948972, + "IsEmpty": false + }, + "Timestamp": 637316496754963640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 1143.3419496062838, + "Y": 498.12149241292764, + "IsEmpty": false + }, + "Timestamp": 637316496755133590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 1145.3715741703654, + "Y": 498.10206388764351, + "IsEmpty": false + }, + "Timestamp": 637316496755301120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 1148.1332940682939, + "Y": 498.06963763016097, + "IsEmpty": false + }, + "Timestamp": 637316496755475110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 1149.5412741499676, + "Y": 498.05015692221792, + "IsEmpty": false + }, + "Timestamp": 637316496755637880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 1150.9087781519352, + "Y": 498.03716024834409, + "IsEmpty": false + }, + "Timestamp": 637316496755814920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713374555, + "Position": { + "X": 1152.3236455742092, + "Y": 498.0176519690981, + "IsEmpty": false + }, + "Timestamp": 637316496755975580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71532768, + "Position": { + "X": 1152.9660520654277, + "Y": 498.01765196909798, + "IsEmpty": false + }, + "Timestamp": 637316496756144640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71532768, + "Position": { + "X": 1153.0102559785012, + "Y": 498.01114587798634, + "IsEmpty": false + }, + "Timestamp": 637316496756320390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71532768, + "Position": { + "X": 1153.6976534679261, + "Y": 498.00463820739611, + "IsEmpty": false + }, + "Timestamp": 637316496756826970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71532768, + "Position": { + "X": 1153.7419721596923, + "Y": 497.9981290090488, + "IsEmpty": false + }, + "Timestamp": 637316496757337670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700923145, + "Position": { + "X": 1153.0545173577159, + "Y": 498.00463820739606, + "IsEmpty": false + }, + "Timestamp": 637316496757679020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592767239, + "Position": { + "X": 1151.6378279360561, + "Y": 498.024156429009, + "IsEmpty": false + }, + "Timestamp": 637316496757835910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.555901408, + "Position": { + "X": 1150.9528087450481, + "Y": 498.03065920599846, + "IsEmpty": false + }, + "Timestamp": 637316496757932360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.555901408, + "Position": { + "X": 1150.9087781519352, + "Y": 498.03716024834409, + "IsEmpty": false + }, + "Timestamp": 637316496757959280, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7e36b5dd-8139-4dc8-864e-08d5e21f9b6c", + "Points": [ + { + "Pressure": 0.153063253, + "Position": { + "X": 999.13239530851865, + "Y": 495.91444584485333, + "IsEmpty": false + }, + "Timestamp": 637316496843115670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.328358889, + "Position": { + "X": 998.97466825773733, + "Y": 496.13456303235336, + "IsEmpty": false + }, + "Timestamp": 637316496843855770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.354238182, + "Position": { + "X": 998.84848417570606, + "Y": 496.32318607922832, + "IsEmpty": false + }, + "Timestamp": 637316496844024600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.402822912, + "Position": { + "X": 998.78539213469048, + "Y": 496.57469975110337, + "IsEmpty": false + }, + "Timestamp": 637316496844185410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.429922938, + "Position": { + "X": 998.78539213469048, + "Y": 496.82621342297836, + "IsEmpty": false + }, + "Timestamp": 637316496844363380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.456290543, + "Position": { + "X": 998.59612211515923, + "Y": 496.73192631360337, + "IsEmpty": false + }, + "Timestamp": 637316496844691560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.461173415, + "Position": { + "X": 997.96520780851858, + "Y": 496.07167240735333, + "IsEmpty": false + }, + "Timestamp": 637316496844867000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.464103162, + "Position": { + "X": 997.61820463469053, + "Y": 495.75726811047832, + "IsEmpty": false + }, + "Timestamp": 637316496845037070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.46727702, + "Position": { + "X": 997.52356352140919, + "Y": 495.56864506360336, + "IsEmpty": false + }, + "Timestamp": 637316496845198900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.47924009, + "Position": { + "X": 997.74438261320608, + "Y": 495.44286381360337, + "IsEmpty": false + }, + "Timestamp": 637316496845711450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498771638, + "Position": { + "X": 998.81694120695613, + "Y": 495.69437748547836, + "IsEmpty": false + }, + "Timestamp": 637316496845871400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.517326593, + "Position": { + "X": 1000.141861861253, + "Y": 496.26029545422836, + "IsEmpty": false + }, + "Timestamp": 637316496846040200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.535881579, + "Position": { + "X": 1001.5614175253155, + "Y": 496.95199467297834, + "IsEmpty": false + }, + "Timestamp": 637316496846215420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54027617, + "Position": { + "X": 1001.782242720628, + "Y": 497.01488529797837, + "IsEmpty": false + }, + "Timestamp": 637316496846386010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544182479, + "Position": { + "X": 1001.9399697714092, + "Y": 496.95199467297834, + "IsEmpty": false + }, + "Timestamp": 637316496846549290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 1001.4983254842998, + "Y": 496.13456303235336, + "IsEmpty": false + }, + "Timestamp": 637316496846727190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 1000.1103127889874, + "Y": 494.81405521985334, + "IsEmpty": false + }, + "Timestamp": 637316496846896000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.548088789, + "Position": { + "X": 999.41631254484673, + "Y": 494.27958256360336, + "IsEmpty": false + }, + "Timestamp": 637316496847065950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.548088789, + "Position": { + "X": 1000.4257729940655, + "Y": 495.03417240735337, + "IsEmpty": false + }, + "Timestamp": 637316496847566760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.548088789, + "Position": { + "X": 1001.6560586385967, + "Y": 495.94589115735334, + "IsEmpty": false + }, + "Timestamp": 637316496847733080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.551995099, + "Position": { + "X": 1002.9809792928936, + "Y": 496.92054936047833, + "IsEmpty": false + }, + "Timestamp": 637316496847900120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.557366312, + "Position": { + "X": 1003.8642617635967, + "Y": 497.61219975110333, + "IsEmpty": false + }, + "Timestamp": 637316496848076880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.561272621, + "Position": { + "X": 1003.5488015585186, + "Y": 497.20350834485333, + "IsEmpty": false + }, + "Timestamp": 637316496848420400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.561272621, + "Position": { + "X": 1002.1607888632061, + "Y": 495.91444584485333, + "IsEmpty": false + }, + "Timestamp": 637316496848578750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558587015, + "Position": { + "X": 1000.6150491171123, + "Y": 494.53109623547834, + "IsEmpty": false + }, + "Timestamp": 637316496848748590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.553704143, + "Position": { + "X": 999.10085233976861, + "Y": 493.30497318860336, + "IsEmpty": false + }, + "Timestamp": 637316496848914590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.553704143, + "Position": { + "X": 999.32167143156551, + "Y": 493.43070561047836, + "IsEmpty": false + }, + "Timestamp": 637316496849263450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.553704143, + "Position": { + "X": 1000.678141158128, + "Y": 494.34247318860332, + "IsEmpty": false + }, + "Timestamp": 637316496849425130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.553704143, + "Position": { + "X": 1004.0535317831279, + "Y": 496.44896732922837, + "IsEmpty": false + }, + "Timestamp": 637316496849593570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558831155, + "Position": { + "X": 1006.1040078573467, + "Y": 497.80087162610334, + "IsEmpty": false + }, + "Timestamp": 637316496849768690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.563714027, + "Position": { + "X": 1007.5235635214092, + "Y": 498.80692631360336, + "IsEmpty": false + }, + "Timestamp": 637316496849929770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567620337, + "Position": { + "X": 1007.9967507772686, + "Y": 499.15277592297832, + "IsEmpty": false + }, + "Timestamp": 637316496850097500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573723972, + "Position": { + "X": 1007.6497476034405, + "Y": 498.58685795422832, + "IsEmpty": false + }, + "Timestamp": 637316496850273230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573723972, + "Position": { + "X": 1006.3563699178936, + "Y": 496.95199467297834, + "IsEmpty": false + }, + "Timestamp": 637316496850443490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573723972, + "Position": { + "X": 1004.589811080003, + "Y": 495.19135014172832, + "IsEmpty": false + }, + "Timestamp": 637316496850614650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573723972, + "Position": { + "X": 1002.9809792928936, + "Y": 493.74510990735337, + "IsEmpty": false + }, + "Timestamp": 637316496850773630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571770787, + "Position": { + "X": 1002.0030618124249, + "Y": 493.08485600110333, + "IsEmpty": false + }, + "Timestamp": 637316496850952000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571770787, + "Position": { + "X": 1002.2554238729717, + "Y": 493.33641850110337, + "IsEmpty": false + }, + "Timestamp": 637316496851120030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576165378, + "Position": { + "X": 1003.7696206503155, + "Y": 494.62543217297832, + "IsEmpty": false + }, + "Timestamp": 637316496851280420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.586175323, + "Position": { + "X": 1005.6623635702374, + "Y": 496.19740482922833, + "IsEmpty": false + }, + "Timestamp": 637316496851457670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593011379, + "Position": { + "X": 1008.3122109823468, + "Y": 498.64974857922834, + "IsEmpty": false + }, + "Timestamp": 637316496851622510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594964504, + "Position": { + "X": 1009.7002236776592, + "Y": 499.87587162610333, + "IsEmpty": false + }, + "Timestamp": 637316496851790220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.598870814, + "Position": { + "X": 1010.4257729940655, + "Y": 500.34750248547834, + "IsEmpty": false + }, + "Timestamp": 637316496851965900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600823998, + "Position": { + "X": 1009.3532205038312, + "Y": 498.14672123547837, + "IsEmpty": false + }, + "Timestamp": 637316496852294390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600823998, + "Position": { + "X": 1007.3027444296124, + "Y": 495.09701420422834, + "IsEmpty": false + }, + "Timestamp": 637316496852471660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600823998, + "Position": { + "X": 1005.8200967245342, + "Y": 493.33641850110337, + "IsEmpty": false + }, + "Timestamp": 637316496852640310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600823998, + "Position": { + "X": 1005.3784524374248, + "Y": 492.83334232922834, + "IsEmpty": false + }, + "Timestamp": 637316496852802550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600823998, + "Position": { + "X": 1005.9778237753155, + "Y": 493.30497318860336, + "IsEmpty": false + }, + "Timestamp": 637316496852968750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608392477, + "Position": { + "X": 1007.6182046346905, + "Y": 494.78260990735333, + "IsEmpty": false + }, + "Timestamp": 637316496853148280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617914081, + "Position": { + "X": 1009.6371316366436, + "Y": 496.57469975110337, + "IsEmpty": false + }, + "Timestamp": 637316496853308460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622796953, + "Position": { + "X": 1011.7191506796123, + "Y": 498.30389896985332, + "IsEmpty": false + }, + "Timestamp": 637316496853475350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631097913, + "Position": { + "X": 1014.7159951620342, + "Y": 499.84447514172837, + "IsEmpty": false + }, + "Timestamp": 637316496853651080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633295178, + "Position": { + "X": 1015.9147256307842, + "Y": 500.00165287610332, + "IsEmpty": false + }, + "Timestamp": 637316496853821000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 1015.9778237753155, + "Y": 499.56151615735337, + "IsEmpty": false + }, + "Timestamp": 637316496853985980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641351938, + "Position": { + "X": 1014.9052651815655, + "Y": 497.89515873547833, + "IsEmpty": false + }, + "Timestamp": 637316496854154260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641351938, + "Position": { + "X": 1012.4762490682842, + "Y": 494.53109623547834, + "IsEmpty": false + }, + "Timestamp": 637316496854323410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641351938, + "Position": { + "X": 1011.245963423753, + "Y": 493.11630131360334, + "IsEmpty": false + }, + "Timestamp": 637316496854498690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641351938, + "Position": { + "X": 1011.0251443319561, + "Y": 492.92767826672832, + "IsEmpty": false + }, + "Timestamp": 637316496854670560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645746529, + "Position": { + "X": 1013.2333413534404, + "Y": 494.59398686047837, + "IsEmpty": false + }, + "Timestamp": 637316496854999080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 1015.2207314901592, + "Y": 496.13456303235336, + "IsEmpty": false + }, + "Timestamp": 637316496855169960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652826726, + "Position": { + "X": 1017.0819253378155, + "Y": 497.48646732922833, + "IsEmpty": false + }, + "Timestamp": 637316496855333340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.654779911, + "Position": { + "X": 1017.996744673753, + "Y": 497.92660404797834, + "IsEmpty": false + }, + "Timestamp": 637316496855509230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656733036, + "Position": { + "X": 1018.4068398885968, + "Y": 497.48646732922833, + "IsEmpty": false + }, + "Timestamp": 637316496855683140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658686221, + "Position": { + "X": 1017.902115767503, + "Y": 496.13456303235336, + "IsEmpty": false + }, + "Timestamp": 637316496855847580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1016.9872842245343, + "Y": 494.75121342297837, + "IsEmpty": false + }, + "Timestamp": 637316496856009340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1016.4194619589092, + "Y": 493.99662357922836, + "IsEmpty": false + }, + "Timestamp": 637316496856182140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 1016.5771890096905, + "Y": 493.87089115735336, + "IsEmpty": false + }, + "Timestamp": 637316496856356790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66259253, + "Position": { + "X": 1017.6812905721905, + "Y": 494.59398686047837, + "IsEmpty": false + }, + "Timestamp": 637316496856518480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.274158835, + "Position": { + "X": 1018.7538491659404, + "Y": 495.41141850110336, + "IsEmpty": false + }, + "Timestamp": 637316496856684490, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF00AACC", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "fa496280-21e0-471e-abc7-02620e0e131b", + "Points": [ + { + "Pressure": 0.107896544, + "Position": { + "X": 1044.8737222128154, + "Y": 498.17811771985333, + "IsEmpty": false + }, + "Timestamp": 637316496860835450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.217517361, + "Position": { + "X": 1045.4415444784404, + "Y": 498.14672123547837, + "IsEmpty": false + }, + "Timestamp": 637316496861089670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.323476017, + "Position": { + "X": 1045.6939126425029, + "Y": 498.05238529797833, + "IsEmpty": false + }, + "Timestamp": 637316496861251700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.399893194, + "Position": { + "X": 1046.2301919393781, + "Y": 497.89515873547833, + "IsEmpty": false + }, + "Timestamp": 637316496861421270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.46703288, + "Position": { + "X": 1046.4825601034404, + "Y": 497.80087162610334, + "IsEmpty": false + }, + "Timestamp": 637316496861590890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534172595, + "Position": { + "X": 1046.7033730917217, + "Y": 497.17206303235332, + "IsEmpty": false + }, + "Timestamp": 637316496861768750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.552239239, + "Position": { + "X": 1046.4510049276591, + "Y": 496.41752201672836, + "IsEmpty": false + }, + "Timestamp": 637316496861926000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587640166, + "Position": { + "X": 1046.2617349081279, + "Y": 496.04022709485332, + "IsEmpty": false + }, + "Timestamp": 637316496862095220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597650111, + "Position": { + "X": 1046.8926431112529, + "Y": 496.63759037610333, + "IsEmpty": false + }, + "Timestamp": 637316496862606030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1047.0819253378154, + "Y": 496.82621342297836, + "IsEmpty": false + }, + "Timestamp": 637316496862770340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614740193, + "Position": { + "X": 1046.5456460409405, + "Y": 496.19740482922833, + "IsEmpty": false + }, + "Timestamp": 637316496863458250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614740193, + "Position": { + "X": 1045.756998580003, + "Y": 495.37997318860334, + "IsEmpty": false + }, + "Timestamp": 637316496863618540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614740193, + "Position": { + "X": 1044.7475381307843, + "Y": 494.46825443860337, + "IsEmpty": false + }, + "Timestamp": 637316496863796530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.616693377, + "Position": { + "X": 1045.2522744589091, + "Y": 494.87694584485337, + "IsEmpty": false + }, + "Timestamp": 637316496864122220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.616693377, + "Position": { + "X": 1048.3752969198467, + "Y": 497.54935795422836, + "IsEmpty": false + }, + "Timestamp": 637316496864541240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.618646502, + "Position": { + "X": 1049.2585732870343, + "Y": 498.08383061047834, + "IsEmpty": false + }, + "Timestamp": 637316496864627580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622552812, + "Position": { + "X": 1049.7948525839092, + "Y": 498.20956303235334, + "IsEmpty": false + }, + "Timestamp": 637316496865067780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628412306, + "Position": { + "X": 1049.7948525839092, + "Y": 497.07772709485334, + "IsEmpty": false + }, + "Timestamp": 637316496865251040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628412306, + "Position": { + "X": 1049.037760298753, + "Y": 495.94589115735334, + "IsEmpty": false + }, + "Timestamp": 637316496865390510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625482559, + "Position": { + "X": 1048.2806558065654, + "Y": 495.03417240735337, + "IsEmpty": false + }, + "Timestamp": 637316496865570060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629388869, + "Position": { + "X": 1049.2585732870343, + "Y": 495.72582279797837, + "IsEmpty": false + }, + "Timestamp": 637316496865982280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6340276, + "Position": { + "X": 1050.2995889120343, + "Y": 496.76332279797833, + "IsEmpty": false + }, + "Timestamp": 637316496866154700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 1051.9715127401591, + "Y": 497.98949467297837, + "IsEmpty": false + }, + "Timestamp": 637316496866438730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647211432, + "Position": { + "X": 1053.6749795370342, + "Y": 498.58685795422832, + "IsEmpty": false + }, + "Timestamp": 637316496866810690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649164557, + "Position": { + "X": 1052.8232461385967, + "Y": 495.97733646985336, + "IsEmpty": false + }, + "Timestamp": 637316496866997480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649164557, + "Position": { + "X": 1050.6465859823468, + "Y": 493.36781498547833, + "IsEmpty": false + }, + "Timestamp": 637316496867306180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649164557, + "Position": { + "X": 1049.6686685018781, + "Y": 492.33031498547837, + "IsEmpty": false + }, + "Timestamp": 637316496867445360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659174502, + "Position": { + "X": 1052.5077920370343, + "Y": 494.71976811047836, + "IsEmpty": false + }, + "Timestamp": 637316496867856040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.666010499, + "Position": { + "X": 1056.9241982870342, + "Y": 497.92660404797834, + "IsEmpty": false + }, + "Timestamp": 637316496868172180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668207824, + "Position": { + "X": 1059.1639443807842, + "Y": 499.05843998547834, + "IsEmpty": false + }, + "Timestamp": 637316496868350570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 1060.1418618612529, + "Y": 499.43573490735332, + "IsEmpty": false + }, + "Timestamp": 637316496868620680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672358274, + "Position": { + "X": 1059.9525796346904, + "Y": 498.46107670422833, + "IsEmpty": false + }, + "Timestamp": 637316496868792960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672358274, + "Position": { + "X": 1056.5141030721904, + "Y": 494.68832279797834, + "IsEmpty": false + }, + "Timestamp": 637316496869178360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672358274, + "Position": { + "X": 1054.9052651815655, + "Y": 493.65077396985333, + "IsEmpty": false + }, + "Timestamp": 637316496869311050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672358274, + "Position": { + "X": 1055.1891763143781, + "Y": 493.96517826672834, + "IsEmpty": false + }, + "Timestamp": 637316496869673000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680415034, + "Position": { + "X": 1061.7191445760968, + "Y": 497.92660404797834, + "IsEmpty": false + }, + "Timestamp": 637316496870027030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682368219, + "Position": { + "X": 1063.4226113729717, + "Y": 498.61830326672833, + "IsEmpty": false + }, + "Timestamp": 637316496870373240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 1063.2964394979717, + "Y": 497.29784428235337, + "IsEmpty": false + }, + "Timestamp": 637316496870549360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 1062.1607827596904, + "Y": 495.56864506360336, + "IsEmpty": false + }, + "Timestamp": 637316496870868520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 1059.605582564378, + "Y": 492.92767826672832, + "IsEmpty": false + }, + "Timestamp": 637316496871281470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.686274529, + "Position": { + "X": 1060.6465859823468, + "Y": 493.77655521985332, + "IsEmpty": false + }, + "Timestamp": 637316496871508180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690669119, + "Position": { + "X": 1067.4604775839093, + "Y": 498.71263920422837, + "IsEmpty": false + }, + "Timestamp": 637316496871897020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 1069.5109414510966, + "Y": 499.59291264172833, + "IsEmpty": false + }, + "Timestamp": 637316496872219230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694575429, + "Position": { + "X": 1070.0156777792217, + "Y": 499.40428959485337, + "IsEmpty": false + }, + "Timestamp": 637316496872341900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694575429, + "Position": { + "X": 1066.5141030721904, + "Y": 494.59398686047837, + "IsEmpty": false + }, + "Timestamp": 637316496872740080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694575429, + "Position": { + "X": 1065.4100015096906, + "Y": 493.99662357922836, + "IsEmpty": false + }, + "Timestamp": 637316496873093630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694575429, + "Position": { + "X": 1068.5014810018779, + "Y": 495.91444584485333, + "IsEmpty": false + }, + "Timestamp": 637316496873419110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 1072.8547891073467, + "Y": 497.95804936047836, + "IsEmpty": false + }, + "Timestamp": 637316496873752230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705317795, + "Position": { + "X": 1075.2522744589091, + "Y": 498.58685795422832, + "IsEmpty": false + }, + "Timestamp": 637316496874110530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622308671, + "Position": { + "X": 1075.3784463339093, + "Y": 497.98949467297837, + "IsEmpty": false + }, + "Timestamp": 637316496874362360, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF00AACC", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7625af8d-d5b1-43c7-9b8e-489b58afaf0e", + "Points": [ + { + "Pressure": 0.0280613415, + "Position": { + "X": 1117.7443887167217, + "Y": 495.00272709485336, + "IsEmpty": false + }, + "Timestamp": 637316496879364890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.317616552, + "Position": { + "X": 1118.7538369589092, + "Y": 495.31713139172837, + "IsEmpty": false + }, + "Timestamp": 637316496879378280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.384267956, + "Position": { + "X": 1119.0062051229718, + "Y": 495.44286381360337, + "IsEmpty": false + }, + "Timestamp": 637316496879645310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.486564428, + "Position": { + "X": 1117.6812783651592, + "Y": 493.74510990735337, + "IsEmpty": false + }, + "Timestamp": 637316496880148300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.508293271, + "Position": { + "X": 1117.1450112753155, + "Y": 493.24208256360333, + "IsEmpty": false + }, + "Timestamp": 637316496880324410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532951832, + "Position": { + "X": 1115.4415444784404, + "Y": 491.98446537610334, + "IsEmpty": false + }, + "Timestamp": 637316496880696120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 1116.2932778768779, + "Y": 492.67616459485333, + "IsEmpty": false + }, + "Timestamp": 637316496881058220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 1119.9210488729718, + "Y": 495.34852787610333, + "IsEmpty": false + }, + "Timestamp": 637316496881371750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627191603, + "Position": { + "X": 1120.7727822714091, + "Y": 495.63148686047833, + "IsEmpty": false + }, + "Timestamp": 637316496881705760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.63378346, + "Position": { + "X": 1118.0913857870341, + "Y": 492.64471928235332, + "IsEmpty": false + }, + "Timestamp": 637316496882075340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638666332, + "Position": { + "X": 1116.324820845628, + "Y": 491.19847904797837, + "IsEmpty": false + }, + "Timestamp": 637316496882324460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638666332, + "Position": { + "X": 1114.8737222128154, + "Y": 490.00375248547834, + "IsEmpty": false + }, + "Timestamp": 637316496882686930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651361883, + "Position": { + "X": 1119.8579385214093, + "Y": 493.21063725110332, + "IsEmpty": false + }, + "Timestamp": 637316496883040120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1121.8137734823467, + "Y": 494.68832279797834, + "IsEmpty": false + }, + "Timestamp": 637316496883398850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1120.7727822714091, + "Y": 492.58182865735336, + "IsEmpty": false + }, + "Timestamp": 637316496883727060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1115.6939126425029, + "Y": 487.86586186047833, + "IsEmpty": false + }, + "Timestamp": 637316496884061810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1114.1481728964093, + "Y": 486.48251225110334, + "IsEmpty": false + }, + "Timestamp": 637316496884401320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 1119.6055703573468, + "Y": 490.25531498547832, + "IsEmpty": false + }, + "Timestamp": 637316496884753370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 1125.5046426229717, + "Y": 494.15385014172836, + "IsEmpty": false + }, + "Timestamp": 637316496885072400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 1127.8074746542218, + "Y": 495.34852787610333, + "IsEmpty": false + }, + "Timestamp": 637316496885408250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699458301, + "Position": { + "X": 1124.8421670370342, + "Y": 491.70150639172834, + "IsEmpty": false + }, + "Timestamp": 637316496885761750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 1121.4667764120343, + "Y": 489.15487553235334, + "IsEmpty": false + }, + "Timestamp": 637316496886081940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 1120.6150430135967, + "Y": 488.21171146985336, + "IsEmpty": false + }, + "Timestamp": 637316496886422820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 1123.8958047323467, + "Y": 490.38104740735332, + "IsEmpty": false + }, + "Timestamp": 637316496886751360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717036724, + "Position": { + "X": 1130.9935830526592, + "Y": 495.69437748547836, + "IsEmpty": false + }, + "Timestamp": 637316496887095880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717036724, + "Position": { + "X": 1131.4036904745342, + "Y": 496.10311771985334, + "IsEmpty": false + }, + "Timestamp": 637316496887456940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717036724, + "Position": { + "X": 1130.0156777792217, + "Y": 494.12240482922834, + "IsEmpty": false + }, + "Timestamp": 637316496887769580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717036724, + "Position": { + "X": 1121.2144082479717, + "Y": 487.11132084485337, + "IsEmpty": false + }, + "Timestamp": 637316496888128510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717036724, + "Position": { + "X": 1121.5614053182842, + "Y": 486.92264896985336, + "IsEmpty": false + }, + "Timestamp": 637316496888480180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717036724, + "Position": { + "X": 1124.4320840292216, + "Y": 488.18026615735334, + "IsEmpty": false + }, + "Timestamp": 637316496888626200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 1131.9715127401591, + "Y": 493.08485600110333, + "IsEmpty": false + }, + "Timestamp": 637316496889027480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 1134.7790810995343, + "Y": 495.25424076672834, + "IsEmpty": false + }, + "Timestamp": 637316496889250320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 1138.6592080526593, + "Y": 496.66903568860334, + "IsEmpty": false + }, + "Timestamp": 637316496889623940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 1134.4320840292216, + "Y": 492.11024662610333, + "IsEmpty": false + }, + "Timestamp": 637316496889964230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 1127.8390176229718, + "Y": 486.32528568860334, + "IsEmpty": false + }, + "Timestamp": 637316496890294870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 1127.6497353964091, + "Y": 485.50785404797836, + "IsEmpty": false + }, + "Timestamp": 637316496890651930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 1131.0251504354717, + "Y": 487.89730717297834, + "IsEmpty": false + }, + "Timestamp": 637316496890972560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 1138.6907510214091, + "Y": 493.27352787610334, + "IsEmpty": false + }, + "Timestamp": 637316496891325720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 1139.2901162557841, + "Y": 493.27352787610334, + "IsEmpty": false + }, + "Timestamp": 637316496891688360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 1137.6181924276593, + "Y": 491.57577396985334, + "IsEmpty": false + }, + "Timestamp": 637316496891833880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 1131.1197793417218, + "Y": 485.94803959485336, + "IsEmpty": false + }, + "Timestamp": 637316496892200630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 1129.9525918417216, + "Y": 484.84764896985337, + "IsEmpty": false + }, + "Timestamp": 637316496892522980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 1132.3500527792216, + "Y": 486.73402592297833, + "IsEmpty": false + }, + "Timestamp": 637316496892822820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 1143.2017861776592, + "Y": 493.80800053235333, + "IsEmpty": false + }, + "Timestamp": 637316496893312040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754146636, + "Position": { + "X": 1146.0093545370341, + "Y": 495.85160404797836, + "IsEmpty": false + }, + "Timestamp": 637316496893461150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1140.3942178182842, + "Y": 489.46927982922836, + "IsEmpty": false + }, + "Timestamp": 637316496893890540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1134.5897988729716, + "Y": 484.56468998547837, + "IsEmpty": false + }, + "Timestamp": 637316496894033240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1131.9715127401591, + "Y": 481.92372318860333, + "IsEmpty": false + }, + "Timestamp": 637316496894419910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1132.2554238729717, + "Y": 482.11234623547836, + "IsEmpty": false + }, + "Timestamp": 637316496894539680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1135.7885537557843, + "Y": 485.03627201672833, + "IsEmpty": false + }, + "Timestamp": 637316496894849500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764644861, + "Position": { + "X": 1146.5456338339093, + "Y": 492.45609623547836, + "IsEmpty": false + }, + "Timestamp": 637316496895262680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769039452, + "Position": { + "X": 1147.6497353964091, + "Y": 493.27352787610334, + "IsEmpty": false + }, + "Timestamp": 637316496895539700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770992577, + "Position": { + "X": 1147.1765664510967, + "Y": 492.58182865735336, + "IsEmpty": false + }, + "Timestamp": 637316496895659840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774898887, + "Position": { + "X": 1139.9525918417216, + "Y": 485.19349857922833, + "IsEmpty": false + }, + "Timestamp": 637316496896064010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774898887, + "Position": { + "X": 1139.3847695760967, + "Y": 484.18739506360333, + "IsEmpty": false + }, + "Timestamp": 637316496896416400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774898887, + "Position": { + "X": 1141.4352334432842, + "Y": 485.41356693860337, + "IsEmpty": false + }, + "Timestamp": 637316496896577270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774898887, + "Position": { + "X": 1148.1860146932843, + "Y": 490.34960209485337, + "IsEmpty": false + }, + "Timestamp": 637316496896921620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774898887, + "Position": { + "X": 1149.7317666464091, + "Y": 491.19847904797837, + "IsEmpty": false + }, + "Timestamp": 637316496897250740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776852071, + "Position": { + "X": 1148.3752969198467, + "Y": 488.96625248547832, + "IsEmpty": false + }, + "Timestamp": 637316496897568750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.780758381, + "Position": { + "X": 1141.7506875448466, + "Y": 480.69755131360336, + "IsEmpty": false + }, + "Timestamp": 637316496897925340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.778805196, + "Position": { + "X": 1141.5298623495341, + "Y": 479.15702396985336, + "IsEmpty": false + }, + "Timestamp": 637316496898260570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.778805196, + "Position": { + "X": 1143.4226113729717, + "Y": 480.00590092297836, + "IsEmpty": false + }, + "Timestamp": 637316496898429580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.778805196, + "Position": { + "X": 1145.4730752401592, + "Y": 481.23207279797833, + "IsEmpty": false + }, + "Timestamp": 637316496898594230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.315419227, + "Position": { + "X": 1147.2396523885968, + "Y": 482.20668217297833, + "IsEmpty": false + }, + "Timestamp": 637316496898765950, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF00AACC", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e2c62ef6-635e-4f03-9db6-f8b49e19640c", + "Points": [ + { + "Pressure": 0.0917830169, + "Position": { + "X": 1115.2522622518779, + "Y": 533.86239506360334, + "IsEmpty": false + }, + "Timestamp": 637316497071460250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.113023572, + "Position": { + "X": 1115.0629922323467, + "Y": 533.79950443860332, + "IsEmpty": false + }, + "Timestamp": 637316497071628300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.324208438, + "Position": { + "X": 1116.1670937948468, + "Y": 535.46581303235337, + "IsEmpty": false + }, + "Timestamp": 637316497072314680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.347402155, + "Position": { + "X": 1118.9115762167216, + "Y": 537.1321216261033, + "IsEmpty": false + }, + "Timestamp": 637316497072475160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.367666125, + "Position": { + "X": 1123.4541543417217, + "Y": 538.60980717297832, + "IsEmpty": false + }, + "Timestamp": 637316497072648180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.384023815, + "Position": { + "X": 1129.5109414510966, + "Y": 540.49618412610334, + "IsEmpty": false + }, + "Timestamp": 637316497072811860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.398672462, + "Position": { + "X": 1137.9651894979718, + "Y": 542.6655688917283, + "IsEmpty": false + }, + "Timestamp": 637316497072989060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.405508518, + "Position": { + "X": 1144.4636269979717, + "Y": 544.42616459485339, + "IsEmpty": false + }, + "Timestamp": 637316497073153550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.405508518, + "Position": { + "X": 1146.0724648885966, + "Y": 544.80345951672837, + "IsEmpty": false + }, + "Timestamp": 637316497073326040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.381094068, + "Position": { + "X": 1147.4604775839093, + "Y": 544.96063725110332, + "IsEmpty": false + }, + "Timestamp": 637316497073398620, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "b15bf0f3-c843-4c96-850c-38ab363433db", + "Points": [ + { + "Pressure": 0.126451507, + "Position": { + "X": 1114.0219888143779, + "Y": 531.78734623547837, + "IsEmpty": false + }, + "Timestamp": 637316497075720260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.13987945, + "Position": { + "X": 1116.5771890096905, + "Y": 532.41615482922839, + "IsEmpty": false + }, + "Timestamp": 637316497075734160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.310292214, + "Position": { + "X": 1121.8768838339092, + "Y": 533.86239506360334, + "IsEmpty": false + }, + "Timestamp": 637316497075954340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.368398577, + "Position": { + "X": 1127.5551064901592, + "Y": 535.65443607922839, + "IsEmpty": false + }, + "Timestamp": 637316497076026470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.394277871, + "Position": { + "X": 1133.6118935995341, + "Y": 537.4150806104783, + "IsEmpty": false + }, + "Timestamp": 637316497076191920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.40233463, + "Position": { + "X": 1141.5298623495341, + "Y": 539.33290287610339, + "IsEmpty": false + }, + "Timestamp": 637316497076360740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.39818418, + "Position": { + "X": 1145.2838174276592, + "Y": 540.62196537610339, + "IsEmpty": false + }, + "Timestamp": 637316497076529260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.238513768, + "Position": { + "X": 1146.0409219198468, + "Y": 540.87347904797832, + "IsEmpty": false + }, + "Timestamp": 637316497076610760, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "fc3b6298-21d8-4914-89ae-030f2698fe5f", + "Points": [ + { + "Pressure": 0.0842145383, + "Position": { + "X": 1116.1040078573467, + "Y": 529.52367436047837, + "IsEmpty": false + }, + "Timestamp": 637316497078492860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.132066831, + "Position": { + "X": 1117.9021035604717, + "Y": 529.83807865735332, + "IsEmpty": false + }, + "Timestamp": 637316497078498310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.380605787, + "Position": { + "X": 1124.7159951620342, + "Y": 531.50438725110337, + "IsEmpty": false + }, + "Timestamp": 637316497078834820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.414053559, + "Position": { + "X": 1130.1418496542217, + "Y": 533.01351811047834, + "IsEmpty": false + }, + "Timestamp": 637316497079020050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.420157164, + "Position": { + "X": 1138.0598428182843, + "Y": 534.99423100110334, + "IsEmpty": false + }, + "Timestamp": 637316497079068720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.420157164, + "Position": { + "X": 1142.4447060995342, + "Y": 536.12606693860334, + "IsEmpty": false + }, + "Timestamp": 637316497079300220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.173327222, + "Position": { + "X": 1144.0850869589092, + "Y": 536.5662036573533, + "IsEmpty": false + }, + "Timestamp": 637316497079375020, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "ebc18b61-69aa-4edf-a71d-7421eb62f29f", + "Points": [ + { + "Pressure": 0.0561379418, + "Position": { + "X": 1113.517252486253, + "Y": 525.46796146985332, + "IsEmpty": false + }, + "Timestamp": 637316497080814820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.433340967, + "Position": { + "X": 1135.4415322714092, + "Y": 529.24071537610337, + "IsEmpty": false + }, + "Timestamp": 637316497081606230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.433340967, + "Position": { + "X": 1143.0440713339092, + "Y": 530.4983325636033, + "IsEmpty": false + }, + "Timestamp": 637316497081801290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.395742744, + "Position": { + "X": 1145.9462685995343, + "Y": 531.03280521985334, + "IsEmpty": false + }, + "Timestamp": 637316497081954170, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "0ae77409-aaa7-4822-8d9d-5d2c3dcea629", + "Points": [ + { + "Pressure": 0.266102076, + "Position": { + "X": 1114.7159951620342, + "Y": 521.31786381360337, + "IsEmpty": false + }, + "Timestamp": 637316497083420960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.386953533, + "Position": { + "X": 1129.2901162557841, + "Y": 523.73876225110337, + "IsEmpty": false + }, + "Timestamp": 637316497084222100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.241931796, + "Position": { + "X": 1147.7759316854717, + "Y": 526.63119389172834, + "IsEmpty": false + }, + "Timestamp": 637316497084306610, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e113c5db-df2a-4c0e-be78-c1f191a80e98", + "Points": [ + { + "Pressure": 0.0419775695, + "Position": { + "X": 1116.5141030721904, + "Y": 518.26820561047839, + "IsEmpty": false + }, + "Timestamp": 637316497085610790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0458838791, + "Position": { + "X": 1117.0188271932843, + "Y": 518.29965092297834, + "IsEmpty": false + }, + "Timestamp": 637316497085614480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.387197673, + "Position": { + "X": 1128.4383828573468, + "Y": 519.5886645948533, + "IsEmpty": false + }, + "Timestamp": 637316497086085310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.423086911, + "Position": { + "X": 1135.1891641073466, + "Y": 520.50043217297832, + "IsEmpty": false + }, + "Timestamp": 637316497086215650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.429922938, + "Position": { + "X": 1141.4667764120343, + "Y": 521.7266040479783, + "IsEmpty": false + }, + "Timestamp": 637316497086329990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.405996799, + "Position": { + "X": 1148.3122109823466, + "Y": 523.4243579542283, + "IsEmpty": false + }, + "Timestamp": 637316497086698630, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "b26c6d9e-d12e-4b3f-8ebc-f891ba49ac09", + "Points": [ + { + "Pressure": 0.224841684, + "Position": { + "X": 1120.4573037557843, + "Y": 515.69012943860332, + "IsEmpty": false + }, + "Timestamp": 637316497088420620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.391836435, + "Position": { + "X": 1140.5835000448467, + "Y": 516.3503833448533, + "IsEmpty": false + }, + "Timestamp": 637316497088424750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.332509339, + "Position": { + "X": 1150.5204141073468, + "Y": 517.41932865735339, + "IsEmpty": false + }, + "Timestamp": 637316497088875930, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8d67c63d-76f7-4d43-987e-1b2e623daf8d", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 1112.917887251878, + "Y": 509.21351811047833, + "IsEmpty": false + }, + "Timestamp": 637316497090212080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.438223839, + "Position": { + "X": 1123.6749795370342, + "Y": 509.59081303235337, + "IsEmpty": false + }, + "Timestamp": 637316497090219160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.207507432, + "Position": { + "X": 1145.5361855917217, + "Y": 511.32001225110332, + "IsEmpty": false + }, + "Timestamp": 637316497091051250, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "bac5ac7a-4830-46cb-a36e-2bf6d933bea1", + "Points": [ + { + "Pressure": 0.0917830169, + "Position": { + "X": 1044.0219888143779, + "Y": 564.83065678235334, + "IsEmpty": false + }, + "Timestamp": 637316497099563310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.212634474, + "Position": { + "X": 1046.0093667440656, + "Y": 564.45336186047837, + "IsEmpty": false + }, + "Timestamp": 637316497099855960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.366201252, + "Position": { + "X": 1049.2585732870343, + "Y": 564.2961841261033, + "IsEmpty": false + }, + "Timestamp": 637316497100026860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.413809419, + "Position": { + "X": 1052.7601602010968, + "Y": 564.17040287610337, + "IsEmpty": false + }, + "Timestamp": 637316497100190690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.427481502, + "Position": { + "X": 1056.4825478964092, + "Y": 564.10751225110334, + "IsEmpty": false + }, + "Timestamp": 637316497100359010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.427481502, + "Position": { + "X": 1058.2806558065654, + "Y": 564.17040287610337, + "IsEmpty": false + }, + "Timestamp": 637316497100525890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.40233463, + "Position": { + "X": 1061.245963423753, + "Y": 564.51625248547839, + "IsEmpty": false + }, + "Timestamp": 637316497100592790, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "22aa6e85-9514-4319-b5b2-04a70f179e8e", + "Points": [ + { + "Pressure": 0.230945289, + "Position": { + "X": 1046.8295571737531, + "Y": 563.41586186047834, + "IsEmpty": false + }, + "Timestamp": 637316497102242250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.308339059, + "Position": { + "X": 1055.9147256307842, + "Y": 562.53553959485339, + "IsEmpty": false + }, + "Timestamp": 637316497102248040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.139391169, + "Position": { + "X": 1063.0756143026592, + "Y": 562.4412036573533, + "IsEmpty": false + }, + "Timestamp": 637316497102636360, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "db77a991-b1d2-4440-ad56-0ddf57113a26", + "Points": [ + { + "Pressure": 0.233630881, + "Position": { + "X": 1043.7065347128155, + "Y": 558.54266850110332, + "IsEmpty": false + }, + "Timestamp": 637316497104775390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.134508282, + "Position": { + "X": 1068.5961221151592, + "Y": 557.25365482922837, + "IsEmpty": false + }, + "Timestamp": 637316497104786990, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "08f27155-763a-46fd-8010-389c5672fa56", + "Points": [ + { + "Pressure": 0.126451507, + "Position": { + "X": 1041.4352334432842, + "Y": 554.3926196729783, + "IsEmpty": false + }, + "Timestamp": 637316497106067630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.181872278, + "Position": { + "X": 1046.1040078573467, + "Y": 554.29828373547832, + "IsEmpty": false + }, + "Timestamp": 637316497106132500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.374502182, + "Position": { + "X": 1072.8547891073467, + "Y": 554.42406498547837, + "IsEmpty": false + }, + "Timestamp": 637316497106802940, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "19faa507-a2cb-4d84-a44f-d915420fdc52", + "Points": [ + { + "Pressure": 0.21092546, + "Position": { + "X": 1044.085074751878, + "Y": 552.19183842297832, + "IsEmpty": false + }, + "Timestamp": 637316497108504820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523186088, + "Position": { + "X": 1063.1071572714093, + "Y": 551.78309818860339, + "IsEmpty": false + }, + "Timestamp": 637316497108512660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.382314801, + "Position": { + "X": 1073.1071572714093, + "Y": 551.78309818860339, + "IsEmpty": false + }, + "Timestamp": 637316497108997140, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7ad0a1d9-3902-4482-8ca6-e9fd394fef55", + "Points": [ + { + "Pressure": 0.350576013, + "Position": { + "X": 1048.2175698690655, + "Y": 549.89672123547837, + "IsEmpty": false + }, + "Timestamp": 637316497110736490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575921237, + "Position": { + "X": 1066.1040078573467, + "Y": 548.23041264172832, + "IsEmpty": false + }, + "Timestamp": 637316497110826290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.303456157, + "Position": { + "X": 1075.9778237753155, + "Y": 547.91600834485337, + "IsEmpty": false + }, + "Timestamp": 637316497111162790, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "cc6267dc-11d4-4cf2-8217-62d3ded953b6", + "Points": [ + { + "Pressure": 0.224841684, + "Position": { + "X": 1046.6087319784406, + "Y": 544.86635014172839, + "IsEmpty": false + }, + "Timestamp": 637316497112561420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.249256119, + "Position": { + "X": 1047.965201705003, + "Y": 544.45760990735334, + "IsEmpty": false + }, + "Timestamp": 637316497113149410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.225085825, + "Position": { + "X": 1073.8642617635967, + "Y": 542.31971928235339, + "IsEmpty": false + }, + "Timestamp": 637316497113606520, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "def0c1d5-277c-4bf3-bb0a-3637e6cebc44", + "Points": [ + { + "Pressure": 0.0842145383, + "Position": { + "X": 1044.8106240682841, + "Y": 540.30756107922832, + "IsEmpty": false + }, + "Timestamp": 637316497114941750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.156481266, + "Position": { + "X": 1048.9746621542217, + "Y": 540.02460209485332, + "IsEmpty": false + }, + "Timestamp": 637316497115499970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.308094919, + "Position": { + "X": 1074.8106240682841, + "Y": 538.9871020948533, + "IsEmpty": false + }, + "Timestamp": 637316497115939900, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "1902b46f-ae77-4fae-bb2a-c0baef76a9db", + "Points": [ + { + "Pressure": 0.325185001, + "Position": { + "X": 1045.1891763143781, + "Y": 537.82382084485334, + "IsEmpty": false + }, + "Timestamp": 637316497117264220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526359975, + "Position": { + "X": 1057.7759316854717, + "Y": 536.88060795422837, + "IsEmpty": false + }, + "Timestamp": 637316497117341570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.457999527, + "Position": { + "X": 1073.6118935995341, + "Y": 534.93134037610332, + "IsEmpty": false + }, + "Timestamp": 637316497118158230, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "eebc14d4-ed22-4637-b723-eb43a0eb7d90", + "Points": [ + { + "Pressure": 0.334706634, + "Position": { + "X": 1045.7885537557843, + "Y": 532.98207279797839, + "IsEmpty": false + }, + "Timestamp": 637316497119536350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.626214981, + "Position": { + "X": 1066.8611001425029, + "Y": 530.74984623547834, + "IsEmpty": false + }, + "Timestamp": 637316497119605530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.257801175, + "Position": { + "X": 1070.7727700643779, + "Y": 529.83807865735332, + "IsEmpty": false + }, + "Timestamp": 637316497120502360, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "945ee2a6-b63d-4a4d-a9f9-822c91bb4e69", + "Points": [ + { + "Pressure": 0.323231846, + "Position": { + "X": 1044.7159951620342, + "Y": 527.57440678235332, + "IsEmpty": false + }, + "Timestamp": 637316497122023230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620355546, + "Position": { + "X": 1072.7917031698466, + "Y": 526.28539311047837, + "IsEmpty": false + }, + "Timestamp": 637316497122093360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412832826, + "Position": { + "X": 1070.9304971151591, + "Y": 526.0967212354783, + "IsEmpty": false + }, + "Timestamp": 637316497122706280, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "6c766f1d-86db-49bf-b837-f1ec0cc5263f", + "Points": [ + { + "Pressure": 0.0842145383, + "Position": { + "X": 1043.7696206503156, + "Y": 525.15355717297837, + "IsEmpty": false + }, + "Timestamp": 637316497124321500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.348134577, + "Position": { + "X": 1072.7286050253156, + "Y": 524.2732349073533, + "IsEmpty": false + }, + "Timestamp": 637316497124326510, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "a917ded6-f093-4f2d-859f-3842621c1a15", + "Points": [ + { + "Pressure": 0.19676508, + "Position": { + "X": 1047.1134683065654, + "Y": 516.72767826672839, + "IsEmpty": false + }, + "Timestamp": 637316497125970830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.495353639, + "Position": { + "X": 1064.8421792440654, + "Y": 515.97308842297832, + "IsEmpty": false + }, + "Timestamp": 637316497126040920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.453849077, + "Position": { + "X": 1071.0251382284405, + "Y": 515.47006107922834, + "IsEmpty": false + }, + "Timestamp": 637316497126491680, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "2e5781cf-6632-43b3-801f-80fd12d2af61", + "Points": [ + { + "Pressure": 0.0702983141, + "Position": { + "X": 1045.0314492635966, + "Y": 512.51473881360334, + "IsEmpty": false + }, + "Timestamp": 637316497127930190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.233875021, + "Position": { + "X": 1069.7317666464091, + "Y": 510.69120365735336, + "IsEmpty": false + }, + "Timestamp": 637316497128534100, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e7760632-fa16-459e-b8f7-3e37e18b4ace", + "Points": [ + { + "Pressure": 0.252185851, + "Position": { + "X": 1001.1513223104718, + "Y": 520.0288501417283, + "IsEmpty": false + }, + "Timestamp": 637316497134210400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.342030972, + "Position": { + "X": 1001.4036904745342, + "Y": 520.09174076672832, + "IsEmpty": false + }, + "Timestamp": 637316497134495460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.439688712, + "Position": { + "X": 1002.5077920370343, + "Y": 520.21747318860332, + "IsEmpty": false + }, + "Timestamp": 637316497134665150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510734737, + "Position": { + "X": 1003.9904397421124, + "Y": 520.21747318860332, + "IsEmpty": false + }, + "Timestamp": 637316497134849090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583977997, + "Position": { + "X": 1008.2806619100811, + "Y": 520.21747318860332, + "IsEmpty": false + }, + "Timestamp": 637316497135000030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.609124899, + "Position": { + "X": 1011.845328658128, + "Y": 520.06029545422837, + "IsEmpty": false + }, + "Timestamp": 637316497135168160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1015.9462808065655, + "Y": 520.09174076672832, + "IsEmpty": false + }, + "Timestamp": 637316497135341800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1017.6182046346905, + "Y": 520.1545825636033, + "IsEmpty": false + }, + "Timestamp": 637316497135503920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5200122, + "Position": { + "X": 1019.1324014120343, + "Y": 520.21747318860332, + "IsEmpty": false + }, + "Timestamp": 637316497135592570, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8cdfc11d-3ef0-44b4-b15e-e1b18c6791bf", + "Points": [ + { + "Pressure": 0.323231846, + "Position": { + "X": 997.77593168547173, + "Y": 518.8970142042283, + "IsEmpty": false + }, + "Timestamp": 637316497137150470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.358388633, + "Position": { + "X": 999.76330961515919, + "Y": 518.51971928235332, + "IsEmpty": false + }, + "Timestamp": 637316497137155460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.291248947, + "Position": { + "X": 1013.1387063436748, + "Y": 518.1738696729783, + "IsEmpty": false + }, + "Timestamp": 637316497138015210, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c3830923-ae4f-48db-88c9-0f032108358d", + "Points": [ + { + "Pressure": 0.323231846, + "Position": { + "X": 997.05037626554986, + "Y": 515.28143803235332, + "IsEmpty": false + }, + "Timestamp": 637316497139439770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.483878851, + "Position": { + "X": 1011.245963423753, + "Y": 514.27533451672832, + "IsEmpty": false + }, + "Timestamp": 637316497139443640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.486320287, + "Position": { + "X": 1020.5519570760968, + "Y": 514.11815678235337, + "IsEmpty": false + }, + "Timestamp": 637316497139850590, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7451048d-aa4a-4bf5-b8e4-87705103404a", + "Points": [ + { + "Pressure": 0.344472408, + "Position": { + "X": 996.86110624601861, + "Y": 510.25106693860334, + "IsEmpty": false + }, + "Timestamp": 637316497141170160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.451895922, + "Position": { + "X": 1004.8421792440655, + "Y": 509.74799076672832, + "IsEmpty": false + }, + "Timestamp": 637316497141242140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.230701149, + "Position": { + "X": 1016.2932778768779, + "Y": 509.40218998547834, + "IsEmpty": false + }, + "Timestamp": 637316497142270080, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "2446bb3a-d5ca-4878-8fa6-5180216c49c2", + "Points": [ + { + "Pressure": 0.0842145383, + "Position": { + "X": 997.68129667570611, + "Y": 507.67299076672833, + "IsEmpty": false + }, + "Timestamp": 637316497143656560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.408438236, + "Position": { + "X": 1009.2585793905498, + "Y": 508.42753178235336, + "IsEmpty": false + }, + "Timestamp": 637316497143659960, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "eb6ef839-d2dd-4dbb-b18c-c566b0b17b77", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 1048.0913857870341, + "Y": 510.03094975110332, + "IsEmpty": false + }, + "Timestamp": 637316497146831720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.107896544, + "Position": { + "X": 1047.4920205526591, + "Y": 509.21351811047833, + "IsEmpty": false + }, + "Timestamp": 637316497146836990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.199938968, + "Position": { + "X": 1047.1134683065654, + "Y": 509.18207279797832, + "IsEmpty": false + }, + "Timestamp": 637316497146994600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.317616552, + "Position": { + "X": 1046.9872842245343, + "Y": 509.33929936047832, + "IsEmpty": false + }, + "Timestamp": 637316497147164290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.393301278, + "Position": { + "X": 1047.8705727987531, + "Y": 509.96810795422834, + "IsEmpty": false + }, + "Timestamp": 637316497147334150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.468986034, + "Position": { + "X": 1050.1418618612529, + "Y": 510.25106693860334, + "IsEmpty": false + }, + "Timestamp": 637316497147509840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51610589, + "Position": { + "X": 1054.9368081503155, + "Y": 509.96810795422834, + "IsEmpty": false + }, + "Timestamp": 637316497147669760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.549553692, + "Position": { + "X": 1065.8831826620342, + "Y": 509.33929936047832, + "IsEmpty": false + }, + "Timestamp": 637316497147850200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55272752, + "Position": { + "X": 1072.5708779745341, + "Y": 508.55331303235334, + "IsEmpty": false + }, + "Timestamp": 637316497148007930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55272752, + "Position": { + "X": 1076.798014205003, + "Y": 507.76727787610332, + "IsEmpty": false + }, + "Timestamp": 637316497148182800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481437385, + "Position": { + "X": 1077.4920205526591, + "Y": 507.10707279797833, + "IsEmpty": false + }, + "Timestamp": 637316497148344870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.399649054, + "Position": { + "X": 1076.4194619589093, + "Y": 506.25819584485333, + "IsEmpty": false + }, + "Timestamp": 637316497148438210, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "51de8c05-e248-4cbd-b5f2-c18a2c16eaeb", + "Points": [ + { + "Pressure": 0.112291142, + "Position": { + "X": 1048.3437539510967, + "Y": 508.86766850110337, + "IsEmpty": false + }, + "Timestamp": 637316497150033450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.178210109, + "Position": { + "X": 1068.0913857870341, + "Y": 508.67904545422834, + "IsEmpty": false + }, + "Timestamp": 637316497150037250, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d0d3d29a-a84d-4f13-955b-39e0ca563951", + "Points": [ + { + "Pressure": 0.334706634, + "Position": { + "X": 1044.4636269979717, + "Y": 517.1992602979783, + "IsEmpty": false + }, + "Timestamp": 637316497151764070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53612572, + "Position": { + "X": 1063.3279824667218, + "Y": 517.35643803235337, + "IsEmpty": false + }, + "Timestamp": 637316497152289180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.47924009, + "Position": { + "X": 1061.8137856893779, + "Y": 517.45077396985334, + "IsEmpty": false + }, + "Timestamp": 637316497152449680, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c506fa7e-b4b9-400c-8f59-e96cc02cca37", + "Points": [ + { + "Pressure": 0.21092546, + "Position": { + "X": 1041.277506392503, + "Y": 521.50653568860332, + "IsEmpty": false + }, + "Timestamp": 637316497154001150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526359975, + "Position": { + "X": 1059.9210366659404, + "Y": 522.26107670422834, + "IsEmpty": false + }, + "Timestamp": 637316497154009270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.218005642, + "Position": { + "X": 1062.7601602010968, + "Y": 523.07850834485339, + "IsEmpty": false + }, + "Timestamp": 637316497154881520, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF008055", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "103e4a4c-7081-4bf7-a95e-4378845580f0", + "Points": [ + { + "Pressure": 0.0878767073, + "Position": { + "X": 1003.6749917440654, + "Y": 608.59491459485332, + "IsEmpty": false + }, + "Timestamp": 637316497221308410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0964217559, + "Position": { + "X": 1004.9683633260968, + "Y": 608.9722095167283, + "IsEmpty": false + }, + "Timestamp": 637316497221349170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.107896544, + "Position": { + "X": 1006.3563760214092, + "Y": 609.4123950636033, + "IsEmpty": false + }, + "Timestamp": 637316497221518760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.172106504, + "Position": { + "X": 1007.5235635214092, + "Y": 609.72675053235332, + "IsEmpty": false + }, + "Timestamp": 637316497221689920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.209704742, + "Position": { + "X": 1008.0913979940655, + "Y": 609.91542240735339, + "IsEmpty": false + }, + "Timestamp": 637316497221859900, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "3737f4e1-f653-4fa9-b254-23bc9ba795cc", + "Points": [ + { + "Pressure": 0.107896544, + "Position": { + "X": 1009.006217330003, + "Y": 611.89613529797839, + "IsEmpty": false + }, + "Timestamp": 637316497224175090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.343739986, + "Position": { + "X": 1008.8484902792218, + "Y": 611.48739506360334, + "IsEmpty": false + }, + "Timestamp": 637316497224861750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.47924009, + "Position": { + "X": 1008.6907632284405, + "Y": 611.33021732922839, + "IsEmpty": false + }, + "Timestamp": 637316497224956210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.50780499, + "Position": { + "X": 1008.469938033128, + "Y": 611.42450443860332, + "IsEmpty": false + }, + "Timestamp": 637316497225742310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.475577921, + "Position": { + "X": 1008.2491250448468, + "Y": 611.48739506360334, + "IsEmpty": false + }, + "Timestamp": 637316497225914550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.39403373, + "Position": { + "X": 1006.5456460409405, + "Y": 611.45594975110339, + "IsEmpty": false + }, + "Timestamp": 637316497226928310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.389394969, + "Position": { + "X": 1001.4667886190655, + "Y": 610.85858646985332, + "IsEmpty": false + }, + "Timestamp": 637316497227097860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.364492267, + "Position": { + "X": 995.94628080656548, + "Y": 610.98436771985337, + "IsEmpty": false + }, + "Timestamp": 637316497227437480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.222888529, + "Position": { + "X": 983.32798857023738, + "Y": 611.61317631360339, + "IsEmpty": false + }, + "Timestamp": 637316497227601440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.174792096, + "Position": { + "X": 976.95574735929983, + "Y": 612.02186771985339, + "IsEmpty": false + }, + "Timestamp": 637316497227769430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.166491181, + "Position": { + "X": 975.25227445890926, + "Y": 612.14764896985332, + "IsEmpty": false + }, + "Timestamp": 637316497227934790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.164293885, + "Position": { + "X": 975.82010282804981, + "Y": 612.21053959485334, + "IsEmpty": false + }, + "Timestamp": 637316497228103360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.164293885, + "Position": { + "X": 976.26174101164361, + "Y": 612.21053959485334, + "IsEmpty": false + }, + "Timestamp": 637316497228188660, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d97f6c99-de7f-4335-989a-6194b68013e3", + "Points": [ + { + "Pressure": 0.0561379418, + "Position": { + "X": 988.65921415617481, + "Y": 610.9529224073533, + "IsEmpty": false + }, + "Timestamp": 637316497229686410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0966659039, + "Position": { + "X": 1000.6150552206279, + "Y": 610.00970951672832, + "IsEmpty": false + }, + "Timestamp": 637316497229694080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.325673312, + "Position": { + "X": 1007.5866616659405, + "Y": 609.66390873547834, + "IsEmpty": false + }, + "Timestamp": 637316497230107060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.375234604, + "Position": { + "X": 1010.5519570760968, + "Y": 609.5381274854783, + "IsEmpty": false + }, + "Timestamp": 637316497230248620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.406729221, + "Position": { + "X": 1012.9494424276593, + "Y": 609.4123950636033, + "IsEmpty": false + }, + "Timestamp": 637316497230321130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.439200431, + "Position": { + "X": 1014.4951821737529, + "Y": 609.44379154797832, + "IsEmpty": false + }, + "Timestamp": 637316497230470670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.437247276, + "Position": { + "X": 1012.7286172323468, + "Y": 609.47523686047839, + "IsEmpty": false + }, + "Timestamp": 637316497230975310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.426016629, + "Position": { + "X": 1011.6560586385967, + "Y": 609.50668217297834, + "IsEmpty": false + }, + "Timestamp": 637316497231349760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.286366075, + "Position": { + "X": 1004.9683633260968, + "Y": 609.19227787610339, + "IsEmpty": false + }, + "Timestamp": 637316497231489280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.10203708, + "Position": { + "X": 1002.5708901815655, + "Y": 609.09799076672834, + "IsEmpty": false + }, + "Timestamp": 637316497231657610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.122789346, + "Position": { + "X": 1004.6213662557842, + "Y": 609.56957279797837, + "IsEmpty": false + }, + "Timestamp": 637316497231825700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.191638052, + "Position": { + "X": 1008.0598428182842, + "Y": 610.13549076672837, + "IsEmpty": false + }, + "Timestamp": 637316497231993820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.240222782, + "Position": { + "X": 1011.4352456503154, + "Y": 610.2612720167283, + "IsEmpty": false + }, + "Timestamp": 637316497232161100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.277821004, + "Position": { + "X": 1013.7696206503155, + "Y": 610.2612720167283, + "IsEmpty": false + }, + "Timestamp": 637316497232335120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.325673312, + "Position": { + "X": 1014.3058999471905, + "Y": 610.19838139172839, + "IsEmpty": false + }, + "Timestamp": 637316497232544180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.342275113, + "Position": { + "X": 1012.6655190878155, + "Y": 609.72675053235332, + "IsEmpty": false + }, + "Timestamp": 637316497232674330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.344960719, + "Position": { + "X": 1008.7538491659404, + "Y": 609.28661381360337, + "IsEmpty": false + }, + "Timestamp": 637316497232849430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.318837255, + "Position": { + "X": 1003.3279824667218, + "Y": 608.65780521985334, + "IsEmpty": false + }, + "Timestamp": 637316497233010660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.262439907, + "Position": { + "X": 995.18918241789356, + "Y": 608.87787357922832, + "IsEmpty": false + }, + "Timestamp": 637316497233180570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.255359739, + "Position": { + "X": 992.28697904875298, + "Y": 609.03510014172832, + "IsEmpty": false + }, + "Timestamp": 637316497233348790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.253406584, + "Position": { + "X": 991.68760771086238, + "Y": 609.16083256360332, + "IsEmpty": false + }, + "Timestamp": 637316497233515150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.267078668, + "Position": { + "X": 993.48571562101858, + "Y": 609.44379154797832, + "IsEmpty": false + }, + "Timestamp": 637316497233683120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.334218353, + "Position": { + "X": 999.13240141203426, + "Y": 609.09799076672834, + "IsEmpty": false + }, + "Timestamp": 637316497233852330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.357656211, + "Position": { + "X": 1002.4447060995342, + "Y": 608.53207279797834, + "IsEmpty": false + }, + "Timestamp": 637316497234025710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.369130999, + "Position": { + "X": 1004.6213662557842, + "Y": 607.87181889172837, + "IsEmpty": false + }, + "Timestamp": 637316497234190090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.371328294, + "Position": { + "X": 1005.3469155721905, + "Y": 606.96005131360334, + "IsEmpty": false + }, + "Timestamp": 637316497234361680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.324208438, + "Position": { + "X": 1004.2428140096905, + "Y": 605.7339282667283, + "IsEmpty": false + }, + "Timestamp": 637316497234529580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.307606608, + "Position": { + "X": 1003.6749917440654, + "Y": 605.41952396985334, + "IsEmpty": false + }, + "Timestamp": 637316497234617220, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8285d630-f807-46af-b3c3-109c1de56d30", + "Points": [ + { + "Pressure": 0.154528111, + "Position": { + "X": 995.18918241789356, + "Y": 604.66493412610339, + "IsEmpty": false + }, + "Timestamp": 637316497236069620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.291737229, + "Position": { + "X": 1011.6560586385967, + "Y": 605.98544193860334, + "IsEmpty": false + }, + "Timestamp": 637316497236073520, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "a898571a-081c-477a-a63d-1fd94ae44885", + "Points": [ + { + "Pressure": 0.19676508, + "Position": { + "X": 949.92104887297171, + "Y": 594.76141850110332, + "IsEmpty": false + }, + "Timestamp": 637316497238154240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.217761502, + "Position": { + "X": 951.21442045500294, + "Y": 594.76141850110332, + "IsEmpty": false + }, + "Timestamp": 637316497238230240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.227283135, + "Position": { + "X": 952.98098539640921, + "Y": 594.79281498547834, + "IsEmpty": false + }, + "Timestamp": 637316497238409300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.320302129, + "Position": { + "X": 954.36899809172178, + "Y": 594.85570561047837, + "IsEmpty": false + }, + "Timestamp": 637316497238583660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.326405734, + "Position": { + "X": 951.34060453703421, + "Y": 594.6985278761033, + "IsEmpty": false + }, + "Timestamp": 637316497239086130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.305409312, + "Position": { + "X": 948.78539823820608, + "Y": 594.50985600110334, + "IsEmpty": false + }, + "Timestamp": 637316497239256270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.25560388, + "Position": { + "X": 945.63082670500296, + "Y": 594.85570561047837, + "IsEmpty": false + }, + "Timestamp": 637316497239426690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.251453429, + "Position": { + "X": 945.94628385832334, + "Y": 595.07577396985334, + "IsEmpty": false + }, + "Timestamp": 637316497239594770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.257557034, + "Position": { + "X": 948.3437600546124, + "Y": 595.6731372511033, + "IsEmpty": false + }, + "Timestamp": 637316497239766890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.296864271, + "Position": { + "X": 954.77909330656553, + "Y": 596.45912357922839, + "IsEmpty": false + }, + "Timestamp": 637316497239942170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.302967876, + "Position": { + "X": 958.81694731047173, + "Y": 596.6792407667283, + "IsEmpty": false + }, + "Timestamp": 637316497240110830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.302967876, + "Position": { + "X": 961.24596952726858, + "Y": 596.77352787610334, + "IsEmpty": false + }, + "Timestamp": 637316497240273530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.304921031, + "Position": { + "X": 961.56142362883111, + "Y": 596.77352787610334, + "IsEmpty": false + }, + "Timestamp": 637316497240443300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.289784074, + "Position": { + "X": 959.29013456633106, + "Y": 596.5220142042283, + "IsEmpty": false + }, + "Timestamp": 637316497240777940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.24779126, + "Position": { + "X": 954.90527128508108, + "Y": 596.55345951672837, + "IsEmpty": false + }, + "Timestamp": 637316497240951150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.115953304, + "Position": { + "X": 944.96836637785452, + "Y": 596.8049731886033, + "IsEmpty": false + }, + "Timestamp": 637316497241123310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0593118183, + "Position": { + "X": 941.71915373137017, + "Y": 597.49667240735334, + "IsEmpty": false + }, + "Timestamp": 637316497241292310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0580910966, + "Position": { + "X": 942.2238870077374, + "Y": 598.06259037610334, + "IsEmpty": false + }, + "Timestamp": 637316497241457270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.126939803, + "Position": { + "X": 945.75701078703423, + "Y": 598.40843998547837, + "IsEmpty": false + }, + "Timestamp": 637316497241647600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.212390319, + "Position": { + "X": 950.80432524015919, + "Y": 598.88002201672839, + "IsEmpty": false + }, + "Timestamp": 637316497241795800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.246570528, + "Position": { + "X": 958.46994413664356, + "Y": 599.47738529797834, + "IsEmpty": false + }, + "Timestamp": 637316497241959560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.258777738, + "Position": { + "X": 962.41316313078426, + "Y": 599.82323490735337, + "IsEmpty": false + }, + "Timestamp": 637316497242130200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.265857935, + "Position": { + "X": 964.71600126554983, + "Y": 600.04330326672834, + "IsEmpty": false + }, + "Timestamp": 637316497242298750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.254383147, + "Position": { + "X": 965.03145536711236, + "Y": 600.04330326672834, + "IsEmpty": false + }, + "Timestamp": 637316497242475560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.226306558, + "Position": { + "X": 964.68445219328419, + "Y": 600.04330326672834, + "IsEmpty": false + }, + "Timestamp": 637316497242639680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.179919124, + "Position": { + "X": 960.70969023039356, + "Y": 600.10619389172837, + "IsEmpty": false + }, + "Timestamp": 637316497242806630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.175524533, + "Position": { + "X": 957.27120756437796, + "Y": 600.54633061047832, + "IsEmpty": false + }, + "Timestamp": 637316497242978010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.173327222, + "Position": { + "X": 953.67499174406544, + "Y": 600.98646732922839, + "IsEmpty": false + }, + "Timestamp": 637316497243144090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.333241791, + "Position": { + "X": 950.55196317961236, + "Y": 601.36376225110337, + "IsEmpty": false + }, + "Timestamp": 637316497243320630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.375967026, + "Position": { + "X": 951.08824247648738, + "Y": 602.0554614698533, + "IsEmpty": false + }, + "Timestamp": 637316497243820600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.396719307, + "Position": { + "X": 951.52988066008106, + "Y": 602.84144779797839, + "IsEmpty": false + }, + "Timestamp": 637316497243993270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.392080575, + "Position": { + "X": 951.18287748625301, + "Y": 603.15585209485334, + "IsEmpty": false + }, + "Timestamp": 637316497244163820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.362539113, + "Position": { + "X": 949.73177274992486, + "Y": 603.4702563917283, + "IsEmpty": false + }, + "Timestamp": 637316497244334960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.172106504, + "Position": { + "X": 947.46048063566707, + "Y": 603.62743412610337, + "IsEmpty": false + }, + "Timestamp": 637316497244461660, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d791ac36-bd5b-41d2-a5cf-8fbd68f57d19", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 947.80748380949512, + "Y": 602.3384204542283, + "IsEmpty": false + }, + "Timestamp": 637316497246009930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.248279542, + "Position": { + "X": 956.76647123625298, + "Y": 600.38915287610337, + "IsEmpty": false + }, + "Timestamp": 637316497246016090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.174547955, + "Position": { + "X": 929.47940763762017, + "Y": 599.7917895948533, + "IsEmpty": false + }, + "Timestamp": 637316497246736730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.124010071, + "Position": { + "X": 923.42262663176075, + "Y": 599.88607670422834, + "IsEmpty": false + }, + "Timestamp": 637316497246894450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.124010071, + "Position": { + "X": 922.6970727377178, + "Y": 599.94896732922837, + "IsEmpty": false + }, + "Timestamp": 637316497247028500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.122056916, + "Position": { + "X": 923.07562345793269, + "Y": 600.13759037610339, + "IsEmpty": false + }, + "Timestamp": 637316497247200090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.122056916, + "Position": { + "X": 924.49517912199519, + "Y": 600.57777592297839, + "IsEmpty": false + }, + "Timestamp": 637316497247316730, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "11f6a9eb-7c98-49b3-89fd-2e0666b45852", + "Points": [ + { + "Pressure": 0.0561379418, + "Position": { + "X": 941.15133146574522, + "Y": 600.42054936047839, + "IsEmpty": false + }, + "Timestamp": 637316497249238220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.148424506, + "Position": { + "X": 941.65606169035459, + "Y": 600.29481693860339, + "IsEmpty": false + }, + "Timestamp": 637316497249244020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.264148921, + "Position": { + "X": 943.61189970304986, + "Y": 599.85463139172839, + "IsEmpty": false + }, + "Timestamp": 637316497249678870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.308827341, + "Position": { + "X": 947.14502348234669, + "Y": 599.85463139172839, + "IsEmpty": false + }, + "Timestamp": 637316497249759620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.313710243, + "Position": { + "X": 948.37530302336233, + "Y": 600.0747485792283, + "IsEmpty": false + }, + "Timestamp": 637316497249906020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.313710243, + "Position": { + "X": 948.88003935148731, + "Y": 600.16903568860334, + "IsEmpty": false + }, + "Timestamp": 637316497250072350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.291493088, + "Position": { + "X": 949.13240141203426, + "Y": 600.23192631360337, + "IsEmpty": false + }, + "Timestamp": 637316497250115150, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e74dc3aa-3fea-4bd2-b2f6-fa32aec91e36", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 1118.0598428182843, + "Y": 493.58790775891583, + "IsEmpty": false + }, + "Timestamp": 637316497284465220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.121568628, + "Position": { + "X": 1118.0282998495343, + "Y": 492.58182865735336, + "IsEmpty": false + }, + "Timestamp": 637316497284715870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.179674983, + "Position": { + "X": 1118.0598428182843, + "Y": 491.92159916516584, + "IsEmpty": false + }, + "Timestamp": 637316497284891750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.234607458, + "Position": { + "X": 1118.2491250448468, + "Y": 490.94696537610332, + "IsEmpty": false + }, + "Timestamp": 637316497285054300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.3002823, + "Position": { + "X": 1118.4383828573468, + "Y": 490.25529057141586, + "IsEmpty": false + }, + "Timestamp": 637316497285230930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.334950775, + "Position": { + "X": 1118.2806680135968, + "Y": 490.44391361829082, + "IsEmpty": false + }, + "Timestamp": 637316497285736100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.33690393, + "Position": { + "X": 1117.9652139120342, + "Y": 490.91552006360337, + "IsEmpty": false + }, + "Timestamp": 637316497285902390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.339345396, + "Position": { + "X": 1117.8390176229718, + "Y": 491.38712650891586, + "IsEmpty": false + }, + "Timestamp": 637316497286075210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.341786832, + "Position": { + "X": 1117.7128457479716, + "Y": 491.60719486829083, + "IsEmpty": false + }, + "Timestamp": 637316497286238730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.356191337, + "Position": { + "X": 1117.4920205526591, + "Y": 490.56969486829087, + "IsEmpty": false + }, + "Timestamp": 637316497286752820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.358388633, + "Position": { + "X": 1117.3658486776592, + "Y": 489.56361576672833, + "IsEmpty": false + }, + "Timestamp": 637316497286908020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.360585958, + "Position": { + "X": 1117.4920205526591, + "Y": 488.65184818860337, + "IsEmpty": false + }, + "Timestamp": 637316497287077620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.380605787, + "Position": { + "X": 1117.5551064901592, + "Y": 489.34352299329083, + "IsEmpty": false + }, + "Timestamp": 637316497287417530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.395742744, + "Position": { + "X": 1117.4604775839093, + "Y": 490.88407475110336, + "IsEmpty": false + }, + "Timestamp": 637316497287586200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.411367983, + "Position": { + "X": 1117.6181924276593, + "Y": 494.21671635266586, + "IsEmpty": false + }, + "Timestamp": 637316497287763490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.41820401, + "Position": { + "X": 1117.7128457479716, + "Y": 497.64364506360334, + "IsEmpty": false + }, + "Timestamp": 637316497287927700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.420157164, + "Position": { + "X": 1117.5551064901592, + "Y": 502.04523197766582, + "IsEmpty": false + }, + "Timestamp": 637316497288100700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.424063474, + "Position": { + "X": 1117.6181924276593, + "Y": 507.16993900891583, + "IsEmpty": false + }, + "Timestamp": 637316497288261940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.429922938, + "Position": { + "X": 1117.1765664510967, + "Y": 515.12421146985332, + "IsEmpty": false + }, + "Timestamp": 637316497288432470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.429922938, + "Position": { + "X": 1117.0188271932843, + "Y": 519.5257983839158, + "IsEmpty": false + }, + "Timestamp": 637316497288602130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.431876093, + "Position": { + "X": 1116.8295693807843, + "Y": 523.61298100110332, + "IsEmpty": false + }, + "Timestamp": 637316497288769250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.434073389, + "Position": { + "X": 1116.3563760214092, + "Y": 527.1656909620408, + "IsEmpty": false + }, + "Timestamp": 637316497288937520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.436026543, + "Position": { + "X": 1115.8200967245343, + "Y": 531.1899829542283, + "IsEmpty": false + }, + "Timestamp": 637316497289115410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.436026543, + "Position": { + "X": 1115.9778359823467, + "Y": 533.4536548292283, + "IsEmpty": false + }, + "Timestamp": 637316497289280270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.437979698, + "Position": { + "X": 1116.1670937948468, + "Y": 535.21429936047832, + "IsEmpty": false + }, + "Timestamp": 637316497289452560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.437979698, + "Position": { + "X": 1116.3248330526592, + "Y": 536.40902592297834, + "IsEmpty": false + }, + "Timestamp": 637316497289621610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.439932853, + "Position": { + "X": 1116.3563760214092, + "Y": 536.94349857922839, + "IsEmpty": false + }, + "Timestamp": 637316497289790520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.443106741, + "Position": { + "X": 1116.3563760214092, + "Y": 537.4150806104783, + "IsEmpty": false + }, + "Timestamp": 637316497289951680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.451407641, + "Position": { + "X": 1116.3879189901593, + "Y": 538.16962162610332, + "IsEmpty": false + }, + "Timestamp": 637316497290128020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.446036458, + "Position": { + "X": 1116.4825478964092, + "Y": 538.70409428235337, + "IsEmpty": false + }, + "Timestamp": 637316497290292240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.439932853, + "Position": { + "X": 1116.5456582479717, + "Y": 540.15033451672832, + "IsEmpty": false + }, + "Timestamp": 637316497290466220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.429922938, + "Position": { + "X": 1116.3879189901593, + "Y": 541.31361576672839, + "IsEmpty": false + }, + "Timestamp": 637316497290630860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.416494995, + "Position": { + "X": 1116.2932900839091, + "Y": 542.53978764172837, + "IsEmpty": false + }, + "Timestamp": 637316497290799000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.370107561, + "Position": { + "X": 1116.1355508260967, + "Y": 543.23143803235337, + "IsEmpty": false + }, + "Timestamp": 637316497290972290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.361806661, + "Position": { + "X": 1116.1986367635968, + "Y": 542.16249271985339, + "IsEmpty": false + }, + "Timestamp": 637316497291303560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.356923789, + "Position": { + "X": 1116.3563760214092, + "Y": 539.17572514172832, + "IsEmpty": false + }, + "Timestamp": 637316497291480360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.354970634, + "Position": { + "X": 1116.1040078573467, + "Y": 534.05101811047837, + "IsEmpty": false + }, + "Timestamp": 637316497291641640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.363027394, + "Position": { + "X": 1115.7885537557843, + "Y": 523.04706303235332, + "IsEmpty": false + }, + "Timestamp": 637316497291818760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.377920181, + "Position": { + "X": 1115.5361855917217, + "Y": 515.53292729016584, + "IsEmpty": false + }, + "Timestamp": 637316497291982380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.384023815, + "Position": { + "X": 1115.3153603964092, + "Y": 508.55328861829082, + "IsEmpty": false + }, + "Timestamp": 637316497292152350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.388418406, + "Position": { + "X": 1115.5361855917217, + "Y": 502.83121830579086, + "IsEmpty": false + }, + "Timestamp": 637316497292320060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.392812997, + "Position": { + "X": 1116.0093789510968, + "Y": 495.75726811047832, + "IsEmpty": false + }, + "Timestamp": 637316497292489470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.394766152, + "Position": { + "X": 1116.3879189901593, + "Y": 489.68937260266586, + "IsEmpty": false + }, + "Timestamp": 637316497292658990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.394766152, + "Position": { + "X": 1116.8295693807843, + "Y": 486.16810795422833, + "IsEmpty": false + }, + "Timestamp": 637316497292824300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.394766152, + "Position": { + "X": 1117.1450234823467, + "Y": 484.09305912610336, + "IsEmpty": false + }, + "Timestamp": 637316497293001170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.396719307, + "Position": { + "X": 1117.3658486776592, + "Y": 482.99266850110337, + "IsEmpty": false + }, + "Timestamp": 637316497293169400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.398672462, + "Position": { + "X": 1117.4289346151593, + "Y": 483.27562748547837, + "IsEmpty": false + }, + "Timestamp": 637316497293644870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.398672462, + "Position": { + "X": 1117.5551064901592, + "Y": 484.81617924329083, + "IsEmpty": false + }, + "Timestamp": 637316497293701610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.398672462, + "Position": { + "X": 1117.3342812948467, + "Y": 488.55753666516586, + "IsEmpty": false + }, + "Timestamp": 637316497293837660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.398672462, + "Position": { + "X": 1117.0819131307842, + "Y": 491.54432865735333, + "IsEmpty": false + }, + "Timestamp": 637316497294004510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.396475166, + "Position": { + "X": 1117.0503701620341, + "Y": 495.09701420422834, + "IsEmpty": false + }, + "Timestamp": 637316497294174650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.396475166, + "Position": { + "X": 1116.9557412557842, + "Y": 499.27853275891584, + "IsEmpty": false + }, + "Timestamp": 637316497294352270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.403067052, + "Position": { + "X": 1116.6718301229716, + "Y": 505.88090092297836, + "IsEmpty": false + }, + "Timestamp": 637316497294520680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.41039139, + "Position": { + "X": 1116.9557412557842, + "Y": 511.13136479016583, + "IsEmpty": false + }, + "Timestamp": 637316497294686910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412344545, + "Position": { + "X": 1116.9872842245343, + "Y": 516.79052006360337, + "IsEmpty": false + }, + "Timestamp": 637316497294859310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412344545, + "Position": { + "X": 1117.5866494589093, + "Y": 522.0724292432908, + "IsEmpty": false + }, + "Timestamp": 637316497295028530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412344545, + "Position": { + "X": 1117.5235635214092, + "Y": 529.17782475110334, + "IsEmpty": false + }, + "Timestamp": 637316497295198300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412344545, + "Position": { + "X": 1117.5866494589093, + "Y": 533.4536548292283, + "IsEmpty": false + }, + "Timestamp": 637316497295359160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.4142977, + "Position": { + "X": 1117.6497598104718, + "Y": 537.6980395948533, + "IsEmpty": false + }, + "Timestamp": 637316497295533940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.420157164, + "Position": { + "X": 1117.2396523885968, + "Y": 542.53978764172837, + "IsEmpty": false + }, + "Timestamp": 637316497295705320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.249011979, + "Position": { + "X": 1117.3027383260967, + "Y": 544.86635014172839, + "IsEmpty": false + }, + "Timestamp": 637316497295874480, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "79e432c8-e303-4b85-a960-79c56572cf20", + "Points": [ + { + "Pressure": 0.122301057, + "Position": { + "X": 1023.1387124471905, + "Y": 492.39320561047833, + "IsEmpty": false + }, + "Timestamp": 637316497304298570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.234363317, + "Position": { + "X": 1023.2964394979717, + "Y": 492.20455814954084, + "IsEmpty": false + }, + "Timestamp": 637316497304486200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.244129092, + "Position": { + "X": 1023.1702554159405, + "Y": 493.11630131360334, + "IsEmpty": false + }, + "Timestamp": 637316497304825890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.248279542, + "Position": { + "X": 1022.8548013143779, + "Y": 494.90839115735332, + "IsEmpty": false + }, + "Timestamp": 637316497304993150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.253162444, + "Position": { + "X": 1022.7601602010967, + "Y": 497.95804936047836, + "IsEmpty": false + }, + "Timestamp": 637316497305162580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.256092161, + "Position": { + "X": 1022.6970742635967, + "Y": 500.69332768079084, + "IsEmpty": false + }, + "Timestamp": 637316497305335700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.153795674, + "Position": { + "X": 1022.6024331503155, + "Y": 501.54220463391584, + "IsEmpty": false + }, + "Timestamp": 637316497305414490, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "ca861855-158a-4694-ab30-05a4914df75e", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 995.82009672453421, + "Y": 489.65792729016584, + "IsEmpty": false + }, + "Timestamp": 637316497309669200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.107896544, + "Position": { + "X": 996.98729032804988, + "Y": 489.59503666516582, + "IsEmpty": false + }, + "Timestamp": 637316497309725270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.269520104, + "Position": { + "X": 997.77593778898733, + "Y": 489.94088627454084, + "IsEmpty": false + }, + "Timestamp": 637316497309895790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.33299762, + "Position": { + "X": 998.02829984953428, + "Y": 490.31815678235336, + "IsEmpty": false + }, + "Timestamp": 637316497310069810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.340077817, + "Position": { + "X": 997.83902372648731, + "Y": 491.57574955579082, + "IsEmpty": false + }, + "Timestamp": 637316497310230510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.340077817, + "Position": { + "X": 997.58666166594048, + "Y": 493.46215092297837, + "IsEmpty": false + }, + "Timestamp": 637316497310399540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.351064324, + "Position": { + "X": 997.36584257414358, + "Y": 499.02699467297833, + "IsEmpty": false + }, + "Timestamp": 637316497310570630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.362539113, + "Position": { + "X": 997.23965849211231, + "Y": 504.30890385266582, + "IsEmpty": false + }, + "Timestamp": 637316497310744740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.371328294, + "Position": { + "X": 997.5235696249249, + "Y": 509.77943607922833, + "IsEmpty": false + }, + "Timestamp": 637316497310906760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.378164351, + "Position": { + "X": 997.80748075773738, + "Y": 514.46398197766587, + "IsEmpty": false + }, + "Timestamp": 637316497311084450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.380117506, + "Position": { + "X": 997.96520780851858, + "Y": 517.85948979016587, + "IsEmpty": false + }, + "Timestamp": 637316497311251470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.384023815, + "Position": { + "X": 998.46994413664356, + "Y": 521.09779545422839, + "IsEmpty": false + }, + "Timestamp": 637316497311419730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.387930125, + "Position": { + "X": 998.56457914640919, + "Y": 521.41219975110334, + "IsEmpty": false + }, + "Timestamp": 637316497311582140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.392812997, + "Position": { + "X": 998.69076322844046, + "Y": 521.12924076672834, + "IsEmpty": false + }, + "Timestamp": 637316497311753100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.37376973, + "Position": { + "X": 998.72230619719051, + "Y": 518.04811283704089, + "IsEmpty": false + }, + "Timestamp": 637316497311926640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.353749901, + "Position": { + "X": 998.65921415617481, + "Y": 514.84125248547832, + "IsEmpty": false + }, + "Timestamp": 637316497312096460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.330800325, + "Position": { + "X": 998.46994413664356, + "Y": 510.34535404797833, + "IsEmpty": false + }, + "Timestamp": 637316497312258870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.311024636, + "Position": { + "X": 997.93366483976865, + "Y": 505.53505131360333, + "IsEmpty": false + }, + "Timestamp": 637316497312429430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.295399398, + "Position": { + "X": 997.27120146086236, + "Y": 501.07059818860336, + "IsEmpty": false + }, + "Timestamp": 637316497312601050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.285877764, + "Position": { + "X": 997.14502348234669, + "Y": 500.78763920422836, + "IsEmpty": false + }, + "Timestamp": 637316497312767100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.274158835, + "Position": { + "X": 996.82956327726856, + "Y": 502.13954350110333, + "IsEmpty": false + }, + "Timestamp": 637316497312932570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.275623709, + "Position": { + "X": 996.86110624601861, + "Y": 505.28353764172834, + "IsEmpty": false + }, + "Timestamp": 637316497313110000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.313466072, + "Position": { + "X": 997.87057279875296, + "Y": 511.00558354016584, + "IsEmpty": false + }, + "Timestamp": 637316497313280070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.332509339, + "Position": { + "X": 998.12294096281551, + "Y": 514.55829350110332, + "IsEmpty": false + }, + "Timestamp": 637316497313448840, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8b3daade-ab12-4d90-b636-ffca47df526f", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 1059.4163125448467, + "Y": 494.59398686047837, + "IsEmpty": false + }, + "Timestamp": 637316497330267780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.107164107, + "Position": { + "X": 1059.006217330003, + "Y": 494.46823002454084, + "IsEmpty": false + }, + "Timestamp": 637316497330347560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.123521782, + "Position": { + "X": 1057.1765664510967, + "Y": 493.99662357922836, + "IsEmpty": false + }, + "Timestamp": 637316497330516840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.191393912, + "Position": { + "X": 1055.4730996542216, + "Y": 493.46215092297837, + "IsEmpty": false + }, + "Timestamp": 637316497330680380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.250720978, + "Position": { + "X": 1052.7286172323468, + "Y": 493.05343510266584, + "IsEmpty": false + }, + "Timestamp": 637316497330854010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.261951625, + "Position": { + "X": 1050.9620522909404, + "Y": 493.11630131360334, + "IsEmpty": false + }, + "Timestamp": 637316497331021690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.261951625, + "Position": { + "X": 1048.6907632284406, + "Y": 493.11630131360334, + "IsEmpty": false + }, + "Timestamp": 637316497331186080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.261951625, + "Position": { + "X": 1046.8926553182841, + "Y": 493.08488041516586, + "IsEmpty": false + }, + "Timestamp": 637316497331352050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.270496666, + "Position": { + "X": 1046.3879189901593, + "Y": 493.21063725110332, + "IsEmpty": false + }, + "Timestamp": 637316497331523970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.289539933, + "Position": { + "X": 1047.2396523885968, + "Y": 493.49359623547832, + "IsEmpty": false + }, + "Timestamp": 637316497331689910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.301747143, + "Position": { + "X": 1049.2585854940655, + "Y": 494.09095951672833, + "IsEmpty": false + }, + "Timestamp": 637316497331858880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.3085832, + "Position": { + "X": 1052.0661538534405, + "Y": 494.40533939954082, + "IsEmpty": false + }, + "Timestamp": 637316497332035680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.317372382, + "Position": { + "X": 1059.1008584432843, + "Y": 494.81405521985334, + "IsEmpty": false + }, + "Timestamp": 637316497332204950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.322255284, + "Position": { + "X": 1065.157633345628, + "Y": 495.12845951672836, + "IsEmpty": false + }, + "Timestamp": 637316497332369320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.320302129, + "Position": { + "X": 1070.8674111776593, + "Y": 495.06559330579086, + "IsEmpty": false + }, + "Timestamp": 637316497332536430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.310292214, + "Position": { + "X": 1074.3374429159405, + "Y": 495.06559330579086, + "IsEmpty": false + }, + "Timestamp": 637316497332714140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.306141764, + "Position": { + "X": 1075.0630044393779, + "Y": 495.06559330579086, + "IsEmpty": false + }, + "Timestamp": 637316497332881450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.281483173, + "Position": { + "X": 1073.3595254354718, + "Y": 494.68829838391582, + "IsEmpty": false + }, + "Timestamp": 637316497333052450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.233630881, + "Position": { + "X": 1068.9746743612529, + "Y": 494.24813725110334, + "IsEmpty": false + }, + "Timestamp": 637316497333222040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.188952461, + "Position": { + "X": 1059.3216714315654, + "Y": 494.18527104016584, + "IsEmpty": false + }, + "Timestamp": 637316497333382060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.183092996, + "Position": { + "X": 1049.9525918417216, + "Y": 494.68829838391582, + "IsEmpty": false + }, + "Timestamp": 637316497333557130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.183092996, + "Position": { + "X": 1046.0724648885966, + "Y": 494.87694584485337, + "IsEmpty": false + }, + "Timestamp": 637316497333723560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.207507432, + "Position": { + "X": 1044.2428140096904, + "Y": 495.06559330579086, + "IsEmpty": false + }, + "Timestamp": 637316497333893560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.235095754, + "Position": { + "X": 1044.4951821737529, + "Y": 495.06559330579086, + "IsEmpty": false + }, + "Timestamp": 637316497334066590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.265125513, + "Position": { + "X": 1048.6907632284406, + "Y": 495.19135014172832, + "IsEmpty": false + }, + "Timestamp": 637316497334233910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.272693992, + "Position": { + "X": 1053.0756143026592, + "Y": 494.87694584485337, + "IsEmpty": false + }, + "Timestamp": 637316497334397670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.272693992, + "Position": { + "X": 1057.4920205526591, + "Y": 494.37391850110333, + "IsEmpty": false + }, + "Timestamp": 637316497334553510, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "fbfab053-4603-4684-9bc9-8c9a22ca9df4", + "Points": [ + { + "Pressure": 0.186266884, + "Position": { + "X": 1107.4920205526591, + "Y": 490.31815678235336, + "IsEmpty": false + }, + "Timestamp": 637316497339566910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.204333559, + "Position": { + "X": 1107.7128457479716, + "Y": 490.16095463391582, + "IsEmpty": false + }, + "Timestamp": 637316497339633220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.216296628, + "Position": { + "X": 1109.5740273885967, + "Y": 489.37496830579084, + "IsEmpty": false + }, + "Timestamp": 637316497339801170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.259510189, + "Position": { + "X": 1112.7601602010968, + "Y": 488.58898197766587, + "IsEmpty": false + }, + "Timestamp": 637316497339971870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.283680469, + "Position": { + "X": 1117.3342812948467, + "Y": 487.83441654797832, + "IsEmpty": false + }, + "Timestamp": 637316497340144920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.291248947, + "Position": { + "X": 1126.3879189901593, + "Y": 486.45106693860333, + "IsEmpty": false + }, + "Timestamp": 637316497340316350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.295399398, + "Position": { + "X": 1132.2869668417218, + "Y": 485.72794682141586, + "IsEmpty": false + }, + "Timestamp": 637316497340485710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.297352552, + "Position": { + "X": 1136.9241982870342, + "Y": 485.19347416516587, + "IsEmpty": false + }, + "Timestamp": 637316497340645650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.301747143, + "Position": { + "X": 1138.9115762167216, + "Y": 484.75331303235333, + "IsEmpty": false + }, + "Timestamp": 637316497340824290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.301747143, + "Position": { + "X": 1137.8705605917216, + "Y": 484.31315189954086, + "IsEmpty": false + }, + "Timestamp": 637316497340992970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.293690383, + "Position": { + "X": 1134.5898232870343, + "Y": 483.96730229016583, + "IsEmpty": false + }, + "Timestamp": 637316497341152930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.285633624, + "Position": { + "X": 1129.4793984823468, + "Y": 484.03019291516586, + "IsEmpty": false + }, + "Timestamp": 637316497341322240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.280750751, + "Position": { + "X": 1123.8011758260968, + "Y": 484.47035404797833, + "IsEmpty": false + }, + "Timestamp": 637316497341499690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.276600301, + "Position": { + "X": 1118.8484902792218, + "Y": 485.25634037610337, + "IsEmpty": false + }, + "Timestamp": 637316497341668630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.279530019, + "Position": { + "X": 1118.5961221151592, + "Y": 485.35067631360334, + "IsEmpty": false + }, + "Timestamp": 637316497341835530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.293446243, + "Position": { + "X": 1120.7096963339093, + "Y": 485.35067631360334, + "IsEmpty": false + }, + "Timestamp": 637316497342001230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.307362467, + "Position": { + "X": 1125.1260781698468, + "Y": 484.91051518079087, + "IsEmpty": false + }, + "Timestamp": 637316497342169550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.32079041, + "Position": { + "X": 1133.9273477010968, + "Y": 483.71578861829084, + "IsEmpty": false + }, + "Timestamp": 637316497342338920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.331044465, + "Position": { + "X": 1140.0472207479718, + "Y": 482.89835697766586, + "IsEmpty": false + }, + "Timestamp": 637316497342507070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.34520486, + "Position": { + "X": 1145.1260781698468, + "Y": 482.20668217297833, + "IsEmpty": false + }, + "Timestamp": 637316497342673820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.351796746, + "Position": { + "X": 1148.4068398885968, + "Y": 481.54645268079082, + "IsEmpty": false + }, + "Timestamp": 637316497342888070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.360585958, + "Position": { + "X": 1148.8484902792218, + "Y": 481.16915775891584, + "IsEmpty": false + }, + "Timestamp": 637316497343016820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.364736408, + "Position": { + "X": 1145.5361855917217, + "Y": 481.35780521985333, + "IsEmpty": false + }, + "Timestamp": 637316497343182590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.354726493, + "Position": { + "X": 1139.9210488729718, + "Y": 481.45211674329084, + "IsEmpty": false + }, + "Timestamp": 637316497343354270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.335927367, + "Position": { + "X": 1133.1387002401593, + "Y": 482.33243900891586, + "IsEmpty": false + }, + "Timestamp": 637316497343523500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.309803933, + "Position": { + "X": 1123.6118935995341, + "Y": 483.74723393079086, + "IsEmpty": false + }, + "Timestamp": 637316497343692500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.296620131, + "Position": { + "X": 1120.0472207479718, + "Y": 484.62755619641587, + "IsEmpty": false + }, + "Timestamp": 637316497343860680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.283436328, + "Position": { + "X": 1119.2901162557841, + "Y": 484.87906986829086, + "IsEmpty": false + }, + "Timestamp": 637316497344033950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.269520104, + "Position": { + "X": 1121.2459512167218, + "Y": 485.00482670422832, + "IsEmpty": false + }, + "Timestamp": 637316497344201980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.276356131, + "Position": { + "X": 1128.2806680135968, + "Y": 484.31315189954086, + "IsEmpty": false + }, + "Timestamp": 637316497344371340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.283192188, + "Position": { + "X": 1134.6529092245341, + "Y": 483.59003178235332, + "IsEmpty": false + }, + "Timestamp": 637316497344533770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.286121905, + "Position": { + "X": 1142.2554238729717, + "Y": 483.02411381360332, + "IsEmpty": false + }, + "Timestamp": 637316497344700700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.286121905, + "Position": { + "X": 1144.2743447714092, + "Y": 482.83546635266583, + "IsEmpty": false + }, + "Timestamp": 637316497344770060, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "2fac3e99-f043-4722-8770-e097bf844b2c", + "Points": [ + { + "Pressure": 0.0561379418, + "Position": { + "X": 1087.9184509274191, + "Y": 568.86721817194484, + "IsEmpty": false + }, + "Timestamp": 637316497522323320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0610208288, + "Position": { + "X": 1087.592270763043, + "Y": 568.61718492667751, + "IsEmpty": false + }, + "Timestamp": 637316497522548050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.178454265, + "Position": { + "X": 1087.1780540809546, + "Y": 568.3194300469255, + "IsEmpty": false + }, + "Timestamp": 637316497522666310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.370351732, + "Position": { + "X": 1087.0894546878114, + "Y": 568.27150664464239, + "IsEmpty": false + }, + "Timestamp": 637316497522811400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.411367983, + "Position": { + "X": 1087.5034965927537, + "Y": 568.5692125228486, + "IsEmpty": false + }, + "Timestamp": 637316497523490180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.435538262, + "Position": { + "X": 1088.3343172349646, + "Y": 569.16552107935524, + "IsEmpty": false + }, + "Timestamp": 637316497523655870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.449210346, + "Position": { + "X": 1089.5873834264557, + "Y": 570.06218822571896, + "IsEmpty": false + }, + "Timestamp": 637316497523832860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.461173415, + "Position": { + "X": 1092.9689061710521, + "Y": 572.46575351306296, + "IsEmpty": false + }, + "Timestamp": 637316497523998000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.46703288, + "Position": { + "X": 1096.3162152012519, + "Y": 574.83754833855278, + "IsEmpty": false + }, + "Timestamp": 637316497524161900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.474845499, + "Position": { + "X": 1100.3469800542994, + "Y": 577.62848830650728, + "IsEmpty": false + }, + "Timestamp": 637316497524329850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.493888766, + "Position": { + "X": 1105.2595721327611, + "Y": 581.00441190021286, + "IsEmpty": false + }, + "Timestamp": 637316497524499270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530022144, + "Position": { + "X": 1113.9005716048255, + "Y": 586.83958897834054, + "IsEmpty": false + }, + "Timestamp": 637316497524668590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.556389689, + "Position": { + "X": 1120.5427308954311, + "Y": 591.21122081574231, + "IsEmpty": false + }, + "Timestamp": 637316497524840800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592767239, + "Position": { + "X": 1128.8396578427253, + "Y": 596.54907505098708, + "IsEmpty": false + }, + "Timestamp": 637316497525003150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633539319, + "Position": { + "X": 1136.8785277509485, + "Y": 601.59204586716328, + "IsEmpty": false + }, + "Timestamp": 637316497525181710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66649884, + "Position": { + "X": 1148.2926356250753, + "Y": 608.53713038058663, + "IsEmpty": false + }, + "Timestamp": 637316497525344770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668940246, + "Position": { + "X": 1154.6929761215724, + "Y": 612.32218378671553, + "IsEmpty": false + }, + "Timestamp": 637316497525511940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670893431, + "Position": { + "X": 1159.5734303393276, + "Y": 615.15610001278378, + "IsEmpty": false + }, + "Timestamp": 637316497525688390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 1163.4166256406215, + "Y": 617.3560556434328, + "IsEmpty": false + }, + "Timestamp": 637316497525852290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 1165.0763319586017, + "Y": 618.29752969206834, + "IsEmpty": false + }, + "Timestamp": 637316497526018740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653070867, + "Position": { + "X": 1167.1864888404714, + "Y": 619.50095649058244, + "IsEmpty": false + }, + "Timestamp": 637316497526194640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 1167.7446142177168, + "Y": 619.81416704292906, + "IsEmpty": false + }, + "Timestamp": 637316497526224050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 1167.4157043882662, + "Y": 619.60180716274272, + "IsEmpty": false + }, + "Timestamp": 637316497526250260, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFD1D3D4", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7b5e00d9-a5d5-42bd-9cc3-fe9fe6727c50", + "Points": [ + { + "Pressure": 0.281483173, + "Position": { + "X": 1074.1844803405472, + "Y": 569.83417825056722, + "IsEmpty": false + }, + "Timestamp": 637316497531338300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.353994042, + "Position": { + "X": 1075.4079193180712, + "Y": 570.9230221945852, + "IsEmpty": false + }, + "Timestamp": 637316497531594960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.432120234, + "Position": { + "X": 1076.8295568333258, + "Y": 572.13022746872014, + "IsEmpty": false + }, + "Timestamp": 637316497531761430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.488517582, + "Position": { + "X": 1078.3614226044845, + "Y": 573.45067942865535, + "IsEmpty": false + }, + "Timestamp": 637316497531934720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55272752, + "Position": { + "X": 1081.5692146923857, + "Y": 576.21832031722829, + "IsEmpty": false + }, + "Timestamp": 637316497532104330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583733857, + "Position": { + "X": 1085.1391552448811, + "Y": 579.23652318621248, + "IsEmpty": false + }, + "Timestamp": 637316497532267160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 1089.9105235511995, + "Y": 583.18923361393797, + "IsEmpty": false + }, + "Timestamp": 637316497532443980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.639887094, + "Position": { + "X": 1095.8732089514058, + "Y": 588.09417523295565, + "IsEmpty": false + }, + "Timestamp": 637316497532607560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678461909, + "Position": { + "X": 1106.7831580862294, + "Y": 596.76920571933647, + "IsEmpty": false + }, + "Timestamp": 637316497532781850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.695551991, + "Position": { + "X": 1114.9950478333394, + "Y": 603.08614764302479, + "IsEmpty": false + }, + "Timestamp": 637316497532947440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 1123.1500966969427, + "Y": 609.20644819664778, + "IsEmpty": false + }, + "Timestamp": 637316497533114670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724116862, + "Position": { + "X": 1131.4498804894502, + "Y": 615.23325883031498, + "IsEmpty": false + }, + "Timestamp": 637316497533285420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 1142.7213380991759, + "Y": 623.16035648061529, + "IsEmpty": false + }, + "Timestamp": 637316497533536320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 1148.0720228011528, + "Y": 626.82382837030752, + "IsEmpty": false + }, + "Timestamp": 637316497533621010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 1150.5716719244733, + "Y": 628.47806360502705, + "IsEmpty": false + }, + "Timestamp": 637316497533794250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709468246, + "Position": { + "X": 1153.3771179629555, + "Y": 630.36404275342522, + "IsEmpty": false + }, + "Timestamp": 637316497533960500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.569329381, + "Position": { + "X": 1154.592882246166, + "Y": 631.18772450265556, + "IsEmpty": false + }, + "Timestamp": 637316497534027270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.569329381, + "Position": { + "X": 1153.7694750383819, + "Y": 630.60092565631044, + "IsEmpty": false + }, + "Timestamp": 637316497534046640, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFD1D3D4", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "85e818a7-7623-4968-8f14-c468d4ca2233", + "Points": [ + { + "Pressure": 0.153063253, + "Position": { + "X": 1062.7795904337995, + "Y": 569.29419339656818, + "IsEmpty": false + }, + "Timestamp": 637316497537583630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.18870832, + "Position": { + "X": 1062.4451033273147, + "Y": 568.94486923946238, + "IsEmpty": false + }, + "Timestamp": 637316497537848070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.332509339, + "Position": { + "X": 1062.1115348294204, + "Y": 568.59605485658494, + "IsEmpty": false + }, + "Timestamp": 637316497538018380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.442374289, + "Position": { + "X": 1063.0090427880161, + "Y": 569.55902732013942, + "IsEmpty": false + }, + "Timestamp": 637316497538197050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.505363524, + "Position": { + "X": 1065.0392007337441, + "Y": 571.66778968412109, + "IsEmpty": false + }, + "Timestamp": 637316497538356910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.559075296, + "Position": { + "X": 1068.1466410573626, + "Y": 574.86351201230536, + "IsEmpty": false + }, + "Timestamp": 637316497538527350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611566365, + "Position": { + "X": 1074.2206502630047, + "Y": 580.99924146899957, + "IsEmpty": false + }, + "Timestamp": 637316497538698500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 1082.6002379163699, + "Y": 589.20146077363597, + "IsEmpty": false + }, + "Timestamp": 637316497538860310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664301515, + "Position": { + "X": 1090.3817887970672, + "Y": 596.62820458134809, + "IsEmpty": false + }, + "Timestamp": 637316497539033830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690424979, + "Position": { + "X": 1098.7910761212768, + "Y": 604.34796052547426, + "IsEmpty": false + }, + "Timestamp": 637316497539200210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710444808, + "Position": { + "X": 1107.3188643846831, + "Y": 611.96758005985396, + "IsEmpty": false + }, + "Timestamp": 637316497539366950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 1119.1462430130337, + "Y": 622.08037778280618, + "IsEmpty": false + }, + "Timestamp": 637316497539543880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.72753489, + "Position": { + "X": 1126.6019327975157, + "Y": 628.23669117107931, + "IsEmpty": false + }, + "Timestamp": 637316497539704730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.72753489, + "Position": { + "X": 1132.4628306646064, + "Y": 632.92886533779438, + "IsEmpty": false + }, + "Timestamp": 637316497539879960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720698833, + "Position": { + "X": 1136.4478419195102, + "Y": 636.05609603038897, + "IsEmpty": false + }, + "Timestamp": 637316497540052600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678461909, + "Position": { + "X": 1138.9701434209367, + "Y": 638.00941678412664, + "IsEmpty": false + }, + "Timestamp": 637316497540216960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.507072568, + "Position": { + "X": 1139.4775314582723, + "Y": 638.39992695486831, + "IsEmpty": false + }, + "Timestamp": 637316497540325600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.507072568, + "Position": { + "X": 1138.8181097713564, + "Y": 637.9154016290164, + "IsEmpty": false + }, + "Timestamp": 637316497540350870, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFD1D3D4", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7a6e6e4d-ffc9-4286-a73d-41080da95825", + "Points": [ + { + "Pressure": 0.371572435, + "Position": { + "X": 1055.270644160466, + "Y": 572.76626711261179, + "IsEmpty": false + }, + "Timestamp": 637316497543365130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.454581529, + "Position": { + "X": 1055.5884763828669, + "Y": 573.16532271146161, + "IsEmpty": false + }, + "Timestamp": 637316497543925820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554436564, + "Position": { + "X": 1057.3825919227413, + "Y": 575.35896942292345, + "IsEmpty": false + }, + "Timestamp": 637316497544103040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.626947403, + "Position": { + "X": 1060.9171217880371, + "Y": 579.69291941355937, + "IsEmpty": false + }, + "Timestamp": 637316497544265760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658930361, + "Position": { + "X": 1066.1270142976628, + "Y": 585.90961852629641, + "IsEmpty": false + }, + "Timestamp": 637316497544434030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687495232, + "Position": { + "X": 1072.9741971107608, + "Y": 593.86385537120339, + "IsEmpty": false + }, + "Timestamp": 637316497544605860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729488075, + "Position": { + "X": 1083.6373950786576, + "Y": 605.79646040719285, + "IsEmpty": false + }, + "Timestamp": 637316497544781990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758052945, + "Position": { + "X": 1095.9606395181795, + "Y": 618.89701155084572, + "IsEmpty": false + }, + "Timestamp": 637316497544948650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764400721, + "Position": { + "X": 1106.1392679514545, + "Y": 629.17422954823917, + "IsEmpty": false + }, + "Timestamp": 637316497545110430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.768551171, + "Position": { + "X": 1115.5444584733659, + "Y": 638.26266600794099, + "IsEmpty": false + }, + "Timestamp": 637316497545286330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.765377283, + "Position": { + "X": 1121.5468166878909, + "Y": 643.85028918556679, + "IsEmpty": false + }, + "Timestamp": 637316497545451650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 1127.7795146744254, + "Y": 649.50640150485719, + "IsEmpty": false + }, + "Timestamp": 637316497545625350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.557122171, + "Position": { + "X": 1130.6366086115063, + "Y": 652.02678572237551, + "IsEmpty": false + }, + "Timestamp": 637316497545780960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.557122171, + "Position": { + "X": 1130.1581761878961, + "Y": 651.60708881813821, + "IsEmpty": false + }, + "Timestamp": 637316497545806990, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFD1D3D4", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "6af47225-8c56-491d-b69a-6606c3249148", + "Points": [ + { + "Pressure": 0.154528111, + "Position": { + "X": 1044.1101127337529, + "Y": 571.48626436544077, + "IsEmpty": false + }, + "Timestamp": 637316497549136520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.171129927, + "Position": { + "X": 1043.4805665141423, + "Y": 570.52739654673587, + "IsEmpty": false + }, + "Timestamp": 637316497549337070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.198718235, + "Position": { + "X": 1043.0756950163802, + "Y": 569.93930980988591, + "IsEmpty": false + }, + "Timestamp": 637316497549403220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.299061567, + "Position": { + "X": 1042.7624292371843, + "Y": 569.45982247662096, + "IsEmpty": false + }, + "Timestamp": 637316497549505610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.407217503, + "Position": { + "X": 1042.6721395052509, + "Y": 569.35170396137414, + "IsEmpty": false + }, + "Timestamp": 637316497549675180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.505119383, + "Position": { + "X": 1043.6125914430554, + "Y": 570.78929865646774, + "IsEmpty": false + }, + "Timestamp": 637316497549845060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596429408, + "Position": { + "X": 1045.6926400580635, + "Y": 573.88164026033428, + "IsEmpty": false + }, + "Timestamp": 637316497550022940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663813233, + "Position": { + "X": 1049.5079872720141, + "Y": 579.4786961040071, + "IsEmpty": false + }, + "Timestamp": 637316497550180500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718501568, + "Position": { + "X": 1058.9706359256463, + "Y": 592.92208134573411, + "IsEmpty": false + }, + "Timestamp": 637316497550356660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 1067.252990935488, + "Y": 604.16018004530326, + "IsEmpty": false + }, + "Timestamp": 637316497550518620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760982692, + "Position": { + "X": 1076.3498131992635, + "Y": 615.99552430799827, + "IsEmpty": false + }, + "Timestamp": 637316497550690130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771480858, + "Position": { + "X": 1088.3495807120535, + "Y": 630.77602058901357, + "IsEmpty": false + }, + "Timestamp": 637316497550859860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773678184, + "Position": { + "X": 1094.8237620333216, + "Y": 638.39077848258398, + "IsEmpty": false + }, + "Timestamp": 637316497551031390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770992577, + "Position": { + "X": 1099.4470688839315, + "Y": 643.67702491213311, + "IsEmpty": false + }, + "Timestamp": 637316497551195070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761715114, + "Position": { + "X": 1101.0518351795977, + "Y": 645.47136945818511, + "IsEmpty": false + }, + "Timestamp": 637316497551369590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636713207, + "Position": { + "X": 1102.1209050633477, + "Y": 646.68717920821518, + "IsEmpty": false + }, + "Timestamp": 637316497551491920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636713207, + "Position": { + "X": 1101.5948293652539, + "Y": 646.04580410696269, + "IsEmpty": false + }, + "Timestamp": 637316497551513910, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFD1D3D4", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "07e20d26-b99c-4c19-b54f-3ff11d2b9cc8", + "Points": [ + { + "Pressure": 0.112291142, + "Position": { + "X": 1032.9837808614379, + "Y": 578.01852039861183, + "IsEmpty": false + }, + "Timestamp": 637316497554403620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.400137335, + "Position": { + "X": 1032.6033938601504, + "Y": 577.16235756925596, + "IsEmpty": false + }, + "Timestamp": 637316497554624260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481193244, + "Position": { + "X": 1033.0875947910954, + "Y": 578.19063585934646, + "IsEmpty": false + }, + "Timestamp": 637316497555088180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.550041974, + "Position": { + "X": 1034.0573531883028, + "Y": 580.24086995507469, + "IsEmpty": false + }, + "Timestamp": 637316497555248040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600091577, + "Position": { + "X": 1035.7923530594323, + "Y": 583.97495126072522, + "IsEmpty": false + }, + "Timestamp": 637316497555421760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645258248, + "Position": { + "X": 1038.8924044925852, + "Y": 590.52249551824093, + "IsEmpty": false + }, + "Timestamp": 637316497555589610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705317795, + "Position": { + "X": 1046.3469385892383, + "Y": 605.61514300990279, + "IsEmpty": false + }, + "Timestamp": 637316497555833260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736568272, + "Position": { + "X": 1052.7843764528332, + "Y": 618.16919386439145, + "IsEmpty": false + }, + "Timestamp": 637316497555932040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1059.0655804795563, + "Y": 630.037482767244, + "IsEmpty": false + }, + "Timestamp": 637316497556096110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75976193, + "Position": { + "X": 1063.988052100508, + "Y": 639.03746804413231, + "IsEmpty": false + }, + "Timestamp": 637316497556265810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723140299, + "Position": { + "X": 1067.6353301038582, + "Y": 645.50547993489431, + "IsEmpty": false + }, + "Timestamp": 637316497556442930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65819788, + "Position": { + "X": 1068.6685853815945, + "Y": 647.25900473491879, + "IsEmpty": false + }, + "Timestamp": 637316497556540470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65819788, + "Position": { + "X": 1068.1516741995119, + "Y": 646.38325774723705, + "IsEmpty": false + }, + "Timestamp": 637316497556567090, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFD1D3D4", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e91e2109-6508-4114-8e20-9868eedbccf1", + "Points": [ + { + "Pressure": 0.174792096, + "Position": { + "X": 1093.7977456308156, + "Y": 572.05583447489494, + "IsEmpty": false + }, + "Timestamp": 637316497605601880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.193835348, + "Position": { + "X": 1093.0503421254512, + "Y": 571.51583302202278, + "IsEmpty": false + }, + "Timestamp": 637316497605825320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.411612123, + "Position": { + "X": 1092.6239951324303, + "Y": 571.21744547143044, + "IsEmpty": false + }, + "Timestamp": 637316497605953420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.461905837, + "Position": { + "X": 1093.0503421254512, + "Y": 571.51583302202278, + "IsEmpty": false + }, + "Timestamp": 637316497606456580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.484855413, + "Position": { + "X": 1093.9057487667537, + "Y": 572.11340591767555, + "IsEmpty": false + }, + "Timestamp": 637316497606625630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514152765, + "Position": { + "X": 1095.6273992244794, + "Y": 573.3116731232908, + "IsEmpty": false + }, + "Timestamp": 637316497606792450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537102282, + "Position": { + "X": 1097.2538485602458, + "Y": 574.45600634695643, + "IsEmpty": false + }, + "Timestamp": 637316497606964380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558098733, + "Position": { + "X": 1098.6749766803803, + "Y": 575.41823959614635, + "IsEmpty": false + }, + "Timestamp": 637316497607133000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.574456394, + "Position": { + "X": 1100.4362190632696, + "Y": 576.62720285980663, + "IsEmpty": false + }, + "Timestamp": 637316497607297690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.586175323, + "Position": { + "X": 1102.5459027528232, + "Y": 578.0849460203392, + "IsEmpty": false + }, + "Timestamp": 637316497607468730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588128507, + "Position": { + "X": 1103.552879018609, + "Y": 578.75143226038688, + "IsEmpty": false + }, + "Timestamp": 637316497607634940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592034817, + "Position": { + "X": 1105.2402600193936, + "Y": 579.91115664832739, + "IsEmpty": false + }, + "Timestamp": 637316497607802490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593987942, + "Position": { + "X": 1106.7132887911998, + "Y": 580.88580292980419, + "IsEmpty": false + }, + "Timestamp": 637316497607971930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1109.4569078815318, + "Y": 582.72268732123462, + "IsEmpty": false + }, + "Timestamp": 637316497608144800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 1112.23244495573, + "Y": 584.56585639270611, + "IsEmpty": false + }, + "Timestamp": 637316497608312330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599847436, + "Position": { + "X": 1116.4553698868115, + "Y": 587.34121651490545, + "IsEmpty": false + }, + "Timestamp": 637316497608481520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606683433, + "Position": { + "X": 1122.6808140534729, + "Y": 591.36921472678932, + "IsEmpty": false + }, + "Timestamp": 637316497608654660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615472674, + "Position": { + "X": 1134.8167689716042, + "Y": 599.04012529319743, + "IsEmpty": false + }, + "Timestamp": 637316497608825790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620355546, + "Position": { + "X": 1143.0208275058342, + "Y": 604.04276520740518, + "IsEmpty": false + }, + "Timestamp": 637316497608986480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.626214981, + "Position": { + "X": 1150.9107092187928, + "Y": 608.73377939137356, + "IsEmpty": false + }, + "Timestamp": 637316497609159070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631097913, + "Position": { + "X": 1158.9911053345461, + "Y": 613.41720344779753, + "IsEmpty": false + }, + "Timestamp": 637316497609333410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 1171.0469323380485, + "Y": 620.19533168984469, + "IsEmpty": false + }, + "Timestamp": 637316497609500820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643793404, + "Position": { + "X": 1178.4383260138659, + "Y": 624.20921611675863, + "IsEmpty": false + }, + "Timestamp": 637316497609665910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 1184.9418818993527, + "Y": 627.64381869055296, + "IsEmpty": false + }, + "Timestamp": 637316497609832070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649896979, + "Position": { + "X": 1190.6716052737072, + "Y": 630.63446938159564, + "IsEmpty": false + }, + "Timestamp": 637316497610001530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652094305, + "Position": { + "X": 1194.8292453698166, + "Y": 632.75676590880289, + "IsEmpty": false + }, + "Timestamp": 637316497610178220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652094305, + "Position": { + "X": 1198.424513743279, + "Y": 634.56703382895989, + "IsEmpty": false + }, + "Timestamp": 637316497610341320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631830335, + "Position": { + "X": 1200.8374981644367, + "Y": 635.76906166152867, + "IsEmpty": false + }, + "Timestamp": 637316497610510430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577874422, + "Position": { + "X": 1202.6556875210745, + "Y": 636.66794001021276, + "IsEmpty": false + }, + "Timestamp": 637316497610641240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577874422, + "Position": { + "X": 1201.7331137559149, + "Y": 636.18416661693823, + "IsEmpty": false + }, + "Timestamp": 637316497610668260, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "9b3da0ef-c3b2-4ccc-8faa-c4ef7264d3e7", + "Points": [ + { + "Pressure": 0.102525368, + "Position": { + "X": 1088.4939452817116, + "Y": 574.92212966731586, + "IsEmpty": false + }, + "Timestamp": 637316497613482750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.232166022, + "Position": { + "X": 1087.2545205919459, + "Y": 573.97437184755449, + "IsEmpty": false + }, + "Timestamp": 637316497613716600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.349599451, + "Position": { + "X": 1086.4377783636596, + "Y": 573.34944036115019, + "IsEmpty": false + }, + "Timestamp": 637316497613884610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412588686, + "Position": { + "X": 1086.0283128249876, + "Y": 573.03472953933885, + "IsEmpty": false + }, + "Timestamp": 637316497614054010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527336538, + "Position": { + "X": 1085.6197703709906, + "Y": 572.72032907620837, + "IsEmpty": false + }, + "Timestamp": 637316497614220890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673823118, + "Position": { + "X": 1087.2594774252177, + "Y": 573.97978253752706, + "IsEmpty": false + }, + "Timestamp": 637316497614949210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697260976, + "Position": { + "X": 1090.169515904777, + "Y": 576.20082473362652, + "IsEmpty": false + }, + "Timestamp": 637316497615069640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717769146, + "Position": { + "X": 1095.2544438866942, + "Y": 580.03091027170353, + "IsEmpty": false + }, + "Timestamp": 637316497615236220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 1102.2394613906522, + "Y": 585.1934245191876, + "IsEmpty": false + }, + "Timestamp": 637316497615408550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 1114.5606618161023, + "Y": 594.02723913003013, + "IsEmpty": false + }, + "Timestamp": 637316497615584510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.74364841, + "Position": { + "X": 1123.1370505397167, + "Y": 599.97219190089447, + "IsEmpty": false + }, + "Timestamp": 637316497615745880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748775482, + "Position": { + "X": 1132.0039869108678, + "Y": 605.9467887081064, + "IsEmpty": false + }, + "Timestamp": 637316497615914950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754146636, + "Position": { + "X": 1141.166182245739, + "Y": 611.94143602202621, + "IsEmpty": false + }, + "Timestamp": 637316497616089930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76000613, + "Position": { + "X": 1154.9111713432344, + "Y": 620.59759824572143, + "IsEmpty": false + }, + "Timestamp": 637316497616259990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761959255, + "Position": { + "X": 1163.6565822600001, + "Y": 625.89609310454455, + "IsEmpty": false + }, + "Timestamp": 637316497616425900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.765865564, + "Position": { + "X": 1168.1130823813423, + "Y": 628.53504850732656, + "IsEmpty": false + }, + "Timestamp": 637316497616590610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.765133142, + "Position": { + "X": 1179.5126516678297, + "Y": 635.10295811615583, + "IsEmpty": false + }, + "Timestamp": 637316497616758150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753658354, + "Position": { + "X": 1182.4129288852755, + "Y": 636.73113458537728, + "IsEmpty": false + }, + "Timestamp": 637316497616935540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71117723, + "Position": { + "X": 1185.3347449649234, + "Y": 638.35427827635147, + "IsEmpty": false + }, + "Timestamp": 637316497617104850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.580071688, + "Position": { + "X": 1187.6876791434049, + "Y": 639.64894821977941, + "IsEmpty": false + }, + "Timestamp": 637316497617273190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412588686, + "Position": { + "X": 1187.0981567590313, + "Y": 639.32561169465487, + "IsEmpty": false + }, + "Timestamp": 637316497617371050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412588686, + "Position": { + "X": 1187.0670128684008, + "Y": 639.30304089393815, + "IsEmpty": false + }, + "Timestamp": 637316497617397130, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "62f3cd5f-43c7-4f08-b050-40371fb93ff8", + "Points": [ + { + "Pressure": 0.0419775695, + "Position": { + "X": 1076.7614211392176, + "Y": 577.88893148663033, + "IsEmpty": false + }, + "Timestamp": 637316497619735460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.291981369, + "Position": { + "X": 1076.0115311026821, + "Y": 577.19161513695167, + "IsEmpty": false + }, + "Timestamp": 637316497619895580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.391836435, + "Position": { + "X": 1075.6379775298526, + "Y": 576.84354019422312, + "IsEmpty": false + }, + "Timestamp": 637316497620116110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473380625, + "Position": { + "X": 1074.8936526305849, + "Y": 576.14857158044651, + "IsEmpty": false + }, + "Timestamp": 637316497620211110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.551262677, + "Position": { + "X": 1074.522881046352, + "Y": 575.80168383238174, + "IsEmpty": false + }, + "Timestamp": 637316497620308810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599847436, + "Position": { + "X": 1074.3477603526451, + "Y": 575.60670369916647, + "IsEmpty": false + }, + "Timestamp": 637316497620815360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61351949, + "Position": { + "X": 1073.6099426351122, + "Y": 574.91460835889018, + "IsEmpty": false + }, + "Timestamp": 637316497620985330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1072.8758310108128, + "Y": 574.22415002519938, + "IsEmpty": false + }, + "Timestamp": 637316497621151180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628168166, + "Position": { + "X": 1072.3177155360429, + "Y": 573.72889574149826, + "IsEmpty": false + }, + "Timestamp": 637316497621457890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646478951, + "Position": { + "X": 1073.4161282084906, + "Y": 574.76344236138152, + "IsEmpty": false + }, + "Timestamp": 637316497621840610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67064929, + "Position": { + "X": 1076.0115311026821, + "Y": 577.19161513695167, + "IsEmpty": false + }, + "Timestamp": 637316497622000580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696040273, + "Position": { + "X": 1081.7262173567669, + "Y": 582.45785787107684, + "IsEmpty": false + }, + "Timestamp": 637316497622169700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711909652, + "Position": { + "X": 1090.4861945650421, + "Y": 590.3194402995889, + "IsEmpty": false + }, + "Timestamp": 637316497622339220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724116862, + "Position": { + "X": 1098.6192143569856, + "Y": 597.42545950229669, + "IsEmpty": false + }, + "Timestamp": 637316497622503260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737056553, + "Position": { + "X": 1106.664455652538, + "Y": 604.24756007517522, + "IsEmpty": false + }, + "Timestamp": 637316497622674280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 1118.2847324861079, + "Y": 613.73281556406619, + "IsEmpty": false + }, + "Timestamp": 637316497622848430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752437651, + "Position": { + "X": 1126.1285559419689, + "Y": 619.91406412609388, + "IsEmpty": false + }, + "Timestamp": 637316497623017470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752437651, + "Position": { + "X": 1134.4857549275926, + "Y": 626.2696595102484, + "IsEmpty": false + }, + "Timestamp": 637316497623182100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 1142.8539052812785, + "Y": 632.46075113266852, + "IsEmpty": false + }, + "Timestamp": 637316497623353850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 1153.8844548282138, + "Y": 640.28509455890776, + "IsEmpty": false + }, + "Timestamp": 637316497623518680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 1159.8296311615707, + "Y": 644.3643440413407, + "IsEmpty": false + }, + "Timestamp": 637316497623692640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 1167.5628841297926, + "Y": 649.5290625012583, + "IsEmpty": false + }, + "Timestamp": 637316497623863460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75194931, + "Position": { + "X": 1172.9153329609994, + "Y": 653.03670397573887, + "IsEmpty": false + }, + "Timestamp": 637316497624026060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 1174.6241593135437, + "Y": 654.13271522141008, + "IsEmpty": false + }, + "Timestamp": 637316497624196640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694087148, + "Position": { + "X": 1177.2026120914857, + "Y": 655.79673415750278, + "IsEmpty": false + }, + "Timestamp": 637316497624360050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.549553692, + "Position": { + "X": 1178.3553330179041, + "Y": 656.52407380719342, + "IsEmpty": false + }, + "Timestamp": 637316497624522780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.549553692, + "Position": { + "X": 1177.4938181890332, + "Y": 655.90675858162467, + "IsEmpty": false + }, + "Timestamp": 637316497624545830, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e826b844-e1d2-40c9-bfd2-ee0986b74d1b", + "Points": [ + { + "Pressure": 0.0764019191, + "Position": { + "X": 1061.8701916144896, + "Y": 573.92376048757205, + "IsEmpty": false + }, + "Timestamp": 637316497627509250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.415030122, + "Position": { + "X": 1061.5233935666934, + "Y": 573.53959010608014, + "IsEmpty": false + }, + "Timestamp": 637316497628080740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.450675219, + "Position": { + "X": 1060.8725011159322, + "Y": 572.8047696632209, + "IsEmpty": false + }, + "Timestamp": 637316497628256590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473624766, + "Position": { + "X": 1060.2252664580938, + "Y": 572.07207083796709, + "IsEmpty": false + }, + "Timestamp": 637316497628525710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506828427, + "Position": { + "X": 1060.205586107081, + "Y": 572.05622970896775, + "IsEmpty": false + }, + "Timestamp": 637316497628647990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543938339, + "Position": { + "X": 1059.9030194961115, + "Y": 571.7065251530189, + "IsEmpty": false + }, + "Timestamp": 637316497628761900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587884307, + "Position": { + "X": 1060.5286966801752, + "Y": 572.42229002189504, + "IsEmpty": false + }, + "Timestamp": 637316497628931870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614984334, + "Position": { + "X": 1062.4865712102201, + "Y": 574.6297478456911, + "IsEmpty": false + }, + "Timestamp": 637316497629101950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646967292, + "Position": { + "X": 1065.4853209211165, + "Y": 577.9754306878508, + "IsEmpty": false + }, + "Timestamp": 637316497629267850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681147456, + "Position": { + "X": 1071.0010304072107, + "Y": 584.01880855879972, + "IsEmpty": false + }, + "Timestamp": 637316497629433910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698725879, + "Position": { + "X": 1078.2307649489805, + "Y": 591.72738444525339, + "IsEmpty": false + }, + "Timestamp": 637316497629604080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733882666, + "Position": { + "X": 1090.9605358060355, + "Y": 604.73892244234253, + "IsEmpty": false + }, + "Timestamp": 637316497629775180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 1099.6173260259247, + "Y": 613.18507305370144, + "IsEmpty": false + }, + "Timestamp": 637316497629939920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754146636, + "Position": { + "X": 1108.7013519023747, + "Y": 621.71626912380918, + "IsEmpty": false + }, + "Timestamp": 637316497630116050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1120.5204019535956, + "Y": 632.3339198789738, + "IsEmpty": false + }, + "Timestamp": 637316497630284560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 1131.0390738866629, + "Y": 641.33888191444589, + "IsEmpty": false + }, + "Timestamp": 637316497630447940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753414214, + "Position": { + "X": 1136.4939197509054, + "Y": 645.8467064076558, + "IsEmpty": false + }, + "Timestamp": 637316497630619800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745845735, + "Position": { + "X": 1138.5077814091312, + "Y": 647.48414025309307, + "IsEmpty": false + }, + "Timestamp": 637316497630784110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706050217, + "Position": { + "X": 1142.5841470321586, + "Y": 650.7549724236253, + "IsEmpty": false + }, + "Timestamp": 637316497630993060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6257267, + "Position": { + "X": 1145.6548249891416, + "Y": 653.18622934162318, + "IsEmpty": false + }, + "Timestamp": 637316497631065340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6257267, + "Position": { + "X": 1145.7134510015319, + "Y": 653.22125874289122, + "IsEmpty": false + }, + "Timestamp": 637316497631077910, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "aac3fdb8-67da-46af-871c-4e9670e4c637", + "Points": [ + { + "Pressure": 0.140611887, + "Position": { + "X": 1049.5097394002369, + "Y": 573.04716014872122, + "IsEmpty": false + }, + "Timestamp": 637316497633685050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.2414435, + "Position": { + "X": 1048.8783710970806, + "Y": 572.16158288178667, + "IsEmpty": false + }, + "Timestamp": 637316497633994530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.332509339, + "Position": { + "X": 1048.5636238275379, + "Y": 571.71895453103502, + "IsEmpty": false + }, + "Timestamp": 637316497634168760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.423575193, + "Position": { + "X": 1048.2495003860186, + "Y": 571.27643559554519, + "IsEmpty": false + }, + "Timestamp": 637316497634333520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.490714878, + "Position": { + "X": 1048.4038544868552, + "Y": 571.530540894007, + "IsEmpty": false + }, + "Timestamp": 637316497634511330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.541496933, + "Position": { + "X": 1048.7181299030647, + "Y": 571.97285968577148, + "IsEmpty": false + }, + "Timestamp": 637316497634667160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.585931182, + "Position": { + "X": 1050.143609855488, + "Y": 573.93315203563816, + "IsEmpty": false + }, + "Timestamp": 637316497634842260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642328501, + "Position": { + "X": 1053.2048398830752, + "Y": 578.05958780611343, + "IsEmpty": false + }, + "Timestamp": 637316497635010200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683100641, + "Position": { + "X": 1056.9805426917906, + "Y": 583.15196352642602, + "IsEmpty": false + }, + "Timestamp": 637316497635245850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713618696, + "Position": { + "X": 1062.4084715696915, + "Y": 590.19862940984399, + "IsEmpty": false + }, + "Timestamp": 637316497635356700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 1069.4157704939798, + "Y": 599.10873766585155, + "IsEmpty": false + }, + "Timestamp": 637316497635518540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752925932, + "Position": { + "X": 1081.1822445587977, + "Y": 613.39201786181127, + "IsEmpty": false + }, + "Timestamp": 637316497635689560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760982692, + "Position": { + "X": 1089.6530435675629, + "Y": 623.19328648658154, + "IsEmpty": false + }, + "Timestamp": 637316497635864270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764889002, + "Position": { + "X": 1098.4578510048771, + "Y": 632.93532790251425, + "IsEmpty": false + }, + "Timestamp": 637316497636029550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.767086267, + "Position": { + "X": 1107.360562651437, + "Y": 642.38137866003058, + "IsEmpty": false + }, + "Timestamp": 637316497636199550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769039452, + "Position": { + "X": 1116.0820917048547, + "Y": 651.29400638849233, + "IsEmpty": false + }, + "Timestamp": 637316497636365140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763668239, + "Position": { + "X": 1124.6390711233719, + "Y": 659.66355245940667, + "IsEmpty": false + }, + "Timestamp": 637316497636533510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660151064, + "Position": { + "X": 1131.411800226075, + "Y": 666.02331352092676, + "IsEmpty": false + }, + "Timestamp": 637316497636878420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480216682, + "Position": { + "X": 1132.5304932036963, + "Y": 667.07310235338082, + "IsEmpty": false + }, + "Timestamp": 637316497636997840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480216682, + "Position": { + "X": 1131.6048835925853, + "Y": 666.22990582844363, + "IsEmpty": false + }, + "Timestamp": 637316497637023720, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "3f3a2ac4-ced9-42c6-ad2f-6c2820422f86", + "Points": [ + { + "Pressure": 0.126451507, + "Position": { + "X": 1035.5452039098084, + "Y": 576.90815164938704, + "IsEmpty": false + }, + "Timestamp": 637316497639754250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.157457843, + "Position": { + "X": 1035.1848483056262, + "Y": 576.16276426848503, + "IsEmpty": false + }, + "Timestamp": 637316497639913940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.243396655, + "Position": { + "X": 1034.6464464226401, + "Y": 575.11954674233561, + "IsEmpty": false + }, + "Timestamp": 637316497640075810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.331044465, + "Position": { + "X": 1034.1087703520272, + "Y": 574.07437245471488, + "IsEmpty": false + }, + "Timestamp": 637316497640261020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.438223839, + "Position": { + "X": 1033.2127934359728, + "Y": 572.27610424686407, + "IsEmpty": false + }, + "Timestamp": 637316497640414380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.561028481, + "Position": { + "X": 1032.8539701399998, + "Y": 571.52369960152907, + "IsEmpty": false + }, + "Timestamp": 637316497640582460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.590814054, + "Position": { + "X": 1033.2127934359728, + "Y": 572.27610424686407, + "IsEmpty": false + }, + "Timestamp": 637316497641094940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623041093, + "Position": { + "X": 1034.1087703520272, + "Y": 574.07437245471488, + "IsEmpty": false + }, + "Timestamp": 637316497641404040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.686274529, + "Position": { + "X": 1039.1561778901116, + "Y": 583.85253348542415, + "IsEmpty": false + }, + "Timestamp": 637316497641601250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720210552, + "Position": { + "X": 1045.550352383545, + "Y": 595.89502844746835, + "IsEmpty": false + }, + "Timestamp": 637316497641773890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7397421, + "Position": { + "X": 1051.4795103685394, + "Y": 606.67015399834861, + "IsEmpty": false + }, + "Timestamp": 637316497641947570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.751216888, + "Position": { + "X": 1058.0600024365722, + "Y": 618.16417750695155, + "IsEmpty": false + }, + "Timestamp": 637316497642103500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 1065.1251541369411, + "Y": 630.03476681700181, + "IsEmpty": false + }, + "Timestamp": 637316497642281640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769771874, + "Position": { + "X": 1072.1053713470994, + "Y": 641.31666166509194, + "IsEmpty": false + }, + "Timestamp": 637316497642453340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771725059, + "Position": { + "X": 1080.9773984192748, + "Y": 655.03324285094709, + "IsEmpty": false + }, + "Timestamp": 637316497642614270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771725059, + "Position": { + "X": 1085.3739796747725, + "Y": 661.57914659316725, + "IsEmpty": false + }, + "Timestamp": 637316497642785230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.766842127, + "Position": { + "X": 1089.8129176240939, + "Y": 668.00590874475915, + "IsEmpty": false + }, + "Timestamp": 637316497642960310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.755123198, + "Position": { + "X": 1091.4456457550127, + "Y": 670.28877696232223, + "IsEmpty": false + }, + "Timestamp": 637316497643124400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.450675219, + "Position": { + "X": 1093.6744282597981, + "Y": 673.48069578472916, + "IsEmpty": false + }, + "Timestamp": 637316497643293640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.450675219, + "Position": { + "X": 1092.6226653726444, + "Y": 672.14625210802751, + "IsEmpty": false + }, + "Timestamp": 637316497643314390, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "3b133a9f-3a78-4930-8291-8f1318cc6ed3", + "Points": [ + { + "Pressure": 0.0878767073, + "Position": { + "X": 1026.4822820079003, + "Y": 575.10994950858958, + "IsEmpty": false + }, + "Timestamp": 637316497646351480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.434073389, + "Position": { + "X": 1026.0870518263587, + "Y": 574.06861824466614, + "IsEmpty": false + }, + "Timestamp": 637316497646497740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.496818483, + "Position": { + "X": 1026.4822820079003, + "Y": 575.10994950858958, + "IsEmpty": false + }, + "Timestamp": 637316497647009470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58519876, + "Position": { + "X": 1028.446330415039, + "Y": 580.19525479674553, + "IsEmpty": false + }, + "Timestamp": 637316497647178600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632562757, + "Position": { + "X": 1030.4130054183638, + "Y": 585.22300669713422, + "IsEmpty": false + }, + "Timestamp": 637316497647348120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673823118, + "Position": { + "X": 1033.1767272998782, + "Y": 592.19924172512174, + "IsEmpty": false + }, + "Timestamp": 637316497647608380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706538498, + "Position": { + "X": 1036.3444213575974, + "Y": 600.04651435732058, + "IsEmpty": false + }, + "Timestamp": 637316497647700000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736324072, + "Position": { + "X": 1041.8868085164615, + "Y": 613.3304511136854, + "IsEmpty": false + }, + "Timestamp": 637316497647854330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741207004, + "Position": { + "X": 1045.4606698102909, + "Y": 621.63592132660051, + "IsEmpty": false + }, + "Timestamp": 637316497648025240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745113313, + "Position": { + "X": 1048.6586600976138, + "Y": 628.9303449356828, + "IsEmpty": false + }, + "Timestamp": 637316497648192560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 1051.8479693393558, + "Y": 636.00914653354175, + "IsEmpty": false + }, + "Timestamp": 637316497648362480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 1054.6582960276453, + "Y": 642.14744145629379, + "IsEmpty": false + }, + "Timestamp": 637316497648535570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742915988, + "Position": { + "X": 1055.8724030750134, + "Y": 644.7776871697688, + "IsEmpty": false + }, + "Timestamp": 637316497648696900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.69897002, + "Position": { + "X": 1058.6925832059069, + "Y": 650.76597155469585, + "IsEmpty": false + }, + "Timestamp": 637316497648867250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577874422, + "Position": { + "X": 1059.8928770596185, + "Y": 653.25932591247624, + "IsEmpty": false + }, + "Timestamp": 637316497649178370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577874422, + "Position": { + "X": 1059.8745993210985, + "Y": 653.18687000563739, + "IsEmpty": false + }, + "Timestamp": 637316497649192580, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e80be184-0e69-40fe-b803-932f78c7da4e", + "Points": [ + { + "Pressure": 0.376211196, + "Position": { + "X": 1020.0670858246169, + "Y": 588.70404376437523, + "IsEmpty": false + }, + "Timestamp": 637316497652717980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.43041122, + "Position": { + "X": 1020.3648726986601, + "Y": 589.87685482546317, + "IsEmpty": false + }, + "Timestamp": 637316497652927690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.499259949, + "Position": { + "X": 1020.8294162123618, + "Y": 591.44936851708258, + "IsEmpty": false + }, + "Timestamp": 637316497653091930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 1022.0298047237989, + "Y": 596.09695612424412, + "IsEmpty": false + }, + "Timestamp": 637316497653264800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620355546, + "Position": { + "X": 1023.2405946360367, + "Y": 600.6991249928617, + "IsEmpty": false + }, + "Timestamp": 637316497653428170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691401541, + "Position": { + "X": 1027.1237882943249, + "Y": 614.2724461970829, + "IsEmpty": false + }, + "Timestamp": 637316497653809570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749752045, + "Position": { + "X": 1035.4463384939011, + "Y": 641.58551065717847, + "IsEmpty": false + }, + "Timestamp": 637316497654132420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760494411, + "Position": { + "X": 1040.081172785031, + "Y": 655.59570073828968, + "IsEmpty": false + }, + "Timestamp": 637316497654572770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 1047.0608338057132, + "Y": 675.20977941370484, + "IsEmpty": false + }, + "Timestamp": 637316497654729640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 1046.3688640180428, + "Y": 673.29747901019141, + "IsEmpty": false + }, + "Timestamp": 637316497654742030, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c0c63951-6733-45a3-8ed3-88dd70d9be3b", + "Points": [ + { + "Pressure": 0.224109247, + "Position": { + "X": 995.60902238154415, + "Y": 576.08370404991706, + "IsEmpty": false + }, + "Timestamp": 637316497662036120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.269520104, + "Position": { + "X": 995.89886811226927, + "Y": 571.83095535986774, + "IsEmpty": false + }, + "Timestamp": 637316497662086600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.404776067, + "Position": { + "X": 996.08926361605711, + "Y": 568.97895869184981, + "IsEmpty": false + }, + "Timestamp": 637316497662336070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608392477, + "Position": { + "X": 995.01633590546476, + "Y": 583.70756155464619, + "IsEmpty": false + }, + "Timestamp": 637316497662822370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650385261, + "Position": { + "X": 994.19134247980992, + "Y": 594.7557730559796, + "IsEmpty": false + }, + "Timestamp": 637316497662995000, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7ab74507-641e-4e16-a937-b68deb0be769", + "Points": [ + { + "Pressure": 0.0917830169, + "Position": { + "X": 991.80506235695941, + "Y": 570.13414589083402, + "IsEmpty": false + }, + "Timestamp": 637316497668616540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.248767838, + "Position": { + "X": 991.80523334618033, + "Y": 570.04816708533713, + "IsEmpty": false + }, + "Timestamp": 637316497668935250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525383353, + "Position": { + "X": 991.80506235695941, + "Y": 570.13414589083402, + "IsEmpty": false + }, + "Timestamp": 637316497669381480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619867265, + "Position": { + "X": 991.41782490459707, + "Y": 572.754394785881, + "IsEmpty": false + }, + "Timestamp": 637316497669493250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678461909, + "Position": { + "X": 990.63079006158262, + "Y": 578.1271933075916, + "IsEmpty": false + }, + "Timestamp": 637316497669648970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720210552, + "Position": { + "X": 989.62443268728759, + "Y": 584.68515494742928, + "IsEmpty": false + }, + "Timestamp": 637316497669933130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764889002, + "Position": { + "X": 987.53574899741989, + "Y": 597.72626784699912, + "IsEmpty": false + }, + "Timestamp": 637316497669995800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.782955647, + "Position": { + "X": 985.57099810571196, + "Y": 609.10645261639706, + "IsEmpty": false + }, + "Timestamp": 637316497670156950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.798580885, + "Position": { + "X": 983.29425133934217, + "Y": 621.4604502332279, + "IsEmpty": false + }, + "Timestamp": 637316497670326510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804440379, + "Position": { + "X": 981.16116245749913, + "Y": 632.38205081054207, + "IsEmpty": false + }, + "Timestamp": 637316497670501540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814694464, + "Position": { + "X": 977.94272050008078, + "Y": 647.63801650442167, + "IsEmpty": false + }, + "Timestamp": 637316497670664500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 976.9196757414179, + "Y": 652.2514049676472, + "IsEmpty": false + }, + "Timestamp": 637316497670842100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820798039, + "Position": { + "X": 975.88143703628566, + "Y": 656.81605259148796, + "IsEmpty": false + }, + "Timestamp": 637316497671005240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 974.56237662234901, + "Y": 662.45371955602127, + "IsEmpty": false + }, + "Timestamp": 637316497671172460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.82494849, + "Position": { + "X": 973.49141469534788, + "Y": 666.83766037506416, + "IsEmpty": false + }, + "Timestamp": 637316497671344030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682124078, + "Position": { + "X": 973.22104973255909, + "Y": 667.94433269994761, + "IsEmpty": false + }, + "Timestamp": 637316497671690140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682124078, + "Position": { + "X": 973.22462617314977, + "Y": 667.72779599444016, + "IsEmpty": false + }, + "Timestamp": 637316497671837500, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "f46e15aa-b652-4f31-bce4-fa0d3f01e260", + "Points": [ + { + "Pressure": 0.0917830169, + "Position": { + "X": 1001.4908150513999, + "Y": 590.90928978216982, + "IsEmpty": false + }, + "Timestamp": 637316497675282610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.219958797, + "Position": { + "X": 1001.5172123452203, + "Y": 591.06551383425199, + "IsEmpty": false + }, + "Timestamp": 637316497675566360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.344960719, + "Position": { + "X": 1001.5484089633151, + "Y": 592.49073097562018, + "IsEmpty": false + }, + "Timestamp": 637316497675734040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.433585107, + "Position": { + "X": 1001.6116597488511, + "Y": 595.33111548929378, + "IsEmpty": false + }, + "Timestamp": 637316497675909730, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "0342f9b8-6dae-4dce-a3f7-e81efa06341c", + "Points": [ + { + "Pressure": 0.0280613415, + "Position": { + "X": 974.4557730511691, + "Y": 602.84567974615197, + "IsEmpty": false + }, + "Timestamp": 637316497681266650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0280613415, + "Position": { + "X": 974.57858419767899, + "Y": 602.18332821315869, + "IsEmpty": false + }, + "Timestamp": 637316497681337570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.030502785, + "Position": { + "X": 975.08901320886764, + "Y": 600.60296687970549, + "IsEmpty": false + }, + "Timestamp": 637316497681444040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.107652396, + "Position": { + "X": 975.40475968932481, + "Y": 599.47747177199267, + "IsEmpty": false + }, + "Timestamp": 637316497681511820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567864478, + "Position": { + "X": 975.71992314773013, + "Y": 598.34921290821194, + "IsEmpty": false + }, + "Timestamp": 637316497681648210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656733036, + "Position": { + "X": 975.40475968932481, + "Y": 599.47747177199267, + "IsEmpty": false + }, + "Timestamp": 637316497681992050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700679004, + "Position": { + "X": 974.4557730511691, + "Y": 602.84567974615197, + "IsEmpty": false + }, + "Timestamp": 637316497682156580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76000613, + "Position": { + "X": 971.83232429891757, + "Y": 611.50573421317017, + "IsEmpty": false + }, + "Timestamp": 637316497682329560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793209732, + "Position": { + "X": 969.04838899484139, + "Y": 620.63562622162726, + "IsEmpty": false + }, + "Timestamp": 637316497682493100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817380011, + "Position": { + "X": 965.89606349799794, + "Y": 630.62577566359801, + "IsEmpty": false + }, + "Timestamp": 637316497682662560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840573728, + "Position": { + "X": 961.15089560818171, + "Y": 644.87014081120503, + "IsEmpty": false + }, + "Timestamp": 637316497682834080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8454566, + "Position": { + "X": 959.05827347975776, + "Y": 650.71471358269559, + "IsEmpty": false + }, + "Timestamp": 637316497683009940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8454566, + "Position": { + "X": 957.6874377205271, + "Y": 654.6857237923814, + "IsEmpty": false + }, + "Timestamp": 637316497683169480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8454566, + "Position": { + "X": 956.8021810772683, + "Y": 657.0543215272188, + "IsEmpty": false + }, + "Timestamp": 637316497683346910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.815915167, + "Position": { + "X": 955.07015042660578, + "Y": 661.92932133745353, + "IsEmpty": false + }, + "Timestamp": 637316497683507230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674311459, + "Position": { + "X": 954.72206573542508, + "Y": 662.89663631788403, + "IsEmpty": false + }, + "Timestamp": 637316497683534400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674311459, + "Position": { + "X": 955.22096825074459, + "Y": 661.35307891093237, + "IsEmpty": false + }, + "Timestamp": 637316497683558230, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "2e556c73-18b8-4779-a2bd-27325347a01f", + "Points": [ + { + "Pressure": 0.112291142, + "Position": { + "X": 953.80178075831373, + "Y": 585.29503724422443, + "IsEmpty": false + }, + "Timestamp": 637316497686798320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.161364153, + "Position": { + "X": 955.42151298191175, + "Y": 582.65070309577686, + "IsEmpty": false + }, + "Timestamp": 637316497686889910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.486076146, + "Position": { + "X": 956.39322912512353, + "Y": 581.05001170175001, + "IsEmpty": false + }, + "Timestamp": 637316497687052220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596185267, + "Position": { + "X": 955.10903885300604, + "Y": 583.15421620365419, + "IsEmpty": false + }, + "Timestamp": 637316497687393360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682124078, + "Position": { + "X": 949.88590052032828, + "Y": 591.58757761547736, + "IsEmpty": false + }, + "Timestamp": 637316497687564340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726070046, + "Position": { + "X": 944.23954346206153, + "Y": 600.43710061844138, + "IsEmpty": false + }, + "Timestamp": 637316497687733190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763179958, + "Position": { + "X": 936.7948084892472, + "Y": 611.68222182376087, + "IsEmpty": false + }, + "Timestamp": 637316497687904400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789791703, + "Position": { + "X": 928.80966417357558, + "Y": 623.24953982313264, + "IsEmpty": false + }, + "Timestamp": 637316497688071150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806393504, + "Position": { + "X": 918.84322355631446, + "Y": 636.96821734934781, + "IsEmpty": false + }, + "Timestamp": 637316497688236830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813717842, + "Position": { + "X": 913.7610548803998, + "Y": 643.66547448434142, + "IsEmpty": false + }, + "Timestamp": 637316497688411640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817624152, + "Position": { + "X": 908.94533229069839, + "Y": 649.85592245069745, + "IsEmpty": false + }, + "Timestamp": 637316497688576220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 904.82812112782585, + "Y": 655.01032595153856, + "IsEmpty": false + }, + "Timestamp": 637316497688749700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804196239, + "Position": { + "X": 903.70041110286195, + "Y": 656.39910506175534, + "IsEmpty": false + }, + "Timestamp": 637316497688914150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 902.18512768396818, + "Y": 658.25508984350404, + "IsEmpty": false + }, + "Timestamp": 637316497689024920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 902.31449996332321, + "Y": 658.0145178982192, + "IsEmpty": false + }, + "Timestamp": 637316497689036820, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "91297040-ce32-4d65-a922-054ed157619d", + "Points": [ + { + "Pressure": 0.488029301, + "Position": { + "X": 944.81338504300948, + "Y": 573.43403005469156, + "IsEmpty": false + }, + "Timestamp": 637316497691541110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543450058, + "Position": { + "X": 943.85440239395814, + "Y": 574.64682596837815, + "IsEmpty": false + }, + "Timestamp": 637316497691799400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6340276, + "Position": { + "X": 942.3146972806062, + "Y": 576.55598826515495, + "IsEmpty": false + }, + "Timestamp": 637316497691967680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698237598, + "Position": { + "X": 939.76709854948581, + "Y": 579.699508495705, + "IsEmpty": false + }, + "Timestamp": 637316497692380560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803463817, + "Position": { + "X": 927.65183797075645, + "Y": 594.13386343336788, + "IsEmpty": false + }, + "Timestamp": 637316497692464190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.837888122, + "Position": { + "X": 920.00882757320812, + "Y": 602.84383212995112, + "IsEmpty": false + }, + "Timestamp": 637316497692630450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.866941333, + "Position": { + "X": 911.84757088545268, + "Y": 611.84269201654183, + "IsEmpty": false + }, + "Timestamp": 637316497692799840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.879636824, + "Position": { + "X": 903.31669971696101, + "Y": 620.87586729082409, + "IsEmpty": false + }, + "Timestamp": 637316497692972330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.886961162, + "Position": { + "X": 895.61003325263198, + "Y": 628.74868097432909, + "IsEmpty": false + }, + "Timestamp": 637316497693137860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.888914347, + "Position": { + "X": 889.99171093166331, + "Y": 634.27612489302282, + "IsEmpty": false + }, + "Timestamp": 637316497693310400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.875486374, + "Position": { + "X": 883.69192981785318, + "Y": 640.32238553275295, + "IsEmpty": false + }, + "Timestamp": 637316497693485510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646478951, + "Position": { + "X": 881.34408792756835, + "Y": 642.54312686981461, + "IsEmpty": false + }, + "Timestamp": 637316497693654010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646478951, + "Position": { + "X": 881.95306192030387, + "Y": 641.82335545797832, + "IsEmpty": false + }, + "Timestamp": 637316497693682610, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF808285", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "a0a4dc77-49b5-4f00-aed4-c077ba1d47a9", + "Points": [ + { + "Pressure": 0.122301057, + "Position": { + "X": 913.68932702900258, + "Y": 661.23315039431736, + "IsEmpty": false + }, + "Timestamp": 637316497995236900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.153063253, + "Position": { + "X": 914.44735127884633, + "Y": 661.32511286837689, + "IsEmpty": false + }, + "Timestamp": 637316497995506040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.286121905, + "Position": { + "X": 914.45472800165066, + "Y": 661.32577881090128, + "IsEmpty": false + }, + "Timestamp": 637316497995614800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 915.21311634123606, + "Y": 661.41692438356267, + "IsEmpty": false + }, + "Timestamp": 637316497995787340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700923145, + "Position": { + "X": 915.20574324532629, + "Y": 661.41626483828736, + "IsEmpty": false + }, + "Timestamp": 637316497996633720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 914.45472800165066, + "Y": 661.32577881090128, + "IsEmpty": false + }, + "Timestamp": 637316497996799720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741207004, + "Position": { + "X": 914.44735127884633, + "Y": 661.32511286837689, + "IsEmpty": false + }, + "Timestamp": 637316497996972970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 913.68932702900258, + "Y": 661.23315039431736, + "IsEmpty": false + }, + "Timestamp": 637316497997138530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 912.93167147221902, + "Y": 661.1403794686197, + "IsEmpty": false + }, + "Timestamp": 637316497997310620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.767330408, + "Position": { + "X": 911.42486130018256, + "Y": 660.95311184381683, + "IsEmpty": false + }, + "Timestamp": 637316497997475170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769771874, + "Position": { + "X": 910.66092672446644, + "Y": 660.85723650680063, + "IsEmpty": false + }, + "Timestamp": 637316497997650540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773678184, + "Position": { + "X": 909.14895825903284, + "Y": 660.66446990342183, + "IsEmpty": false + }, + "Timestamp": 637316497997819910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.777828634, + "Position": { + "X": 908.38612723242682, + "Y": 660.56616857309405, + "IsEmpty": false + }, + "Timestamp": 637316497997982020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785641253, + "Position": { + "X": 905.37560883590254, + "Y": 660.16865692383851, + "IsEmpty": false + }, + "Timestamp": 637316497998335820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791500747, + "Position": { + "X": 903.10871354486244, + "Y": 659.86095610596453, + "IsEmpty": false + }, + "Timestamp": 637316497998484810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793698013, + "Position": { + "X": 901.60430792962563, + "Y": 659.65241873761101, + "IsEmpty": false + }, + "Timestamp": 637316497998658850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795651197, + "Position": { + "X": 898.59266404259108, + "Y": 659.22524461366675, + "IsEmpty": false + }, + "Timestamp": 637316497998986470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799557507, + "Position": { + "X": 895.59467300899701, + "Y": 658.78657702826013, + "IsEmpty": false + }, + "Timestamp": 637316497999166250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799557507, + "Position": { + "X": 893.3502942270452, + "Y": 658.44959798197601, + "IsEmpty": false + }, + "Timestamp": 637316497999333550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801510632, + "Position": { + "X": 891.84853458040288, + "Y": 658.2203087817112, + "IsEmpty": false + }, + "Timestamp": 637316497999498390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801510632, + "Position": { + "X": 889.61008910693943, + "Y": 657.87204798425341, + "IsEmpty": false + }, + "Timestamp": 637316497999666980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.805905223, + "Position": { + "X": 886.63109998927098, + "Y": 657.3973117066887, + "IsEmpty": false + }, + "Timestamp": 637316497999837810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.807858407, + "Position": { + "X": 884.40860274567592, + "Y": 657.03446580871992, + "IsEmpty": false + }, + "Timestamp": 637316498000006470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809811532, + "Position": { + "X": 882.91645926005617, + "Y": 656.78738020557216, + "IsEmpty": false + }, + "Timestamp": 637316498000173370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811764717, + "Position": { + "X": 881.43345779324886, + "Y": 656.5383234827118, + "IsEmpty": false + }, + "Timestamp": 637316498000345620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.815915167, + "Position": { + "X": 878.47239180778183, + "Y": 656.03158470902986, + "IsEmpty": false + }, + "Timestamp": 637316498000519720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.819821477, + "Position": { + "X": 876.25594290565675, + "Y": 655.64404812088264, + "IsEmpty": false + }, + "Timestamp": 637316498000688110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.823727787, + "Position": { + "X": 874.77285845009999, + "Y": 655.3811539554481, + "IsEmpty": false + }, + "Timestamp": 637316498000851940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825680912, + "Position": { + "X": 873.29898634878725, + "Y": 655.11644630452008, + "IsEmpty": false + }, + "Timestamp": 637316498001027300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.831540406, + "Position": { + "X": 871.0913421086002, + "Y": 654.71415831903323, + "IsEmpty": false + }, + "Timestamp": 637316498001196170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.833493531, + "Position": { + "X": 869.62169994793976, + "Y": 654.44250593526795, + "IsEmpty": false + }, + "Timestamp": 637316498001365970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.837888122, + "Position": { + "X": 868.14620606394044, + "Y": 654.16704629578032, + "IsEmpty": false + }, + "Timestamp": 637316498001532110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842038631, + "Position": { + "X": 866.67997950333722, + "Y": 653.88990141437557, + "IsEmpty": false + }, + "Timestamp": 637316498001697840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.843991756, + "Position": { + "X": 863.75269832890729, + "Y": 653.32747931025642, + "IsEmpty": false + }, + "Timestamp": 637316498001864360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.845944941, + "Position": { + "X": 862.29165933785907, + "Y": 653.04223492770984, + "IsEmpty": false + }, + "Timestamp": 637316498002035870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.849851251, + "Position": { + "X": 860.83236515944179, + "Y": 652.7543235516174, + "IsEmpty": false + }, + "Timestamp": 637316498002204710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.851804376, + "Position": { + "X": 859.37482360504418, + "Y": 652.46376160206296, + "IsEmpty": false + }, + "Timestamp": 637316498002371170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.85375756, + "Position": { + "X": 857.19181453089959, + "Y": 652.02298477142392, + "IsEmpty": false + }, + "Timestamp": 637316498002542730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.855710685, + "Position": { + "X": 855.73868871138052, + "Y": 651.72586822608207, + "IsEmpty": false + }, + "Timestamp": 637316498002713400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.85766387, + "Position": { + "X": 854.28734285574387, + "Y": 651.42615857757244, + "IsEmpty": false + }, + "Timestamp": 637316498002880220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.859616995, + "Position": { + "X": 852.83778477537999, + "Y": 651.12387224597887, + "IsEmpty": false + }, + "Timestamp": 637316498003047230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.859616995, + "Position": { + "X": 850.65922352456516, + "Y": 650.66446136873469, + "IsEmpty": false + }, + "Timestamp": 637316498003217370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.861570179, + "Position": { + "X": 848.49991529981446, + "Y": 650.20171735353438, + "IsEmpty": false + }, + "Timestamp": 637316498003391880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.861570179, + "Position": { + "X": 847.77092554432613, + "Y": 650.04461021414738, + "IsEmpty": false + }, + "Timestamp": 637316498003560780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.863523304, + "Position": { + "X": 846.32950720253518, + "Y": 649.73092233378588, + "IsEmpty": false + }, + "Timestamp": 637316498003724950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.865476489, + "Position": { + "X": 844.88991970814936, + "Y": 649.41474814482422, + "IsEmpty": false + }, + "Timestamp": 637316498003899500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.871580064, + "Position": { + "X": 842.73398839286904, + "Y": 648.93586095169053, + "IsEmpty": false + }, + "Timestamp": 637316498004234060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.875974655, + "Position": { + "X": 842.0162685071499, + "Y": 648.77500652143704, + "IsEmpty": false + }, + "Timestamp": 637316498004407430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.88207829, + "Position": { + "X": 840.57461378276241, + "Y": 648.4502139586557, + "IsEmpty": false + }, + "Timestamp": 637316498004567030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.884031415, + "Position": { + "X": 838.42703359259303, + "Y": 647.9603645625948, + "IsEmpty": false + }, + "Timestamp": 637316498004910810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8859846, + "Position": { + "X": 837.71210918707379, + "Y": 647.79588072683578, + "IsEmpty": false + }, + "Timestamp": 637316498005076780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 836.29127997514502, + "Y": 647.46641005515926, + "IsEmpty": false + }, + "Timestamp": 637316498005252500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 835.57776737421796, + "Y": 647.30014615650066, + "IsEmpty": false + }, + "Timestamp": 637316498005413850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.889890909, + "Position": { + "X": 835.57015661405978, + "Y": 647.29885584348995, + "IsEmpty": false + }, + "Timestamp": 637316498005584570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.898680091, + "Position": { + "X": 834.85711589231539, + "Y": 647.13199659871998, + "IsEmpty": false + }, + "Timestamp": 637316498005916010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.893064797, + "Position": { + "X": 834.86472713149703, + "Y": 647.13329146834963, + "IsEmpty": false + }, + "Timestamp": 637316498006258040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789303422, + "Position": { + "X": 835.57015661405978, + "Y": 647.29885584348995, + "IsEmpty": false + }, + "Timestamp": 637316498006534920, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d8ddc383-a001-4c4d-996f-e222da751309", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 904.77909330656553, + "Y": 659.82616459485337, + "IsEmpty": false + }, + "Timestamp": 637316498031592860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.110582128, + "Position": { + "X": 904.77909330656553, + "Y": 660.32919193860334, + "IsEmpty": false + }, + "Timestamp": 637316498032053360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.132066831, + "Position": { + "X": 904.77909330656553, + "Y": 660.58070561047839, + "IsEmpty": false + }, + "Timestamp": 637316498032405060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.182848856, + "Position": { + "X": 904.77909330656553, + "Y": 660.76937748547834, + "IsEmpty": false + }, + "Timestamp": 637316498032565330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.24779126, + "Position": { + "X": 904.77909330656553, + "Y": 661.24095951672837, + "IsEmpty": false + }, + "Timestamp": 637316498032730240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.326405734, + "Position": { + "X": 904.77909330656553, + "Y": 661.6496997511033, + "IsEmpty": false + }, + "Timestamp": 637316498032900010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.613275349, + "Position": { + "X": 904.77909330656553, + "Y": 661.14662357922839, + "IsEmpty": false + }, + "Timestamp": 637316498033900380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644281685, + "Position": { + "X": 904.77909330656553, + "Y": 660.17201420422839, + "IsEmpty": false + }, + "Timestamp": 637316498034086380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.686030388, + "Position": { + "X": 904.77909330656553, + "Y": 658.47426029797839, + "IsEmpty": false + }, + "Timestamp": 637316498034252630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713618696, + "Position": { + "X": 904.77909330656553, + "Y": 657.09091068860334, + "IsEmpty": false + }, + "Timestamp": 637316498034419960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733882666, + "Position": { + "X": 904.77909330656553, + "Y": 655.33026615735332, + "IsEmpty": false + }, + "Timestamp": 637316498034582180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753414214, + "Position": { + "X": 904.77909330656553, + "Y": 653.1609302198533, + "IsEmpty": false + }, + "Timestamp": 637316498034758240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 904.77909330656553, + "Y": 647.72181889172839, + "IsEmpty": false + }, + "Timestamp": 637316498034927230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790279984, + "Position": { + "X": 904.77909330656553, + "Y": 642.78578373547839, + "IsEmpty": false + }, + "Timestamp": 637316498035092790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799557507, + "Position": { + "X": 904.77909330656553, + "Y": 637.69252201672839, + "IsEmpty": false + }, + "Timestamp": 637316498035265140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809079111, + "Position": { + "X": 904.77909330656553, + "Y": 632.56781498547832, + "IsEmpty": false + }, + "Timestamp": 637316498035427120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 904.77909330656553, + "Y": 625.80824467297839, + "IsEmpty": false + }, + "Timestamp": 637316498035596800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822507083, + "Position": { + "X": 904.77909330656553, + "Y": 621.37523686047837, + "IsEmpty": false + }, + "Timestamp": 637316498035776430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.828366518, + "Position": { + "X": 904.77909330656553, + "Y": 616.87933842297832, + "IsEmpty": false + }, + "Timestamp": 637316498035934240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.83324939, + "Position": { + "X": 904.77909330656553, + "Y": 612.50917240735339, + "IsEmpty": false + }, + "Timestamp": 637316498036101660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.835202575, + "Position": { + "X": 904.77909330656553, + "Y": 606.7556567823533, + "IsEmpty": false + }, + "Timestamp": 637316498036278930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.835202575, + "Position": { + "X": 904.77909330656553, + "Y": 603.58026615735332, + "IsEmpty": false + }, + "Timestamp": 637316498036434850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8371557, + "Position": { + "X": 904.77909330656553, + "Y": 600.62489506360339, + "IsEmpty": false + }, + "Timestamp": 637316498036616240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8371557, + "Position": { + "X": 904.77909330656553, + "Y": 598.04681889172832, + "IsEmpty": false + }, + "Timestamp": 637316498036785900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.839108884, + "Position": { + "X": 904.77909330656553, + "Y": 594.6199145948533, + "IsEmpty": false + }, + "Timestamp": 637316498036942080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.839108884, + "Position": { + "X": 904.77909330656553, + "Y": 592.73348881360334, + "IsEmpty": false + }, + "Timestamp": 637316498037109440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.839108884, + "Position": { + "X": 904.77909330656553, + "Y": 591.13007084485332, + "IsEmpty": false + }, + "Timestamp": 637316498037294290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.839108884, + "Position": { + "X": 904.77909330656553, + "Y": 589.58949467297839, + "IsEmpty": false + }, + "Timestamp": 637316498037461110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.841062009, + "Position": { + "X": 904.77909330656553, + "Y": 587.6716724073533, + "IsEmpty": false + }, + "Timestamp": 637316498037687590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.344228268, + "Position": { + "X": 904.77909330656553, + "Y": 587.51449467297834, + "IsEmpty": false + }, + "Timestamp": 637316498037858580, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "44b714d9-f827-4981-8c2d-6971d467a15d", + "Points": [ + { + "Pressure": 0.146471351, + "Position": { + "X": 842.76017240812803, + "Y": 648.09911381360337, + "IsEmpty": false + }, + "Timestamp": 637316498044902420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.156237125, + "Position": { + "X": 842.76017240812803, + "Y": 648.3506274854783, + "IsEmpty": false + }, + "Timestamp": 637316498045131560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.200427249, + "Position": { + "X": 842.76017240812803, + "Y": 648.60214115735334, + "IsEmpty": false + }, + "Timestamp": 637316498045297910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.253162444, + "Position": { + "X": 842.76017240812803, + "Y": 648.85365482922839, + "IsEmpty": false + }, + "Timestamp": 637316498045468930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.337636381, + "Position": { + "X": 842.76017240812803, + "Y": 649.63964115735337, + "IsEmpty": false + }, + "Timestamp": 637316498045634920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.387197673, + "Position": { + "X": 842.76017240812803, + "Y": 650.1741138136033, + "IsEmpty": false + }, + "Timestamp": 637316498045800540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.431387812, + "Position": { + "X": 842.76017240812803, + "Y": 650.42562748547834, + "IsEmpty": false + }, + "Timestamp": 637316498045976440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.504142821, + "Position": { + "X": 842.76017240812803, + "Y": 650.8972583448533, + "IsEmpty": false + }, + "Timestamp": 637316498046138780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 842.76017240812803, + "Y": 651.11732670422839, + "IsEmpty": false + }, + "Timestamp": 637316498046475940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.618646502, + "Position": { + "X": 842.76017240812803, + "Y": 650.64574467297837, + "IsEmpty": false + }, + "Timestamp": 637316498046990010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633539319, + "Position": { + "X": 842.76017240812803, + "Y": 649.41957279797839, + "IsEmpty": false + }, + "Timestamp": 637316498047150720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648432136, + "Position": { + "X": 842.76017240812803, + "Y": 647.37596928235337, + "IsEmpty": false + }, + "Timestamp": 637316498047319350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664057374, + "Position": { + "X": 842.76017240812803, + "Y": 644.26342045422837, + "IsEmpty": false + }, + "Timestamp": 637316498047497820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691157401, + "Position": { + "X": 842.76017240812803, + "Y": 637.97548100110339, + "IsEmpty": false + }, + "Timestamp": 637316498047664890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705561936, + "Position": { + "X": 842.76017240812803, + "Y": 632.6621509229783, + "IsEmpty": false + }, + "Timestamp": 637316498047830600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714106977, + "Position": { + "X": 842.76017240812803, + "Y": 626.8457446729783, + "IsEmpty": false + }, + "Timestamp": 637316498047995910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 842.76017240812803, + "Y": 620.55775639172839, + "IsEmpty": false + }, + "Timestamp": 637316498048168200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726802468, + "Position": { + "X": 842.76017240812803, + "Y": 611.81747318860334, + "IsEmpty": false + }, + "Timestamp": 637316498048340320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.731929481, + "Position": { + "X": 842.76017240812803, + "Y": 606.7556567823533, + "IsEmpty": false + }, + "Timestamp": 637316498048512280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736324072, + "Position": { + "X": 842.76017240812803, + "Y": 602.3855395948533, + "IsEmpty": false + }, + "Timestamp": 637316498048675820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741207004, + "Position": { + "X": 842.76017240812803, + "Y": 598.54989506360334, + "IsEmpty": false + }, + "Timestamp": 637316498048849490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753414214, + "Position": { + "X": 842.76017240812803, + "Y": 593.2051196729783, + "IsEmpty": false + }, + "Timestamp": 637316498049011650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761959255, + "Position": { + "X": 842.76017240812803, + "Y": 590.2183032667283, + "IsEmpty": false + }, + "Timestamp": 637316498049190940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769771874, + "Position": { + "X": 842.76017240812803, + "Y": 588.04896732922839, + "IsEmpty": false + }, + "Timestamp": 637316498049348970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774654746, + "Position": { + "X": 842.76017240812803, + "Y": 586.38265873547834, + "IsEmpty": false + }, + "Timestamp": 637316498049518310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.780758381, + "Position": { + "X": 842.76017240812803, + "Y": 584.46483646985337, + "IsEmpty": false + }, + "Timestamp": 637316498049687980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.782955647, + "Position": { + "X": 842.76017240812803, + "Y": 583.55306889172834, + "IsEmpty": false + }, + "Timestamp": 637316498049858820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785152972, + "Position": { + "X": 842.76017240812803, + "Y": 583.1443286573533, + "IsEmpty": false + }, + "Timestamp": 637316498050024990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789303422, + "Position": { + "X": 842.76017240812803, + "Y": 582.5784106886033, + "IsEmpty": false + }, + "Timestamp": 637316498050198650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 842.76017240812803, + "Y": 582.35834232922832, + "IsEmpty": false + }, + "Timestamp": 637316498050366520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.434317529, + "Position": { + "X": 842.76017240812803, + "Y": 581.41512943860334, + "IsEmpty": false + }, + "Timestamp": 637316498050521880, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "6d89c969-c64d-472a-99f7-d6bcb79ca17b", + "Points": [ + { + "Pressure": 0.211902037, + "Position": { + "X": 844.68668784751401, + "Y": 598.36586199953535, + "IsEmpty": false + }, + "Timestamp": 637316498151052480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.303700298, + "Position": { + "X": 844.47133762096894, + "Y": 598.50167468749146, + "IsEmpty": false + }, + "Timestamp": 637316498151757980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.43456167, + "Position": { + "X": 844.14794189512497, + "Y": 598.65060391358861, + "IsEmpty": false + }, + "Timestamp": 637316498152434260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.463614851, + "Position": { + "X": 843.93223100321029, + "Y": 598.78640426774336, + "IsEmpty": false + }, + "Timestamp": 637316498153269290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.515373468, + "Position": { + "X": 843.60839876383091, + "Y": 598.93531421366629, + "IsEmpty": false + }, + "Timestamp": 637316498153609910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570305943, + "Position": { + "X": 843.392327341738, + "Y": 599.07110115795297, + "IsEmpty": false + }, + "Timestamp": 637316498154626720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575188816, + "Position": { + "X": 843.0680591555398, + "Y": 599.21999060762187, + "IsEmpty": false + }, + "Timestamp": 637316498155134670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.598626673, + "Position": { + "X": 842.85162733845971, + "Y": 599.35576306597341, + "IsEmpty": false + }, + "Timestamp": 637316498155805570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600579858, + "Position": { + "X": 842.52692377215919, + "Y": 599.50463080330883, + "IsEmpty": false + }, + "Timestamp": 637316498158182430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622796953, + "Position": { + "X": 842.31013169528308, + "Y": 599.64038769965873, + "IsEmpty": false + }, + "Timestamp": 637316498159700150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.69481957, + "Position": { + "X": 841.76784111411621, + "Y": 599.92497276686231, + "IsEmpty": false + }, + "Timestamp": 637316498162740330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704097033, + "Position": { + "X": 842.85162733845971, + "Y": 599.35576306597341, + "IsEmpty": false + }, + "Timestamp": 637316498163576810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714106977, + "Position": { + "X": 843.93223100321029, + "Y": 598.78640426774336, + "IsEmpty": false + }, + "Timestamp": 637316498163748770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 845.22463591909025, + "Y": 598.08109076365281, + "IsEmpty": false + }, + "Timestamp": 637316498163918480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 847.68920010269039, + "Y": 596.79273907528625, + "IsEmpty": false + }, + "Timestamp": 637316498164088990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737056553, + "Position": { + "X": 849.28731439887986, + "Y": 595.93801561746818, + "IsEmpty": false + }, + "Timestamp": 637316498164262920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741939425, + "Position": { + "X": 851.08920382714246, + "Y": 594.9473274820823, + "IsEmpty": false + }, + "Timestamp": 637316498164429580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746578157, + "Position": { + "X": 852.98807280323001, + "Y": 593.94342594914247, + "IsEmpty": false + }, + "Timestamp": 637316498164604090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752437651, + "Position": { + "X": 855.8149614418611, + "Y": 592.38303836730393, + "IsEmpty": false + }, + "Timestamp": 637316498164766240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756832242, + "Position": { + "X": 857.89420043271025, + "Y": 591.24374413431804, + "IsEmpty": false + }, + "Timestamp": 637316498164932870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761715114, + "Position": { + "X": 860.47489676551891, + "Y": 589.82027312537207, + "IsEmpty": false + }, + "Timestamp": 637316498165118900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761715114, + "Position": { + "X": 862.5247171583527, + "Y": 588.68219253146322, + "IsEmpty": false + }, + "Timestamp": 637316498165285150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 866.08023861371464, + "Y": 586.69251126896233, + "IsEmpty": false + }, + "Timestamp": 637316498165436870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.768551171, + "Position": { + "X": 868.09379410286147, + "Y": 585.55692255611666, + "IsEmpty": false + }, + "Timestamp": 637316498165614780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770504296, + "Position": { + "X": 870.09407812536404, + "Y": 584.42251503940656, + "IsEmpty": false + }, + "Timestamp": 637316498165774380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770504296, + "Position": { + "X": 872.27671929687904, + "Y": 583.15455466219316, + "IsEmpty": false + }, + "Timestamp": 637316498165951490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.77245748, + "Position": { + "X": 875.22989361836187, + "Y": 581.45804316844601, + "IsEmpty": false + }, + "Timestamp": 637316498166122660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.77245748, + "Position": { + "X": 877.18189728680056, + "Y": 580.32914476149244, + "IsEmpty": false + }, + "Timestamp": 637316498166285980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774410605, + "Position": { + "X": 878.92991735306362, + "Y": 579.33623183960412, + "IsEmpty": false + }, + "Timestamp": 637316498166458110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776607931, + "Position": { + "X": 880.37605315274709, + "Y": 578.49207089725678, + "IsEmpty": false + }, + "Timestamp": 637316498166627640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.778561056, + "Position": { + "X": 882.00285165698426, + "Y": 577.51535080683175, + "IsEmpty": false + }, + "Timestamp": 637316498166792160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.78051424, + "Position": { + "X": 882.95687392876357, + "Y": 576.95418763830719, + "IsEmpty": false + }, + "Timestamp": 637316498166962630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.78051424, + "Position": { + "X": 883.907493564177, + "Y": 576.39359913065095, + "IsEmpty": false + }, + "Timestamp": 637316498167136590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785885394, + "Position": { + "X": 884.381525638477, + "Y": 576.1135261050149, + "IsEmpty": false + }, + "Timestamp": 637316498167297940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785885394, + "Position": { + "X": 885.61318685404228, + "Y": 575.40738165092216, + "IsEmpty": false + }, + "Timestamp": 637316498167466680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785885394, + "Position": { + "X": 886.73888049959828, + "Y": 574.7154649446054, + "IsEmpty": false + }, + "Timestamp": 637316498167648140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785885394, + "Position": { + "X": 887.67583343692354, + "Y": 574.15735845213487, + "IsEmpty": false + }, + "Timestamp": 637316498167806150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785885394, + "Position": { + "X": 889.07482850186909, + "Y": 573.32145384390344, + "IsEmpty": false + }, + "Timestamp": 637316498167974530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787838578, + "Position": { + "X": 890.46608551177599, + "Y": 572.48711040375383, + "IsEmpty": false + }, + "Timestamp": 637316498168154530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791989028, + "Position": { + "X": 891.3892819068102, + "Y": 571.93177932120761, + "IsEmpty": false + }, + "Timestamp": 637316498168318690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797116041, + "Position": { + "X": 891.84958551513296, + "Y": 571.65439001963978, + "IsEmpty": false + }, + "Timestamp": 637316498168487290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801266491, + "Position": { + "X": 892.30902512811531, + "Y": 571.37718793407021, + "IsEmpty": false + }, + "Timestamp": 637316498168651680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803219676, + "Position": { + "X": 892.76760004384948, + "Y": 571.1001753566461, + "IsEmpty": false + }, + "Timestamp": 637316498168821340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.805172801, + "Position": { + "X": 892.94694925198871, + "Y": 570.96837395628086, + "IsEmpty": false + }, + "Timestamp": 637316498168993190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680170894, + "Position": { + "X": 893.22530956042817, + "Y": 570.82335457951297, + "IsEmpty": false + }, + "Timestamp": 637316498169327160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680170894, + "Position": { + "X": 893.95952861412206, + "Y": 570.40190952537819, + "IsEmpty": false + }, + "Timestamp": 637316498169532970, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "db1953b0-1441-4306-aa28-5b33c8c99d0a", + "Points": [ + { + "Pressure": 0.0771343559, + "Position": { + "X": 906.24152804527364, + "Y": 608.62621788207673, + "IsEmpty": false + }, + "Timestamp": 637316498179277250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.185046151, + "Position": { + "X": 905.83277370819962, + "Y": 609.03066763732784, + "IsEmpty": false + }, + "Timestamp": 637316498179621450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.493400484, + "Position": { + "X": 905.42305490590593, + "Y": 609.435351059803, + "IsEmpty": false + }, + "Timestamp": 637316498180038590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 905.82353023974883, + "Y": 609.03726201334098, + "IsEmpty": false + }, + "Timestamp": 637316498180914670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.621332109, + "Position": { + "X": 905.83277370819962, + "Y": 609.03066763732784, + "IsEmpty": false + }, + "Timestamp": 637316498181082560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678217769, + "Position": { + "X": 907.45283968301601, + "Y": 607.42088323367238, + "IsEmpty": false + }, + "Timestamp": 637316498181485600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 908.27085206505421, + "Y": 606.60758856585699, + "IsEmpty": false + }, + "Timestamp": 637316498181659050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717036724, + "Position": { + "X": 909.46782996956415, + "Y": 605.40598490562797, + "IsEmpty": false + }, + "Timestamp": 637316498181981240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736324072, + "Position": { + "X": 912.24853313934659, + "Y": 602.59626667733858, + "IsEmpty": false + }, + "Timestamp": 637316498182167350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749263763, + "Position": { + "X": 915.3691528623857, + "Y": 599.40238162275853, + "IsEmpty": false + }, + "Timestamp": 637316498182335370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 918.04974664774056, + "Y": 596.62405997403062, + "IsEmpty": false + }, + "Timestamp": 637316498182635400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773678184, + "Position": { + "X": 929.35744382911219, + "Y": 584.53906050655905, + "IsEmpty": false + }, + "Timestamp": 637316498183023790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.783443987, + "Position": { + "X": 934.51899817420735, + "Y": 578.82668557452348, + "IsEmpty": false + }, + "Timestamp": 637316498183345790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 937.51137097529875, + "Y": 575.45474718770652, + "IsEmpty": false + }, + "Timestamp": 637316498183519520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 939.45744823541054, + "Y": 573.23586382585381, + "IsEmpty": false + }, + "Timestamp": 637316498183846670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793453872, + "Position": { + "X": 942.64064324304763, + "Y": 569.57065260720049, + "IsEmpty": false + }, + "Timestamp": 637316498184182030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795407057, + "Position": { + "X": 945.74018918816034, + "Y": 565.95627450945403, + "IsEmpty": false + }, + "Timestamp": 637316498184370490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795407057, + "Position": { + "X": 946.94466744460408, + "Y": 564.53536317330327, + "IsEmpty": false + }, + "Timestamp": 637316498184645260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797360182, + "Position": { + "X": 947.84394542975463, + "Y": 563.47169543695622, + "IsEmpty": false + }, + "Timestamp": 637316498184804670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799313366, + "Position": { + "X": 949.91082887595303, + "Y": 561.01175103744504, + "IsEmpty": false + }, + "Timestamp": 637316498185193880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803219676, + "Position": { + "X": 951.64753396689093, + "Y": 558.9283626486191, + "IsEmpty": false + }, + "Timestamp": 637316498185552970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803219676, + "Position": { + "X": 952.78749769646822, + "Y": 557.55269760109491, + "IsEmpty": false + }, + "Timestamp": 637316498185876020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.420889586, + "Position": { + "X": 953.91323089499008, + "Y": 556.18788515317931, + "IsEmpty": false + }, + "Timestamp": 637316498186237390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.420889586, + "Position": { + "X": 953.91986217145279, + "Y": 556.18229194541755, + "IsEmpty": false + }, + "Timestamp": 637316498186596230, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "890c2d85-9b2d-42ae-829c-f7fc12c480a8", + "Points": [ + { + "Pressure": 0.0561379418, + "Position": { + "X": 905.68479508368034, + "Y": 657.99408227371191, + "IsEmpty": false + }, + "Timestamp": 637316498209030610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.1743038, + "Position": { + "X": 905.35321481529468, + "Y": 658.39277966591067, + "IsEmpty": false + }, + "Timestamp": 637316498209134250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.421377897, + "Position": { + "X": 904.57943209235009, + "Y": 659.39467468244516, + "IsEmpty": false + }, + "Timestamp": 637316498209872260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.453849077, + "Position": { + "X": 904.24678199831806, + "Y": 659.79209856950047, + "IsEmpty": false + }, + "Timestamp": 637316498210054890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.478507668, + "Position": { + "X": 903.52560926099034, + "Y": 660.68815775302642, + "IsEmpty": false + }, + "Timestamp": 637316498210327360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546379805, + "Position": { + "X": 902.74815743119359, + "Y": 661.68420437632722, + "IsEmpty": false + }, + "Timestamp": 637316498210723780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612542927, + "Position": { + "X": 903.13707048904394, + "Y": 661.18652681213712, + "IsEmpty": false + }, + "Timestamp": 637316498211425070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 903.85897504838692, + "Y": 660.29158473746122, + "IsEmpty": false + }, + "Timestamp": 637316498211569060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 905.35321481529468, + "Y": 658.39277966591067, + "IsEmpty": false + }, + "Timestamp": 637316498211867970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.72729075, + "Position": { + "X": 912.62847907060643, + "Y": 648.97509741945601, + "IsEmpty": false + }, + "Timestamp": 637316498212264620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 915.48801087072036, + "Y": 645.17000482032586, + "IsEmpty": false + }, + "Timestamp": 637316498212418080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.766842127, + "Position": { + "X": 924.35648147200777, + "Y": 632.9103956056357, + "IsEmpty": false + }, + "Timestamp": 637316498212750920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785397112, + "Position": { + "X": 930.90594816657222, + "Y": 623.4767908713626, + "IsEmpty": false + }, + "Timestamp": 637316498213092580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794918716, + "Position": { + "X": 935.61104539062387, + "Y": 616.50747987392174, + "IsEmpty": false + }, + "Timestamp": 637316498213403770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.800289929, + "Position": { + "X": 940.30789651915097, + "Y": 609.3221742905464, + "IsEmpty": false + }, + "Timestamp": 637316498213702610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804196239, + "Position": { + "X": 944.94377181936045, + "Y": 602.03757689500299, + "IsEmpty": false + }, + "Timestamp": 637316498214123760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806393504, + "Position": { + "X": 945.53193213837312, + "Y": 601.14799779722773, + "IsEmpty": false + }, + "Timestamp": 637316498214438740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583245575, + "Position": { + "X": 945.87939698783202, + "Y": 600.57890413565895, + "IsEmpty": false + }, + "Timestamp": 637316498214782110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583245575, + "Position": { + "X": 945.93321962983418, + "Y": 600.45487779900373, + "IsEmpty": false + }, + "Timestamp": 637316498214808170, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7c60b107-8148-4117-b74f-17b6bc166403", + "Points": [ + { + "Pressure": 0.34129855, + "Position": { + "X": 842.99437735992683, + "Y": 598.50954684655619, + "IsEmpty": false + }, + "Timestamp": 637316498345035510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.383779645, + "Position": { + "X": 842.32901075876816, + "Y": 598.39596049679767, + "IsEmpty": false + }, + "Timestamp": 637316498346078520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.494621187, + "Position": { + "X": 842.32691800744021, + "Y": 598.39578575886208, + "IsEmpty": false + }, + "Timestamp": 637316498346248100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534905016, + "Position": { + "X": 841.6615143185204, + "Y": 598.28180389604472, + "IsEmpty": false + }, + "Timestamp": 637316498347093610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571038365, + "Position": { + "X": 841.65942196817412, + "Y": 598.28162861234364, + "IsEmpty": false + }, + "Timestamp": 637316498347436990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.607904196, + "Position": { + "X": 842.99437735992683, + "Y": 598.50954684655619, + "IsEmpty": false + }, + "Timestamp": 637316498348444670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624017715, + "Position": { + "X": 844.99651131028656, + "Y": 598.84843974588603, + "IsEmpty": false + }, + "Timestamp": 637316498348623710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647211432, + "Position": { + "X": 847.6632687180919, + "Y": 599.29449626046426, + "IsEmpty": false + }, + "Timestamp": 637316498348781880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66259253, + "Position": { + "X": 850.33332289813848, + "Y": 599.7343782197446, + "IsEmpty": false + }, + "Timestamp": 637316498348955200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 855.66594437483252, + "Y": 600.59389289899855, + "IsEmpty": false + }, + "Timestamp": 637316498349124360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697505176, + "Position": { + "X": 859.6598210763442, + "Y": 601.22059631055117, + "IsEmpty": false + }, + "Timestamp": 637316498349291520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 862.98709927139021, + "Y": 601.73110532094779, + "IsEmpty": false + }, + "Timestamp": 637316498349460800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 866.31160149627215, + "Y": 602.23062707286476, + "IsEmpty": false + }, + "Timestamp": 637316498349630130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 870.95856597846569, + "Y": 602.9110148184734, + "IsEmpty": false + }, + "Timestamp": 637316498349797090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71532768, + "Position": { + "X": 873.61215270628793, + "Y": 603.28988858377465, + "IsEmpty": false + }, + "Timestamp": 637316498349972280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 876.26124377543817, + "Y": 603.66122564753141, + "IsEmpty": false + }, + "Timestamp": 637316498350132220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 878.25008480106942, + "Y": 603.9350803640757, + "IsEmpty": false + }, + "Timestamp": 637316498350303060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719722271, + "Position": { + "X": 882.21689860235813, + "Y": 604.46958293466764, + "IsEmpty": false + }, + "Timestamp": 637316498350477050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 884.19895265113996, + "Y": 604.73044368380374, + "IsEmpty": false + }, + "Timestamp": 637316498350644630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 886.17931664759033, + "Y": 604.98694554436224, + "IsEmpty": false + }, + "Timestamp": 637316498350808620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 888.15581963328952, + "Y": 605.23891567383362, + "IsEmpty": false + }, + "Timestamp": 637316498350977910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 890.79112354236406, + "Y": 605.56815385976734, + "IsEmpty": false + }, + "Timestamp": 637316498351150480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 892.10751450668045, + "Y": 605.72978857839462, + "IsEmpty": false + }, + "Timestamp": 637316498351318120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 893.42303922533233, + "Y": 605.88941876927004, + "IsEmpty": false + }, + "Timestamp": 637316498351485000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 895.39255405940571, + "Y": 606.12495288825858, + "IsEmpty": false + }, + "Timestamp": 637316498351660860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 898.01817117572955, + "Y": 606.43205159486536, + "IsEmpty": false + }, + "Timestamp": 637316498351830460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 898.67398609313329, + "Y": 606.507545425015, + "IsEmpty": false + }, + "Timestamp": 637316498351999900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 899.98489190343219, + "Y": 606.6569862619483, + "IsEmpty": false + }, + "Timestamp": 637316498352160510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 900.6399779990428, + "Y": 606.73093046657084, + "IsEmpty": false + }, + "Timestamp": 637316498352332440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 901.94940457797475, + "Y": 606.8772594427254, + "IsEmpty": false + }, + "Timestamp": 637316498352501130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 902.60374026401189, + "Y": 606.94964141209641, + "IsEmpty": false + }, + "Timestamp": 637316498352669830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 903.25782101623963, + "Y": 607.02149983422248, + "IsEmpty": false + }, + "Timestamp": 637316498352839780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 903.90953932123489, + "Y": 607.09271363601624, + "IsEmpty": false + }, + "Timestamp": 637316498353013830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 904.56310312668222, + "Y": 607.16352148052874, + "IsEmpty": false + }, + "Timestamp": 637316498353184470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 905.21640480827705, + "Y": 607.23380157653583, + "IsEmpty": false + }, + "Timestamp": 637316498353347520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 903.90953932123489, + "Y": 607.09271363601624, + "IsEmpty": false + }, + "Timestamp": 637316498354526070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 902.60374026401189, + "Y": 606.94964141209641, + "IsEmpty": false + }, + "Timestamp": 637316498354701720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 899.98489190343219, + "Y": 606.6569862619483, + "IsEmpty": false + }, + "Timestamp": 637316498354863360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 897.36211811501255, + "Y": 606.35604402503441, + "IsEmpty": false + }, + "Timestamp": 637316498355036000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730220497, + "Position": { + "X": 892.76328016317655, + "Y": 605.80972401590384, + "IsEmpty": false + }, + "Timestamp": 637316498355204830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 890.13260921468714, + "Y": 605.48658830524801, + "IsEmpty": false + }, + "Timestamp": 637316498355375370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 887.49648223550878, + "Y": 605.15537081101161, + "IsEmpty": false + }, + "Timestamp": 637316498355539630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 884.19895265113996, + "Y": 604.73044368380374, + "IsEmpty": false + }, + "Timestamp": 637316498355721040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734126806, + "Position": { + "X": 878.90989541630745, + "Y": 604.02523134628336, + "IsEmpty": false + }, + "Timestamp": 637316498355881420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739253819, + "Position": { + "X": 874.93805919757131, + "Y": 603.47655963687043, + "IsEmpty": false + }, + "Timestamp": 637316498356049570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741451144, + "Position": { + "X": 870.29691772447347, + "Y": 602.81530340380164, + "IsEmpty": false + }, + "Timestamp": 637316498356217170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741451144, + "Position": { + "X": 866.31160149627215, + "Y": 602.23062707286476, + "IsEmpty": false + }, + "Timestamp": 637316498356392240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745357454, + "Position": { + "X": 860.99104628164412, + "Y": 601.42610717708317, + "IsEmpty": false + }, + "Timestamp": 637316498356556390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745357454, + "Position": { + "X": 858.3281996886634, + "Y": 601.01335550427245, + "IsEmpty": false + }, + "Timestamp": 637316498356728710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 855.66594437483252, + "Y": 600.59389289899855, + "IsEmpty": false + }, + "Timestamp": 637316498356891060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 853.6667803055974, + "Y": 600.27471696782527, + "IsEmpty": false + }, + "Timestamp": 637316498357060630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749263763, + "Position": { + "X": 851.00015491517286, + "Y": 599.84327731726421, + "IsEmpty": false + }, + "Timestamp": 637316498357236090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.751216888, + "Position": { + "X": 848.99946485125099, + "Y": 599.51534281041393, + "IsEmpty": false + }, + "Timestamp": 637316498357401400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753170073, + "Position": { + "X": 848.33244361868287, + "Y": 599.40520930076377, + "IsEmpty": false + }, + "Timestamp": 637316498357573660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.755123198, + "Position": { + "X": 846.99822872850837, + "Y": 599.18371767689655, + "IsEmpty": false + }, + "Timestamp": 637316498357738710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761715114, + "Position": { + "X": 846.33103986818696, + "Y": 599.0723623648405, + "IsEmpty": false + }, + "Timestamp": 637316498357907480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.766597986, + "Position": { + "X": 845.66589459721683, + "Y": 598.9607745668651, + "IsEmpty": false + }, + "Timestamp": 637316498358081050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.772701621, + "Position": { + "X": 845.66379992923237, + "Y": 598.96060258747684, + "IsEmpty": false + }, + "Timestamp": 637316498358243170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776607931, + "Position": { + "X": 844.99860560670675, + "Y": 598.8486122809461, + "IsEmpty": false + }, + "Timestamp": 637316498358589100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776607931, + "Position": { + "X": 844.99651131028656, + "Y": 598.84843974588603, + "IsEmpty": false + }, + "Timestamp": 637316498358751200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776607931, + "Position": { + "X": 844.33127032896448, + "Y": 598.73604832989963, + "IsEmpty": false + }, + "Timestamp": 637316498358926990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.78466469, + "Position": { + "X": 844.32917640999221, + "Y": 598.73587524114873, + "IsEmpty": false + }, + "Timestamp": 637316498359091910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.780758381, + "Position": { + "X": 843.66389116263269, + "Y": 598.62308411480558, + "IsEmpty": false + }, + "Timestamp": 637316498360106110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6828565, + "Position": { + "X": 843.66179762699164, + "Y": 598.62291047434519, + "IsEmpty": false + }, + "Timestamp": 637316498360375740, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "99961b81-7833-4fb5-b25e-68df7bf41195", + "Points": [ + { + "Pressure": 0.0458838791, + "Position": { + "X": 874.20410013206128, + "Y": 577.58615776809688, + "IsEmpty": false + }, + "Timestamp": 637316498485759820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.165758759, + "Position": { + "X": 873.86408511928664, + "Y": 577.53719635239418, + "IsEmpty": false + }, + "Timestamp": 637316498486046880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.262439907, + "Position": { + "X": 873.52402585576192, + "Y": 577.51305515746731, + "IsEmpty": false + }, + "Timestamp": 637316498486159360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.313710243, + "Position": { + "X": 873.18393889517438, + "Y": 577.46385952532751, + "IsEmpty": false + }, + "Timestamp": 637316498486335980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.38158235, + "Position": { + "X": 872.50374586751195, + "Y": 577.39018724263042, + "IsEmpty": false + }, + "Timestamp": 637316498486499280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.555901408, + "Position": { + "X": 872.84390354603545, + "Y": 577.43961637207065, + "IsEmpty": false + }, + "Timestamp": 637316498487515380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577386141, + "Position": { + "X": 874.20410013206128, + "Y": 577.58615776809688, + "IsEmpty": false + }, + "Timestamp": 637316498487681860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.607904196, + "Position": { + "X": 876.24401295437656, + "Y": 577.80343815843298, + "IsEmpty": false + }, + "Timestamp": 637316498487852510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 878.96309195963102, + "Y": 578.08837584824084, + "IsEmpty": false + }, + "Timestamp": 637316498488023800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.654779911, + "Position": { + "X": 882.3604511012195, + "Y": 578.43678916041108, + "IsEmpty": false + }, + "Timestamp": 637316498488195980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673578978, + "Position": { + "X": 886.43282468230916, + "Y": 578.86545754745657, + "IsEmpty": false + }, + "Timestamp": 637316498488364950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693843007, + "Position": { + "X": 893.89250326819047, + "Y": 579.5757812109714, + "IsEmpty": false + }, + "Timestamp": 637316498488533550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704585314, + "Position": { + "X": 898.96895925646595, + "Y": 580.04425255853675, + "IsEmpty": false + }, + "Timestamp": 637316498488704390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713862836, + "Position": { + "X": 903.36165445827874, + "Y": 580.43339845658556, + "IsEmpty": false + }, + "Timestamp": 637316498488862110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718013287, + "Position": { + "X": 907.41289654034006, + "Y": 580.7695010449695, + "IsEmpty": false + }, + "Timestamp": 637316498489041350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 913.4723923854508, + "Y": 581.2627252659646, + "IsEmpty": false + }, + "Timestamp": 637316498489203560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 917.50785363212447, + "Y": 581.56244500894013, + "IsEmpty": false + }, + "Timestamp": 637316498489373770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 920.52598065746338, + "Y": 581.78438145205655, + "IsEmpty": false + }, + "Timestamp": 637316498489541080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725825906, + "Position": { + "X": 923.20866141634531, + "Y": 581.96841345621419, + "IsEmpty": false + }, + "Timestamp": 637316498489719100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725825906, + "Position": { + "X": 925.887993619952, + "Y": 582.14582211028778, + "IsEmpty": false + }, + "Timestamp": 637316498489883820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 926.8872171247599, + "Y": 582.21644002700828, + "IsEmpty": false + }, + "Timestamp": 637316498490053130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 928.2247920651555, + "Y": 582.30121193218554, + "IsEmpty": false + }, + "Timestamp": 637316498490218950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 928.89324195746076, + "Y": 582.3429654740479, + "IsEmpty": false + }, + "Timestamp": 637316498490390330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 929.56146389036849, + "Y": 582.38429602303268, + "IsEmpty": false + }, + "Timestamp": 637316498490563510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 929.89051147369958, + "Y": 582.41012775420222, + "IsEmpty": false + }, + "Timestamp": 637316498490903290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 930.2294556832768, + "Y": 582.4252025398448, + "IsEmpty": false + }, + "Timestamp": 637316498491240050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 930.55832308960612, + "Y": 582.4507367705653, + "IsEmpty": false + }, + "Timestamp": 637316498491407420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 930.89721515558358, + "Y": 582.46568398518889, + "IsEmpty": false + }, + "Timestamp": 637316498491572640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 931.22590115503374, + "Y": 582.49091999632424, + "IsEmpty": false + }, + "Timestamp": 637316498491746870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726802468, + "Position": { + "X": 931.89324348938101, + "Y": 582.53067639218352, + "IsEmpty": false + }, + "Timestamp": 637316498491910600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720210552, + "Position": { + "X": 932.23202841598436, + "Y": 582.54536750429315, + "IsEmpty": false + }, + "Timestamp": 637316498492253640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.69481957, + "Position": { + "X": 930.89721515558358, + "Y": 582.46568398518889, + "IsEmpty": false + }, + "Timestamp": 637316498493598900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 926.55728710457709, + "Y": 582.1891315806422, + "IsEmpty": false + }, + "Timestamp": 637316498493771410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 921.86773088390589, + "Y": 581.87722121571528, + "IsEmpty": false + }, + "Timestamp": 637316498493941560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685542047, + "Position": { + "X": 916.50319336378209, + "Y": 581.48158485053318, + "IsEmpty": false + }, + "Timestamp": 637316498494103050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685542047, + "Position": { + "X": 910.78461699724949, + "Y": 581.03890028150818, + "IsEmpty": false + }, + "Timestamp": 637316498494270970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 904.71266989825972, + "Y": 580.54697454535858, + "IsEmpty": false + }, + "Timestamp": 637316498494449150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708247483, + "Position": { + "X": 895.24741501080064, + "Y": 579.70019071670731, + "IsEmpty": false + }, + "Timestamp": 637316498494620240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 888.46848152037046, + "Y": 579.06351622771012, + "IsEmpty": false + }, + "Timestamp": 637316498494778150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 882.69941887360483, + "Y": 578.48264032101122, + "IsEmpty": false + }, + "Timestamp": 637316498494948600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 877.60367469108155, + "Y": 577.94659182441217, + "IsEmpty": false + }, + "Timestamp": 637316498495115780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 872.16373538348353, + "Y": 577.3658424512023, + "IsEmpty": false + }, + "Timestamp": 637316498495292790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 869.78254933340179, + "Y": 577.09216434144003, + "IsEmpty": false + }, + "Timestamp": 637316498495455820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 868.42172694069768, + "Y": 576.94116717873499, + "IsEmpty": false + }, + "Timestamp": 637316498495626070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727046609, + "Position": { + "X": 867.06077839064858, + "Y": 576.78885729377146, + "IsEmpty": false + }, + "Timestamp": 637316498495795740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73559165, + "Position": { + "X": 868.42172694069768, + "Y": 576.94116717873499, + "IsEmpty": false + }, + "Timestamp": 637316498496299280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737788975, + "Position": { + "X": 871.14322812394505, + "Y": 577.24184046752544, + "IsEmpty": false + }, + "Timestamp": 637316498496469890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7397421, + "Position": { + "X": 873.86408511928664, + "Y": 577.53719635239418, + "IsEmpty": false + }, + "Timestamp": 637316498496645220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741695285, + "Position": { + "X": 876.24401295437656, + "Y": 577.80343815843298, + "IsEmpty": false + }, + "Timestamp": 637316498496807120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741695285, + "Position": { + "X": 878.28341497417682, + "Y": 578.01765556124292, + "IsEmpty": false + }, + "Timestamp": 637316498496974870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741695285, + "Position": { + "X": 879.98201560482823, + "Y": 578.20557275273814, + "IsEmpty": false + }, + "Timestamp": 637316498497151930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619378984, + "Position": { + "X": 880.66147520661025, + "Y": 578.2753616143832, + "IsEmpty": false + }, + "Timestamp": 637316498497320650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619378984, + "Position": { + "X": 879.64270346684236, + "Y": 578.158751646111, + "IsEmpty": false + }, + "Timestamp": 637316498497605380, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "b2c5bfba-d3e1-4f8c-8772-19f082c56c41", + "Points": [ + { + "Pressure": 0.189929038, + "Position": { + "X": 927.99676908781544, + "Y": 583.64735600110339, + "IsEmpty": false + }, + "Timestamp": 637316498511825630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.204577699, + "Position": { + "X": 927.99676908781544, + "Y": 583.52162357922839, + "IsEmpty": false + }, + "Timestamp": 637316498512020820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.273670554, + "Position": { + "X": 927.99676908781544, + "Y": 583.27010990735334, + "IsEmpty": false + }, + "Timestamp": 637316498512186150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.339101255, + "Position": { + "X": 927.99676908781544, + "Y": 582.95570561047839, + "IsEmpty": false + }, + "Timestamp": 637316498512352170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.485832006, + "Position": { + "X": 927.99676908781544, + "Y": 582.35834232922832, + "IsEmpty": false + }, + "Timestamp": 637316498512691730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532951832, + "Position": { + "X": 927.99676908781544, + "Y": 582.20116459485337, + "IsEmpty": false + }, + "Timestamp": 637316498512869140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.555168986, + "Position": { + "X": 927.99676908781544, + "Y": 582.04393803235337, + "IsEmpty": false + }, + "Timestamp": 637316498513029670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.603753746, + "Position": { + "X": 927.99676908781544, + "Y": 581.8867602979783, + "IsEmpty": false + }, + "Timestamp": 637316498513205870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640131235, + "Position": { + "X": 927.99676908781544, + "Y": 581.79242436047832, + "IsEmpty": false + }, + "Timestamp": 637316498513367790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 927.99676908781544, + "Y": 582.10682865735339, + "IsEmpty": false + }, + "Timestamp": 637316498513712100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.666254699, + "Position": { + "X": 927.99676908781544, + "Y": 583.0185962354783, + "IsEmpty": false + }, + "Timestamp": 637316498513874970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687983513, + "Position": { + "X": 927.99676908781544, + "Y": 584.5591235792283, + "IsEmpty": false + }, + "Timestamp": 637316498514057530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702632189, + "Position": { + "X": 927.99676908781544, + "Y": 585.75385014172832, + "IsEmpty": false + }, + "Timestamp": 637316498514214320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714839399, + "Position": { + "X": 927.99676908781544, + "Y": 587.23153568860334, + "IsEmpty": false + }, + "Timestamp": 637316498514380430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 927.99676908781544, + "Y": 589.21224857922834, + "IsEmpty": false + }, + "Timestamp": 637316498514555150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737788975, + "Position": { + "X": 927.99676908781544, + "Y": 593.39374271985332, + "IsEmpty": false + }, + "Timestamp": 637316498514724320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746822298, + "Position": { + "X": 927.99676908781544, + "Y": 596.75780521985337, + "IsEmpty": false + }, + "Timestamp": 637316498514891400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756588101, + "Position": { + "X": 927.99676908781544, + "Y": 599.74457279797832, + "IsEmpty": false + }, + "Timestamp": 637316498515057820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.765865564, + "Position": { + "X": 927.99676908781544, + "Y": 602.92001225110334, + "IsEmpty": false + }, + "Timestamp": 637316498515232330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776607931, + "Position": { + "X": 927.99676908781544, + "Y": 608.23334232922832, + "IsEmpty": false + }, + "Timestamp": 637316498515403010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781490803, + "Position": { + "X": 927.99676908781544, + "Y": 611.91180912610332, + "IsEmpty": false + }, + "Timestamp": 637316498515571760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786861956, + "Position": { + "X": 927.99676908781544, + "Y": 615.46454350110332, + "IsEmpty": false + }, + "Timestamp": 637316498515734550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791500747, + "Position": { + "X": 927.99676908781544, + "Y": 619.11156498547837, + "IsEmpty": false + }, + "Timestamp": 637316498515910070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793453872, + "Position": { + "X": 927.99676908781544, + "Y": 623.98470951672834, + "IsEmpty": false + }, + "Timestamp": 637316498516081260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795407057, + "Position": { + "X": 927.99676908781544, + "Y": 626.53134037610334, + "IsEmpty": false + }, + "Timestamp": 637316498516248680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797360182, + "Position": { + "X": 927.99676908781544, + "Y": 628.88934818860332, + "IsEmpty": false + }, + "Timestamp": 637316498516409630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799313366, + "Position": { + "X": 927.99676908781544, + "Y": 631.05868412610334, + "IsEmpty": false + }, + "Timestamp": 637316498516582560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803219676, + "Position": { + "X": 927.99676908781544, + "Y": 633.76254154797834, + "IsEmpty": false + }, + "Timestamp": 637316498516753650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.805172801, + "Position": { + "X": 927.99676908781544, + "Y": 634.86293217297839, + "IsEmpty": false + }, + "Timestamp": 637316498516919480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.807370126, + "Position": { + "X": 927.99676908781544, + "Y": 635.02010990735334, + "IsEmpty": false + }, + "Timestamp": 637316498517085470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.830319703, + "Position": { + "X": 927.99676908781544, + "Y": 633.82538334485332, + "IsEmpty": false + }, + "Timestamp": 637316498517433800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.835202575, + "Position": { + "X": 927.99676908781544, + "Y": 631.59315678235339, + "IsEmpty": false + }, + "Timestamp": 637316498517598650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840085447, + "Position": { + "X": 927.99676908781544, + "Y": 628.10336186047834, + "IsEmpty": false + }, + "Timestamp": 637316498517764100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842282772, + "Position": { + "X": 927.99676908781544, + "Y": 623.70175053235334, + "IsEmpty": false + }, + "Timestamp": 637316498517931770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.844235897, + "Position": { + "X": 927.99676908781544, + "Y": 615.59027592297832, + "IsEmpty": false + }, + "Timestamp": 637316498518105830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.844235897, + "Position": { + "X": 927.99676908781544, + "Y": 609.93109623547832, + "IsEmpty": false + }, + "Timestamp": 637316498518276120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.844235897, + "Position": { + "X": 927.99676908781544, + "Y": 603.17152592297839, + "IsEmpty": false + }, + "Timestamp": 637316498518444950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.846189082, + "Position": { + "X": 927.99676908781544, + "Y": 596.4434009229783, + "IsEmpty": false + }, + "Timestamp": 637316498518607840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.846189082, + "Position": { + "X": 927.99676908781544, + "Y": 588.14330326672837, + "IsEmpty": false + }, + "Timestamp": 637316498518776810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.844235897, + "Position": { + "X": 927.99676908781544, + "Y": 584.49623295422839, + "IsEmpty": false + }, + "Timestamp": 637316498518944060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842282772, + "Position": { + "X": 927.99676908781544, + "Y": 581.28939701672834, + "IsEmpty": false + }, + "Timestamp": 637316498519115330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842282772, + "Position": { + "X": 927.99676908781544, + "Y": 579.21434818860337, + "IsEmpty": false + }, + "Timestamp": 637316498519287140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.305409312, + "Position": { + "X": 927.99676908781544, + "Y": 577.86244389172839, + "IsEmpty": false + }, + "Timestamp": 637316498519459690, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "02cf5826-02c6-4417-9d4a-0d4793030446", + "Points": [ + { + "Pressure": 0.160143435, + "Position": { + "X": 849.76333402922171, + "Y": 596.91503178235337, + "IsEmpty": false + }, + "Timestamp": 637316498585263720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.223376825, + "Position": { + "X": 849.70024809172173, + "Y": 597.19799076672837, + "IsEmpty": false + }, + "Timestamp": 637316498585689250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.257068753, + "Position": { + "X": 849.63716215422176, + "Y": 597.41805912610334, + "IsEmpty": false + }, + "Timestamp": 637316498585861660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.283192188, + "Position": { + "X": 849.60559477140919, + "Y": 597.66957279797839, + "IsEmpty": false + }, + "Timestamp": 637316498586039120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.310780495, + "Position": { + "X": 849.60559477140919, + "Y": 597.92108646985332, + "IsEmpty": false + }, + "Timestamp": 637316498586201610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.343739986, + "Position": { + "X": 849.54250883390921, + "Y": 598.10970951672834, + "IsEmpty": false + }, + "Timestamp": 637316498586372450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.382803082, + "Position": { + "X": 849.35322660734676, + "Y": 598.04686771985337, + "IsEmpty": false + }, + "Timestamp": 637316498586705670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.397207588, + "Position": { + "X": 849.06931547453428, + "Y": 597.98397709485334, + "IsEmpty": false + }, + "Timestamp": 637316498586871290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.403067052, + "Position": { + "X": 848.69077543547178, + "Y": 597.70101811047834, + "IsEmpty": false + }, + "Timestamp": 637316498587044370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.405508518, + "Position": { + "X": 848.46995024015928, + "Y": 597.63812748547832, + "IsEmpty": false + }, + "Timestamp": 637316498587223810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.407461673, + "Position": { + "X": 848.24914945890919, + "Y": 597.54379154797834, + "IsEmpty": false + }, + "Timestamp": 637316498587387590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.48754102, + "Position": { + "X": 848.50149320890921, + "Y": 597.60668217297837, + "IsEmpty": false + }, + "Timestamp": 637316498588064760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.502433836, + "Position": { + "X": 849.29014066984678, + "Y": 597.95253178235339, + "IsEmpty": false + }, + "Timestamp": 637316498588230440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513420284, + "Position": { + "X": 849.47942289640923, + "Y": 598.07831303235332, + "IsEmpty": false + }, + "Timestamp": 637316498588395790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528557241, + "Position": { + "X": 849.73179106047178, + "Y": 598.0154224073533, + "IsEmpty": false + }, + "Timestamp": 637316498588733840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530510426, + "Position": { + "X": 849.85796293547173, + "Y": 597.82675053235334, + "IsEmpty": false + }, + "Timestamp": 637316498588910980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 849.92107328703423, + "Y": 597.63812748547832, + "IsEmpty": false + }, + "Timestamp": 637316498589070840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533684313, + "Position": { + "X": 849.92107328703423, + "Y": 597.22943607922832, + "IsEmpty": false + }, + "Timestamp": 637316498589241460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533684313, + "Position": { + "X": 849.95261625578428, + "Y": 596.82069584485339, + "IsEmpty": false + }, + "Timestamp": 637316498589410870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533684313, + "Position": { + "X": 849.85796293547173, + "Y": 596.63207279797837, + "IsEmpty": false + }, + "Timestamp": 637316498589580880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54052031, + "Position": { + "X": 850.93052152922178, + "Y": 597.13510014172834, + "IsEmpty": false + }, + "Timestamp": 637316498590087580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.549065411, + "Position": { + "X": 852.03462309172176, + "Y": 597.98397709485334, + "IsEmpty": false + }, + "Timestamp": 637316498590257870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554924846, + "Position": { + "X": 852.25544828703426, + "Y": 598.1411548292283, + "IsEmpty": false + }, + "Timestamp": 637316498590423930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558831155, + "Position": { + "X": 852.69709867765926, + "Y": 598.4241138136033, + "IsEmpty": false + }, + "Timestamp": 637316498590602040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 852.44473051359671, + "Y": 597.79535404797832, + "IsEmpty": false + }, + "Timestamp": 637316498590930290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56493479, + "Position": { + "X": 851.84534086515919, + "Y": 596.82069584485339, + "IsEmpty": false + }, + "Timestamp": 637316498591098690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566887915, + "Position": { + "X": 851.49834379484673, + "Y": 596.22333256360332, + "IsEmpty": false + }, + "Timestamp": 637316498591268610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566887915, + "Position": { + "X": 851.40371488859671, + "Y": 595.81464115735332, + "IsEmpty": false + }, + "Timestamp": 637316498591447010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566887915, + "Position": { + "X": 851.71916899015923, + "Y": 595.84603764172834, + "IsEmpty": false + }, + "Timestamp": 637316498591775360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566887915, + "Position": { + "X": 852.88635649015919, + "Y": 596.50629154797832, + "IsEmpty": false + }, + "Timestamp": 637316498591945350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5688411, + "Position": { + "X": 855.09455961515926, + "Y": 597.95253178235339, + "IsEmpty": false + }, + "Timestamp": 637316498592120510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570794225, + "Position": { + "X": 856.29329008390926, + "Y": 598.73851811047837, + "IsEmpty": false + }, + "Timestamp": 637316498592290600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572747409, + "Position": { + "X": 856.98730863859669, + "Y": 599.11581303235334, + "IsEmpty": false + }, + "Timestamp": 637316498592452800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572747409, + "Position": { + "X": 857.20813383390919, + "Y": 599.17870365735337, + "IsEmpty": false + }, + "Timestamp": 637316498592624020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.578606844, + "Position": { + "X": 857.05039457609678, + "Y": 598.32982670422837, + "IsEmpty": false + }, + "Timestamp": 637316498592793220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.580560029, + "Position": { + "X": 856.23020414640928, + "Y": 597.04076420422837, + "IsEmpty": false + }, + "Timestamp": 637316498592964360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.580560029, + "Position": { + "X": 855.12610258390919, + "Y": 595.68885990735339, + "IsEmpty": false + }, + "Timestamp": 637316498593124740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.580560029, + "Position": { + "X": 854.14819731047169, + "Y": 594.52557865735332, + "IsEmpty": false + }, + "Timestamp": 637316498593301650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.580560029, + "Position": { + "X": 853.64346098234671, + "Y": 593.95966068860332, + "IsEmpty": false + }, + "Timestamp": 637316498593472530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.580560029, + "Position": { + "X": 853.89582914640926, + "Y": 593.95966068860332, + "IsEmpty": false + }, + "Timestamp": 637316498593810910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582513154, + "Position": { + "X": 855.06301664640921, + "Y": 594.65135990735337, + "IsEmpty": false + }, + "Timestamp": 637316498593975400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582513154, + "Position": { + "X": 856.79802641203423, + "Y": 596.09760014172832, + "IsEmpty": false + }, + "Timestamp": 637316498594142470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584466338, + "Position": { + "X": 858.40686430265919, + "Y": 597.4495044386033, + "IsEmpty": false + }, + "Timestamp": 637316498594315420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584466338, + "Position": { + "X": 859.25859770109673, + "Y": 598.2983813917283, + "IsEmpty": false + }, + "Timestamp": 637316498594480580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584466338, + "Position": { + "X": 859.44787992765919, + "Y": 598.45555912610337, + "IsEmpty": false + }, + "Timestamp": 637316498594649460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 859.32168363859671, + "Y": 597.48094975110337, + "IsEmpty": false + }, + "Timestamp": 637316498594988560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 858.53306059172178, + "Y": 596.25477787610339, + "IsEmpty": false + }, + "Timestamp": 637316498595155310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 857.55513090422176, + "Y": 594.99716068860334, + "IsEmpty": false + }, + "Timestamp": 637316498595324310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 856.86113676359673, + "Y": 594.11688725110332, + "IsEmpty": false + }, + "Timestamp": 637316498595498530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588372648, + "Position": { + "X": 856.70339750578421, + "Y": 593.95966068860332, + "IsEmpty": false + }, + "Timestamp": 637316498595661930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.590325773, + "Position": { + "X": 857.90212797453421, + "Y": 594.93431889172837, + "IsEmpty": false + }, + "Timestamp": 637316498595999260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.590325773, + "Position": { + "X": 859.85796293547173, + "Y": 597.10365482922839, + "IsEmpty": false + }, + "Timestamp": 637316498596172840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592278957, + "Position": { + "X": 861.21443266203426, + "Y": 598.76996342297832, + "IsEmpty": false + }, + "Timestamp": 637316498596336140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592278957, + "Position": { + "X": 862.91789945890923, + "Y": 600.53060795422834, + "IsEmpty": false + }, + "Timestamp": 637316498596506410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594232082, + "Position": { + "X": 864.33745512297173, + "Y": 601.75673100110339, + "IsEmpty": false + }, + "Timestamp": 637316498596684600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594232082, + "Position": { + "X": 864.84219145109671, + "Y": 602.07113529797834, + "IsEmpty": false + }, + "Timestamp": 637316498596843110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596185267, + "Position": { + "X": 864.84219145109671, + "Y": 601.75673100110339, + "IsEmpty": false + }, + "Timestamp": 637316498597013730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600091577, + "Position": { + "X": 864.02200102140921, + "Y": 600.2790942823533, + "IsEmpty": false + }, + "Timestamp": 637316498597191650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600091577, + "Position": { + "X": 862.88635649015919, + "Y": 598.45555912610337, + "IsEmpty": false + }, + "Timestamp": 637316498597355400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600091577, + "Position": { + "X": 861.34062895109673, + "Y": 595.94037357922832, + "IsEmpty": false + }, + "Timestamp": 637316498597529040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600091577, + "Position": { + "X": 860.58352445890921, + "Y": 594.71420170422834, + "IsEmpty": false + }, + "Timestamp": 637316498597691490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600091577, + "Position": { + "X": 860.42578520109669, + "Y": 594.3369556104783, + "IsEmpty": false + }, + "Timestamp": 637316498597867920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602044702, + "Position": { + "X": 861.46680082609669, + "Y": 595.12294193860339, + "IsEmpty": false + }, + "Timestamp": 637316498598205230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602044702, + "Position": { + "X": 862.57090238859678, + "Y": 596.47484623547837, + "IsEmpty": false + }, + "Timestamp": 637316498598365450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602044702, + "Position": { + "X": 864.05354399015926, + "Y": 598.07831303235332, + "IsEmpty": false + }, + "Timestamp": 637316498598533120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.603997886, + "Position": { + "X": 865.44155668547171, + "Y": 599.52450443860334, + "IsEmpty": false + }, + "Timestamp": 637316498598709620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605951011, + "Position": { + "X": 867.42895902922169, + "Y": 600.93929936047834, + "IsEmpty": false + }, + "Timestamp": 637316498598881060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605951011, + "Position": { + "X": 867.96521391203419, + "Y": 601.15941654797837, + "IsEmpty": false + }, + "Timestamp": 637316498599047560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610345602, + "Position": { + "X": 868.15449613859676, + "Y": 601.15941654797837, + "IsEmpty": false + }, + "Timestamp": 637316498599211650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615960956, + "Position": { + "X": 867.96521391203419, + "Y": 600.1218677198533, + "IsEmpty": false + }, + "Timestamp": 637316498599388020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.618402362, + "Position": { + "X": 866.04094633390923, + "Y": 597.51239506360332, + "IsEmpty": false + }, + "Timestamp": 637316498599555040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.618402362, + "Position": { + "X": 864.77910551359673, + "Y": 595.72030521985334, + "IsEmpty": false + }, + "Timestamp": 637316498599722900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.618402362, + "Position": { + "X": 863.70654691984669, + "Y": 594.3369556104783, + "IsEmpty": false + }, + "Timestamp": 637316498599887960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620355546, + "Position": { + "X": 863.01255277922178, + "Y": 593.55096928235332, + "IsEmpty": false + }, + "Timestamp": 637316498600066390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622308671, + "Position": { + "X": 863.58037504484673, + "Y": 593.86532475110334, + "IsEmpty": false + }, + "Timestamp": 637316498600564460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624261856, + "Position": { + "X": 864.81064848234678, + "Y": 594.99716068860334, + "IsEmpty": false + }, + "Timestamp": 637316498600730880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628168166, + "Position": { + "X": 867.14504789640921, + "Y": 597.38661381360339, + "IsEmpty": false + }, + "Timestamp": 637316498600907030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630121291, + "Position": { + "X": 868.84851469328419, + "Y": 598.89574467297837, + "IsEmpty": false + }, + "Timestamp": 637316498601068670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630121291, + "Position": { + "X": 870.23652738859676, + "Y": 600.09042240735334, + "IsEmpty": false + }, + "Timestamp": 637316498601238030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630121291, + "Position": { + "X": 871.05671781828426, + "Y": 600.6877856886033, + "IsEmpty": false + }, + "Timestamp": 637316498601409360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 871.27751859953423, + "Y": 600.81356693860334, + "IsEmpty": false + }, + "Timestamp": 637316498601587370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.634515882, + "Position": { + "X": 870.99360746672176, + "Y": 599.96468998547834, + "IsEmpty": false + }, + "Timestamp": 637316498601744960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 869.70024809172173, + "Y": 598.0154224073533, + "IsEmpty": false + }, + "Timestamp": 637316498601918090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 867.68130277922171, + "Y": 595.65741459485332, + "IsEmpty": false + }, + "Timestamp": 637316498602091420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 865.12610258390919, + "Y": 592.95360600110337, + "IsEmpty": false + }, + "Timestamp": 637316498602259130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 863.99045805265928, + "Y": 592.01039311047839, + "IsEmpty": false + }, + "Timestamp": 637316498602420840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 863.83274320890928, + "Y": 591.85321537610332, + "IsEmpty": false + }, + "Timestamp": 637316498602593330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 864.90527738859669, + "Y": 592.51342045422837, + "IsEmpty": false + }, + "Timestamp": 637316498602932320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 866.32485746672171, + "Y": 593.83392826672832, + "IsEmpty": false + }, + "Timestamp": 637316498603097480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 868.43840727140923, + "Y": 595.7517505323533, + "IsEmpty": false + }, + "Timestamp": 637316498603270230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 870.58352445890921, + "Y": 597.8581958448533, + "IsEmpty": false + }, + "Timestamp": 637316498603443180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 873.26492094328421, + "Y": 600.5620532667283, + "IsEmpty": false + }, + "Timestamp": 637316498603603830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 874.58982328703428, + "Y": 601.8196216261033, + "IsEmpty": false + }, + "Timestamp": 637316498603783200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 875.09455961515926, + "Y": 602.19691654797839, + "IsEmpty": false + }, + "Timestamp": 637316498603950220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 874.08508695890919, + "Y": 600.21620365735339, + "IsEmpty": false + }, + "Timestamp": 637316498604290620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 872.53935941984673, + "Y": 597.79535404797832, + "IsEmpty": false + }, + "Timestamp": 637316498604459540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 870.11033109953428, + "Y": 594.68280521985332, + "IsEmpty": false + }, + "Timestamp": 637316498604623120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 867.39739164640923, + "Y": 592.13617436047832, + "IsEmpty": false + }, + "Timestamp": 637316498604789430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 864.55828031828423, + "Y": 589.77816654797834, + "IsEmpty": false + }, + "Timestamp": 637316498604962570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 863.64346098234671, + "Y": 589.05507084485339, + "IsEmpty": false + }, + "Timestamp": 637316498605127800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 865.31538481047176, + "Y": 590.53270756360337, + "IsEmpty": false + }, + "Timestamp": 637316498605474750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 867.39739164640923, + "Y": 592.26190678235332, + "IsEmpty": false + }, + "Timestamp": 637316498605642560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 870.04724516203419, + "Y": 594.58846928235334, + "IsEmpty": false + }, + "Timestamp": 637316498605801230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 872.57090238859678, + "Y": 597.04076420422837, + "IsEmpty": false + }, + "Timestamp": 637316498605978930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 874.46365141203421, + "Y": 598.9900317823533, + "IsEmpty": false + }, + "Timestamp": 637316498606140030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652826726, + "Position": { + "X": 876.54565824797169, + "Y": 601.09652592297834, + "IsEmpty": false + }, + "Timestamp": 637316498606308470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.654779911, + "Position": { + "X": 876.95576566984676, + "Y": 601.50521732922834, + "IsEmpty": false + }, + "Timestamp": 637316498606475790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663080812, + "Position": { + "X": 876.04094633390923, + "Y": 599.77606693860332, + "IsEmpty": false + }, + "Timestamp": 637316498606819790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663080812, + "Position": { + "X": 874.33745512297173, + "Y": 596.69491459485334, + "IsEmpty": false + }, + "Timestamp": 637316498606987630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665033937, + "Position": { + "X": 872.53935941984673, + "Y": 593.99110600110339, + "IsEmpty": false + }, + "Timestamp": 637316498607154050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665033937, + "Position": { + "X": 870.93052152922178, + "Y": 592.01039311047839, + "IsEmpty": false + }, + "Timestamp": 637316498607327420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665033937, + "Position": { + "X": 869.63713774015923, + "Y": 590.62704350110334, + "IsEmpty": false + }, + "Timestamp": 637316498607489320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665033937, + "Position": { + "X": 868.94314359953421, + "Y": 589.8096118604783, + "IsEmpty": false + }, + "Timestamp": 637316498607666490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665033937, + "Position": { + "X": 869.76333402922171, + "Y": 590.24974857922837, + "IsEmpty": false + }, + "Timestamp": 637316498608005630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.666987121, + "Position": { + "X": 872.72864164640919, + "Y": 592.82782475110332, + "IsEmpty": false + }, + "Timestamp": 637316498608165420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.666987121, + "Position": { + "X": 875.22075590422173, + "Y": 595.53168217297832, + "IsEmpty": false + }, + "Timestamp": 637316498608338730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.666987121, + "Position": { + "X": 877.71287016203428, + "Y": 598.39266850110334, + "IsEmpty": false + }, + "Timestamp": 637316498608503030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.666987121, + "Position": { + "X": 880.26807035734669, + "Y": 600.6877856886033, + "IsEmpty": false + }, + "Timestamp": 637316498608677080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.666987121, + "Position": { + "X": 882.47627348234676, + "Y": 602.13402592297837, + "IsEmpty": false + }, + "Timestamp": 637316498608841110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668940246, + "Position": { + "X": 883.51726469328423, + "Y": 602.69994389172837, + "IsEmpty": false + }, + "Timestamp": 637316498609020320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668940246, + "Position": { + "X": 883.51726469328423, + "Y": 602.19691654797839, + "IsEmpty": false + }, + "Timestamp": 637316498609182600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668940246, + "Position": { + "X": 882.16081938078423, + "Y": 600.15331303235337, + "IsEmpty": false + }, + "Timestamp": 637316498609345750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668940246, + "Position": { + "X": 878.94314359953421, + "Y": 596.3176685011033, + "IsEmpty": false + }, + "Timestamp": 637316498609525540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668940246, + "Position": { + "X": 875.28384184172171, + "Y": 592.10472904797837, + "IsEmpty": false + }, + "Timestamp": 637316498609695530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668940246, + "Position": { + "X": 872.31853422453423, + "Y": 589.14935795422832, + "IsEmpty": false + }, + "Timestamp": 637316498609857000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668940246, + "Position": { + "X": 870.29961332609673, + "Y": 587.07435795422839, + "IsEmpty": false + }, + "Timestamp": 637316498610035120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668940246, + "Position": { + "X": 869.06931547453428, + "Y": 586.00536381360337, + "IsEmpty": false + }, + "Timestamp": 637316498610196050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668940246, + "Position": { + "X": 870.29961332609673, + "Y": 587.23153568860334, + "IsEmpty": false + }, + "Timestamp": 637316498610538100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670893431, + "Position": { + "X": 872.66553129484669, + "Y": 589.49520756360334, + "IsEmpty": false + }, + "Timestamp": 637316498610699680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670893431, + "Position": { + "X": 877.14504789640921, + "Y": 593.8967700636033, + "IsEmpty": false + }, + "Timestamp": 637316498610876580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 880.17341703703426, + "Y": 596.75780521985337, + "IsEmpty": false + }, + "Timestamp": 637316498611048950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 882.72864164640919, + "Y": 598.9900317823533, + "IsEmpty": false + }, + "Timestamp": 637316498611208450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 884.40056547453423, + "Y": 600.34193607922839, + "IsEmpty": false + }, + "Timestamp": 637316498611377710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 884.87373441984676, + "Y": 600.65634037610334, + "IsEmpty": false + }, + "Timestamp": 637316498611556550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 884.58982328703428, + "Y": 599.96468998547834, + "IsEmpty": false + }, + "Timestamp": 637316498611724540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 882.88635649015919, + "Y": 597.66957279797839, + "IsEmpty": false + }, + "Timestamp": 637316498611884150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 879.95261625578428, + "Y": 594.49413334485337, + "IsEmpty": false + }, + "Timestamp": 637316498612051560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 875.34692777922169, + "Y": 589.6523852979783, + "IsEmpty": false + }, + "Timestamp": 637316498612223710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 872.79172758390928, + "Y": 586.85424076672837, + "IsEmpty": false + }, + "Timestamp": 637316498612400720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 871.08826078703419, + "Y": 584.81068607922839, + "IsEmpty": false + }, + "Timestamp": 637316498612567740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 870.29961332609673, + "Y": 584.02465092297837, + "IsEmpty": false + }, + "Timestamp": 637316498612729330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 870.48889555265919, + "Y": 584.18187748547837, + "IsEmpty": false + }, + "Timestamp": 637316498612898810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 871.93999418547173, + "Y": 585.65956303235339, + "IsEmpty": false + }, + "Timestamp": 637316498613072530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 874.52673734953419, + "Y": 588.45770756360332, + "IsEmpty": false + }, + "Timestamp": 637316498613235730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 878.21758207609673, + "Y": 592.0732837354783, + "IsEmpty": false + }, + "Timestamp": 637316498613410930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 884.55828031828423, + "Y": 597.41805912610334, + "IsEmpty": false + }, + "Timestamp": 637316498613582250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 887.83904203703423, + "Y": 600.59349857922837, + "IsEmpty": false + }, + "Timestamp": 637316498613748910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 890.48889555265919, + "Y": 602.98290287610337, + "IsEmpty": false + }, + "Timestamp": 637316498613919780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 891.68762602140919, + "Y": 603.9575610792283, + "IsEmpty": false + }, + "Timestamp": 637316498614086710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 891.81379789640926, + "Y": 603.86322514172832, + "IsEmpty": false + }, + "Timestamp": 637316498614252120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 890.45732816984673, + "Y": 602.00829350110337, + "IsEmpty": false + }, + "Timestamp": 637316498614423740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 888.15449613859676, + "Y": 598.7070727979783, + "IsEmpty": false + }, + "Timestamp": 637316498614588060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 885.12610258390919, + "Y": 594.87142826672834, + "IsEmpty": false + }, + "Timestamp": 637316498614765980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 880.07878813078423, + "Y": 590.31263920422839, + "IsEmpty": false + }, + "Timestamp": 637316498614926990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 877.49204496672178, + "Y": 588.14330326672837, + "IsEmpty": false + }, + "Timestamp": 637316498615098420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 876.00937895109678, + "Y": 586.63417240735339, + "IsEmpty": false + }, + "Timestamp": 637316498615263880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 875.63083891203428, + "Y": 586.19403568860332, + "IsEmpty": false + }, + "Timestamp": 637316498615437260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 876.51411527922176, + "Y": 587.2629810011033, + "IsEmpty": false + }, + "Timestamp": 637316498615608840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 879.03777250578423, + "Y": 589.49520756360334, + "IsEmpty": false + }, + "Timestamp": 637316498615775400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 882.98100981047173, + "Y": 592.60775639172834, + "IsEmpty": false + }, + "Timestamp": 637316498615938770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 887.23967680265923, + "Y": 596.78925053235332, + "IsEmpty": false + }, + "Timestamp": 637316498616117180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 893.64346098234671, + "Y": 602.47987553235339, + "IsEmpty": false + }, + "Timestamp": 637316498616281670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 897.23967680265923, + "Y": 604.8064380323533, + "IsEmpty": false + }, + "Timestamp": 637316498616457430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 899.22705473234669, + "Y": 605.96971928235337, + "IsEmpty": false + }, + "Timestamp": 637316498616616430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 899.44787992765919, + "Y": 605.84393803235332, + "IsEmpty": false + }, + "Timestamp": 637316498616794440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 897.61821684172173, + "Y": 603.45448490735339, + "IsEmpty": false + }, + "Timestamp": 637316498616962960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 891.78225492765921, + "Y": 596.94647709485332, + "IsEmpty": false + }, + "Timestamp": 637316498617126200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 887.01885160734673, + "Y": 591.94750248547837, + "IsEmpty": false + }, + "Timestamp": 637316498617289520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 881.93999418547173, + "Y": 587.6716724073533, + "IsEmpty": false + }, + "Timestamp": 637316498617468890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671381712, + "Position": { + "X": 877.30276274015921, + "Y": 583.39589115735339, + "IsEmpty": false + }, + "Timestamp": 637316498617634340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669428527, + "Position": { + "X": 876.19866117765923, + "Y": 582.20116459485337, + "IsEmpty": false + }, + "Timestamp": 637316498617804360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671381712, + "Position": { + "X": 877.74441313078421, + "Y": 584.05609623547832, + "IsEmpty": false + }, + "Timestamp": 637316498618140300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673334837, + "Position": { + "X": 883.70654691984669, + "Y": 589.27513920422837, + "IsEmpty": false + }, + "Timestamp": 637316498618314500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675288022, + "Position": { + "X": 888.59614652922176, + "Y": 593.86532475110334, + "IsEmpty": false + }, + "Timestamp": 637316498618474010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677241147, + "Position": { + "X": 893.42263578703421, + "Y": 598.48700443860332, + "IsEmpty": false + }, + "Timestamp": 637316498618640670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677241147, + "Position": { + "X": 897.96521391203419, + "Y": 602.19691654797839, + "IsEmpty": false + }, + "Timestamp": 637316498618816750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677241147, + "Position": { + "X": 901.93999418547173, + "Y": 605.4980884229783, + "IsEmpty": false + }, + "Timestamp": 637316498618985690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677241147, + "Position": { + "X": 902.19236234953428, + "Y": 605.68676029797837, + "IsEmpty": false + }, + "Timestamp": 637316498619154560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677241147, + "Position": { + "X": 900.96206449797171, + "Y": 604.05184818860334, + "IsEmpty": false + }, + "Timestamp": 637316498619316810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 897.74441313078421, + "Y": 600.49916264172839, + "IsEmpty": false + }, + "Timestamp": 637316498619485790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 891.21443266203426, + "Y": 593.92821537610337, + "IsEmpty": false + }, + "Timestamp": 637316498619663500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 887.27121977140928, + "Y": 590.34408451672834, + "IsEmpty": false + }, + "Timestamp": 637316498619836490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 884.52673734953419, + "Y": 588.08041264172834, + "IsEmpty": false + }, + "Timestamp": 637316498619994380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 883.51726469328423, + "Y": 587.13719975110337, + "IsEmpty": false + }, + "Timestamp": 637316498620164010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 884.02200102140921, + "Y": 587.48304936047839, + "IsEmpty": false + }, + "Timestamp": 637316498620333900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 886.13557524015926, + "Y": 589.30658451672832, + "IsEmpty": false + }, + "Timestamp": 637316498620502060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 889.54250883390921, + "Y": 592.51342045422837, + "IsEmpty": false + }, + "Timestamp": 637316498620674450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 893.99045805265928, + "Y": 596.66351811047832, + "IsEmpty": false + }, + "Timestamp": 637316498620845360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 901.65608305265926, + "Y": 603.61171146985339, + "IsEmpty": false + }, + "Timestamp": 637316498621010500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 906.13557524015926, + "Y": 607.51024662610337, + "IsEmpty": false + }, + "Timestamp": 637316498621184230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 909.25859770109673, + "Y": 609.77391850110337, + "IsEmpty": false + }, + "Timestamp": 637316498621345080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 910.01570219328426, + "Y": 610.24550053235339, + "IsEmpty": false + }, + "Timestamp": 637316498621521780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 907.83904203703423, + "Y": 607.6360278761033, + "IsEmpty": false + }, + "Timestamp": 637316498621688400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 903.64346098234671, + "Y": 603.48593021985334, + "IsEmpty": false + }, + "Timestamp": 637316498621857220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 898.56460356047171, + "Y": 598.04686771985337, + "IsEmpty": false + }, + "Timestamp": 637316498622032360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 893.13872465422173, + "Y": 593.39374271985332, + "IsEmpty": false + }, + "Timestamp": 637316498622197030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670893431, + "Position": { + "X": 887.14502348234669, + "Y": 588.04896732922839, + "IsEmpty": false + }, + "Timestamp": 637316498622362450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670893431, + "Position": { + "X": 884.96838774015919, + "Y": 585.87963139172837, + "IsEmpty": false + }, + "Timestamp": 637316498622535880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670893431, + "Position": { + "X": 884.27436918547176, + "Y": 585.09364506360339, + "IsEmpty": false + }, + "Timestamp": 637316498622705250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682368219, + "Position": { + "X": 887.20813383390919, + "Y": 587.3887134229783, + "IsEmpty": false + }, + "Timestamp": 637316498623049480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684809625, + "Position": { + "X": 890.86743559172169, + "Y": 590.75282475110339, + "IsEmpty": false + }, + "Timestamp": 637316498623210200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690180838, + "Position": { + "X": 895.75701078703423, + "Y": 594.68280521985332, + "IsEmpty": false + }, + "Timestamp": 637316498623378800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690180838, + "Position": { + "X": 900.33115629484678, + "Y": 598.76996342297832, + "IsEmpty": false + }, + "Timestamp": 637316498623543360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690180838, + "Position": { + "X": 904.71601957609676, + "Y": 602.35409428235334, + "IsEmpty": false + }, + "Timestamp": 637316498623718440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690180838, + "Position": { + "X": 905.03147367765928, + "Y": 602.51132084485334, + "IsEmpty": false + }, + "Timestamp": 637316498623884840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 903.95891508390923, + "Y": 600.46771732922832, + "IsEmpty": false + }, + "Timestamp": 637316498624059870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 901.34062895109673, + "Y": 596.69491459485334, + "IsEmpty": false + }, + "Timestamp": 637316498624226280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 894.58982328703428, + "Y": 590.53270756360337, + "IsEmpty": false + }, + "Timestamp": 637316498624395280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 890.89897856047173, + "Y": 587.51449467297834, + "IsEmpty": false + }, + "Timestamp": 637316498624562120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 889.06931547453428, + "Y": 585.6909595167283, + "IsEmpty": false + }, + "Timestamp": 637316498624723350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 888.72231840422171, + "Y": 585.34515873547832, + "IsEmpty": false + }, + "Timestamp": 637316498624892560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 890.23652738859676, + "Y": 587.01146732922837, + "IsEmpty": false + }, + "Timestamp": 637316498625073670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 893.80117582609671, + "Y": 589.9353442823533, + "IsEmpty": false + }, + "Timestamp": 637316498625245160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694575429, + "Position": { + "X": 899.03777250578423, + "Y": 594.08544193860337, + "IsEmpty": false + }, + "Timestamp": 637316498625402370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694575429, + "Position": { + "X": 904.30591215422169, + "Y": 599.2729907667283, + "IsEmpty": false + }, + "Timestamp": 637316498625573670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.69897002, + "Position": { + "X": 911.90845121672169, + "Y": 604.83788334485337, + "IsEmpty": false + }, + "Timestamp": 637316498625744220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 914.11665434172176, + "Y": 606.15834232922839, + "IsEmpty": false + }, + "Timestamp": 637316498625914270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 913.58037504484673, + "Y": 604.96361576672837, + "IsEmpty": false + }, + "Timestamp": 637316498626078730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.69897002, + "Position": { + "X": 909.47942289640923, + "Y": 600.5620532667283, + "IsEmpty": false + }, + "Timestamp": 637316498626251920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 900.45732816984673, + "Y": 591.53881107922837, + "IsEmpty": false + }, + "Timestamp": 637316498626419170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696284413, + "Position": { + "X": 894.36899809172178, + "Y": 586.66561771985334, + "IsEmpty": false + }, + "Timestamp": 637316498626595400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696284413, + "Position": { + "X": 890.17341703703426, + "Y": 583.08148686047832, + "IsEmpty": false + }, + "Timestamp": 637316498626763950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696284413, + "Position": { + "X": 887.77595609953426, + "Y": 581.00643803235334, + "IsEmpty": false + }, + "Timestamp": 637316498626924300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696284413, + "Position": { + "X": 887.27121977140928, + "Y": 580.4719653761033, + "IsEmpty": false + }, + "Timestamp": 637316498627097470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.69921416, + "Position": { + "X": 889.16396879484671, + "Y": 581.91820561047837, + "IsEmpty": false + }, + "Timestamp": 637316498627268710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 892.98098539640921, + "Y": 585.31371342297837, + "IsEmpty": false + }, + "Timestamp": 637316498627439310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 898.56460356047171, + "Y": 589.55809818860337, + "IsEmpty": false + }, + "Timestamp": 637316498627607060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 906.60876859953419, + "Y": 596.0347095167283, + "IsEmpty": false + }, + "Timestamp": 637316498627769330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 910.58352445890921, + "Y": 598.7070727979783, + "IsEmpty": false + }, + "Timestamp": 637316498627944390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 911.97153715422178, + "Y": 599.39877201672834, + "IsEmpty": false + }, + "Timestamp": 637316498628106790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705317795, + "Position": { + "X": 911.34062895109673, + "Y": 598.23549076672839, + "IsEmpty": false + }, + "Timestamp": 637316498628272610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 906.00937895109678, + "Y": 592.98505131360332, + "IsEmpty": false + }, + "Timestamp": 637316498628453470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 901.18288969328421, + "Y": 588.5205493604783, + "IsEmpty": false + }, + "Timestamp": 637316498628620020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 897.20813383390919, + "Y": 584.96786381360334, + "IsEmpty": false + }, + "Timestamp": 637316498628784590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 894.77910551359673, + "Y": 583.08148686047832, + "IsEmpty": false + }, + "Timestamp": 637316498628947910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 894.17974027922173, + "Y": 582.70419193860334, + "IsEmpty": false + }, + "Timestamp": 637316498629129080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 896.04094633390923, + "Y": 583.93036381360332, + "IsEmpty": false + }, + "Timestamp": 637316498629290220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 899.35322660734676, + "Y": 586.63417240735339, + "IsEmpty": false + }, + "Timestamp": 637316498629455470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71117723, + "Position": { + "X": 903.89582914640926, + "Y": 590.53270756360337, + "IsEmpty": false + }, + "Timestamp": 637316498629642820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71117723, + "Position": { + "X": 911.65608305265926, + "Y": 595.84603764172834, + "IsEmpty": false + }, + "Timestamp": 637316498629816720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71117723, + "Position": { + "X": 914.46365141203421, + "Y": 597.79535404797832, + "IsEmpty": false + }, + "Timestamp": 637316498629969300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 914.90527738859669, + "Y": 597.70101811047834, + "IsEmpty": false + }, + "Timestamp": 637316498630131620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713130414, + "Position": { + "X": 913.51726469328423, + "Y": 595.06005131360337, + "IsEmpty": false + }, + "Timestamp": 637316498630309200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 907.05039457609678, + "Y": 589.58954350110332, + "IsEmpty": false + }, + "Timestamp": 637316498630473190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 903.23335356047176, + "Y": 586.2568774854783, + "IsEmpty": false + }, + "Timestamp": 637316498630645250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 900.96206449797171, + "Y": 584.11898686047834, + "IsEmpty": false + }, + "Timestamp": 637316498630815540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 900.14187406828421, + "Y": 583.39589115735339, + "IsEmpty": false + }, + "Timestamp": 637316498630984910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 900.70969633390928, + "Y": 583.77313725110332, + "IsEmpty": false + }, + "Timestamp": 637316498631149810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 902.60244535734671, + "Y": 585.6909595167283, + "IsEmpty": false + }, + "Timestamp": 637316498631323280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 906.16711820890919, + "Y": 588.61488529797839, + "IsEmpty": false + }, + "Timestamp": 637316498631483180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 910.89897856047173, + "Y": 591.53881107922837, + "IsEmpty": false + }, + "Timestamp": 637316498631652150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 916.00937895109678, + "Y": 594.83998295422839, + "IsEmpty": false + }, + "Timestamp": 637316498631830580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 916.76648344328419, + "Y": 595.12294193860339, + "IsEmpty": false + }, + "Timestamp": 637316498631995650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 916.23020414640928, + "Y": 593.42518803235339, + "IsEmpty": false + }, + "Timestamp": 637316498632162350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 913.61191801359678, + "Y": 590.56415287610332, + "IsEmpty": false + }, + "Timestamp": 637316498632334510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720943034, + "Position": { + "X": 908.43840727140923, + "Y": 586.28832279797837, + "IsEmpty": false + }, + "Timestamp": 637316498632499010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718745708, + "Position": { + "X": 905.85166410734678, + "Y": 584.4333911573533, + "IsEmpty": false + }, + "Timestamp": 637316498632677290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718745708, + "Position": { + "X": 905.03147367765928, + "Y": 583.89891850110337, + "IsEmpty": false + }, + "Timestamp": 637316498632841490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718989849, + "Position": { + "X": 907.80749906828419, + "Y": 586.38265873547834, + "IsEmpty": false + }, + "Timestamp": 637316498633177500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718989849, + "Position": { + "X": 908.59614652922176, + "Y": 586.94857670422834, + "IsEmpty": false + }, + "Timestamp": 637316498633512190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720943034, + "Position": { + "X": 916.54565824797169, + "Y": 592.13617436047832, + "IsEmpty": false + }, + "Timestamp": 637316498633678290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722896159, + "Position": { + "X": 917.30276274015921, + "Y": 592.0732837354783, + "IsEmpty": false + }, + "Timestamp": 637316498633856080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 915.72546781828419, + "Y": 589.6523852979783, + "IsEmpty": false + }, + "Timestamp": 637316498634018150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 912.98098539640921, + "Y": 586.57128178235337, + "IsEmpty": false + }, + "Timestamp": 637316498634193640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 910.39424223234676, + "Y": 584.02465092297837, + "IsEmpty": false + }, + "Timestamp": 637316498634365380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 907.99678129484676, + "Y": 581.94965092297832, + "IsEmpty": false + }, + "Timestamp": 637316498634531720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 909.03777250578423, + "Y": 582.82997318860339, + "IsEmpty": false + }, + "Timestamp": 637316498634866020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 911.49834379484673, + "Y": 584.77924076672832, + "IsEmpty": false + }, + "Timestamp": 637316498635034160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 915.94629301359669, + "Y": 588.64633061047834, + "IsEmpty": false + }, + "Timestamp": 637316498635209220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 918.56460356047171, + "Y": 590.53270756360337, + "IsEmpty": false + }, + "Timestamp": 637316498635384830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 919.63713774015923, + "Y": 590.9414477979783, + "IsEmpty": false + }, + "Timestamp": 637316498635542070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 919.54250883390921, + "Y": 590.3755298292283, + "IsEmpty": false + }, + "Timestamp": 637316498635717360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 916.89267973234678, + "Y": 586.88568607922832, + "IsEmpty": false + }, + "Timestamp": 637316498635887070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 914.62136625578421, + "Y": 584.05609623547832, + "IsEmpty": false + }, + "Timestamp": 637316498636049780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 912.53935941984673, + "Y": 582.01254154797834, + "IsEmpty": false + }, + "Timestamp": 637316498636219210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 911.37217191984678, + "Y": 581.10077396985332, + "IsEmpty": false + }, + "Timestamp": 637316498636393870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 911.59297270109676, + "Y": 581.25795170422839, + "IsEmpty": false + }, + "Timestamp": 637316498636558710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 913.07563871672176, + "Y": 582.4526782667283, + "IsEmpty": false + }, + "Timestamp": 637316498636723190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 914.96838774015919, + "Y": 584.30760990735337, + "IsEmpty": false + }, + "Timestamp": 637316498636899750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 916.98730863859669, + "Y": 586.47699467297832, + "IsEmpty": false + }, + "Timestamp": 637316498637059370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 919.16396879484671, + "Y": 587.98607670422837, + "IsEmpty": false + }, + "Timestamp": 637316498637239090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726558328, + "Position": { + "X": 919.44787992765919, + "Y": 587.98607670422837, + "IsEmpty": false + }, + "Timestamp": 637316498637401050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 919.29014066984678, + "Y": 586.94857670422834, + "IsEmpty": false + }, + "Timestamp": 637316498637575210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 918.46995024015928, + "Y": 585.18793217297832, + "IsEmpty": false + }, + "Timestamp": 637316498637743740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 917.27121977140928, + "Y": 583.08148686047832, + "IsEmpty": false + }, + "Timestamp": 637316498637911540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 917.14502348234669, + "Y": 582.92426029797832, + "IsEmpty": false + }, + "Timestamp": 637316498638082430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 917.93367094328426, + "Y": 583.17577396985337, + "IsEmpty": false + }, + "Timestamp": 637316498638427020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 920.39424223234676, + "Y": 584.40194584485334, + "IsEmpty": false + }, + "Timestamp": 637316498638587000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 922.88635649015919, + "Y": 585.53378178235334, + "IsEmpty": false + }, + "Timestamp": 637316498638758640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 925.28384184172171, + "Y": 586.60272709485332, + "IsEmpty": false + }, + "Timestamp": 637316498638926170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.436514825, + "Position": { + "X": 926.45102934172178, + "Y": 587.1057544386033, + "IsEmpty": false + }, + "Timestamp": 637316498639095900, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFFFFFFF", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "2ebfe98d-f21b-43c1-b486-b97f384c6bc9", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 902.82327055265921, + "Y": 651.14877201672834, + "IsEmpty": false + }, + "Timestamp": 637316498695490900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.12449836, + "Position": { + "X": 903.39109281828428, + "Y": 652.12343021985339, + "IsEmpty": false + }, + "Timestamp": 637316498695697440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.224353403, + "Position": { + "X": 904.27436918547176, + "Y": 652.68934818860339, + "IsEmpty": false + }, + "Timestamp": 637316498695874980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.263172358, + "Position": { + "X": 904.71601957609676, + "Y": 652.97230717297839, + "IsEmpty": false + }, + "Timestamp": 637316498696034420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.294178694, + "Position": { + "X": 905.09455961515926, + "Y": 653.38099857922839, + "IsEmpty": false + }, + "Timestamp": 637316498696211390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.326405734, + "Position": { + "X": 905.69392484953426, + "Y": 653.91547123547832, + "IsEmpty": false + }, + "Timestamp": 637316498696380760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.359609365, + "Position": { + "X": 906.19866117765923, + "Y": 654.13558842297834, + "IsEmpty": false + }, + "Timestamp": 637316498696542890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.396475166, + "Position": { + "X": 906.70339750578421, + "Y": 654.32421146985337, + "IsEmpty": false + }, + "Timestamp": 637316498696710720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.433096826, + "Position": { + "X": 906.86111234953421, + "Y": 654.35565678235332, + "IsEmpty": false + }, + "Timestamp": 637316498696886120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.47924009, + "Position": { + "X": 907.17659086515926, + "Y": 654.38710209485339, + "IsEmpty": false + }, + "Timestamp": 637316498697052070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506096005, + "Position": { + "X": 907.42893461515928, + "Y": 654.38710209485339, + "IsEmpty": false + }, + "Timestamp": 637316498697226740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531242847, + "Position": { + "X": 907.39739164640923, + "Y": 654.16698490735337, + "IsEmpty": false + }, + "Timestamp": 637316498697388030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544914901, + "Position": { + "X": 906.95576566984676, + "Y": 653.38099857922839, + "IsEmpty": false + }, + "Timestamp": 637316498697557970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562249184, + "Position": { + "X": 906.19866117765923, + "Y": 652.4692798292283, + "IsEmpty": false + }, + "Timestamp": 637316498697725260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65844208, + "Position": { + "X": 905.78857816984669, + "Y": 651.93475834485332, + "IsEmpty": false + }, + "Timestamp": 637316498697894510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.662836671, + "Position": { + "X": 906.51411527922176, + "Y": 652.3120532667283, + "IsEmpty": false + }, + "Timestamp": 637316498698739520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667719543, + "Position": { + "X": 907.55513090422176, + "Y": 652.65790287610332, + "IsEmpty": false + }, + "Timestamp": 637316498698912460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674311459, + "Position": { + "X": 907.80749906828419, + "Y": 652.62645756360337, + "IsEmpty": false + }, + "Timestamp": 637316498699084850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 907.71287016203428, + "Y": 652.12343021985339, + "IsEmpty": false + }, + "Timestamp": 637316498699253680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 907.01885160734673, + "Y": 650.83436771985339, + "IsEmpty": false + }, + "Timestamp": 637316498699416170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 906.29329008390926, + "Y": 649.51390873547837, + "IsEmpty": false + }, + "Timestamp": 637316498699586440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67870605, + "Position": { + "X": 905.88320707609671, + "Y": 648.60214115735334, + "IsEmpty": false + }, + "Timestamp": 637316498699760310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 906.57720121672173, + "Y": 649.01088139172839, + "IsEmpty": false + }, + "Timestamp": 637316498700267700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 909.19551176359676, + "Y": 650.6142993604783, + "IsEmpty": false + }, + "Timestamp": 637316498700438590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.69481957, + "Position": { + "X": 910.96206449797171, + "Y": 651.6204028761033, + "IsEmpty": false + }, + "Timestamp": 637316498700606970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700923145, + "Position": { + "X": 911.49834379484673, + "Y": 651.84047123547839, + "IsEmpty": false + }, + "Timestamp": 637316498700773270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705073595, + "Position": { + "X": 911.24597563078419, + "Y": 650.51996342297832, + "IsEmpty": false + }, + "Timestamp": 637316498701110610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705073595, + "Position": { + "X": 910.11033109953428, + "Y": 648.97943607922832, + "IsEmpty": false + }, + "Timestamp": 637316498701282840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705073595, + "Position": { + "X": 908.91160063078428, + "Y": 647.53319584485337, + "IsEmpty": false + }, + "Timestamp": 637316498701442400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705073595, + "Position": { + "X": 908.21758207609673, + "Y": 646.90438725110334, + "IsEmpty": false + }, + "Timestamp": 637316498701621730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 908.78540434172169, + "Y": 647.43885990735339, + "IsEmpty": false + }, + "Timestamp": 637316498702119030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 910.01570219328426, + "Y": 648.57069584485339, + "IsEmpty": false + }, + "Timestamp": 637316498702288220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 911.05671781828426, + "Y": 649.51390873547837, + "IsEmpty": false + }, + "Timestamp": 637316498702466030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 911.75071195890928, + "Y": 649.9226489698533, + "IsEmpty": false + }, + "Timestamp": 637316498702626310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 911.40371488859671, + "Y": 648.41351811047832, + "IsEmpty": false + }, + "Timestamp": 637316498702961370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 909.00622953703419, + "Y": 645.1123462354783, + "IsEmpty": false + }, + "Timestamp": 637316498703139590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 906.95576566984676, + "Y": 643.19447514172839, + "IsEmpty": false + }, + "Timestamp": 637316498703301980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 905.63083891203428, + "Y": 641.90546146985332, + "IsEmpty": false + }, + "Timestamp": 637316498703471590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730464637, + "Position": { + "X": 905.25229887297178, + "Y": 641.52816654797834, + "IsEmpty": false + }, + "Timestamp": 637316498703648780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 906.45102934172178, + "Y": 642.43993412610337, + "IsEmpty": false + }, + "Timestamp": 637316498703989220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737544835, + "Position": { + "X": 908.28069242765923, + "Y": 643.63466068860339, + "IsEmpty": false + }, + "Timestamp": 637316498704146710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 910.14187406828421, + "Y": 644.86083256360337, + "IsEmpty": false + }, + "Timestamp": 637316498704321120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743160129, + "Position": { + "X": 912.25544828703426, + "Y": 645.99261967297832, + "IsEmpty": false + }, + "Timestamp": 637316498704491710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 912.19236234953428, + "Y": 645.30096928235332, + "IsEmpty": false + }, + "Timestamp": 637316498704826510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 910.93052152922178, + "Y": 643.50887943860334, + "IsEmpty": false + }, + "Timestamp": 637316498704991480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 908.21758207609673, + "Y": 640.5850024854783, + "IsEmpty": false + }, + "Timestamp": 637316498705164830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 906.98730863859669, + "Y": 639.39027592297839, + "IsEmpty": false + }, + "Timestamp": 637316498705340010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745601594, + "Position": { + "X": 906.57720121672173, + "Y": 639.13876225110334, + "IsEmpty": false + }, + "Timestamp": 637316498705498060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 908.50149320890921, + "Y": 640.55355717297834, + "IsEmpty": false + }, + "Timestamp": 637316498705844130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75170517, + "Position": { + "X": 910.33115629484678, + "Y": 641.9997974073533, + "IsEmpty": false + }, + "Timestamp": 637316498706005050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753658354, + "Position": { + "X": 912.38162016203421, + "Y": 643.47743412610339, + "IsEmpty": false + }, + "Timestamp": 637316498706173720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753658354, + "Position": { + "X": 913.89582914640926, + "Y": 644.57787357922837, + "IsEmpty": false + }, + "Timestamp": 637316498706351160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.755611479, + "Position": { + "X": 914.43210844328428, + "Y": 644.8293872511033, + "IsEmpty": false + }, + "Timestamp": 637316498706521340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757808805, + "Position": { + "X": 914.40056547453423, + "Y": 644.13768803235337, + "IsEmpty": false + }, + "Timestamp": 637316498706688140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76000613, + "Position": { + "X": 913.26489652922169, + "Y": 642.15697514172837, + "IsEmpty": false + }, + "Timestamp": 637316498706849460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76000613, + "Position": { + "X": 911.40371488859671, + "Y": 639.89330326672837, + "IsEmpty": false + }, + "Timestamp": 637316498707035670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76000613, + "Position": { + "X": 908.78540434172169, + "Y": 637.25238529797832, + "IsEmpty": false + }, + "Timestamp": 637316498707189550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761959255, + "Position": { + "X": 908.09141020109678, + "Y": 636.65502201672837, + "IsEmpty": false + }, + "Timestamp": 637316498707364780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 908.24912504484678, + "Y": 636.84364506360339, + "IsEmpty": false + }, + "Timestamp": 637316498707702260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.765377283, + "Position": { + "X": 910.26807035734669, + "Y": 638.6042895948533, + "IsEmpty": false + }, + "Timestamp": 637316498707862330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.767330408, + "Position": { + "X": 912.03462309172176, + "Y": 640.08192631360339, + "IsEmpty": false + }, + "Timestamp": 637316498708032490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769283593, + "Position": { + "X": 913.80117582609671, + "Y": 641.46532475110337, + "IsEmpty": false + }, + "Timestamp": 637316498708198840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769283593, + "Position": { + "X": 915.09455961515926, + "Y": 642.37704350110334, + "IsEmpty": false + }, + "Timestamp": 637316498708373800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771236718, + "Position": { + "X": 915.34692777922169, + "Y": 642.43993412610337, + "IsEmpty": false + }, + "Timestamp": 637316498708542240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771236718, + "Position": { + "X": 914.46365141203421, + "Y": 640.67928959485334, + "IsEmpty": false + }, + "Timestamp": 637316498708716550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771236718, + "Position": { + "X": 912.79172758390928, + "Y": 638.41561771985334, + "IsEmpty": false + }, + "Timestamp": 637316498708878910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771236718, + "Position": { + "X": 910.70969633390928, + "Y": 636.15194584485334, + "IsEmpty": false + }, + "Timestamp": 637316498709050750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771236718, + "Position": { + "X": 908.40686430265919, + "Y": 633.7939868604783, + "IsEmpty": false + }, + "Timestamp": 637316498709219570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771236718, + "Position": { + "X": 908.02832426359669, + "Y": 633.5110278761033, + "IsEmpty": false + }, + "Timestamp": 637316498709387490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.775387168, + "Position": { + "X": 908.78540434172169, + "Y": 634.29701420422839, + "IsEmpty": false + }, + "Timestamp": 637316498709730600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.779293478, + "Position": { + "X": 911.56142973234671, + "Y": 636.7493091261033, + "IsEmpty": false + }, + "Timestamp": 637316498709898270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781490803, + "Position": { + "X": 913.48572172453419, + "Y": 638.41561771985334, + "IsEmpty": false + }, + "Timestamp": 637316498710062000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781490803, + "Position": { + "X": 915.12610258390919, + "Y": 639.70468021985334, + "IsEmpty": false + }, + "Timestamp": 637316498710233070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781490803, + "Position": { + "X": 916.00937895109678, + "Y": 640.27059818860334, + "IsEmpty": false + }, + "Timestamp": 637316498710401800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785397112, + "Position": { + "X": 916.07248930265928, + "Y": 639.1702075636033, + "IsEmpty": false + }, + "Timestamp": 637316498710570460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785397112, + "Position": { + "X": 914.93684477140926, + "Y": 636.96942631360332, + "IsEmpty": false + }, + "Timestamp": 637316498710737830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 912.79172758390928, + "Y": 634.10839115735337, + "IsEmpty": false + }, + "Timestamp": 637316498710908540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 910.36269926359671, + "Y": 631.84471928235337, + "IsEmpty": false + }, + "Timestamp": 637316498711076470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 908.02832426359669, + "Y": 630.17841068860332, + "IsEmpty": false + }, + "Timestamp": 637316498711251830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 908.46995024015928, + "Y": 630.61854740735339, + "IsEmpty": false + }, + "Timestamp": 637316498711582250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 910.61506742765926, + "Y": 632.25341068860337, + "IsEmpty": false + }, + "Timestamp": 637316498711753320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789303422, + "Position": { + "X": 914.68447660734671, + "Y": 635.86898686047834, + "IsEmpty": false + }, + "Timestamp": 637316498711916120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 917.01885160734673, + "Y": 637.84969975110334, + "IsEmpty": false + }, + "Timestamp": 637316498712092450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 918.78540434172169, + "Y": 639.10731693860339, + "IsEmpty": false + }, + "Timestamp": 637316498712256810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 919.03777250578423, + "Y": 639.20165287610337, + "IsEmpty": false + }, + "Timestamp": 637316498712431800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 918.37532133390926, + "Y": 636.7493091261033, + "IsEmpty": false + }, + "Timestamp": 637316498712596300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 916.23020414640928, + "Y": 633.82543217297837, + "IsEmpty": false + }, + "Timestamp": 637316498712763420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 913.10718168547169, + "Y": 630.90150639172839, + "IsEmpty": false + }, + "Timestamp": 637316498712931660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 910.20496000578419, + "Y": 628.60638920422832, + "IsEmpty": false + }, + "Timestamp": 637316498713100970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 908.21758207609673, + "Y": 627.34882084485332, + "IsEmpty": false + }, + "Timestamp": 637316498713277940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 908.02832426359669, + "Y": 627.25448490735334, + "IsEmpty": false + }, + "Timestamp": 637316498713447760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793698013, + "Position": { + "X": 909.35322660734676, + "Y": 628.2605395948533, + "IsEmpty": false + }, + "Timestamp": 637316498713607620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.798092604, + "Position": { + "X": 912.03462309172176, + "Y": 630.20985600110339, + "IsEmpty": false + }, + "Timestamp": 637316498713776790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.800045788, + "Position": { + "X": 916.67185453703428, + "Y": 633.98260990735332, + "IsEmpty": false + }, + "Timestamp": 637316498713953320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.800045788, + "Position": { + "X": 919.22705473234669, + "Y": 636.02621342297834, + "IsEmpty": false + }, + "Timestamp": 637316498714114620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801998913, + "Position": { + "X": 920.77280668547178, + "Y": 636.87509037610334, + "IsEmpty": false + }, + "Timestamp": 637316498714284020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804196239, + "Position": { + "X": 920.74123930265921, + "Y": 636.24628178235332, + "IsEmpty": false + }, + "Timestamp": 637316498714461350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804196239, + "Position": { + "X": 917.87058500578428, + "Y": 632.25341068860337, + "IsEmpty": false + }, + "Timestamp": 637316498714631790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804196239, + "Position": { + "X": 914.08508695890919, + "Y": 628.57494389172837, + "IsEmpty": false + }, + "Timestamp": 637316498714793590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802243054, + "Position": { + "X": 910.29961332609673, + "Y": 625.52528568860339, + "IsEmpty": false + }, + "Timestamp": 637316498714959350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802243054, + "Position": { + "X": 907.83904203703423, + "Y": 623.82753178235339, + "IsEmpty": false + }, + "Timestamp": 637316498715130340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802243054, + "Position": { + "X": 907.27121977140928, + "Y": 623.4502368604783, + "IsEmpty": false + }, + "Timestamp": 637316498715305030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802243054, + "Position": { + "X": 908.94314359953421, + "Y": 624.8650317823533, + "IsEmpty": false + }, + "Timestamp": 637316498715473670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804196239, + "Position": { + "X": 912.03462309172176, + "Y": 627.34882084485332, + "IsEmpty": false + }, + "Timestamp": 637316498715637890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806393504, + "Position": { + "X": 915.97783598234673, + "Y": 630.36703373547834, + "IsEmpty": false + }, + "Timestamp": 637316498715807140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806393504, + "Position": { + "X": 920.83589262297176, + "Y": 633.88827396985334, + "IsEmpty": false + }, + "Timestamp": 637316498715981570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806393504, + "Position": { + "X": 922.94944242765928, + "Y": 635.08300053235337, + "IsEmpty": false + }, + "Timestamp": 637316498716143340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808346689, + "Position": { + "X": 923.26489652922169, + "Y": 634.98871342297832, + "IsEmpty": false + }, + "Timestamp": 637316498716314790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808346689, + "Position": { + "X": 922.06616606047169, + "Y": 633.10228764172837, + "IsEmpty": false + }, + "Timestamp": 637316498716483690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808346689, + "Position": { + "X": 917.27121977140928, + "Y": 628.5434985792283, + "IsEmpty": false + }, + "Timestamp": 637316498716657520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 913.89582914640926, + "Y": 625.39955326672839, + "IsEmpty": false + }, + "Timestamp": 637316498716830680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 911.34062895109673, + "Y": 623.3245044386033, + "IsEmpty": false + }, + "Timestamp": 637316498716990080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 909.76333402922171, + "Y": 622.34984623547837, + "IsEmpty": false + }, + "Timestamp": 637316498717155570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 909.73179106047178, + "Y": 622.50707279797837, + "IsEmpty": false + }, + "Timestamp": 637316498717327980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 911.18288969328421, + "Y": 623.92186771985337, + "IsEmpty": false + }, + "Timestamp": 637316498717499870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 913.67500395109676, + "Y": 626.09120365735339, + "IsEmpty": false + }, + "Timestamp": 637316498717665580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 916.73494047453426, + "Y": 628.66927982922834, + "IsEmpty": false + }, + "Timestamp": 637316498717840960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 920.64661039640919, + "Y": 631.2473560011033, + "IsEmpty": false + }, + "Timestamp": 637316498718001630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 921.81379789640926, + "Y": 631.71893803235332, + "IsEmpty": false + }, + "Timestamp": 637316498718178370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 921.65608305265926, + "Y": 631.3730884229783, + "IsEmpty": false + }, + "Timestamp": 637316498718338090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 919.60559477140919, + "Y": 629.1094165479783, + "IsEmpty": false + }, + "Timestamp": 637316498718506810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 914.40056547453423, + "Y": 623.79608646985332, + "IsEmpty": false + }, + "Timestamp": 637316498718685470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 910.58352445890921, + "Y": 620.68353764172832, + "IsEmpty": false + }, + "Timestamp": 637316498718849790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 907.74441313078421, + "Y": 619.01722904797839, + "IsEmpty": false + }, + "Timestamp": 637316498719016590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 906.64031156828423, + "Y": 618.48275639172834, + "IsEmpty": false + }, + "Timestamp": 637316498719184670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 906.70339750578421, + "Y": 618.63998295422834, + "IsEmpty": false + }, + "Timestamp": 637316498719361140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 908.78540434172169, + "Y": 620.14906498547839, + "IsEmpty": false + }, + "Timestamp": 637316498719523320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 912.12925199797178, + "Y": 622.7585864698533, + "IsEmpty": false + }, + "Timestamp": 637316498719692090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 915.82012113859673, + "Y": 625.80824467297839, + "IsEmpty": false + }, + "Timestamp": 637316498719861840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 921.21443266203426, + "Y": 629.61249271985332, + "IsEmpty": false + }, + "Timestamp": 637316498720037520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 923.54883207609669, + "Y": 630.71288334485337, + "IsEmpty": false + }, + "Timestamp": 637316498720195530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 923.86428617765921, + "Y": 630.83861576672837, + "IsEmpty": false + }, + "Timestamp": 637316498720367310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 922.79172758390928, + "Y": 629.23519779797834, + "IsEmpty": false + }, + "Timestamp": 637316498720542690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 917.58667387297169, + "Y": 623.95331303235332, + "IsEmpty": false + }, + "Timestamp": 637316498720713460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 913.10718168547169, + "Y": 619.96044193860337, + "IsEmpty": false + }, + "Timestamp": 637316498720875180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 908.91160063078428, + "Y": 617.16229740735332, + "IsEmpty": false + }, + "Timestamp": 637316498721051650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 906.41948637297173, + "Y": 615.74750248547832, + "IsEmpty": false + }, + "Timestamp": 637316498721212460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 905.88320707609671, + "Y": 615.46454350110332, + "IsEmpty": false + }, + "Timestamp": 637316498721387340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 907.49204496672178, + "Y": 616.59637943860332, + "IsEmpty": false + }, + "Timestamp": 637316498721557020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 911.15134672453428, + "Y": 618.98578373547832, + "IsEmpty": false + }, + "Timestamp": 637316498721725750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 915.50466703703421, + "Y": 622.34984623547837, + "IsEmpty": false + }, + "Timestamp": 637316498721889770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 921.68762602140919, + "Y": 626.94008061047839, + "IsEmpty": false + }, + "Timestamp": 637316498722059730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 924.71601957609676, + "Y": 628.63783451672839, + "IsEmpty": false + }, + "Timestamp": 637316498722226740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 925.78857816984669, + "Y": 629.04657475110332, + "IsEmpty": false + }, + "Timestamp": 637316498722395430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 925.06301664640921, + "Y": 627.88329350110337, + "IsEmpty": false + }, + "Timestamp": 637316498722565380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 920.20496000578419, + "Y": 622.60140873547834, + "IsEmpty": false + }, + "Timestamp": 637316498722738470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 915.59929594328423, + "Y": 618.29413334485332, + "IsEmpty": false + }, + "Timestamp": 637316498722906210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 910.83589262297176, + "Y": 614.74139896985332, + "IsEmpty": false + }, + "Timestamp": 637316498723074300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 907.52358793547171, + "Y": 612.76068607922832, + "IsEmpty": false + }, + "Timestamp": 637316498723240290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 906.38794340422169, + "Y": 612.1633716261033, + "IsEmpty": false + }, + "Timestamp": 637316498723418790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806149364, + "Position": { + "X": 906.98730863859669, + "Y": 612.63495365735332, + "IsEmpty": false + }, + "Timestamp": 637316498723580480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 909.73179106047178, + "Y": 614.5527759229783, + "IsEmpty": false + }, + "Timestamp": 637316498723747980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 913.89582914640926, + "Y": 617.60243412610339, + "IsEmpty": false + }, + "Timestamp": 637316498723916780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 919.95261625578428, + "Y": 622.22411381360337, + "IsEmpty": false + }, + "Timestamp": 637316498724093450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 923.04409574797171, + "Y": 624.36200443860332, + "IsEmpty": false + }, + "Timestamp": 637316498724258400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 924.33745512297173, + "Y": 624.95936771985339, + "IsEmpty": false + }, + "Timestamp": 637316498724424530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 924.14819731047169, + "Y": 624.39344975110339, + "IsEmpty": false + }, + "Timestamp": 637316498724592940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 919.95261625578428, + "Y": 619.89755131360334, + "IsEmpty": false + }, + "Timestamp": 637316498724767350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 915.34692777922169, + "Y": 615.81039311047834, + "IsEmpty": false + }, + "Timestamp": 637316498724929660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 910.70969633390928, + "Y": 612.2891040479783, + "IsEmpty": false + }, + "Timestamp": 637316498725105120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 906.82956938078428, + "Y": 609.7424731886033, + "IsEmpty": false + }, + "Timestamp": 637316498725275530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 905.97783598234673, + "Y": 609.14510990735334, + "IsEmpty": false + }, + "Timestamp": 637316498725444520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 906.51411527922176, + "Y": 609.64813725110332, + "IsEmpty": false + }, + "Timestamp": 637316498725608230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808102548, + "Position": { + "X": 909.10088285734673, + "Y": 611.62885014172832, + "IsEmpty": false + }, + "Timestamp": 637316498725774700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 913.13872465422173, + "Y": 614.52133061047834, + "IsEmpty": false + }, + "Timestamp": 637316498725950830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 919.76333402922171, + "Y": 619.30018803235339, + "IsEmpty": false + }, + "Timestamp": 637316498726116270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 923.29646391203426, + "Y": 621.56385990735339, + "IsEmpty": false + }, + "Timestamp": 637316498726283020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 925.09455961515926, + "Y": 622.50707279797837, + "IsEmpty": false + }, + "Timestamp": 637316498726457750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 923.95891508390923, + "Y": 620.71498295422839, + "IsEmpty": false + }, + "Timestamp": 637316498726627500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 920.70969633390928, + "Y": 617.6653247511033, + "IsEmpty": false + }, + "Timestamp": 637316498726792190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 916.64031156828423, + "Y": 613.9868579542283, + "IsEmpty": false + }, + "Timestamp": 637316498726959920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 913.23335356047176, + "Y": 611.09437748547839, + "IsEmpty": false + }, + "Timestamp": 637316498727128130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 910.93052152922178, + "Y": 609.3337817823533, + "IsEmpty": false + }, + "Timestamp": 637316498727301740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 909.95261625578428, + "Y": 608.73641850110334, + "IsEmpty": false + }, + "Timestamp": 637316498727466230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 910.55198149015928, + "Y": 609.1765552198533, + "IsEmpty": false + }, + "Timestamp": 637316498727633460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 912.72864164640919, + "Y": 610.77997318860332, + "IsEmpty": false + }, + "Timestamp": 637316498727805220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 917.46050199797173, + "Y": 614.64711186047839, + "IsEmpty": false + }, + "Timestamp": 637316498727974000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 920.64661039640919, + "Y": 616.78500248547834, + "IsEmpty": false + }, + "Timestamp": 637316498728147970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 923.04409574797171, + "Y": 618.01117436047832, + "IsEmpty": false + }, + "Timestamp": 637316498728308900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 923.64346098234671, + "Y": 618.26268803235337, + "IsEmpty": false + }, + "Timestamp": 637316498728477790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 923.07563871672176, + "Y": 617.19374271985339, + "IsEmpty": false + }, + "Timestamp": 637316498728650280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 919.00622953703419, + "Y": 613.16942631360337, + "IsEmpty": false + }, + "Timestamp": 637316498728824860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 916.10403227140921, + "Y": 610.15121342297834, + "IsEmpty": false + }, + "Timestamp": 637316498728985820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 913.73808988859673, + "Y": 607.9189868604783, + "IsEmpty": false + }, + "Timestamp": 637316498729156760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 912.16081938078423, + "Y": 606.5041919386033, + "IsEmpty": false + }, + "Timestamp": 637316498729331000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810055673, + "Position": { + "X": 913.17026762297178, + "Y": 606.97577396985332, + "IsEmpty": false + }, + "Timestamp": 637316498729661980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 915.41001371672178, + "Y": 608.67352787610332, + "IsEmpty": false + }, + "Timestamp": 637316498729833630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 918.78540434172169, + "Y": 611.47167240735337, + "IsEmpty": false + }, + "Timestamp": 637316498730006420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 922.53935941984673, + "Y": 613.92396732922839, + "IsEmpty": false + }, + "Timestamp": 637316498730176660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 924.43210844328428, + "Y": 614.93007084485339, + "IsEmpty": false + }, + "Timestamp": 637316498730345290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 924.43210844328428, + "Y": 614.7100024854783, + "IsEmpty": false + }, + "Timestamp": 637316498730511360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 922.47627348234676, + "Y": 612.1633716261033, + "IsEmpty": false + }, + "Timestamp": 637316498730683020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 918.78540434172169, + "Y": 607.98182865735339, + "IsEmpty": false + }, + "Timestamp": 637316498730854140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 915.59929594328423, + "Y": 604.96361576672837, + "IsEmpty": false + }, + "Timestamp": 637316498731014170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 913.04409574797171, + "Y": 602.88856693860339, + "IsEmpty": false + }, + "Timestamp": 637316498731185620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 911.62454008390921, + "Y": 601.8196216261033, + "IsEmpty": false + }, + "Timestamp": 637316498731358610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812008858, + "Position": { + "X": 913.04409574797171, + "Y": 602.79427982922834, + "IsEmpty": false + }, + "Timestamp": 637316498731690640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 915.66238188078421, + "Y": 604.77499271985334, + "IsEmpty": false + }, + "Timestamp": 637316498731857910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 919.06931547453428, + "Y": 607.51024662610337, + "IsEmpty": false + }, + "Timestamp": 637316498732030230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 922.00308012297171, + "Y": 609.77391850110337, + "IsEmpty": false + }, + "Timestamp": 637316498732203420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 923.13872465422173, + "Y": 610.4656177198533, + "IsEmpty": false + }, + "Timestamp": 637316498732367220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 923.04409574797171, + "Y": 610.11976811047839, + "IsEmpty": false + }, + "Timestamp": 637316498732533850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 920.20496000578419, + "Y": 606.59847904797834, + "IsEmpty": false + }, + "Timestamp": 637316498732709720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 917.39739164640923, + "Y": 603.83177982922837, + "IsEmpty": false + }, + "Timestamp": 637316498732878060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 914.84219145109671, + "Y": 601.50521732922834, + "IsEmpty": false + }, + "Timestamp": 637316498733039030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 913.35954984953423, + "Y": 600.24764896985334, + "IsEmpty": false + }, + "Timestamp": 637316498733218050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 913.17026762297178, + "Y": 600.09042240735334, + "IsEmpty": false + }, + "Timestamp": 637316498733380440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 913.67500395109676, + "Y": 600.46771732922832, + "IsEmpty": false + }, + "Timestamp": 637316498733555130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.815915167, + "Position": { + "X": 915.53621000578426, + "Y": 601.94540287610334, + "IsEmpty": false + }, + "Timestamp": 637316498733717170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.815915167, + "Position": { + "X": 918.15449613859676, + "Y": 603.92611576672834, + "IsEmpty": false + }, + "Timestamp": 637316498733886260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 922.03462309172176, + "Y": 606.40985600110332, + "IsEmpty": false + }, + "Timestamp": 637316498734060960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 923.61191801359678, + "Y": 607.16439701672834, + "IsEmpty": false + }, + "Timestamp": 637316498734229980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 923.67500395109676, + "Y": 606.94432865735337, + "IsEmpty": false + }, + "Timestamp": 637316498734397080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 922.79172758390928, + "Y": 605.3723560011033, + "IsEmpty": false + }, + "Timestamp": 637316498734563850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 919.63713774015923, + "Y": 602.22836186047834, + "IsEmpty": false + }, + "Timestamp": 637316498734737680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 917.68130277922171, + "Y": 600.09042240735334, + "IsEmpty": false + }, + "Timestamp": 637316498734902740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 916.57720121672173, + "Y": 598.64423100110332, + "IsEmpty": false + }, + "Timestamp": 637316498735068630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 916.45102934172178, + "Y": 598.45555912610337, + "IsEmpty": false + }, + "Timestamp": 637316498735246830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 916.73494047453426, + "Y": 598.5813403761033, + "IsEmpty": false + }, + "Timestamp": 637316498735414710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 918.34377836515921, + "Y": 599.68173100110334, + "IsEmpty": false + }, + "Timestamp": 637316498735581740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 920.58352445890921, + "Y": 601.1279712354783, + "IsEmpty": false + }, + "Timestamp": 637316498735746670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 922.85481352140926, + "Y": 602.35409428235334, + "IsEmpty": false + }, + "Timestamp": 637316498735919720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 924.30591215422169, + "Y": 602.98290287610337, + "IsEmpty": false + }, + "Timestamp": 637316498736090480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.819821477, + "Position": { + "X": 924.33745512297173, + "Y": 602.2598071729783, + "IsEmpty": false + }, + "Timestamp": 637316498736260280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.821774602, + "Position": { + "X": 923.17026762297178, + "Y": 600.5620532667283, + "IsEmpty": false + }, + "Timestamp": 637316498736423080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.821774602, + "Position": { + "X": 921.24597563078419, + "Y": 598.32982670422837, + "IsEmpty": false + }, + "Timestamp": 637316498736593170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.821774602, + "Position": { + "X": 918.97468656828426, + "Y": 595.62596928235337, + "IsEmpty": false + }, + "Timestamp": 637316498736765710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.821774602, + "Position": { + "X": 918.59614652922176, + "Y": 595.21727787610337, + "IsEmpty": false + }, + "Timestamp": 637316498736933330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.821774602, + "Position": { + "X": 919.44787992765919, + "Y": 595.78319584485337, + "IsEmpty": false + }, + "Timestamp": 637316498737275190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.821774602, + "Position": { + "X": 922.16081938078423, + "Y": 597.79535404797832, + "IsEmpty": false + }, + "Timestamp": 637316498737435510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.821774602, + "Position": { + "X": 923.92737211515919, + "Y": 598.8642993604783, + "IsEmpty": false + }, + "Timestamp": 637316498737610960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.821774602, + "Position": { + "X": 924.90527738859669, + "Y": 599.2729907667283, + "IsEmpty": false + }, + "Timestamp": 637316498737774300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.821774602, + "Position": { + "X": 925.37847074797173, + "Y": 599.24154545422834, + "IsEmpty": false + }, + "Timestamp": 637316498737940850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.823727787, + "Position": { + "X": 925.22075590422173, + "Y": 598.04686771985337, + "IsEmpty": false + }, + "Timestamp": 637316498738108980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.823727787, + "Position": { + "X": 924.49519438078426, + "Y": 596.69491459485334, + "IsEmpty": false + }, + "Timestamp": 637316498738288700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.823727787, + "Position": { + "X": 923.45417875578426, + "Y": 595.15438725110334, + "IsEmpty": false + }, + "Timestamp": 637316498738448510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.823727787, + "Position": { + "X": 922.44473051359671, + "Y": 593.86532475110334, + "IsEmpty": false + }, + "Timestamp": 637316498738623020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.823727787, + "Position": { + "X": 921.90845121672169, + "Y": 593.01644779797834, + "IsEmpty": false + }, + "Timestamp": 637316498738794610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825680912, + "Position": { + "X": 922.66553129484669, + "Y": 592.79637943860337, + "IsEmpty": false + }, + "Timestamp": 637316498739123960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825680912, + "Position": { + "X": 923.70654691984669, + "Y": 592.82782475110332, + "IsEmpty": false + }, + "Timestamp": 637316498739296230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825680912, + "Position": { + "X": 924.68447660734671, + "Y": 592.73348881360334, + "IsEmpty": false + }, + "Timestamp": 637316498739466310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.827634096, + "Position": { + "X": 924.84219145109671, + "Y": 592.57631107922839, + "IsEmpty": false + }, + "Timestamp": 637316498739637860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.827634096, + "Position": { + "X": 925.03147367765928, + "Y": 592.0732837354783, + "IsEmpty": false + }, + "Timestamp": 637316498739809210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469230175, + "Position": { + "X": 924.81064848234678, + "Y": 590.84711186047832, + "IsEmpty": false + }, + "Timestamp": 637316498739945800, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFA7A9AC", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c0386753-312b-4390-bb06-ad5486c9dc75", + "Points": [ + { + "Pressure": 0.206286713, + "Position": { + "X": 846.23020414640928, + "Y": 648.0676685011033, + "IsEmpty": false + }, + "Timestamp": 637316498793792850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.310048074, + "Position": { + "X": 846.45102934172178, + "Y": 648.19344975110334, + "IsEmpty": false + }, + "Timestamp": 637316498794045080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.388174266, + "Position": { + "X": 846.13557524015926, + "Y": 647.5017505323533, + "IsEmpty": false + }, + "Timestamp": 637316498794556850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.417471588, + "Position": { + "X": 845.50466703703421, + "Y": 646.43280521985332, + "IsEmpty": false + }, + "Timestamp": 637316498794718870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.454337388, + "Position": { + "X": 844.36902250578419, + "Y": 644.92367436047834, + "IsEmpty": false + }, + "Timestamp": 637316498794887550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.472404063, + "Position": { + "X": 843.80120024015923, + "Y": 644.16913334485332, + "IsEmpty": false + }, + "Timestamp": 637316498795059220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.50389868, + "Position": { + "X": 843.67500395109676, + "Y": 644.01195561047837, + "IsEmpty": false + }, + "Timestamp": 637316498795234200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 844.24282621672171, + "Y": 644.5464282667283, + "IsEmpty": false + }, + "Timestamp": 637316498795573910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547844648, + "Position": { + "X": 845.34692777922169, + "Y": 645.55248295422837, + "IsEmpty": false + }, + "Timestamp": 637316498795733700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.560295999, + "Position": { + "X": 846.26174711515921, + "Y": 646.49569584485334, + "IsEmpty": false + }, + "Timestamp": 637316498795908320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567620337, + "Position": { + "X": 846.86113676359673, + "Y": 647.06161381360334, + "IsEmpty": false + }, + "Timestamp": 637316498796078360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.578362703, + "Position": { + "X": 846.73494047453426, + "Y": 646.58998295422839, + "IsEmpty": false + }, + "Timestamp": 637316498796414280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 845.97783598234673, + "Y": 645.26952396985337, + "IsEmpty": false + }, + "Timestamp": 637316498796578480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 844.21128324797178, + "Y": 643.1316333448533, + "IsEmpty": false + }, + "Timestamp": 637316498796745690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 843.64346098234671, + "Y": 642.43993412610337, + "IsEmpty": false + }, + "Timestamp": 637316498796922490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597894251, + "Position": { + "X": 844.77910551359673, + "Y": 643.66610600110334, + "IsEmpty": false + }, + "Timestamp": 637316498797423970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 846.26174711515921, + "Y": 645.2380786573533, + "IsEmpty": false + }, + "Timestamp": 637316498797597380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608636618, + "Position": { + "X": 847.74441313078421, + "Y": 646.90438725110334, + "IsEmpty": false + }, + "Timestamp": 637316498797759320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 848.75386137297176, + "Y": 648.16200443860339, + "IsEmpty": false + }, + "Timestamp": 637316498797927960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614740193, + "Position": { + "X": 848.91160063078428, + "Y": 648.3506274854783, + "IsEmpty": false + }, + "Timestamp": 637316498798104890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619134784, + "Position": { + "X": 848.88005766203423, + "Y": 648.03622318860334, + "IsEmpty": false + }, + "Timestamp": 637316498798270140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 847.99678129484676, + "Y": 646.27557865735332, + "IsEmpty": false + }, + "Timestamp": 637316498798443380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 846.38794340422169, + "Y": 644.04335209485339, + "IsEmpty": false + }, + "Timestamp": 637316498798615460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 843.92737211515919, + "Y": 641.5596118604783, + "IsEmpty": false + }, + "Timestamp": 637316498798778120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 843.32800688078419, + "Y": 640.9936938917283, + "IsEmpty": false + }, + "Timestamp": 637316498798951420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 843.45417875578426, + "Y": 641.59105717297837, + "IsEmpty": false + }, + "Timestamp": 637316498799290210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627924025, + "Position": { + "X": 845.06301664640921, + "Y": 644.04335209485339, + "IsEmpty": false + }, + "Timestamp": 637316498799450670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62987715, + "Position": { + "X": 846.16711820890919, + "Y": 645.64681889172834, + "IsEmpty": false + }, + "Timestamp": 637316498799623980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 846.89267973234678, + "Y": 646.87294193860339, + "IsEmpty": false + }, + "Timestamp": 637316498799792310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6340276, + "Position": { + "X": 847.05039457609678, + "Y": 647.12445561047832, + "IsEmpty": false + }, + "Timestamp": 637316498799964160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.63793391, + "Position": { + "X": 846.26174711515921, + "Y": 646.68431889172837, + "IsEmpty": false + }, + "Timestamp": 637316498800297100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.639887094, + "Position": { + "X": 845.25229887297178, + "Y": 645.99261967297832, + "IsEmpty": false + }, + "Timestamp": 637316498800464470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.639887094, + "Position": { + "X": 844.58982328703428, + "Y": 645.55248295422837, + "IsEmpty": false + }, + "Timestamp": 637316498800641310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.639887094, + "Position": { + "X": 844.55828031828423, + "Y": 646.0869556104783, + "IsEmpty": false + }, + "Timestamp": 637316498800976570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641840219, + "Position": { + "X": 845.18921293547169, + "Y": 647.47030521985334, + "IsEmpty": false + }, + "Timestamp": 637316498801149060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643793404, + "Position": { + "X": 846.13557524015926, + "Y": 649.16805912610334, + "IsEmpty": false + }, + "Timestamp": 637316498801307830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647699714, + "Position": { + "X": 846.98730863859669, + "Y": 650.80292240735332, + "IsEmpty": false + }, + "Timestamp": 637316498801485670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655268192, + "Position": { + "X": 846.57722563078426, + "Y": 649.3567310011033, + "IsEmpty": false + }, + "Timestamp": 637316498801983860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657221317, + "Position": { + "X": 845.15764555265923, + "Y": 646.43280521985332, + "IsEmpty": false + }, + "Timestamp": 637316498802160760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657221317, + "Position": { + "X": 844.08511137297171, + "Y": 644.92367436047834, + "IsEmpty": false + }, + "Timestamp": 637316498802326020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657221317, + "Position": { + "X": 843.67500395109676, + "Y": 644.2634692823533, + "IsEmpty": false + }, + "Timestamp": 637316498802502000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667231262, + "Position": { + "X": 844.99993070890923, + "Y": 645.2380786573533, + "IsEmpty": false + }, + "Timestamp": 637316498802830620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 846.45102934172178, + "Y": 646.62142826672834, + "IsEmpty": false + }, + "Timestamp": 637316498803000010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675288022, + "Position": { + "X": 847.90212797453421, + "Y": 648.13055912610332, + "IsEmpty": false + }, + "Timestamp": 637316498803174270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677241147, + "Position": { + "X": 849.13242582609678, + "Y": 649.3567310011033, + "IsEmpty": false + }, + "Timestamp": 637316498803335580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 849.88950590422178, + "Y": 649.89120365735334, + "IsEmpty": false + }, + "Timestamp": 637316498803514820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 850.01570219328426, + "Y": 649.29384037610339, + "IsEmpty": false + }, + "Timestamp": 637316498803676630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 849.22705473234669, + "Y": 647.18734623547834, + "IsEmpty": false + }, + "Timestamp": 637316498803852320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 847.49204496672178, + "Y": 644.42064701672837, + "IsEmpty": false + }, + "Timestamp": 637316498804011390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 844.77910551359673, + "Y": 641.21376225110339, + "IsEmpty": false + }, + "Timestamp": 637316498804187450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 844.17974027922173, + "Y": 640.64784428235339, + "IsEmpty": false + }, + "Timestamp": 637316498804358130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689204216, + "Position": { + "X": 845.47312406828428, + "Y": 642.03124271985337, + "IsEmpty": false + }, + "Timestamp": 637316498804693540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697993457, + "Position": { + "X": 848.46995024015928, + "Y": 645.42670170422832, + "IsEmpty": false + }, + "Timestamp": 637316498804865420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699946582, + "Position": { + "X": 850.52043852140923, + "Y": 647.75326420422834, + "IsEmpty": false + }, + "Timestamp": 637316498805026790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701899767, + "Position": { + "X": 852.19236234953428, + "Y": 649.70253178235339, + "IsEmpty": false + }, + "Timestamp": 637316498805198510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703852892, + "Position": { + "X": 853.17026762297178, + "Y": 650.51996342297832, + "IsEmpty": false + }, + "Timestamp": 637316498805372530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705806077, + "Position": { + "X": 853.07563871672176, + "Y": 649.45101811047834, + "IsEmpty": false + }, + "Timestamp": 637316498805542600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 851.84534086515919, + "Y": 646.87294193860339, + "IsEmpty": false + }, + "Timestamp": 637316498805704210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 849.66870512297169, + "Y": 643.88617436047832, + "IsEmpty": false + }, + "Timestamp": 637316498805874050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 846.70339750578421, + "Y": 640.11337162610334, + "IsEmpty": false + }, + "Timestamp": 637316498806039690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 845.22075590422173, + "Y": 638.10121342297839, + "IsEmpty": false + }, + "Timestamp": 637316498806218440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 845.09455961515926, + "Y": 637.94403568860332, + "IsEmpty": false + }, + "Timestamp": 637316498806378420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 845.44155668547171, + "Y": 638.47850834485337, + "IsEmpty": false + }, + "Timestamp": 637316498806547070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720210552, + "Position": { + "X": 846.89267973234678, + "Y": 640.3020435011033, + "IsEmpty": false + }, + "Timestamp": 637316498806722560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 850.55198149015928, + "Y": 644.23202396985334, + "IsEmpty": false + }, + "Timestamp": 637316498806895580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 853.23335356047176, + "Y": 646.6528735792283, + "IsEmpty": false + }, + "Timestamp": 637316498807055560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730708778, + "Position": { + "X": 855.66238188078421, + "Y": 648.60214115735334, + "IsEmpty": false + }, + "Timestamp": 637316498807231070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 856.67185453703428, + "Y": 649.41957279797839, + "IsEmpty": false + }, + "Timestamp": 637316498807403630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 856.51411527922176, + "Y": 648.41351811047832, + "IsEmpty": false + }, + "Timestamp": 637316498807569290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 854.74756254484669, + "Y": 645.77255131360334, + "IsEmpty": false + }, + "Timestamp": 637316498807733580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 851.78225492765921, + "Y": 642.53427006360334, + "IsEmpty": false + }, + "Timestamp": 637316498807901930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 848.94314359953421, + "Y": 638.91869389172837, + "IsEmpty": false + }, + "Timestamp": 637316498808075950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 846.23020414640928, + "Y": 635.3345142042283, + "IsEmpty": false + }, + "Timestamp": 637316498808238140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736568272, + "Position": { + "X": 845.82012113859673, + "Y": 634.86293217297839, + "IsEmpty": false + }, + "Timestamp": 637316498808416680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736568272, + "Position": { + "X": 846.60876859953419, + "Y": 636.59213139172834, + "IsEmpty": false + }, + "Timestamp": 637316498808755880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 849.70024809172173, + "Y": 640.74218021985337, + "IsEmpty": false + }, + "Timestamp": 637316498808921280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 852.88635649015919, + "Y": 643.91761967297839, + "IsEmpty": false + }, + "Timestamp": 637316498809082530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 856.41948637297173, + "Y": 646.99872318860332, + "IsEmpty": false + }, + "Timestamp": 637316498809256000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742427707, + "Position": { + "X": 858.94314359953421, + "Y": 649.6396899854783, + "IsEmpty": false + }, + "Timestamp": 637316498809430800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 860.04724516203419, + "Y": 650.74008061047834, + "IsEmpty": false + }, + "Timestamp": 637316498809591010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 859.92107328703423, + "Y": 649.98549076672839, + "IsEmpty": false + }, + "Timestamp": 637316498809758580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 858.24914945890919, + "Y": 646.96727787610337, + "IsEmpty": false + }, + "Timestamp": 637316498809934080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 853.83274320890928, + "Y": 642.15697514172837, + "IsEmpty": false + }, + "Timestamp": 637316498810098100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 849.70024809172173, + "Y": 637.56674076672834, + "IsEmpty": false + }, + "Timestamp": 637316498810271340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 847.77595609953426, + "Y": 635.39740482922832, + "IsEmpty": false + }, + "Timestamp": 637316498810441810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 847.14504789640921, + "Y": 634.7685962354783, + "IsEmpty": false + }, + "Timestamp": 637316498810606790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 847.42895902922169, + "Y": 635.46029545422834, + "IsEmpty": false + }, + "Timestamp": 637316498810776070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 848.72231840422171, + "Y": 637.72396732922834, + "IsEmpty": false + }, + "Timestamp": 637316498810948970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 851.18288969328421, + "Y": 641.02513920422837, + "IsEmpty": false + }, + "Timestamp": 637316498811109360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 855.28384184172171, + "Y": 644.60927006360339, + "IsEmpty": false + }, + "Timestamp": 637316498811281150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 859.88950590422178, + "Y": 649.10516850110332, + "IsEmpty": false + }, + "Timestamp": 637316498811456610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 862.53935941984673, + "Y": 651.77758061047837, + "IsEmpty": false + }, + "Timestamp": 637316498811623560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 863.01255277922178, + "Y": 652.24916264172839, + "IsEmpty": false + }, + "Timestamp": 637316498811785800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 862.66553129484669, + "Y": 650.80292240735332, + "IsEmpty": false + }, + "Timestamp": 637316498811959450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 860.58352445890921, + "Y": 647.03016850110339, + "IsEmpty": false + }, + "Timestamp": 637316498812123360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 854.27436918547176, + "Y": 640.0190845167283, + "IsEmpty": false + }, + "Timestamp": 637316498812299050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 850.23652738859676, + "Y": 635.58602787610334, + "IsEmpty": false + }, + "Timestamp": 637316498812464250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 846.98730863859669, + "Y": 632.44208256360332, + "IsEmpty": false + }, + "Timestamp": 637316498812636270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 844.49519438078426, + "Y": 630.55565678235337, + "IsEmpty": false + }, + "Timestamp": 637316498812802150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 844.65293363859678, + "Y": 630.83861576672837, + "IsEmpty": false + }, + "Timestamp": 637316498812977240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 846.32485746672171, + "Y": 632.81932865735337, + "IsEmpty": false + }, + "Timestamp": 637316498813143300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 849.10088285734673, + "Y": 636.15194584485334, + "IsEmpty": false + }, + "Timestamp": 637316498813307600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 855.31538481047176, + "Y": 642.09408451672834, + "IsEmpty": false + }, + "Timestamp": 637316498813475480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 859.95261625578428, + "Y": 646.05551029797834, + "IsEmpty": false + }, + "Timestamp": 637316498813647460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 863.26492094328421, + "Y": 649.13661381360339, + "IsEmpty": false + }, + "Timestamp": 637316498813814140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 865.06301664640921, + "Y": 650.80292240735332, + "IsEmpty": false + }, + "Timestamp": 637316498813986660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 864.87373441984676, + "Y": 649.60824467297834, + "IsEmpty": false + }, + "Timestamp": 637316498814152450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 862.50781645109669, + "Y": 645.83544193860337, + "IsEmpty": false + }, + "Timestamp": 637316498814325310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 857.90212797453421, + "Y": 640.39633061047834, + "IsEmpty": false + }, + "Timestamp": 637316498814493040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 852.63398832609676, + "Y": 634.9258227979783, + "IsEmpty": false + }, + "Timestamp": 637316498814666380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 846.07248930265928, + "Y": 628.85790287610337, + "IsEmpty": false + }, + "Timestamp": 637316498814830810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 843.99045805265928, + "Y": 627.2859302198533, + "IsEmpty": false + }, + "Timestamp": 637316498815004310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 843.73808988859673, + "Y": 627.16014896985337, + "IsEmpty": false + }, + "Timestamp": 637316498815167900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 844.71601957609676, + "Y": 628.57494389172837, + "IsEmpty": false + }, + "Timestamp": 637316498815338060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 849.44787992765919, + "Y": 633.60531498547834, + "IsEmpty": false + }, + "Timestamp": 637316498815510080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750484467, + "Position": { + "X": 854.21128324797178, + "Y": 638.41561771985334, + "IsEmpty": false + }, + "Timestamp": 637316498815677520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752437651, + "Position": { + "X": 860.14187406828421, + "Y": 644.04335209485339, + "IsEmpty": false + }, + "Timestamp": 637316498815841210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752437651, + "Position": { + "X": 863.01255277922178, + "Y": 646.96727787610337, + "IsEmpty": false + }, + "Timestamp": 637316498816018620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 872.12925199797178, + "Y": 655.26742436047834, + "IsEmpty": false + }, + "Timestamp": 637316498816178370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 873.42263578703421, + "Y": 656.30492436047837, + "IsEmpty": false + }, + "Timestamp": 637316498816348450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 873.07563871672176, + "Y": 655.48749271985332, + "IsEmpty": false + }, + "Timestamp": 637316498816521240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.751461029, + "Position": { + "X": 870.74123930265921, + "Y": 652.06053959485337, + "IsEmpty": false + }, + "Timestamp": 637316498816691750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 863.45417875578426, + "Y": 643.57177006360337, + "IsEmpty": false + }, + "Timestamp": 637316498816863590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 857.77595609953426, + "Y": 637.1894946729783, + "IsEmpty": false + }, + "Timestamp": 637316498817032060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745601594, + "Position": { + "X": 852.19236234953428, + "Y": 632.19052006360334, + "IsEmpty": false + }, + "Timestamp": 637316498817192820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.74364841, + "Position": { + "X": 848.46995024015928, + "Y": 628.79506107922839, + "IsEmpty": false + }, + "Timestamp": 637316498817364370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.74364841, + "Position": { + "X": 846.54565824797169, + "Y": 627.06586186047832, + "IsEmpty": false + }, + "Timestamp": 637316498817530410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.74364841, + "Position": { + "X": 847.05039457609678, + "Y": 627.78895756360339, + "IsEmpty": false + }, + "Timestamp": 637316498817706060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.74364841, + "Position": { + "X": 849.47942289640923, + "Y": 630.49276615735334, + "IsEmpty": false + }, + "Timestamp": 637316498817868590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745601594, + "Position": { + "X": 853.58037504484673, + "Y": 634.54852787610332, + "IsEmpty": false + }, + "Timestamp": 637316498818045620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 861.68762602140919, + "Y": 642.47137943860332, + "IsEmpty": false + }, + "Timestamp": 637316498818210670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 867.20813383390919, + "Y": 647.43885990735339, + "IsEmpty": false + }, + "Timestamp": 637316498818383660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 869.47942289640923, + "Y": 649.41957279797839, + "IsEmpty": false + }, + "Timestamp": 637316498818548270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 872.79172758390928, + "Y": 652.12343021985339, + "IsEmpty": false + }, + "Timestamp": 637316498818718680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 871.93999418547173, + "Y": 650.23700443860332, + "IsEmpty": false + }, + "Timestamp": 637316498818890460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 868.59614652922176, + "Y": 645.8039966261033, + "IsEmpty": false + }, + "Timestamp": 637316498819071250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 863.54883207609669, + "Y": 640.27059818860334, + "IsEmpty": false + }, + "Timestamp": 637316498819222460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 858.37532133390926, + "Y": 634.26556889172832, + "IsEmpty": false + }, + "Timestamp": 637316498819392600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 850.48889555265919, + "Y": 627.47455326672832, + "IsEmpty": false + }, + "Timestamp": 637316498819558690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 848.02832426359669, + "Y": 625.0222583448533, + "IsEmpty": false + }, + "Timestamp": 637316498819734780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 847.49204496672178, + "Y": 624.51923100110332, + "IsEmpty": false + }, + "Timestamp": 637316498819904700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 847.83904203703423, + "Y": 625.17943607922837, + "IsEmpty": false + }, + "Timestamp": 637316498820073280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 852.12925199797178, + "Y": 629.58104740735337, + "IsEmpty": false + }, + "Timestamp": 637316498820235740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 857.33430570890926, + "Y": 634.04550053235334, + "IsEmpty": false + }, + "Timestamp": 637316498820409620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 862.82327055265921, + "Y": 639.61034428235337, + "IsEmpty": false + }, + "Timestamp": 637316498820580520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 868.78540434172169, + "Y": 644.64071537610334, + "IsEmpty": false + }, + "Timestamp": 637316498820743130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750240326, + "Position": { + "X": 874.08508695890919, + "Y": 649.4824634229783, + "IsEmpty": false + }, + "Timestamp": 637316498820918200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752193511, + "Position": { + "X": 874.71601957609676, + "Y": 650.14271732922839, + "IsEmpty": false + }, + "Timestamp": 637316498821087940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75194931, + "Position": { + "X": 874.27436918547176, + "Y": 648.9165454542283, + "IsEmpty": false + }, + "Timestamp": 637316498821249250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 871.56142973234671, + "Y": 644.98656498547837, + "IsEmpty": false + }, + "Timestamp": 637316498821426300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 864.08511137297171, + "Y": 636.30917240735334, + "IsEmpty": false + }, + "Timestamp": 637316498821593420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 858.37532133390926, + "Y": 630.3984790479783, + "IsEmpty": false + }, + "Timestamp": 637316498821761630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 853.07563871672176, + "Y": 625.7139087354783, + "IsEmpty": false + }, + "Timestamp": 637316498821926810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 849.76333402922171, + "Y": 622.4756274854783, + "IsEmpty": false + }, + "Timestamp": 637316498822095660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 848.05986723234673, + "Y": 620.80931889172837, + "IsEmpty": false + }, + "Timestamp": 637316498822268290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 848.46995024015928, + "Y": 621.46957279797834, + "IsEmpty": false + }, + "Timestamp": 637316498822439760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742183566, + "Position": { + "X": 850.39424223234676, + "Y": 624.20482670422837, + "IsEmpty": false + }, + "Timestamp": 637316498822602040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 854.81064848234678, + "Y": 628.38632084485334, + "IsEmpty": false + }, + "Timestamp": 637316498822775880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746089876, + "Position": { + "X": 863.58037504484673, + "Y": 637.34667240735337, + "IsEmpty": false + }, + "Timestamp": 637316498822945350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 870.45732816984673, + "Y": 643.6975513136033, + "IsEmpty": false + }, + "Timestamp": 637316498823109400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749996185, + "Position": { + "X": 875.82012113859673, + "Y": 649.3567310011033, + "IsEmpty": false + }, + "Timestamp": 637316498823277140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749996185, + "Position": { + "X": 879.06931547453428, + "Y": 652.78363529797832, + "IsEmpty": false + }, + "Timestamp": 637316498823445050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744869173, + "Position": { + "X": 880.64661039640919, + "Y": 654.13558842297834, + "IsEmpty": false + }, + "Timestamp": 637316498823621900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733638525, + "Position": { + "X": 879.76333402922171, + "Y": 652.94086186047832, + "IsEmpty": false + }, + "Timestamp": 637316498823783950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720698833, + "Position": { + "X": 877.30276274015921, + "Y": 649.32528568860334, + "IsEmpty": false + }, + "Timestamp": 637316498823952470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717525005, + "Position": { + "X": 872.72864164640919, + "Y": 643.5403247511033, + "IsEmpty": false + }, + "Timestamp": 637316498824126260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713374555, + "Position": { + "X": 863.48572172453419, + "Y": 633.6367602979783, + "IsEmpty": false + }, + "Timestamp": 637316498824297270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 857.55513090422176, + "Y": 627.9775806104783, + "IsEmpty": false + }, + "Timestamp": 637316498824459760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 853.04409574797171, + "Y": 623.7331958448533, + "IsEmpty": false + }, + "Timestamp": 637316498824635570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 850.61506742765926, + "Y": 621.3437915479783, + "IsEmpty": false + }, + "Timestamp": 637316498824807620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 849.92107328703423, + "Y": 620.68353764172832, + "IsEmpty": false + }, + "Timestamp": 637316498824968680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713374555, + "Position": { + "X": 851.34062895109673, + "Y": 622.66425053235332, + "IsEmpty": false + }, + "Timestamp": 637316498825141850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718501568, + "Position": { + "X": 854.90527738859669, + "Y": 626.34271732922832, + "IsEmpty": false + }, + "Timestamp": 637316498825306790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720943034, + "Position": { + "X": 860.26807035734669, + "Y": 631.56176029797837, + "IsEmpty": false + }, + "Timestamp": 637316498825475080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 870.48889555265919, + "Y": 641.87401615735337, + "IsEmpty": false + }, + "Timestamp": 637316498825641450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726802468, + "Position": { + "X": 877.17659086515926, + "Y": 648.6335864698533, + "IsEmpty": false + }, + "Timestamp": 637316498825819670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 882.12925199797178, + "Y": 653.47533451672837, + "IsEmpty": false + }, + "Timestamp": 637316498825980940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 884.71601957609676, + "Y": 655.73900639172837, + "IsEmpty": false + }, + "Timestamp": 637316498826153350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726558328, + "Position": { + "X": 883.45417875578426, + "Y": 653.97836186047834, + "IsEmpty": false + }, + "Timestamp": 637316498826319310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722163737, + "Position": { + "X": 879.13242582609678, + "Y": 648.3506274854783, + "IsEmpty": false + }, + "Timestamp": 637316498826489580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720210552, + "Position": { + "X": 872.82327055265921, + "Y": 640.7107349073533, + "IsEmpty": false + }, + "Timestamp": 637316498826657300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718257427, + "Position": { + "X": 865.12610258390919, + "Y": 632.63070561047834, + "IsEmpty": false + }, + "Timestamp": 637316498826827550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716304243, + "Position": { + "X": 854.21128324797178, + "Y": 621.68964115735332, + "IsEmpty": false + }, + "Timestamp": 637316498826995740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716304243, + "Position": { + "X": 848.81697172453426, + "Y": 616.62782475110339, + "IsEmpty": false + }, + "Timestamp": 637316498827163030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 845.56775297453419, + "Y": 613.7038989698533, + "IsEmpty": false + }, + "Timestamp": 637316498827331580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 844.87373441984676, + "Y": 613.10653568860334, + "IsEmpty": false + }, + "Timestamp": 637316498827500610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726070046, + "Position": { + "X": 847.23967680265923, + "Y": 615.55883061047837, + "IsEmpty": false + }, + "Timestamp": 637316498827676740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730708778, + "Position": { + "X": 851.40371488859671, + "Y": 619.33163334485334, + "IsEmpty": false + }, + "Timestamp": 637316498827846570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 857.20813383390919, + "Y": 624.83363529797839, + "IsEmpty": false + }, + "Timestamp": 637316498828007570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736812413, + "Position": { + "X": 864.49519438078426, + "Y": 631.49886967297834, + "IsEmpty": false + }, + "Timestamp": 637316498828186320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738765538, + "Position": { + "X": 875.44155668547171, + "Y": 641.77968021985339, + "IsEmpty": false + }, + "Timestamp": 637316498828353430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740718722, + "Position": { + "X": 880.83589262297176, + "Y": 646.2441821729783, + "IsEmpty": false + }, + "Timestamp": 637316498828519780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740718722, + "Position": { + "X": 883.64346098234671, + "Y": 648.60214115735334, + "IsEmpty": false + }, + "Timestamp": 637316498828684740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740718722, + "Position": { + "X": 883.95891508390923, + "Y": 648.85365482922839, + "IsEmpty": false + }, + "Timestamp": 637316498828853380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.72753489, + "Position": { + "X": 880.26807035734669, + "Y": 644.35775639172834, + "IsEmpty": false + }, + "Timestamp": 637316498829025940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 875.12610258390919, + "Y": 637.97548100110339, + "IsEmpty": false + }, + "Timestamp": 637316498829196130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 867.93367094328426, + "Y": 630.49276615735334, + "IsEmpty": false + }, + "Timestamp": 637316498829359630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 860.64661039640919, + "Y": 623.0415454542283, + "IsEmpty": false + }, + "Timestamp": 637316498829531360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71532768, + "Position": { + "X": 851.15134672453428, + "Y": 615.43309818860337, + "IsEmpty": false + }, + "Timestamp": 637316498829705530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71532768, + "Position": { + "X": 847.90212797453421, + "Y": 612.66639896985339, + "IsEmpty": false + }, + "Timestamp": 637316498829867310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713374555, + "Position": { + "X": 846.82956938078428, + "Y": 611.91180912610332, + "IsEmpty": false + }, + "Timestamp": 637316498830043840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.713374555, + "Position": { + "X": 847.49204496672178, + "Y": 612.94935795422839, + "IsEmpty": false + }, + "Timestamp": 637316498830207630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720210552, + "Position": { + "X": 853.42263578703421, + "Y": 618.82860600110337, + "IsEmpty": false + }, + "Timestamp": 637316498830381380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 860.17341703703426, + "Y": 625.55673100110334, + "IsEmpty": false + }, + "Timestamp": 637316498830553230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724361002, + "Position": { + "X": 868.59614652922176, + "Y": 633.3538013136033, + "IsEmpty": false + }, + "Timestamp": 637316498830717890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726314187, + "Position": { + "X": 877.14504789640921, + "Y": 641.8425708448533, + "IsEmpty": false + }, + "Timestamp": 637316498830880640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728267312, + "Position": { + "X": 888.31223539640928, + "Y": 653.1609302198533, + "IsEmpty": false + }, + "Timestamp": 637316498831056610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728267312, + "Position": { + "X": 892.12925199797178, + "Y": 657.31097904797832, + "IsEmpty": false + }, + "Timestamp": 637316498831227190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728267312, + "Position": { + "X": 894.17974027922173, + "Y": 659.63754154797834, + "IsEmpty": false + }, + "Timestamp": 637316498831387200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 894.68447660734671, + "Y": 660.20345951672834, + "IsEmpty": false + }, + "Timestamp": 637316498831559310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706294358, + "Position": { + "X": 892.25544828703426, + "Y": 656.30492436047837, + "IsEmpty": false + }, + "Timestamp": 637316498831733170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700434864, + "Position": { + "X": 887.08193754484671, + "Y": 648.44496342297839, + "IsEmpty": false + }, + "Timestamp": 637316498831898110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698237598, + "Position": { + "X": 879.54250883390921, + "Y": 639.42172123547834, + "IsEmpty": false + }, + "Timestamp": 637316498832064000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696284413, + "Position": { + "X": 871.87690824797176, + "Y": 630.64999271985334, + "IsEmpty": false + }, + "Timestamp": 637316498832240260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 860.61506742765926, + "Y": 619.39452396985337, + "IsEmpty": false + }, + "Timestamp": 637316498832402270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 855.18918852140928, + "Y": 614.89862553235332, + "IsEmpty": false + }, + "Timestamp": 637316498832568760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 852.22390531828421, + "Y": 612.7292895948533, + "IsEmpty": false + }, + "Timestamp": 637316498832741800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 851.65608305265926, + "Y": 612.38343998547839, + "IsEmpty": false + }, + "Timestamp": 637316498832916560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708003342, + "Position": { + "X": 854.68447660734671, + "Y": 615.15013920422837, + "IsEmpty": false + }, + "Timestamp": 637316498833080750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716548383, + "Position": { + "X": 859.79487699797176, + "Y": 619.67748295422837, + "IsEmpty": false + }, + "Timestamp": 637316498833251670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718501568, + "Position": { + "X": 866.45102934172178, + "Y": 626.18553959485337, + "IsEmpty": false + }, + "Timestamp": 637316498833419000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720698833, + "Position": { + "X": 874.55828031828423, + "Y": 633.6367602979783, + "IsEmpty": false + }, + "Timestamp": 637316498833592640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 886.45102934172178, + "Y": 644.8293872511033, + "IsEmpty": false + }, + "Timestamp": 637316498833755420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 889.32168363859671, + "Y": 647.84760014172832, + "IsEmpty": false + }, + "Timestamp": 637316498833923090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 894.49519438078426, + "Y": 652.84652592297834, + "IsEmpty": false + }, + "Timestamp": 637316498834093430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 894.65293363859678, + "Y": 652.7522388136033, + "IsEmpty": false + }, + "Timestamp": 637316498834262670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722896159, + "Position": { + "X": 890.14187406828421, + "Y": 646.14984623547832, + "IsEmpty": false + }, + "Timestamp": 637316498834432680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722896159, + "Position": { + "X": 883.61191801359678, + "Y": 638.3213306104783, + "IsEmpty": false + }, + "Timestamp": 637316498834602800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722896159, + "Position": { + "X": 875.31538481047176, + "Y": 629.5496020948533, + "IsEmpty": false + }, + "Timestamp": 637316498834769960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720698833, + "Position": { + "X": 866.29329008390926, + "Y": 620.87220951672839, + "IsEmpty": false + }, + "Timestamp": 637316498834940120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718745708, + "Position": { + "X": 855.22075590422173, + "Y": 610.8743091261033, + "IsEmpty": false + }, + "Timestamp": 637316498835110760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718745708, + "Position": { + "X": 850.99360746672176, + "Y": 607.1958423292283, + "IsEmpty": false + }, + "Timestamp": 637316498835280300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718745708, + "Position": { + "X": 849.35322660734676, + "Y": 605.74960209485334, + "IsEmpty": false + }, + "Timestamp": 637316498835451420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718745708, + "Position": { + "X": 850.01570219328426, + "Y": 606.12689701672832, + "IsEmpty": false + }, + "Timestamp": 637316498835611830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.72338444, + "Position": { + "X": 855.12610258390919, + "Y": 610.1826587354783, + "IsEmpty": false + }, + "Timestamp": 637316498835788750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728023171, + "Position": { + "X": 861.21443266203426, + "Y": 615.65316654797834, + "IsEmpty": false + }, + "Timestamp": 637316498835953240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728023171, + "Position": { + "X": 869.41633695890926, + "Y": 623.10443607922832, + "IsEmpty": false + }, + "Timestamp": 637316498836123460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.731929481, + "Position": { + "X": 878.97468656828426, + "Y": 632.12767826672837, + "IsEmpty": false + }, + "Timestamp": 637316498836291650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 892.41316313078426, + "Y": 645.42670170422832, + "IsEmpty": false + }, + "Timestamp": 637316498836457310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738033116, + "Position": { + "X": 898.65923246672173, + "Y": 651.80902592297832, + "IsEmpty": false + }, + "Timestamp": 637316498836628570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 901.81379789640926, + "Y": 655.29882084485337, + "IsEmpty": false + }, + "Timestamp": 637316498836802470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 902.31853422453423, + "Y": 655.92762943860339, + "IsEmpty": false + }, + "Timestamp": 637316498836966790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73559165, + "Position": { + "X": 899.79487699797176, + "Y": 652.72079350110334, + "IsEmpty": false + }, + "Timestamp": 637316498837137890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73559165, + "Position": { + "X": 894.74756254484669, + "Y": 646.55853764172832, + "IsEmpty": false + }, + "Timestamp": 637316498837303610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733638525, + "Position": { + "X": 887.58667387297169, + "Y": 637.91259037610337, + "IsEmpty": false + }, + "Timestamp": 637316498837471250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733638525, + "Position": { + "X": 878.97468656828426, + "Y": 629.32953373547832, + "IsEmpty": false + }, + "Timestamp": 637316498837648160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 867.74441313078421, + "Y": 618.29413334485332, + "IsEmpty": false + }, + "Timestamp": 637316498837817100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 861.90845121672169, + "Y": 613.0122485792283, + "IsEmpty": false + }, + "Timestamp": 637316498837983330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 858.81697172453426, + "Y": 610.0254321729783, + "IsEmpty": false + }, + "Timestamp": 637316498838145440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 858.12295316984671, + "Y": 609.36517826672832, + "IsEmpty": false + }, + "Timestamp": 637316498838323170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 860.96206449797171, + "Y": 612.5720630323533, + "IsEmpty": false + }, + "Timestamp": 637316498838489040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 866.29329008390926, + "Y": 617.57098881360332, + "IsEmpty": false + }, + "Timestamp": 637316498838654550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 873.92737211515919, + "Y": 624.95936771985339, + "IsEmpty": false + }, + "Timestamp": 637316498838823530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.735347509, + "Position": { + "X": 882.91789945890923, + "Y": 633.29095951672832, + "IsEmpty": false + }, + "Timestamp": 637316498838999310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737300694, + "Position": { + "X": 894.52673734953419, + "Y": 644.73505131360332, + "IsEmpty": false + }, + "Timestamp": 637316498839167390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737300694, + "Position": { + "X": 898.94314359953421, + "Y": 649.0737720167283, + "IsEmpty": false + }, + "Timestamp": 637316498839331740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737300694, + "Position": { + "X": 899.76333402922171, + "Y": 649.9226489698533, + "IsEmpty": false + }, + "Timestamp": 637316498839500120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737300694, + "Position": { + "X": 898.24912504484678, + "Y": 647.62753178235334, + "IsEmpty": false + }, + "Timestamp": 637316498839675250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737300694, + "Position": { + "X": 890.36269926359671, + "Y": 638.22699467297832, + "IsEmpty": false + }, + "Timestamp": 637316498839843810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.735347509, + "Position": { + "X": 882.22390531828421, + "Y": 629.58104740735337, + "IsEmpty": false + }, + "Timestamp": 637316498840005370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 874.05354399015926, + "Y": 621.37523686047837, + "IsEmpty": false + }, + "Timestamp": 637316498840175020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 866.92422270109671, + "Y": 615.6846118604783, + "IsEmpty": false + }, + "Timestamp": 637316498840350970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 861.68762602140919, + "Y": 611.50311771985332, + "IsEmpty": false + }, + "Timestamp": 637316498840519020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 861.52988676359678, + "Y": 611.56600834485334, + "IsEmpty": false + }, + "Timestamp": 637316498840681460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 863.89582914640926, + "Y": 614.23837162610334, + "IsEmpty": false + }, + "Timestamp": 637316498840853720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 869.85796293547173, + "Y": 618.95433842297837, + "IsEmpty": false + }, + "Timestamp": 637316498841022310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 881.68762602140919, + "Y": 629.61249271985332, + "IsEmpty": false + }, + "Timestamp": 637316498841195720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 889.70024809172173, + "Y": 637.09515873547832, + "IsEmpty": false + }, + "Timestamp": 637316498841359780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 896.19866117765923, + "Y": 642.18842045422832, + "IsEmpty": false + }, + "Timestamp": 637316498841528490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 899.06931547453428, + "Y": 643.8232837354783, + "IsEmpty": false + }, + "Timestamp": 637316498841698520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 895.88320707609671, + "Y": 638.69857670422834, + "IsEmpty": false + }, + "Timestamp": 637316498841870190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 889.92104887297171, + "Y": 631.68749271985337, + "IsEmpty": false + }, + "Timestamp": 637316498842039120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 882.60244535734671, + "Y": 624.2991138136033, + "IsEmpty": false + }, + "Timestamp": 637316498842202430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736324072, + "Position": { + "X": 875.72546781828419, + "Y": 618.01117436047832, + "IsEmpty": false + }, + "Timestamp": 637316498842376020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73559165, + "Position": { + "X": 868.62768949797169, + "Y": 612.41488529797834, + "IsEmpty": false + }, + "Timestamp": 637316498842548420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73559165, + "Position": { + "X": 866.95576566984676, + "Y": 611.25160404797839, + "IsEmpty": false + }, + "Timestamp": 637316498842710520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73559165, + "Position": { + "X": 867.96521391203419, + "Y": 612.06903568860332, + "IsEmpty": false + }, + "Timestamp": 637316498842884230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73559165, + "Position": { + "X": 871.75071195890928, + "Y": 615.27587162610337, + "IsEmpty": false + }, + "Timestamp": 637316498843050240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737544835, + "Position": { + "X": 880.42578520109669, + "Y": 623.19872318860337, + "IsEmpty": false + }, + "Timestamp": 637316498843223460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 887.27121977140928, + "Y": 629.29808842297837, + "IsEmpty": false + }, + "Timestamp": 637316498843391690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 892.82327055265921, + "Y": 634.2026782667283, + "IsEmpty": false + }, + "Timestamp": 637316498843560560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 895.72546781828419, + "Y": 636.4663501417283, + "IsEmpty": false + }, + "Timestamp": 637316498843723470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 893.67500395109676, + "Y": 632.97655521985337, + "IsEmpty": false + }, + "Timestamp": 637316498843898990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742427707, + "Position": { + "X": 888.69077543547178, + "Y": 626.94008061047839, + "IsEmpty": false + }, + "Timestamp": 637316498844071600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742427707, + "Position": { + "X": 882.63398832609676, + "Y": 620.62069584485334, + "IsEmpty": false + }, + "Timestamp": 637316498844237480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 877.20813383390919, + "Y": 616.06190678235339, + "IsEmpty": false + }, + "Timestamp": 637316498844405000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 873.07563871672176, + "Y": 612.25765873547834, + "IsEmpty": false + }, + "Timestamp": 637316498844575790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 872.69709867765926, + "Y": 611.91180912610332, + "IsEmpty": false + }, + "Timestamp": 637316498844751280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 874.05354399015926, + "Y": 613.23231693860339, + "IsEmpty": false + }, + "Timestamp": 637316498844905140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742427707, + "Position": { + "X": 877.58667387297169, + "Y": 616.59637943860332, + "IsEmpty": false + }, + "Timestamp": 637316498845082410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 885.50466703703421, + "Y": 623.38739506360332, + "IsEmpty": false + }, + "Timestamp": 637316498845252810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 890.45732816984673, + "Y": 628.16625248547837, + "IsEmpty": false + }, + "Timestamp": 637316498845427520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 894.49519438078426, + "Y": 631.21591068860334, + "IsEmpty": false + }, + "Timestamp": 637316498845585520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 895.94629301359669, + "Y": 631.8132739698533, + "IsEmpty": false + }, + "Timestamp": 637316498845753180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 892.35007719328428, + "Y": 626.97152592297834, + "IsEmpty": false + }, + "Timestamp": 637316498845926400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 887.36584867765919, + "Y": 620.71498295422839, + "IsEmpty": false + }, + "Timestamp": 637316498846088540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 881.08826078703419, + "Y": 615.05580326672839, + "IsEmpty": false + }, + "Timestamp": 637316498846262260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 876.70339750578421, + "Y": 610.7485767042283, + "IsEmpty": false + }, + "Timestamp": 637316498846473980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 874.21128324797178, + "Y": 608.23334232922832, + "IsEmpty": false + }, + "Timestamp": 637316498846604310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 873.95891508390923, + "Y": 607.88754154797834, + "IsEmpty": false + }, + "Timestamp": 637316498846764010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744136691, + "Position": { + "X": 876.26174711515921, + "Y": 610.3083911573533, + "IsEmpty": false + }, + "Timestamp": 637316498846937530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746089876, + "Position": { + "X": 880.61506742765926, + "Y": 614.36415287610339, + "IsEmpty": false + }, + "Timestamp": 637316498847107870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 889.25859770109673, + "Y": 622.22411381360337, + "IsEmpty": false + }, + "Timestamp": 637316498847279900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 894.52673734953419, + "Y": 627.16014896985337, + "IsEmpty": false + }, + "Timestamp": 637316498847447990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 898.50149320890921, + "Y": 630.3984790479783, + "IsEmpty": false + }, + "Timestamp": 637316498847611540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749996185, + "Position": { + "X": 899.38479399015921, + "Y": 630.90150639172839, + "IsEmpty": false + }, + "Timestamp": 637316498847784260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749996185, + "Position": { + "X": 895.82012113859673, + "Y": 626.8457446729783, + "IsEmpty": false + }, + "Timestamp": 637316498847954540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749996185, + "Position": { + "X": 891.15134672453428, + "Y": 621.46957279797834, + "IsEmpty": false + }, + "Timestamp": 637316498848117620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749996185, + "Position": { + "X": 886.13557524015926, + "Y": 616.40770756360337, + "IsEmpty": false + }, + "Timestamp": 637316498848287910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 882.12925199797178, + "Y": 612.98080326672834, + "IsEmpty": false + }, + "Timestamp": 637316498848462440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 879.82641996672169, + "Y": 611.09437748547839, + "IsEmpty": false + }, + "Timestamp": 637316498848631430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 880.55198149015928, + "Y": 611.7231860792283, + "IsEmpty": false + }, + "Timestamp": 637316498848792460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748043001, + "Position": { + "X": 883.39109281828428, + "Y": 614.08119389172839, + "IsEmpty": false + }, + "Timestamp": 637316498848963300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752681792, + "Position": { + "X": 889.60559477140919, + "Y": 619.61459232922834, + "IsEmpty": false + }, + "Timestamp": 637316498849134180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752681792, + "Position": { + "X": 893.92737211515919, + "Y": 623.6074634229783, + "IsEmpty": false + }, + "Timestamp": 637316498849298640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752681792, + "Position": { + "X": 897.58667387297169, + "Y": 626.75145756360337, + "IsEmpty": false + }, + "Timestamp": 637316498849465990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752681792, + "Position": { + "X": 899.63713774015923, + "Y": 628.10336186047834, + "IsEmpty": false + }, + "Timestamp": 637316498849647650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752681792, + "Position": { + "X": 899.38479399015921, + "Y": 627.19159428235332, + "IsEmpty": false + }, + "Timestamp": 637316498849815990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752681792, + "Position": { + "X": 895.37847074797173, + "Y": 621.56385990735339, + "IsEmpty": false + }, + "Timestamp": 637316498850060570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750484467, + "Position": { + "X": 891.78225492765921, + "Y": 617.88539311047839, + "IsEmpty": false + }, + "Timestamp": 637316498850141380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750484467, + "Position": { + "X": 889.29014066984678, + "Y": 615.1186938917283, + "IsEmpty": false + }, + "Timestamp": 637316498850318110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750484467, + "Position": { + "X": 888.24912504484678, + "Y": 613.8611255323533, + "IsEmpty": false + }, + "Timestamp": 637316498850490420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750484467, + "Position": { + "X": 889.00622953703419, + "Y": 614.5527759229783, + "IsEmpty": false + }, + "Timestamp": 637316498850654790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750484467, + "Position": { + "X": 891.37217191984678, + "Y": 616.75355717297839, + "IsEmpty": false + }, + "Timestamp": 637316498850824960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750484467, + "Position": { + "X": 894.52673734953419, + "Y": 619.39452396985337, + "IsEmpty": false + }, + "Timestamp": 637316498850992060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750484467, + "Position": { + "X": 897.93367094328426, + "Y": 622.60140873547834, + "IsEmpty": false + }, + "Timestamp": 637316498851159180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 901.11980375578423, + "Y": 625.7139087354783, + "IsEmpty": false + }, + "Timestamp": 637316498851334480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 900.23652738859676, + "Y": 623.29305912610334, + "IsEmpty": false + }, + "Timestamp": 637316498851665600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.751461029, + "Position": { + "X": 895.41001371672178, + "Y": 617.03651615735339, + "IsEmpty": false + }, + "Timestamp": 637316498851840960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 892.25544828703426, + "Y": 613.32660404797832, + "IsEmpty": false + }, + "Timestamp": 637316498852009700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 890.26807035734669, + "Y": 610.62279545422837, + "IsEmpty": false + }, + "Timestamp": 637316498852175450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 889.44787992765919, + "Y": 609.42806889172834, + "IsEmpty": false + }, + "Timestamp": 637316498852348060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 891.78225492765921, + "Y": 611.8804126417283, + "IsEmpty": false + }, + "Timestamp": 637316498852687580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 894.24282621672171, + "Y": 614.1440845167283, + "IsEmpty": false + }, + "Timestamp": 637316498852848390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 896.73494047453426, + "Y": 616.18763920422839, + "IsEmpty": false + }, + "Timestamp": 637316498853018560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 898.31223539640928, + "Y": 617.31947514172839, + "IsEmpty": false + }, + "Timestamp": 637316498853190720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 898.28069242765923, + "Y": 616.94222904797834, + "IsEmpty": false + }, + "Timestamp": 637316498853356060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 897.36584867765919, + "Y": 615.05580326672839, + "IsEmpty": false + }, + "Timestamp": 637316498853523810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 896.07248930265928, + "Y": 613.04364506360332, + "IsEmpty": false + }, + "Timestamp": 637316498853698920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 894.71601957609676, + "Y": 610.96864506360339, + "IsEmpty": false + }, + "Timestamp": 637316498853866420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.751461029, + "Position": { + "X": 894.46365141203421, + "Y": 610.4656177198533, + "IsEmpty": false + }, + "Timestamp": 637316498854032720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753414214, + "Position": { + "X": 895.31538481047176, + "Y": 610.4656177198533, + "IsEmpty": false + }, + "Timestamp": 637316498854196090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.751461029, + "Position": { + "X": 896.70339750578421, + "Y": 611.47167240735337, + "IsEmpty": false + }, + "Timestamp": 637316498854373510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.751461029, + "Position": { + "X": 898.88005766203423, + "Y": 613.54672123547834, + "IsEmpty": false + }, + "Timestamp": 637316498854539470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.309803933, + "Position": { + "X": 899.32168363859671, + "Y": 614.01830326672837, + "IsEmpty": false + }, + "Timestamp": 637316498854706710, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "a64d0de8-6f70-4543-822b-b395cab355b4", + "Points": [ + { + "Pressure": 0.151110098, + "Position": { + "X": 902.03462309172176, + "Y": 654.89012943860337, + "IsEmpty": false + }, + "Timestamp": 637316498858776630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.157701984, + "Position": { + "X": 902.31853422453423, + "Y": 655.29882084485337, + "IsEmpty": false + }, + "Timestamp": 637316498858788270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.165758759, + "Position": { + "X": 903.23335356047176, + "Y": 656.61932865735332, + "IsEmpty": false + }, + "Timestamp": 637316498859022190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.219470516, + "Position": { + "X": 903.92737211515919, + "Y": 657.49965092297839, + "IsEmpty": false + }, + "Timestamp": 637316498859101140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.319081396, + "Position": { + "X": 904.11665434172176, + "Y": 657.75116459485332, + "IsEmpty": false + }, + "Timestamp": 637316498859272210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.374746323, + "Position": { + "X": 903.92737211515919, + "Y": 657.37386967297834, + "IsEmpty": false + }, + "Timestamp": 637316498859449070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.404287785, + "Position": { + "X": 902.79172758390928, + "Y": 655.45604740735337, + "IsEmpty": false + }, + "Timestamp": 637316498859615270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.424307615, + "Position": { + "X": 900.36269926359671, + "Y": 651.08588139172832, + "IsEmpty": false + }, + "Timestamp": 637316498859777110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.478751808, + "Position": { + "X": 895.72546781828419, + "Y": 644.32631107922839, + "IsEmpty": false + }, + "Timestamp": 637316498859953520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520500481, + "Position": { + "X": 893.20181059172171, + "Y": 641.5596118604783, + "IsEmpty": false + }, + "Timestamp": 637316498860119280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547112226, + "Position": { + "X": 892.03462309172176, + "Y": 640.1448169386033, + "IsEmpty": false + }, + "Timestamp": 637316498860291260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.607171714, + "Position": { + "X": 894.43210844328428, + "Y": 641.81112553235334, + "IsEmpty": false + }, + "Timestamp": 637316498860625220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615472674, + "Position": { + "X": 897.52358793547171, + "Y": 644.1062427198533, + "IsEmpty": false + }, + "Timestamp": 637316498860796160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620355546, + "Position": { + "X": 900.89897856047173, + "Y": 646.77865482922834, + "IsEmpty": false + }, + "Timestamp": 637316498860962740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622308671, + "Position": { + "X": 903.39109281828428, + "Y": 648.85365482922839, + "IsEmpty": false + }, + "Timestamp": 637316498861135200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624261856, + "Position": { + "X": 904.77910551359673, + "Y": 649.4824634229783, + "IsEmpty": false + }, + "Timestamp": 637316498861305000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.626459122, + "Position": { + "X": 904.30591215422169, + "Y": 647.31312748547839, + "IsEmpty": false + }, + "Timestamp": 637316498861466700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628412306, + "Position": { + "X": 901.78225492765921, + "Y": 643.32025639172832, + "IsEmpty": false + }, + "Timestamp": 637316498861637610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628412306, + "Position": { + "X": 898.28069242765923, + "Y": 639.1702075636033, + "IsEmpty": false + }, + "Timestamp": 637316498861806820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628412306, + "Position": { + "X": 893.73808988859673, + "Y": 634.86293217297839, + "IsEmpty": false + }, + "Timestamp": 637316498861973610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628412306, + "Position": { + "X": 892.41316313078426, + "Y": 633.88827396985334, + "IsEmpty": false + }, + "Timestamp": 637316498862150400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.634515882, + "Position": { + "X": 893.64346098234671, + "Y": 635.68036381360332, + "IsEmpty": false + }, + "Timestamp": 637316498862483660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652582586, + "Position": { + "X": 897.64975981047178, + "Y": 639.39027592297839, + "IsEmpty": false + }, + "Timestamp": 637316498862653790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 900.86743559172169, + "Y": 642.31420170422837, + "IsEmpty": false + }, + "Timestamp": 637316498862826190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 903.51726469328423, + "Y": 644.79794193860334, + "IsEmpty": false + }, + "Timestamp": 637316498862990930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658930361, + "Position": { + "X": 904.68447660734671, + "Y": 645.61537357922839, + "IsEmpty": false + }, + "Timestamp": 637316498863157690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660883486, + "Position": { + "X": 903.86428617765921, + "Y": 643.6975513136033, + "IsEmpty": false + }, + "Timestamp": 637316498863328860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660883486, + "Position": { + "X": 901.24597563078419, + "Y": 639.8618579542283, + "IsEmpty": false + }, + "Timestamp": 637316498863502210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660883486, + "Position": { + "X": 897.80749906828419, + "Y": 635.6174731886033, + "IsEmpty": false + }, + "Timestamp": 637316498863664070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660883486, + "Position": { + "X": 894.30591215422169, + "Y": 632.0962329542283, + "IsEmpty": false + }, + "Timestamp": 637316498863835090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660883486, + "Position": { + "X": 891.18288969328421, + "Y": 629.1094165479783, + "IsEmpty": false + }, + "Timestamp": 637316498864005640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660883486, + "Position": { + "X": 890.70969633390928, + "Y": 628.66927982922834, + "IsEmpty": false + }, + "Timestamp": 637316498864181390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668207824, + "Position": { + "X": 891.30906156828428, + "Y": 629.1094165479783, + "IsEmpty": false + }, + "Timestamp": 637316498864340390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678217769, + "Position": { + "X": 893.23335356047176, + "Y": 630.58710209485332, + "IsEmpty": false + }, + "Timestamp": 637316498864514630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.688715935, + "Position": { + "X": 897.83904203703423, + "Y": 633.82543217297837, + "IsEmpty": false + }, + "Timestamp": 637316498864686640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 900.67815336515923, + "Y": 636.1833911573533, + "IsEmpty": false + }, + "Timestamp": 637316498864853280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 902.47627348234676, + "Y": 637.5981860792283, + "IsEmpty": false + }, + "Timestamp": 637316498865017110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 902.94944242765928, + "Y": 637.62963139172837, + "IsEmpty": false + }, + "Timestamp": 637316498865184960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 901.68762602140919, + "Y": 633.73109623547839, + "IsEmpty": false + }, + "Timestamp": 637316498865351360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 898.62768949797169, + "Y": 629.64393803235339, + "IsEmpty": false + }, + "Timestamp": 637316498865527570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 895.34692777922169, + "Y": 625.90258061047837, + "IsEmpty": false + }, + "Timestamp": 637316498865692510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 893.07563871672176, + "Y": 623.07299076672837, + "IsEmpty": false + }, + "Timestamp": 637316498865860670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 891.71916899015923, + "Y": 621.43812748547839, + "IsEmpty": false + }, + "Timestamp": 637316498866036520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 891.97153715422178, + "Y": 621.56385990735339, + "IsEmpty": false + }, + "Timestamp": 637316498866205720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 893.61191801359678, + "Y": 622.94720951672832, + "IsEmpty": false + }, + "Timestamp": 637316498866366740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700679004, + "Position": { + "X": 896.13557524015926, + "Y": 625.21088139172832, + "IsEmpty": false + }, + "Timestamp": 637316498866539450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702632189, + "Position": { + "X": 900.36269926359671, + "Y": 628.4177661573533, + "IsEmpty": false + }, + "Timestamp": 637316498866705530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704585314, + "Position": { + "X": 902.25544828703426, + "Y": 629.70677982922837, + "IsEmpty": false + }, + "Timestamp": 637316498866880560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704585314, + "Position": { + "X": 902.35007719328428, + "Y": 629.42382084485337, + "IsEmpty": false + }, + "Timestamp": 637316498867048290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704585314, + "Position": { + "X": 901.34062895109673, + "Y": 626.97152592297834, + "IsEmpty": false + }, + "Timestamp": 637316498867220900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706538498, + "Position": { + "X": 897.93367094328426, + "Y": 621.31234623547834, + "IsEmpty": false + }, + "Timestamp": 637316498867380110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706538498, + "Position": { + "X": 895.50466703703421, + "Y": 618.38842045422837, + "IsEmpty": false + }, + "Timestamp": 637316498867553950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706538498, + "Position": { + "X": 893.86428617765921, + "Y": 616.56493412610337, + "IsEmpty": false + }, + "Timestamp": 637316498867720060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706538498, + "Position": { + "X": 893.51726469328423, + "Y": 616.06190678235339, + "IsEmpty": false + }, + "Timestamp": 637316498867894460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706538498, + "Position": { + "X": 894.99993070890923, + "Y": 616.65927006360334, + "IsEmpty": false + }, + "Timestamp": 637316498868067410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706538498, + "Position": { + "X": 897.52358793547171, + "Y": 618.29413334485332, + "IsEmpty": false + }, + "Timestamp": 637316498868228920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706538498, + "Position": { + "X": 900.23652738859676, + "Y": 620.46346928235334, + "IsEmpty": false + }, + "Timestamp": 637316498868394460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 902.44473051359671, + "Y": 622.4756274854783, + "IsEmpty": false + }, + "Timestamp": 637316498868570080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 903.61191801359678, + "Y": 623.01010014172834, + "IsEmpty": false + }, + "Timestamp": 637316498868738220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710444808, + "Position": { + "X": 903.51726469328423, + "Y": 621.43812748547839, + "IsEmpty": false + }, + "Timestamp": 637316498868903330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710444808, + "Position": { + "X": 902.12925199797178, + "Y": 618.63998295422834, + "IsEmpty": false + }, + "Timestamp": 637316498869069720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710444808, + "Position": { + "X": 900.11033109953428, + "Y": 615.49598881360339, + "IsEmpty": false + }, + "Timestamp": 637316498869247460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712397933, + "Position": { + "X": 898.31223539640928, + "Y": 612.2891040479783, + "IsEmpty": false + }, + "Timestamp": 637316498869410540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712397933, + "Position": { + "X": 898.15449613859676, + "Y": 611.53456303235339, + "IsEmpty": false + }, + "Timestamp": 637316498869580380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712397933, + "Position": { + "X": 898.65923246672173, + "Y": 611.34589115735332, + "IsEmpty": false + }, + "Timestamp": 637316498869747180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712397933, + "Position": { + "X": 899.51096586515928, + "Y": 611.3144946729783, + "IsEmpty": false + }, + "Timestamp": 637316498869916110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712397933, + "Position": { + "X": 900.26807035734669, + "Y": 611.4402270948533, + "IsEmpty": false + }, + "Timestamp": 637316498870093330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.425528347, + "Position": { + "X": 900.23652738859676, + "Y": 611.18871342297837, + "IsEmpty": false + }, + "Timestamp": 637316498870406920, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "56e9e574-cd89-457e-b038-3ffa6049c323", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 850.33115629484678, + "Y": 645.2380786573533, + "IsEmpty": false + }, + "Timestamp": 637316498875002720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.107164107, + "Position": { + "X": 850.17341703703426, + "Y": 644.6721606886033, + "IsEmpty": false + }, + "Timestamp": 637316498875014800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.107164107, + "Position": { + "X": 849.73179106047178, + "Y": 643.66610600110334, + "IsEmpty": false + }, + "Timestamp": 637316498875161430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.193102926, + "Position": { + "X": 848.28069242765923, + "Y": 640.7107349073533, + "IsEmpty": false + }, + "Timestamp": 637316498875325490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.331532776, + "Position": { + "X": 846.32485746672171, + "Y": 635.27167240735332, + "IsEmpty": false + }, + "Timestamp": 637316498875493830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.39794004, + "Position": { + "X": 844.96838774015919, + "Y": 632.12767826672837, + "IsEmpty": false + }, + "Timestamp": 637316498875665820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.45482567, + "Position": { + "X": 843.99045805265928, + "Y": 630.1155200636033, + "IsEmpty": false + }, + "Timestamp": 637316498875837990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.496330202, + "Position": { + "X": 843.86428617765921, + "Y": 629.3923755323533, + "IsEmpty": false + }, + "Timestamp": 637316498876007720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546868086, + "Position": { + "X": 844.87373441984676, + "Y": 629.64393803235339, + "IsEmpty": false + }, + "Timestamp": 637316498876170190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.559319437, + "Position": { + "X": 846.35640043547176, + "Y": 630.8071704542283, + "IsEmpty": false + }, + "Timestamp": 637316498876342700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.563714027, + "Position": { + "X": 847.93367094328426, + "Y": 632.15912357922832, + "IsEmpty": false + }, + "Timestamp": 637316498876513590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.563714027, + "Position": { + "X": 848.88005766203423, + "Y": 632.7878833448533, + "IsEmpty": false + }, + "Timestamp": 637316498876693220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567620337, + "Position": { + "X": 849.16396879484671, + "Y": 631.90756107922834, + "IsEmpty": false + }, + "Timestamp": 637316498876844690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573479831, + "Position": { + "X": 847.87058500578428, + "Y": 629.17230717297832, + "IsEmpty": false + }, + "Timestamp": 637316498877013620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575677097, + "Position": { + "X": 846.07248930265928, + "Y": 625.49384037610332, + "IsEmpty": false + }, + "Timestamp": 637316498877181720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575677097, + "Position": { + "X": 844.27436918547176, + "Y": 622.12977787610339, + "IsEmpty": false + }, + "Timestamp": 637316498877356340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575677097, + "Position": { + "X": 842.25544828703426, + "Y": 619.17445561047839, + "IsEmpty": false + }, + "Timestamp": 637316498877527950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583001435, + "Position": { + "X": 842.00308012297171, + "Y": 618.73427006360339, + "IsEmpty": false + }, + "Timestamp": 637316498877692190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600579858, + "Position": { + "X": 842.31853422453423, + "Y": 618.86005131360332, + "IsEmpty": false + }, + "Timestamp": 637316498877859050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617914081, + "Position": { + "X": 843.86428617765921, + "Y": 620.2119556104783, + "IsEmpty": false + }, + "Timestamp": 637316498878030890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627924025, + "Position": { + "X": 846.79802641203423, + "Y": 623.57601811047834, + "IsEmpty": false + }, + "Timestamp": 637316498878196150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627924025, + "Position": { + "X": 848.59614652922176, + "Y": 625.80824467297839, + "IsEmpty": false + }, + "Timestamp": 637316498878370650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62987715, + "Position": { + "X": 850.11033109953428, + "Y": 627.25448490735334, + "IsEmpty": false + }, + "Timestamp": 637316498878539200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631830335, + "Position": { + "X": 850.36269926359671, + "Y": 627.4116626417283, + "IsEmpty": false + }, + "Timestamp": 637316498878704710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6340276, + "Position": { + "X": 849.19551176359676, + "Y": 624.26771732922839, + "IsEmpty": false + }, + "Timestamp": 637316498878871390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635980785, + "Position": { + "X": 847.36584867765919, + "Y": 620.99794193860339, + "IsEmpty": false + }, + "Timestamp": 637316498879061810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635980785, + "Position": { + "X": 845.12610258390919, + "Y": 618.16835209485339, + "IsEmpty": false + }, + "Timestamp": 637316498879215170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635980785, + "Position": { + "X": 843.42263578703421, + "Y": 616.37631107922834, + "IsEmpty": false + }, + "Timestamp": 637316498879456150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635980785, + "Position": { + "X": 843.10718168547169, + "Y": 615.90468021985339, + "IsEmpty": false + }, + "Timestamp": 637316498879552880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641107798, + "Position": { + "X": 843.42263578703421, + "Y": 616.15619389172832, + "IsEmpty": false + }, + "Timestamp": 637316498879718930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 845.09455961515926, + "Y": 617.53954350110337, + "IsEmpty": false + }, + "Timestamp": 637316498879888340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652582586, + "Position": { + "X": 847.14504789640921, + "Y": 619.42596928235332, + "IsEmpty": false + }, + "Timestamp": 637316498880062960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.654779911, + "Position": { + "X": 850.20498441984671, + "Y": 622.06688725110337, + "IsEmpty": false + }, + "Timestamp": 637316498880228300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656733036, + "Position": { + "X": 851.11980375578423, + "Y": 622.7585864698533, + "IsEmpty": false + }, + "Timestamp": 637316498880398160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658930361, + "Position": { + "X": 851.40371488859671, + "Y": 622.16122318860334, + "IsEmpty": false + }, + "Timestamp": 637316498880564170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661127627, + "Position": { + "X": 850.07878813078423, + "Y": 619.67748295422837, + "IsEmpty": false + }, + "Timestamp": 637316498880736490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663324952, + "Position": { + "X": 845.66238188078421, + "Y": 614.11263920422834, + "IsEmpty": false + }, + "Timestamp": 637316498880906960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663324952, + "Position": { + "X": 842.85481352140926, + "Y": 610.7485767042283, + "IsEmpty": false + }, + "Timestamp": 637316498881075240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663324952, + "Position": { + "X": 840.61506742765926, + "Y": 608.45345951672834, + "IsEmpty": false + }, + "Timestamp": 637316498881237640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663324952, + "Position": { + "X": 839.92107328703423, + "Y": 607.69886967297839, + "IsEmpty": false + }, + "Timestamp": 637316498881416790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665766358, + "Position": { + "X": 841.15134672453428, + "Y": 608.4849048292283, + "IsEmpty": false + }, + "Timestamp": 637316498881583530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668207824, + "Position": { + "X": 843.70654691984669, + "Y": 610.55990482922834, + "IsEmpty": false + }, + "Timestamp": 637316498881753400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 846.57722563078426, + "Y": 613.1379810011033, + "IsEmpty": false + }, + "Timestamp": 637316498881918230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672114134, + "Position": { + "X": 849.95261625578428, + "Y": 615.90468021985339, + "IsEmpty": false + }, + "Timestamp": 637316498882084240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674067318, + "Position": { + "X": 853.89582914640926, + "Y": 617.88539311047839, + "IsEmpty": false + }, + "Timestamp": 637316498882258280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676020443, + "Position": { + "X": 854.24282621672171, + "Y": 617.3823657667283, + "IsEmpty": false + }, + "Timestamp": 637316498882419840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 852.72864164640919, + "Y": 614.86718021985337, + "IsEmpty": false + }, + "Timestamp": 637316498882598290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 850.04724516203419, + "Y": 610.93719975110332, + "IsEmpty": false + }, + "Timestamp": 637316498882765480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 845.34692777922169, + "Y": 605.18368412610334, + "IsEmpty": false + }, + "Timestamp": 637316498882931590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 843.07563871672176, + "Y": 602.98290287610337, + "IsEmpty": false + }, + "Timestamp": 637316498883103030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 842.25544828703426, + "Y": 602.29125248547837, + "IsEmpty": false + }, + "Timestamp": 637316498883272250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 842.72864164640919, + "Y": 602.6684985792283, + "IsEmpty": false + }, + "Timestamp": 637316498883437770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 846.54565824797169, + "Y": 605.81249271985337, + "IsEmpty": false + }, + "Timestamp": 637316498883611130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 849.82641996672169, + "Y": 608.7678638136033, + "IsEmpty": false + }, + "Timestamp": 637316498883774660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 853.64346098234671, + "Y": 611.78607670422832, + "IsEmpty": false + }, + "Timestamp": 637316498883944950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 857.05039457609678, + "Y": 614.17548100110332, + "IsEmpty": false + }, + "Timestamp": 637316498884109970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 858.65923246672173, + "Y": 614.7100024854783, + "IsEmpty": false + }, + "Timestamp": 637316498884278970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 857.96521391203419, + "Y": 612.69784428235334, + "IsEmpty": false + }, + "Timestamp": 637316498884457100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 855.47312406828428, + "Y": 609.36517826672832, + "IsEmpty": false + }, + "Timestamp": 637316498884619310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 851.90845121672169, + "Y": 606.03256107922834, + "IsEmpty": false + }, + "Timestamp": 637316498884791200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 847.96521391203419, + "Y": 602.6684985792283, + "IsEmpty": false + }, + "Timestamp": 637316498884959490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 847.14504789640921, + "Y": 601.9768481886033, + "IsEmpty": false + }, + "Timestamp": 637316498885132070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 847.33430570890926, + "Y": 602.16547123547832, + "IsEmpty": false + }, + "Timestamp": 637316498885300370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694575429, + "Position": { + "X": 849.13242582609678, + "Y": 603.76888920422834, + "IsEmpty": false + }, + "Timestamp": 637316498885461650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 853.92737211515919, + "Y": 607.1958423292283, + "IsEmpty": false + }, + "Timestamp": 637316498885638830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 857.71287016203428, + "Y": 610.11976811047839, + "IsEmpty": false + }, + "Timestamp": 637316498885800720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 860.86743559172169, + "Y": 612.88646732922837, + "IsEmpty": false + }, + "Timestamp": 637316498885970890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705317795, + "Position": { + "X": 863.13872465422173, + "Y": 614.4270435011033, + "IsEmpty": false + }, + "Timestamp": 637316498886143870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 863.07563871672176, + "Y": 613.54672123547834, + "IsEmpty": false + }, + "Timestamp": 637316498886320750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 861.46680082609669, + "Y": 610.37128178235332, + "IsEmpty": false + }, + "Timestamp": 637316498886484910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 858.37532133390926, + "Y": 606.47274662610334, + "IsEmpty": false + }, + "Timestamp": 637316498886647600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 854.93684477140926, + "Y": 603.5173755323533, + "IsEmpty": false + }, + "Timestamp": 637316498886823240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 851.97153715422178, + "Y": 601.44237553235337, + "IsEmpty": false + }, + "Timestamp": 637316498886987970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712153792, + "Position": { + "X": 851.56142973234671, + "Y": 601.31659428235332, + "IsEmpty": false + }, + "Timestamp": 637316498887156550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 852.76018461515923, + "Y": 601.94540287610334, + "IsEmpty": false + }, + "Timestamp": 637316498887320840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720454693, + "Position": { + "X": 855.56775297453419, + "Y": 603.54882084485337, + "IsEmpty": false + }, + "Timestamp": 637316498887499970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722896159, + "Position": { + "X": 860.74123930265921, + "Y": 607.32162357922834, + "IsEmpty": false + }, + "Timestamp": 637316498887661450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 864.11665434172176, + "Y": 610.3083911573533, + "IsEmpty": false + }, + "Timestamp": 637316498887827620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 867.80749906828419, + "Y": 612.69784428235334, + "IsEmpty": false + }, + "Timestamp": 637316498888007390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726802468, + "Position": { + "X": 870.42578520109669, + "Y": 613.64100834485339, + "IsEmpty": false + }, + "Timestamp": 637316498888163250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 870.36269926359671, + "Y": 612.13192631360334, + "IsEmpty": false + }, + "Timestamp": 637316498888340690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 868.02832426359669, + "Y": 608.83070561047839, + "IsEmpty": false + }, + "Timestamp": 637316498888503120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 864.84219145109671, + "Y": 605.52953373547837, + "IsEmpty": false + }, + "Timestamp": 637316498888670430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 861.40371488859671, + "Y": 602.32264896985339, + "IsEmpty": false + }, + "Timestamp": 637316498888844140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 860.42578520109669, + "Y": 601.50521732922834, + "IsEmpty": false + }, + "Timestamp": 637316498889019480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 860.61506742765926, + "Y": 601.72533451672837, + "IsEmpty": false + }, + "Timestamp": 637316498889181560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 862.16081938078423, + "Y": 603.32875248547839, + "IsEmpty": false + }, + "Timestamp": 637316498889351130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 864.84219145109671, + "Y": 605.34091068860334, + "IsEmpty": false + }, + "Timestamp": 637316498889524440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 870.14187406828421, + "Y": 609.08221928235332, + "IsEmpty": false + }, + "Timestamp": 637316498889694910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 873.26492094328421, + "Y": 611.62885014172832, + "IsEmpty": false + }, + "Timestamp": 637316498889855950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 875.44155668547171, + "Y": 613.23231693860339, + "IsEmpty": false + }, + "Timestamp": 637316498890028330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 876.07248930265928, + "Y": 613.45238529797837, + "IsEmpty": false + }, + "Timestamp": 637316498890193820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 874.99993070890923, + "Y": 609.93109623547832, + "IsEmpty": false + }, + "Timestamp": 637316498890369370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 872.53935941984673, + "Y": 606.66136967297837, + "IsEmpty": false + }, + "Timestamp": 637316498890537850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 869.92107328703423, + "Y": 604.30336186047839, + "IsEmpty": false + }, + "Timestamp": 637316498890706020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 868.21758207609673, + "Y": 603.14012943860337, + "IsEmpty": false + }, + "Timestamp": 637316498890876640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 869.76333402922171, + "Y": 604.33480717297834, + "IsEmpty": false + }, + "Timestamp": 637316498891210390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736812413, + "Position": { + "X": 872.41316313078426, + "Y": 606.3469653761033, + "IsEmpty": false + }, + "Timestamp": 637316498891376040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736812413, + "Position": { + "X": 875.50466703703421, + "Y": 608.8935962354783, + "IsEmpty": false + }, + "Timestamp": 637316498891543700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738765538, + "Position": { + "X": 880.23652738859676, + "Y": 612.41488529797834, + "IsEmpty": false + }, + "Timestamp": 637316498891721110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738765538, + "Position": { + "X": 882.60244535734671, + "Y": 613.4209399854783, + "IsEmpty": false + }, + "Timestamp": 637316498891885430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740718722, + "Position": { + "X": 883.39109281828428, + "Y": 613.32660404797832, + "IsEmpty": false + }, + "Timestamp": 637316498892053740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742671847, + "Position": { + "X": 882.31853422453423, + "Y": 610.84286381360334, + "IsEmpty": false + }, + "Timestamp": 637316498892229330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744625032, + "Position": { + "X": 878.88005766203423, + "Y": 606.94432865735337, + "IsEmpty": false + }, + "Timestamp": 637316498892394150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744625032, + "Position": { + "X": 876.35640043547176, + "Y": 604.71210209485332, + "IsEmpty": false + }, + "Timestamp": 637316498892557790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746822298, + "Position": { + "X": 874.90527738859669, + "Y": 603.64315678235334, + "IsEmpty": false + }, + "Timestamp": 637316498892733020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 875.06301664640921, + "Y": 603.89467045422839, + "IsEmpty": false + }, + "Timestamp": 637316498892899000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748531342, + "Position": { + "X": 876.51411527922176, + "Y": 605.27802006360332, + "IsEmpty": false + }, + "Timestamp": 637316498893066770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.74364841, + "Position": { + "X": 878.97468656828426, + "Y": 607.1958423292283, + "IsEmpty": false + }, + "Timestamp": 637316498893236780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 882.47627348234676, + "Y": 609.6167407667283, + "IsEmpty": false + }, + "Timestamp": 637316498893405750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745601594, + "Position": { + "X": 887.20813383390919, + "Y": 612.98080326672834, + "IsEmpty": false + }, + "Timestamp": 637316498893578640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745601594, + "Position": { + "X": 889.16396879484671, + "Y": 614.36415287610339, + "IsEmpty": false + }, + "Timestamp": 637316498893747320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745601594, + "Position": { + "X": 889.47942289640923, + "Y": 614.48988529797839, + "IsEmpty": false + }, + "Timestamp": 637316498893919270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 889.22705473234669, + "Y": 612.88646732922837, + "IsEmpty": false + }, + "Timestamp": 637316498894079080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 887.58667387297169, + "Y": 609.6167407667283, + "IsEmpty": false + }, + "Timestamp": 637316498894249930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 885.50466703703421, + "Y": 606.7871509229783, + "IsEmpty": false + }, + "Timestamp": 637316498894425160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 884.40056547453423, + "Y": 605.59242436047839, + "IsEmpty": false + }, + "Timestamp": 637316498894585760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 884.21128324797178, + "Y": 605.40380131360337, + "IsEmpty": false + }, + "Timestamp": 637316498894763650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 884.68447660734671, + "Y": 605.46664311047834, + "IsEmpty": false + }, + "Timestamp": 637316498894933200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 885.91475004484676, + "Y": 606.00111576672839, + "IsEmpty": false + }, + "Timestamp": 637316498895096650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 887.14502348234669, + "Y": 606.6299243604783, + "IsEmpty": false + }, + "Timestamp": 637316498895263370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 887.93367094328426, + "Y": 606.97577396985332, + "IsEmpty": false + }, + "Timestamp": 637316498895445530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 888.37532133390926, + "Y": 606.94432865735337, + "IsEmpty": false + }, + "Timestamp": 637316498895633590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 888.15449613859676, + "Y": 606.15834232922839, + "IsEmpty": false + }, + "Timestamp": 637316498895776390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 887.39739164640923, + "Y": 604.99506107922832, + "IsEmpty": false + }, + "Timestamp": 637316498895938410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 886.51411527922176, + "Y": 603.9575610792283, + "IsEmpty": false + }, + "Timestamp": 637316498896106760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 886.04094633390923, + "Y": 603.45448490735339, + "IsEmpty": false + }, + "Timestamp": 637316498896284960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 887.46050199797173, + "Y": 604.33480717297834, + "IsEmpty": false + }, + "Timestamp": 637316498896619420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 889.60559477140919, + "Y": 606.00111576672839, + "IsEmpty": false + }, + "Timestamp": 637316498896785470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 893.76963285734678, + "Y": 609.20800053235337, + "IsEmpty": false + }, + "Timestamp": 637316498896951520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 896.76648344328419, + "Y": 611.25160404797839, + "IsEmpty": false + }, + "Timestamp": 637316498897128340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 898.75386137297176, + "Y": 612.41488529797834, + "IsEmpty": false + }, + "Timestamp": 637316498897290770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738765538, + "Position": { + "X": 899.29014066984678, + "Y": 612.7292895948533, + "IsEmpty": false + }, + "Timestamp": 637316498897467660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62157625, + "Position": { + "X": 899.06931547453428, + "Y": 612.7292895948533, + "IsEmpty": false + }, + "Timestamp": 637316498897729020, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF58595B", + "Size": 1, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8e08b2e6-7232-408a-974d-e5e0d85bae18", + "Points": [ + { + "Pressure": 0.0764019191, + "Position": { + "X": 841.97153715422178, + "Y": 601.22225834485334, + "IsEmpty": false + }, + "Timestamp": 637316499044944470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0947127491, + "Position": { + "X": 842.25544828703426, + "Y": 601.03363529797832, + "IsEmpty": false + }, + "Timestamp": 637316499045148230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.169665068, + "Position": { + "X": 842.50781645109669, + "Y": 600.49916264172839, + "IsEmpty": false + }, + "Timestamp": 637316499045314770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.209704742, + "Position": { + "X": 842.53935941984673, + "Y": 599.90179936047832, + "IsEmpty": false + }, + "Timestamp": 637316499045491800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.463614851, + "Position": { + "X": 842.57090238859678, + "Y": 599.7131763136033, + "IsEmpty": false + }, + "Timestamp": 637316499045663260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.496086061, + "Position": { + "X": 842.69709867765926, + "Y": 599.9961352979783, + "IsEmpty": false + }, + "Timestamp": 637316499046503760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513420284, + "Position": { + "X": 842.79172758390928, + "Y": 600.59349857922837, + "IsEmpty": false + }, + "Timestamp": 637316499046671170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 842.82327055265921, + "Y": 601.4109302198533, + "IsEmpty": false + }, + "Timestamp": 637316499046844390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.551018536, + "Position": { + "X": 842.94944242765928, + "Y": 602.85717045422837, + "IsEmpty": false + }, + "Timestamp": 637316499047015730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562981606, + "Position": { + "X": 843.13872465422173, + "Y": 603.83177982922837, + "IsEmpty": false + }, + "Timestamp": 637316499047182230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571526647, + "Position": { + "X": 843.23335356047176, + "Y": 604.99506107922832, + "IsEmpty": false + }, + "Timestamp": 637316499047347950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575921237, + "Position": { + "X": 843.42263578703421, + "Y": 606.3469653761033, + "IsEmpty": false + }, + "Timestamp": 637316499047515590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 843.54883207609669, + "Y": 608.17050053235334, + "IsEmpty": false + }, + "Timestamp": 637316499047688370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 843.61191801359678, + "Y": 609.99398686047834, + "IsEmpty": false + }, + "Timestamp": 637316499047852520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593011379, + "Position": { + "X": 843.51726469328423, + "Y": 611.34589115735332, + "IsEmpty": false + }, + "Timestamp": 637316499048020660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595208645, + "Position": { + "X": 843.29646391203426, + "Y": 612.5720630323533, + "IsEmpty": false + }, + "Timestamp": 637316499048191510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599114954, + "Position": { + "X": 843.17026762297178, + "Y": 614.52133061047834, + "IsEmpty": false + }, + "Timestamp": 637316499048364890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.601068139, + "Position": { + "X": 843.13872465422173, + "Y": 616.06190678235339, + "IsEmpty": false + }, + "Timestamp": 637316499048531990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.601068139, + "Position": { + "X": 843.04409574797171, + "Y": 617.6653247511033, + "IsEmpty": false + }, + "Timestamp": 637316499048695160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.603021264, + "Position": { + "X": 843.01255277922178, + "Y": 619.26874271985332, + "IsEmpty": false + }, + "Timestamp": 637316499048866220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604974449, + "Position": { + "X": 842.85481352140926, + "Y": 621.56385990735339, + "IsEmpty": false + }, + "Timestamp": 637316499049035560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606927574, + "Position": { + "X": 842.85481352140926, + "Y": 623.1672778761033, + "IsEmpty": false + }, + "Timestamp": 637316499049210000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606927574, + "Position": { + "X": 842.85481352140926, + "Y": 624.89647709485337, + "IsEmpty": false + }, + "Timestamp": 637316499049370840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606927574, + "Position": { + "X": 842.76018461515923, + "Y": 626.5627856886033, + "IsEmpty": false + }, + "Timestamp": 637316499049542690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606927574, + "Position": { + "X": 842.69709867765926, + "Y": 628.60638920422832, + "IsEmpty": false + }, + "Timestamp": 637316499049717810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608880758, + "Position": { + "X": 842.69709867765926, + "Y": 629.86400639172837, + "IsEmpty": false + }, + "Timestamp": 637316499049884050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608880758, + "Position": { + "X": 842.85481352140926, + "Y": 631.0901294386033, + "IsEmpty": false + }, + "Timestamp": 637316499050051350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608880758, + "Position": { + "X": 842.98100981047173, + "Y": 632.44208256360332, + "IsEmpty": false + }, + "Timestamp": 637316499050214970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 843.01255277922178, + "Y": 634.67430912610337, + "IsEmpty": false + }, + "Timestamp": 637316499050384080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 843.13872465422173, + "Y": 636.0576587354783, + "IsEmpty": false + }, + "Timestamp": 637316499050559370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 843.17026762297178, + "Y": 637.1894946729783, + "IsEmpty": false + }, + "Timestamp": 637316499050724360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 843.20181059172171, + "Y": 637.72396732922834, + "IsEmpty": false + }, + "Timestamp": 637316499050892550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 843.29646391203426, + "Y": 638.50995365735332, + "IsEmpty": false + }, + "Timestamp": 637316499051064230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 843.23335356047176, + "Y": 639.64178959485332, + "IsEmpty": false + }, + "Timestamp": 637316499051235900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 843.26492094328421, + "Y": 640.49066654797832, + "IsEmpty": false + }, + "Timestamp": 637316499051400470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 843.29646391203426, + "Y": 641.30809818860337, + "IsEmpty": false + }, + "Timestamp": 637316499051569360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 843.42263578703421, + "Y": 642.37704350110334, + "IsEmpty": false + }, + "Timestamp": 637316499051739470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 843.51726469328423, + "Y": 643.10018803235334, + "IsEmpty": false + }, + "Timestamp": 637316499051908440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 843.64346098234671, + "Y": 644.20057865735339, + "IsEmpty": false + }, + "Timestamp": 637316499052075100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 843.58037504484673, + "Y": 645.26952396985337, + "IsEmpty": false + }, + "Timestamp": 637316499052251790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 843.61191801359678, + "Y": 646.21273686047834, + "IsEmpty": false + }, + "Timestamp": 637316499052421030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 843.64346098234671, + "Y": 646.68431889172837, + "IsEmpty": false + }, + "Timestamp": 637316499052589840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 843.70654691984669, + "Y": 646.90438725110334, + "IsEmpty": false + }, + "Timestamp": 637316499052755810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 843.83274320890928, + "Y": 647.59608646985339, + "IsEmpty": false + }, + "Timestamp": 637316499052921290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 843.95891508390923, + "Y": 648.25629154797832, + "IsEmpty": false + }, + "Timestamp": 637316499053087770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.36571297, + "Position": { + "X": 844.02200102140921, + "Y": 648.44496342297839, + "IsEmpty": false + }, + "Timestamp": 637316499053263590, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "baaf4883-c60d-42c6-9566-1cc9ff191dab", + "Points": [ + { + "Pressure": 0.293446243, + "Position": { + "X": 882.88635649015919, + "Y": 577.32797123547834, + "IsEmpty": false + }, + "Timestamp": 637316499082848290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.430899531, + "Position": { + "X": 882.72864164640919, + "Y": 577.51659428235337, + "IsEmpty": false + }, + "Timestamp": 637316499083777900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.478507668, + "Position": { + "X": 882.57090238859678, + "Y": 577.67382084485337, + "IsEmpty": false + }, + "Timestamp": 637316499083951630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.507072568, + "Position": { + "X": 882.16081938078423, + "Y": 577.73671146985339, + "IsEmpty": false + }, + "Timestamp": 637316499084133570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529045522, + "Position": { + "X": 881.97153715422178, + "Y": 577.76815678235334, + "IsEmpty": false + }, + "Timestamp": 637316499084300130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.539299607, + "Position": { + "X": 881.56142973234671, + "Y": 577.79955326672837, + "IsEmpty": false + }, + "Timestamp": 637316499084471910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.550774395, + "Position": { + "X": 881.11980375578423, + "Y": 577.73671146985339, + "IsEmpty": false + }, + "Timestamp": 637316499084636250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.586419463, + "Position": { + "X": 880.52043852140923, + "Y": 577.54803959485332, + "IsEmpty": false + }, + "Timestamp": 637316499085032220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597894251, + "Position": { + "X": 879.92107328703423, + "Y": 577.45375248547839, + "IsEmpty": false + }, + "Timestamp": 637316499085391460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655512333, + "Position": { + "X": 880.14187406828421, + "Y": 577.48519779797834, + "IsEmpty": false + }, + "Timestamp": 637316499086076170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664789796, + "Position": { + "X": 880.99360746672176, + "Y": 577.70526615735332, + "IsEmpty": false + }, + "Timestamp": 637316499086211080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.688715935, + "Position": { + "X": 883.64346098234671, + "Y": 578.01967045422839, + "IsEmpty": false + }, + "Timestamp": 637316499086640830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704097033, + "Position": { + "X": 885.82012113859673, + "Y": 578.27118412610332, + "IsEmpty": false + }, + "Timestamp": 637316499086844980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 888.28069242765923, + "Y": 578.61703373547834, + "IsEmpty": false + }, + "Timestamp": 637316499086994530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737544835, + "Position": { + "X": 894.81064848234678, + "Y": 578.93138920422837, + "IsEmpty": false + }, + "Timestamp": 637316499087402110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 897.77595609953426, + "Y": 579.24579350110332, + "IsEmpty": false + }, + "Timestamp": 637316499087713020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741451144, + "Position": { + "X": 899.66870512297169, + "Y": 579.49730717297837, + "IsEmpty": false + }, + "Timestamp": 637316499087809420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 904.81064848234678, + "Y": 580.06322514172837, + "IsEmpty": false + }, + "Timestamp": 637316499088280390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 907.46050199797173, + "Y": 580.28334232922839, + "IsEmpty": false + }, + "Timestamp": 637316499088532630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 909.06931547453428, + "Y": 580.50341068860337, + "IsEmpty": false + }, + "Timestamp": 637316499088687790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 910.58352445890921, + "Y": 580.78636967297837, + "IsEmpty": false + }, + "Timestamp": 637316499088855830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 912.09770902922173, + "Y": 581.10077396985332, + "IsEmpty": false + }, + "Timestamp": 637316499089037880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 914.14819731047169, + "Y": 581.57235600110334, + "IsEmpty": false + }, + "Timestamp": 637316499089167580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 915.28384184172171, + "Y": 581.76097904797837, + "IsEmpty": false + }, + "Timestamp": 637316499089343090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 916.35640043547176, + "Y": 582.01254154797834, + "IsEmpty": false + }, + "Timestamp": 637316499089542870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 919.13242582609678, + "Y": 582.57845951672834, + "IsEmpty": false + }, + "Timestamp": 637316499089941130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 921.84534086515919, + "Y": 583.05004154797837, + "IsEmpty": false + }, + "Timestamp": 637316499090261530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 922.69707426359673, + "Y": 583.08148686047832, + "IsEmpty": false + }, + "Timestamp": 637316499090436860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 923.76963285734678, + "Y": 583.08148686047832, + "IsEmpty": false + }, + "Timestamp": 637316499090760210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 926.29329008390926, + "Y": 582.95570561047839, + "IsEmpty": false + }, + "Timestamp": 637316499091135060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 927.05039457609678, + "Y": 582.89281498547837, + "IsEmpty": false + }, + "Timestamp": 637316499091406110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 927.80749906828419, + "Y": 582.79852787610332, + "IsEmpty": false + }, + "Timestamp": 637316499091593030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.759517789, + "Position": { + "X": 928.18603910734669, + "Y": 582.64130131360332, + "IsEmpty": false + }, + "Timestamp": 637316499091975950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71117723, + "Position": { + "X": 927.61821684172173, + "Y": 582.48412357922837, + "IsEmpty": false + }, + "Timestamp": 637316499092330430, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "0ddcfde3-255e-4e14-856b-2a2cb58bdade", + "Points": [ + { + "Pressure": 0.209460586, + "Position": { + "X": 928.37532133390926, + "Y": 583.55306889172834, + "IsEmpty": false + }, + "Timestamp": 637316499099388040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.563225746, + "Position": { + "X": 928.50149320890921, + "Y": 584.02465092297837, + "IsEmpty": false + }, + "Timestamp": 637316499100350680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.609857321, + "Position": { + "X": 928.18603910734669, + "Y": 585.87963139172837, + "IsEmpty": false + }, + "Timestamp": 637316499100804080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617181659, + "Position": { + "X": 928.02832426359669, + "Y": 587.13719975110337, + "IsEmpty": false + }, + "Timestamp": 637316499101030470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631097913, + "Position": { + "X": 928.05986723234673, + "Y": 589.96678959485337, + "IsEmpty": false + }, + "Timestamp": 637316499101426880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633051038, + "Position": { + "X": 927.90212797453421, + "Y": 591.66454350110337, + "IsEmpty": false + }, + "Timestamp": 637316499101743890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635004222, + "Position": { + "X": 927.90212797453421, + "Y": 596.09760014172832, + "IsEmpty": false + }, + "Timestamp": 637316499102096570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 927.83904203703423, + "Y": 600.02758061047837, + "IsEmpty": false + }, + "Timestamp": 637316499102421080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 927.99678129484676, + "Y": 602.6684985792283, + "IsEmpty": false + }, + "Timestamp": 637316499102782070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 928.53303617765926, + "Y": 604.8064380323533, + "IsEmpty": false + }, + "Timestamp": 637316499103051090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 929.10085844328421, + "Y": 609.39662357922839, + "IsEmpty": false + }, + "Timestamp": 637316499103483200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 928.88005766203423, + "Y": 611.47167240735337, + "IsEmpty": false + }, + "Timestamp": 637316499103618480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 928.91160063078428, + "Y": 613.76678959485332, + "IsEmpty": false + }, + "Timestamp": 637316499103945110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 929.06931547453428, + "Y": 615.6846118604783, + "IsEmpty": false + }, + "Timestamp": 637316499104299020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 929.19551176359676, + "Y": 618.10546146985337, + "IsEmpty": false + }, + "Timestamp": 637316499104648270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 929.00622953703419, + "Y": 619.89755131360334, + "IsEmpty": false + }, + "Timestamp": 637316499104975420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646723151, + "Position": { + "X": 928.43840727140923, + "Y": 622.09833256360332, + "IsEmpty": false + }, + "Timestamp": 637316499105323780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 928.21758207609673, + "Y": 622.79003178235337, + "IsEmpty": false + }, + "Timestamp": 637316499105618810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 927.68130277922171, + "Y": 625.4309497511033, + "IsEmpty": false + }, + "Timestamp": 637316499105978360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690424979, + "Position": { + "X": 927.83904203703423, + "Y": 626.68856693860334, + "IsEmpty": false + }, + "Timestamp": 637316499106342360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 927.87058500578428, + "Y": 626.90863529797832, + "IsEmpty": false + }, + "Timestamp": 637316499106630090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 928.46995024015928, + "Y": 628.07191654797839, + "IsEmpty": false + }, + "Timestamp": 637316499106991590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7397421, + "Position": { + "X": 928.91160063078428, + "Y": 628.95223881360334, + "IsEmpty": false + }, + "Timestamp": 637316499107367590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7397421, + "Position": { + "X": 928.97468656828426, + "Y": 629.20375248547839, + "IsEmpty": false + }, + "Timestamp": 637316499107509350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.436026543, + "Position": { + "X": 928.40686430265919, + "Y": 629.73822514172832, + "IsEmpty": false + }, + "Timestamp": 637316499107821960, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d14aff23-27d7-4bc3-b865-312e2b8dac5b", + "Points": [ + { + "Pressure": 0.0439307243, + "Position": { + "X": 879.16396879484671, + "Y": 579.84315678235339, + "IsEmpty": false + }, + "Timestamp": 637316499128273450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0461280234, + "Position": { + "X": 879.92107328703423, + "Y": 579.27723881360339, + "IsEmpty": false + }, + "Timestamp": 637316499128455430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.207263291, + "Position": { + "X": 880.48889555265919, + "Y": 578.74276615735334, + "IsEmpty": false + }, + "Timestamp": 637316499128632280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.462882429, + "Position": { + "X": 880.70969633390928, + "Y": 578.52269779797837, + "IsEmpty": false + }, + "Timestamp": 637316499128872650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49144733, + "Position": { + "X": 880.48889555265919, + "Y": 578.52269779797837, + "IsEmpty": false + }, + "Timestamp": 637316499129471100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544914901, + "Position": { + "X": 880.29961332609673, + "Y": 578.4912524854783, + "IsEmpty": false + }, + "Timestamp": 637316499129640820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.565423071, + "Position": { + "X": 880.07878813078423, + "Y": 578.52269779797837, + "IsEmpty": false + }, + "Timestamp": 637316499130147320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.585442901, + "Position": { + "X": 879.41633695890926, + "Y": 578.7742114698533, + "IsEmpty": false + }, + "Timestamp": 637316499130321410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599603236, + "Position": { + "X": 878.72231840422171, + "Y": 579.21434818860337, + "IsEmpty": false + }, + "Timestamp": 637316499130485000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620843828, + "Position": { + "X": 877.52358793547171, + "Y": 579.96893803235332, + "IsEmpty": false + }, + "Timestamp": 637316499130650750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631586194, + "Position": { + "X": 876.64031156828423, + "Y": 580.69203373547839, + "IsEmpty": false + }, + "Timestamp": 637316499130831890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640619516, + "Position": { + "X": 875.66238188078421, + "Y": 581.47802006360337, + "IsEmpty": false + }, + "Timestamp": 637316499130989770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65014112, + "Position": { + "X": 874.43210844328428, + "Y": 582.54701420422839, + "IsEmpty": false + }, + "Timestamp": 637316499131157070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657465458, + "Position": { + "X": 872.25544828703426, + "Y": 584.1504321729783, + "IsEmpty": false + }, + "Timestamp": 637316499131334170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659662783, + "Position": { + "X": 870.45732816984673, + "Y": 585.37660404797839, + "IsEmpty": false + }, + "Timestamp": 637316499131495920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661615908, + "Position": { + "X": 868.62768949797169, + "Y": 586.38265873547834, + "IsEmpty": false + }, + "Timestamp": 637316499131664370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661615908, + "Position": { + "X": 866.86113676359673, + "Y": 587.32587162610332, + "IsEmpty": false + }, + "Timestamp": 637316499131843280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.666254699, + "Position": { + "X": 864.27436918547176, + "Y": 588.5205493604783, + "IsEmpty": false + }, + "Timestamp": 637316499132005820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669184387, + "Position": { + "X": 862.76018461515923, + "Y": 589.46376225110339, + "IsEmpty": false + }, + "Timestamp": 637316499132179020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669184387, + "Position": { + "X": 861.49834379484673, + "Y": 590.43842045422832, + "IsEmpty": false + }, + "Timestamp": 637316499132343260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669184387, + "Position": { + "X": 860.17341703703426, + "Y": 591.41302982922832, + "IsEmpty": false + }, + "Timestamp": 637316499132509710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669184387, + "Position": { + "X": 858.50149320890921, + "Y": 592.6392017042283, + "IsEmpty": false + }, + "Timestamp": 637316499132678010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669184387, + "Position": { + "X": 857.46050199797173, + "Y": 593.45663334485334, + "IsEmpty": false + }, + "Timestamp": 637316499132848800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.669184387, + "Position": { + "X": 856.38794340422169, + "Y": 594.24261967297832, + "IsEmpty": false + }, + "Timestamp": 637316499133018280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671137571, + "Position": { + "X": 855.09455961515926, + "Y": 594.96576420422832, + "IsEmpty": false + }, + "Timestamp": 637316499133186710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671137571, + "Position": { + "X": 853.99045805265928, + "Y": 595.5945239698533, + "IsEmpty": false + }, + "Timestamp": 637316499133364300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671137571, + "Position": { + "X": 852.91789945890923, + "Y": 596.00326420422834, + "IsEmpty": false + }, + "Timestamp": 637316499133528880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 851.97153715422178, + "Y": 596.38055912610332, + "IsEmpty": false + }, + "Timestamp": 637316499133695720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 851.15134672453428, + "Y": 596.85214115735334, + "IsEmpty": false + }, + "Timestamp": 637316499133868360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 850.11033109953428, + "Y": 597.2922778761033, + "IsEmpty": false + }, + "Timestamp": 637316499134038110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 849.73179106047178, + "Y": 597.54379154797834, + "IsEmpty": false + }, + "Timestamp": 637316499134207080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 849.06931547453428, + "Y": 597.95253178235339, + "IsEmpty": false + }, + "Timestamp": 637316499134369340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677973628, + "Position": { + "X": 848.43840727140923, + "Y": 598.20404545422832, + "IsEmpty": false + }, + "Timestamp": 637316499134544500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 847.90212797453421, + "Y": 598.48700443860332, + "IsEmpty": false + }, + "Timestamp": 637316499134711570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 847.39739164640923, + "Y": 598.83285404797834, + "IsEmpty": false + }, + "Timestamp": 637316499134883560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 847.01885160734673, + "Y": 599.08436771985339, + "IsEmpty": false + }, + "Timestamp": 637316499135053240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 846.60876859953419, + "Y": 599.30443607922837, + "IsEmpty": false + }, + "Timestamp": 637316499135212040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678217769, + "Position": { + "X": 846.41948637297173, + "Y": 599.39877201672834, + "IsEmpty": false + }, + "Timestamp": 637316499135386060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684809625, + "Position": { + "X": 846.07248930265928, + "Y": 599.65028568860339, + "IsEmpty": false + }, + "Timestamp": 637316499135554500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687495232, + "Position": { + "X": 845.75703520109676, + "Y": 599.90179936047832, + "IsEmpty": false + }, + "Timestamp": 637316499135726510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697016835, + "Position": { + "X": 845.22075590422173, + "Y": 600.18475834485332, + "IsEmpty": false + }, + "Timestamp": 637316499135895840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702876329, + "Position": { + "X": 844.62136625578421, + "Y": 600.53060795422834, + "IsEmpty": false + }, + "Timestamp": 637316499136069900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708735764, + "Position": { + "X": 844.46365141203421, + "Y": 600.65634037610334, + "IsEmpty": false + }, + "Timestamp": 637316499136237370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715571821, + "Position": { + "X": 844.27436918547176, + "Y": 600.75067631360332, + "IsEmpty": false + }, + "Timestamp": 637316499136398540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.565178931, + "Position": { + "X": 844.40056547453423, + "Y": 600.09042240735334, + "IsEmpty": false + }, + "Timestamp": 637316499137498000, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "fb3d1cea-7e83-45a0-97b5-888e4bc9871a", + "Points": [ + { + "Pressure": 0.0458838791, + "Position": { + "X": 904.74756254484669, + "Y": 660.04628178235339, + "IsEmpty": false + }, + "Timestamp": 637316499163886220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.074937053, + "Position": { + "X": 904.49519438078426, + "Y": 660.45497318860339, + "IsEmpty": false + }, + "Timestamp": 637316499164110970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.224597543, + "Position": { + "X": 904.05354399015926, + "Y": 660.98944584485332, + "IsEmpty": false + }, + "Timestamp": 637316499164285260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.263172358, + "Position": { + "X": 903.70654691984669, + "Y": 661.27240482922832, + "IsEmpty": false + }, + "Timestamp": 637316499164458670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.298085004, + "Position": { + "X": 903.51726469328423, + "Y": 661.3667407667283, + "IsEmpty": false + }, + "Timestamp": 637316499164625140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.44676891, + "Position": { + "X": 903.29646391203426, + "Y": 661.42963139172832, + "IsEmpty": false + }, + "Timestamp": 637316499164963260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.492423892, + "Position": { + "X": 903.61191801359678, + "Y": 660.9265552198533, + "IsEmpty": false + }, + "Timestamp": 637316499165463360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528557241, + "Position": { + "X": 904.62136625578421, + "Y": 659.57465092297832, + "IsEmpty": false + }, + "Timestamp": 637316499165634090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.550530255, + "Position": { + "X": 905.47309965422176, + "Y": 658.22274662610334, + "IsEmpty": false + }, + "Timestamp": 637316499165806860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570794225, + "Position": { + "X": 906.67185453703428, + "Y": 656.8393970167283, + "IsEmpty": false + }, + "Timestamp": 637316499165974810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.591790617, + "Position": { + "X": 907.90212797453421, + "Y": 655.55038334485334, + "IsEmpty": false + }, + "Timestamp": 637316499166139180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62182039, + "Position": { + "X": 910.01570219328426, + "Y": 653.50677982922832, + "IsEmpty": false + }, + "Timestamp": 637316499166306200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 911.46680082609669, + "Y": 652.09198490735332, + "IsEmpty": false + }, + "Timestamp": 637316499166476470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647455573, + "Position": { + "X": 912.94944242765928, + "Y": 650.6142993604783, + "IsEmpty": false + }, + "Timestamp": 637316499166652840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657465458, + "Position": { + "X": 914.30591215422169, + "Y": 649.13661381360339, + "IsEmpty": false + }, + "Timestamp": 637316499166811290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671381712, + "Position": { + "X": 916.07248930265928, + "Y": 647.03016850110339, + "IsEmpty": false + }, + "Timestamp": 637316499166988580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681391597, + "Position": { + "X": 916.95576566984676, + "Y": 645.77255131360334, + "IsEmpty": false + }, + "Timestamp": 637316499167157460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 917.58667387297169, + "Y": 644.51498295422834, + "IsEmpty": false + }, + "Timestamp": 637316499167319130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 918.28069242765923, + "Y": 643.19447514172839, + "IsEmpty": false + }, + "Timestamp": 637316499167489430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 919.66870512297169, + "Y": 641.37098881360339, + "IsEmpty": false + }, + "Timestamp": 637316499167662600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 920.67815336515923, + "Y": 640.36488529797839, + "IsEmpty": false + }, + "Timestamp": 637316499167827070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 921.68762602140919, + "Y": 639.51600834485339, + "IsEmpty": false + }, + "Timestamp": 637316499167997070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 922.50781645109669, + "Y": 638.8872485792283, + "IsEmpty": false + }, + "Timestamp": 637316499168172310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 923.73808988859673, + "Y": 637.69252201672839, + "IsEmpty": false + }, + "Timestamp": 637316499168342700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 924.71601957609676, + "Y": 636.81219975110332, + "IsEmpty": false + }, + "Timestamp": 637316499168510840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689692557, + "Position": { + "X": 925.91475004484676, + "Y": 635.74325443860334, + "IsEmpty": false + }, + "Timestamp": 637316499168678740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689692557, + "Position": { + "X": 926.95576566984676, + "Y": 634.51708256360337, + "IsEmpty": false + }, + "Timestamp": 637316499168845810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689692557, + "Position": { + "X": 928.28069242765923, + "Y": 632.7878833448533, + "IsEmpty": false + }, + "Timestamp": 637316499169011720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689692557, + "Position": { + "X": 928.88005766203423, + "Y": 631.8132739698533, + "IsEmpty": false + }, + "Timestamp": 637316499169182770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689692557, + "Position": { + "X": 929.22705473234669, + "Y": 630.99584232922837, + "IsEmpty": false + }, + "Timestamp": 637316499169345610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691645682, + "Position": { + "X": 929.54250883390921, + "Y": 630.08407475110334, + "IsEmpty": false + }, + "Timestamp": 637316499169518170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.68261236, + "Position": { + "X": 930.23652738859676, + "Y": 628.48065678235332, + "IsEmpty": false + }, + "Timestamp": 637316499169688520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.57299155, + "Position": { + "X": 931.27751859953423, + "Y": 626.49994389172832, + "IsEmpty": false + }, + "Timestamp": 637316499170032930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.493156314, + "Position": { + "X": 931.46680082609669, + "Y": 625.93402592297832, + "IsEmpty": false + }, + "Timestamp": 637316499170111000, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "2c060e53-6784-49f2-81ce-d1ad948d0428", + "Points": [ + { + "Pressure": 0.145494774, + "Position": { + "X": 843.83274320890928, + "Y": 653.53822514172839, + "IsEmpty": false + }, + "Timestamp": 637316499193425190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.162829027, + "Position": { + "X": 843.17026762297178, + "Y": 653.47533451672837, + "IsEmpty": false + }, + "Timestamp": 637316499193683990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.263416499, + "Position": { + "X": 842.12925199797178, + "Y": 652.97230717297839, + "IsEmpty": false + }, + "Timestamp": 637316499193859150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.3002823, + "Position": { + "X": 841.11980375578423, + "Y": 652.68934818860339, + "IsEmpty": false + }, + "Timestamp": 637316499194026600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.316151679, + "Position": { + "X": 839.98415922453421, + "Y": 652.43783451672834, + "IsEmpty": false + }, + "Timestamp": 637316499194191210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.318593115, + "Position": { + "X": 839.22705473234669, + "Y": 652.24916264172839, + "IsEmpty": false + }, + "Timestamp": 637316499194361550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.517326593, + "Position": { + "X": 838.78540434172169, + "Y": 652.12343021985339, + "IsEmpty": false + }, + "Timestamp": 637316499194530460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533684313, + "Position": { + "X": 839.44787992765919, + "Y": 652.43783451672834, + "IsEmpty": false + }, + "Timestamp": 637316499195372650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554436564, + "Position": { + "X": 840.58352445890921, + "Y": 652.81508061047839, + "IsEmpty": false + }, + "Timestamp": 637316499195544600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583001435, + "Position": { + "X": 842.03462309172176, + "Y": 653.19237553235337, + "IsEmpty": false + }, + "Timestamp": 637316499195716440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625238419, + "Position": { + "X": 844.77910551359673, + "Y": 653.82118412610339, + "IsEmpty": false + }, + "Timestamp": 637316499195879860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647455573, + "Position": { + "X": 846.57722563078426, + "Y": 654.38710209485339, + "IsEmpty": false + }, + "Timestamp": 637316499196047960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663324952, + "Position": { + "X": 848.24914945890919, + "Y": 654.89012943860337, + "IsEmpty": false + }, + "Timestamp": 637316499196215450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675776303, + "Position": { + "X": 850.52043852140923, + "Y": 655.17308842297837, + "IsEmpty": false + }, + "Timestamp": 637316499196383950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692866385, + "Position": { + "X": 855.06301664640921, + "Y": 655.64467045422839, + "IsEmpty": false + }, + "Timestamp": 637316499196560210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702143908, + "Position": { + "X": 858.31223539640928, + "Y": 656.08485600110339, + "IsEmpty": false + }, + "Timestamp": 637316499196721880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 860.96206449797171, + "Y": 656.65077396985339, + "IsEmpty": false + }, + "Timestamp": 637316499196899240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712642074, + "Position": { + "X": 863.42263578703421, + "Y": 656.96517826672834, + "IsEmpty": false + }, + "Timestamp": 637316499197067170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71947813, + "Position": { + "X": 867.96521391203419, + "Y": 657.31097904797832, + "IsEmpty": false + }, + "Timestamp": 637316499197228940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 871.21443266203426, + "Y": 657.65682865735334, + "IsEmpty": false + }, + "Timestamp": 637316499197404740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 873.89582914640926, + "Y": 658.22274662610334, + "IsEmpty": false + }, + "Timestamp": 637316499197569580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 877.11348051359676, + "Y": 658.60004154797832, + "IsEmpty": false + }, + "Timestamp": 637316499197742780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 879.70024809172173, + "Y": 658.75721928235339, + "IsEmpty": false + }, + "Timestamp": 637316499197912180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 882.66553129484669, + "Y": 659.07162357922834, + "IsEmpty": false + }, + "Timestamp": 637316499198076240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 885.44155668547171, + "Y": 659.57465092297832, + "IsEmpty": false + }, + "Timestamp": 637316499198242480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 887.68130277922171, + "Y": 660.20345951672834, + "IsEmpty": false + }, + "Timestamp": 637316499198420780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 889.66870512297169, + "Y": 660.61219975110339, + "IsEmpty": false + }, + "Timestamp": 637316499198588300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722407877, + "Position": { + "X": 891.97153715422178, + "Y": 661.02089115735339, + "IsEmpty": false + }, + "Timestamp": 637316499198749850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724361002, + "Position": { + "X": 894.27436918547176, + "Y": 661.46107670422839, + "IsEmpty": false + }, + "Timestamp": 637316499198917260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724361002, + "Position": { + "X": 897.17659086515926, + "Y": 662.12128178235332, + "IsEmpty": false + }, + "Timestamp": 637316499199093240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724361002, + "Position": { + "X": 898.78540434172169, + "Y": 662.75009037610334, + "IsEmpty": false + }, + "Timestamp": 637316499199264890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724361002, + "Position": { + "X": 899.98415922453421, + "Y": 663.31600834485334, + "IsEmpty": false + }, + "Timestamp": 637316499199426390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722163737, + "Position": { + "X": 900.64661039640919, + "Y": 663.69330326672832, + "IsEmpty": false + }, + "Timestamp": 637316499199594130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720210552, + "Position": { + "X": 901.08826078703419, + "Y": 663.97626225110332, + "IsEmpty": false + }, + "Timestamp": 637316499199770320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699946582, + "Position": { + "X": 901.49834379484673, + "Y": 664.3220630323533, + "IsEmpty": false + }, + "Timestamp": 637316499199935820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673334837, + "Position": { + "X": 901.68762602140919, + "Y": 664.44784428235334, + "IsEmpty": false + }, + "Timestamp": 637316499200278220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.586663604, + "Position": { + "X": 902.06616606047169, + "Y": 664.13343998547839, + "IsEmpty": false + }, + "Timestamp": 637316499200358740, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "3849fd29-303d-4086-ad10-a6e308c4a772", + "Points": [ + { + "Pressure": 0.0561379418, + "Position": { + "X": 422.68503588810279, + "Y": 579.64639116728722, + "IsEmpty": false + }, + "Timestamp": 637320034360647980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.238269627, + "Position": { + "X": 421.70770310239618, + "Y": 579.5742983409998, + "IsEmpty": false + }, + "Timestamp": 637320034361292400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.388662547, + "Position": { + "X": 420.36156418078872, + "Y": 579.48290142451901, + "IsEmpty": false + }, + "Timestamp": 637320034361609960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.47924009, + "Position": { + "X": 419.68820904087647, + "Y": 579.43660768237123, + "IsEmpty": false + }, + "Timestamp": 637320034361920630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 419.0146663310307, + "Y": 579.38991842908854, + "IsEmpty": false + }, + "Timestamp": 637320034362263000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660639346, + "Position": { + "X": 419.68820904087647, + "Y": 579.43660768237123, + "IsEmpty": false + }, + "Timestamp": 637320034362962880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690669119, + "Position": { + "X": 423.35746697788534, + "Y": 579.69082707996961, + "IsEmpty": false + }, + "Timestamp": 637320034363441640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715083539, + "Position": { + "X": 429.03253258874764, + "Y": 580.05609081218006, + "IsEmpty": false + }, + "Timestamp": 637320034363987830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 441.6633665906258, + "Y": 580.75943686770756, + "IsEmpty": false + }, + "Timestamp": 637320034364610190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.737300694, + "Position": { + "X": 454.78659612417556, + "Y": 581.32684436752993, + "IsEmpty": false + }, + "Timestamp": 637320034365151920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741207004, + "Position": { + "X": 464.57960096249388, + "Y": 581.62670272453556, + "IsEmpty": false + }, + "Timestamp": 637320034365731810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741207004, + "Position": { + "X": 473.28110144990904, + "Y": 581.79989684365137, + "IsEmpty": false + }, + "Timestamp": 637320034366183160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741207004, + "Position": { + "X": 481.62592819842882, + "Y": 581.88022837240464, + "IsEmpty": false + }, + "Timestamp": 637320034366540430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741207004, + "Position": { + "X": 492.09751472089613, + "Y": 581.85237715351877, + "IsEmpty": false + }, + "Timestamp": 637320034367033340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741207004, + "Position": { + "X": 497.74282970193292, + "Y": 581.77248072228281, + "IsEmpty": false + }, + "Timestamp": 637320034367442160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743160129, + "Position": { + "X": 502.25717029806708, + "Y": 581.77248072228281, + "IsEmpty": false + }, + "Timestamp": 637320034367770890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743160129, + "Position": { + "X": 513.30325250858311, + "Y": 581.88245777143334, + "IsEmpty": false + }, + "Timestamp": 637320034368327330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 517.08456534267964, + "Y": 581.88602398568719, + "IsEmpty": false + }, + "Timestamp": 637320034368804930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 525.41923493909508, + "Y": 581.81869546471796, + "IsEmpty": false + }, + "Timestamp": 637320034369222230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 533.45659413194744, + "Y": 581.674100251548, + "IsEmpty": false + }, + "Timestamp": 637320034369640320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 536.73128138494872, + "Y": 581.5927743542311, + "IsEmpty": false + }, + "Timestamp": 637320034369697830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 543.23474163267576, + "Y": 581.39537743400672, + "IsEmpty": false + }, + "Timestamp": 637320034370056110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 551.75967397557952, + "Y": 581.06680985450089, + "IsEmpty": false + }, + "Timestamp": 637320034370557060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 559.66886963063439, + "Y": 580.69336074707337, + "IsEmpty": false + }, + "Timestamp": 637320034370984100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 561.00212503525779, + "Y": 580.6255750008122, + "IsEmpty": false + }, + "Timestamp": 637320034371371330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 565.97776434892728, + "Y": 580.353147798691, + "IsEmpty": false + }, + "Timestamp": 637320034371738660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 571.2704483409384, + "Y": 580.03178589731601, + "IsEmpty": false + }, + "Timestamp": 637320034372245630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 576.94693420097963, + "Y": 579.66410110971242, + "IsEmpty": false + }, + "Timestamp": 637320034372613830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 581.9646484861305, + "Y": 579.31400163242006, + "IsEmpty": false + }, + "Timestamp": 637320034373047570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754879057, + "Position": { + "X": 585.33669870397716, + "Y": 579.07140519446148, + "IsEmpty": false + }, + "Timestamp": 637320034373441540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756832242, + "Position": { + "X": 591.04826158260801, + "Y": 578.63071973773572, + "IsEmpty": false + }, + "Timestamp": 637320034373929800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 598.1271336997296, + "Y": 578.04864527067184, + "IsEmpty": false + }, + "Timestamp": 637320034374755280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 599.11406415403167, + "Y": 577.95603056865048, + "IsEmpty": false + }, + "Timestamp": 637320034375064050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764889002, + "Position": { + "X": 599.79218179727729, + "Y": 577.89843788407416, + "IsEmpty": false + }, + "Timestamp": 637320034375560680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.316395819, + "Position": { + "X": 597.4493866982948, + "Y": 578.10525979227396, + "IsEmpty": false + }, + "Timestamp": 637320034376089000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.316395819, + "Position": { + "X": 598.1271336997296, + "Y": 578.04864527067184, + "IsEmpty": false + }, + "Timestamp": 637320034376217570, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "43aa06ba-c75e-48d4-a6ed-60e2d4e485a6", + "Points": [ + { + "Pressure": 0.338612944, + "Position": { + "X": 420.5790075601692, + "Y": 581.83603224534579, + "IsEmpty": false + }, + "Timestamp": 637320034529034010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.434317529, + "Position": { + "X": 420.5790075601692, + "Y": 581.75905773808086, + "IsEmpty": false + }, + "Timestamp": 637320034531301050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51610589, + "Position": { + "X": 420.5790075601692, + "Y": 581.68208323081603, + "IsEmpty": false + }, + "Timestamp": 637320034531660780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628900588, + "Position": { + "X": 420.5790075601692, + "Y": 579.68110461882623, + "IsEmpty": false + }, + "Timestamp": 637320034533435760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647455573, + "Position": { + "X": 420.5790075601692, + "Y": 574.98649635509503, + "IsEmpty": false + }, + "Timestamp": 637320034533938070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65453577, + "Position": { + "X": 420.5790075601692, + "Y": 572.4468157178834, + "IsEmpty": false + }, + "Timestamp": 637320034534465400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680903316, + "Position": { + "X": 420.5790075601692, + "Y": 552.97561209757464, + "IsEmpty": false + }, + "Timestamp": 637320034535094790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685053766, + "Position": { + "X": 420.5790075601692, + "Y": 548.51180783000564, + "IsEmpty": false + }, + "Timestamp": 637320034535620440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692866385, + "Position": { + "X": 420.5790075601692, + "Y": 530.11812778577291, + "IsEmpty": false + }, + "Timestamp": 637320034536220680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692866385, + "Position": { + "X": 420.5790075601692, + "Y": 525.57746853657147, + "IsEmpty": false + }, + "Timestamp": 637320034536639570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692866385, + "Position": { + "X": 420.5790075601692, + "Y": 509.49254560775563, + "IsEmpty": false + }, + "Timestamp": 637320034537325480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692866385, + "Position": { + "X": 420.5790075601692, + "Y": 497.79445243924386, + "IsEmpty": false + }, + "Timestamp": 637320034537763470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692866385, + "Position": { + "X": 420.5790075601692, + "Y": 488.32826140451658, + "IsEmpty": false + }, + "Timestamp": 637320034538213300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692866385, + "Position": { + "X": 420.5790075601692, + "Y": 484.48013366943434, + "IsEmpty": false + }, + "Timestamp": 637320034538556150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692866385, + "Position": { + "X": 420.5790075601692, + "Y": 480.24725292366003, + "IsEmpty": false + }, + "Timestamp": 637320034538952530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692866385, + "Position": { + "X": 420.5790075601692, + "Y": 476.16832119241553, + "IsEmpty": false + }, + "Timestamp": 637320034539255730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692866385, + "Position": { + "X": 420.5790075601692, + "Y": 474.47524060948524, + "IsEmpty": false + }, + "Timestamp": 637320034539516240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698725879, + "Position": { + "X": 420.5790075601692, + "Y": 467.24083218291003, + "IsEmpty": false + }, + "Timestamp": 637320034539963900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698725879, + "Position": { + "X": 420.5790075601692, + "Y": 463.39282397346017, + "IsEmpty": false + }, + "Timestamp": 637320034540328870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.700679004, + "Position": { + "X": 420.5790075601692, + "Y": 460.08351778923208, + "IsEmpty": false + }, + "Timestamp": 637320034540696690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 420.5790075601692, + "Y": 454.85008797464673, + "IsEmpty": false + }, + "Timestamp": 637320034541099580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716792524, + "Position": { + "X": 420.5790075601692, + "Y": 452.9260838699218, + "IsEmpty": false + }, + "Timestamp": 637320034541426890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 420.5790075601692, + "Y": 452.00250930837558, + "IsEmpty": false + }, + "Timestamp": 637320034541760170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73559165, + "Position": { + "X": 420.5790075601692, + "Y": 450.00153069638571, + "IsEmpty": false + }, + "Timestamp": 637320034542260210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749263763, + "Position": { + "X": 420.5790075601692, + "Y": 446.76919901942256, + "IsEmpty": false + }, + "Timestamp": 637320034542564710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757320523, + "Position": { + "X": 420.5790075601692, + "Y": 442.07453099287517, + "IsEmpty": false + }, + "Timestamp": 637320034542983900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.765133142, + "Position": { + "X": 420.5790075601692, + "Y": 438.99608856762552, + "IsEmpty": false + }, + "Timestamp": 637320034543464880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522697806, + "Position": { + "X": 420.5790075601692, + "Y": 437.68776099538729, + "IsEmpty": false + }, + "Timestamp": 637320034543941740, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "56878d6e-9221-4b88-800b-79a30e68d23f", + "Points": [ + { + "Pressure": 0.514152765, + "Position": { + "X": 597.56803698311842, + "Y": 583.22133432484884, + "IsEmpty": false + }, + "Timestamp": 637320034568307360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599114954, + "Position": { + "X": 597.56803698311842, + "Y": 581.06640669832927, + "IsEmpty": false + }, + "Timestamp": 637320034569348800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.626459122, + "Position": { + "X": 597.56803698311842, + "Y": 577.75710051410124, + "IsEmpty": false + }, + "Timestamp": 637320034569635810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 597.56803698311842, + "Y": 575.91007091664119, + "IsEmpty": false + }, + "Timestamp": 637320034569898300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66674298, + "Position": { + "X": 597.56803698311842, + "Y": 568.98356051912549, + "IsEmpty": false + }, + "Timestamp": 637320034570241520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 597.56803698311842, + "Y": 557.13151833608401, + "IsEmpty": false + }, + "Timestamp": 637320034570637000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705317795, + "Position": { + "X": 597.56803698311842, + "Y": 553.74523764459104, + "IsEmpty": false + }, + "Timestamp": 637320034570944700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.727779031, + "Position": { + "X": 597.56803698311842, + "Y": 542.20109349060908, + "IsEmpty": false + }, + "Timestamp": 637320034571446880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 597.56803698311842, + "Y": 534.27403402428229, + "IsEmpty": false + }, + "Timestamp": 637320034571793770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 597.56803698311842, + "Y": 524.42297045323062, + "IsEmpty": false + }, + "Timestamp": 637320034572116590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 597.56803698311842, + "Y": 523.49951541731673, + "IsEmpty": false + }, + "Timestamp": 637320034572446910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754879057, + "Position": { + "X": 597.56803698311842, + "Y": 509.26162208596099, + "IsEmpty": false + }, + "Timestamp": 637320034572812930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758785367, + "Position": { + "X": 597.56803698311842, + "Y": 499.02580550421726, + "IsEmpty": false + }, + "Timestamp": 637320034573249860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760738552, + "Position": { + "X": 597.56803698311842, + "Y": 491.17584007078773, + "IsEmpty": false + }, + "Timestamp": 637320034573583680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762691677, + "Position": { + "X": 597.56803698311842, + "Y": 486.48111228142415, + "IsEmpty": false + }, + "Timestamp": 637320034573898470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762691677, + "Position": { + "X": 597.56803698311842, + "Y": 478.78497633689204, + "IsEmpty": false + }, + "Timestamp": 637320034574398700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762691677, + "Position": { + "X": 597.56803698311842, + "Y": 474.47524060948524, + "IsEmpty": false + }, + "Timestamp": 637320034574793810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764644861, + "Position": { + "X": 597.56803698311842, + "Y": 468.24138125172112, + "IsEmpty": false + }, + "Timestamp": 637320034575038430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764644861, + "Position": { + "X": 597.56803698311842, + "Y": 466.9330536794829, + "IsEmpty": false + }, + "Timestamp": 637320034575358130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764644861, + "Position": { + "X": 597.56803698311842, + "Y": 461.39184536147036, + "IsEmpty": false + }, + "Timestamp": 637320034575621030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770504296, + "Position": { + "X": 597.56803698311842, + "Y": 457.08199010843117, + "IsEmpty": false + }, + "Timestamp": 637320034575917720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.77245748, + "Position": { + "X": 597.56803698311842, + "Y": 456.62026259047428, + "IsEmpty": false + }, + "Timestamp": 637320034576174950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.778561056, + "Position": { + "X": 597.56803698311842, + "Y": 455.311935018236, + "IsEmpty": false + }, + "Timestamp": 637320034576572520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.78466469, + "Position": { + "X": 597.56803698311842, + "Y": 454.54230947121954, + "IsEmpty": false + }, + "Timestamp": 637320034576928560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653803289, + "Position": { + "X": 597.56803698311842, + "Y": 456.92804109390141, + "IsEmpty": false + }, + "Timestamp": 637320034578615780, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d00fb446-dd23-4c85-84f1-8aa80941a4ef", + "Points": [ + { + "Pressure": 0.299793988, + "Position": { + "X": 598.1085617742342, + "Y": 442.92113104715651, + "IsEmpty": false + }, + "Timestamp": 637320034592166820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.440909445, + "Position": { + "X": 598.1085617742342, + "Y": 442.99810555442139, + "IsEmpty": false + }, + "Timestamp": 637320034593063140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.48754102, + "Position": { + "X": 598.1085617742342, + "Y": 448.00055208439591, + "IsEmpty": false + }, + "Timestamp": 637320034593570390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513908625, + "Position": { + "X": 598.1085617742342, + "Y": 459.6216707456428, + "IsEmpty": false + }, + "Timestamp": 637320034594051070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521721244, + "Position": { + "X": 598.1085617742342, + "Y": 470.08841084918117, + "IsEmpty": false + }, + "Timestamp": 637320034594560310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.222156093, + "Position": { + "X": 598.1085617742342, + "Y": 472.70506599365768, + "IsEmpty": false + }, + "Timestamp": 637320034595229950, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "5de99a2e-0c48-4401-b0c0-196f4d9075a5", + "Points": [ + { + "Pressure": 0.41014725, + "Position": { + "X": 422.66568885085849, + "Y": 575.87646138000105, + "IsEmpty": false + }, + "Timestamp": 637320034877262320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.449942768, + "Position": { + "X": 423.34165596705606, + "Y": 575.91955520751685, + "IsEmpty": false + }, + "Timestamp": 637320034878966490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.497062624, + "Position": { + "X": 426.30385823839612, + "Y": 576.11009826721352, + "IsEmpty": false + }, + "Timestamp": 637320034879272540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.502922118, + "Position": { + "X": 426.9787565889186, + "Y": 576.15105373920085, + "IsEmpty": false + }, + "Timestamp": 637320034879798360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 429.93574205865974, + "Y": 576.33159893440609, + "IsEmpty": false + }, + "Timestamp": 637320034879872030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.561760902, + "Position": { + "X": 434.90590629232969, + "Y": 576.61357273972396, + "IsEmpty": false + }, + "Timestamp": 637320034880350240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.565911353, + "Position": { + "X": 436.9216358311561, + "Y": 576.71976606704163, + "IsEmpty": false + }, + "Timestamp": 637320034880724900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567864478, + "Position": { + "X": 437.59309678604751, + "Y": 576.75436596228224, + "IsEmpty": false + }, + "Timestamp": 637320034880818140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567864478, + "Position": { + "X": 438.52162225458108, + "Y": 576.80582385410628, + "IsEmpty": false + }, + "Timestamp": 637320034880881650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 442.79936135801819, + "Y": 577.01665077114853, + "IsEmpty": false + }, + "Timestamp": 637320034881103910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575188816, + "Position": { + "X": 446.81114760133227, + "Y": 577.19575931828035, + "IsEmpty": false + }, + "Timestamp": 637320034881361490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575188816, + "Position": { + "X": 451.06767629602626, + "Y": 577.37227572981897, + "IsEmpty": false + }, + "Timestamp": 637320034881777620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.57299155, + "Position": { + "X": 458.88157685436033, + "Y": 577.64931161184052, + "IsEmpty": false + }, + "Timestamp": 637320034882142400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5688411, + "Position": { + "X": 465.99161477847002, + "Y": 577.84602808880584, + "IsEmpty": false + }, + "Timestamp": 637320034882490990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5688411, + "Position": { + "X": 470.43646963240263, + "Y": 577.94015776184744, + "IsEmpty": false + }, + "Timestamp": 637320034882813330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5688411, + "Position": { + "X": 475.92577735942018, + "Y": 578.02719442873695, + "IsEmpty": false + }, + "Timestamp": 637320034883214900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5688411, + "Position": { + "X": 478.78304832701366, + "Y": 578.05786588665956, + "IsEmpty": false + }, + "Timestamp": 637320034883570520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5688411, + "Position": { + "X": 483.58234283455045, + "Y": 578.08964511369618, + "IsEmpty": false + }, + "Timestamp": 637320034883915410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573479831, + "Position": { + "X": 487.30744896274518, + "Y": 578.09000946818514, + "IsEmpty": false + }, + "Timestamp": 637320034884294830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573479831, + "Position": { + "X": 492.0661459110043, + "Y": 578.07178947662157, + "IsEmpty": false + }, + "Timestamp": 637320034884640580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575921237, + "Position": { + "X": 497.03858393857473, + "Y": 578.01610072068218, + "IsEmpty": false + }, + "Timestamp": 637320034885144940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 507.9338540889957, + "Y": 578.07178947662157, + "IsEmpty": false + }, + "Timestamp": 637320034885924360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594964504, + "Position": { + "X": 512.69255103725482, + "Y": 578.09000946818514, + "IsEmpty": false + }, + "Timestamp": 637320034886505740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.598870814, + "Position": { + "X": 517.71714602439602, + "Y": 578.08276491603965, + "IsEmpty": false + }, + "Timestamp": 637320034886957940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 535.32734019345128, + "Y": 577.81363335986816, + "IsEmpty": false + }, + "Timestamp": 637320034888076970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 540.20463681289891, + "Y": 577.67821395066881, + "IsEmpty": false + }, + "Timestamp": 637320034888511610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606927574, + "Position": { + "X": 546.0169263420122, + "Y": 577.48338752247105, + "IsEmpty": false + }, + "Timestamp": 637320034888958700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606927574, + "Position": { + "X": 553.85685175448668, + "Y": 577.16693761807323, + "IsEmpty": false + }, + "Timestamp": 637320034889439320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608880758, + "Position": { + "X": 559.46653468876536, + "Y": 576.90528224734044, + "IsEmpty": false + }, + "Timestamp": 637320034889808020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608880758, + "Position": { + "X": 572.08676781033466, + "Y": 576.21290537948812, + "IsEmpty": false + }, + "Timestamp": 637320034890917260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 579.36328593312521, + "Y": 575.74491142380157, + "IsEmpty": false + }, + "Timestamp": 637320034891994300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 583.68796489368378, + "Y": 575.44632756372721, + "IsEmpty": false + }, + "Timestamp": 637320034892625580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 584.10354857238144, + "Y": 575.42485171781755, + "IsEmpty": false + }, + "Timestamp": 637320034892946670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 585.72181923317646, + "Y": 575.30404514555971, + "IsEmpty": false + }, + "Timestamp": 637320034893299250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 586.40008107832125, + "Y": 575.25588308721649, + "IsEmpty": false + }, + "Timestamp": 637320034893423200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606927574, + "Position": { + "X": 588.01996559140468, + "Y": 575.13156337164787, + "IsEmpty": false + }, + "Timestamp": 637320034893902040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604974449, + "Position": { + "X": 588.6987888532243, + "Y": 575.08208973353703, + "IsEmpty": false + }, + "Timestamp": 637320034894250500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604974449, + "Position": { + "X": 589.79362236915711, + "Y": 575.00960651735932, + "IsEmpty": false + }, + "Timestamp": 637320034894624780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.607660055, + "Position": { + "X": 590.4727621187202, + "Y": 574.9592646543847, + "IsEmpty": false + }, + "Timestamp": 637320034895009760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599114954, + "Position": { + "X": 591.41550341103664, + "Y": 574.88058220984351, + "IsEmpty": false + }, + "Timestamp": 637320034895379620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597161829, + "Position": { + "X": 592.09502676981833, + "Y": 574.82930687655369, + "IsEmpty": false + }, + "Timestamp": 637320034895799150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599114954, + "Position": { + "X": 593.45447222894984, + "Y": 574.72568477375899, + "IsEmpty": false + }, + "Timestamp": 637320034896311670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596185267, + "Position": { + "X": 594.13439006597775, + "Y": 574.67333992043268, + "IsEmpty": false + }, + "Timestamp": 637320034896636050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.598138392, + "Position": { + "X": 595.49460529665316, + "Y": 574.56758740036844, + "IsEmpty": false + }, + "Timestamp": 637320034897091090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.248767838, + "Position": { + "X": 595.75880383069284, + "Y": 574.53811692863769, + "IsEmpty": false + }, + "Timestamp": 637320034897550390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.248767838, + "Position": { + "X": 596.43919820671044, + "Y": 574.48450061018366, + "IsEmpty": false + }, + "Timestamp": 637320034897803370, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "16e7e049-2bad-45bd-9c1b-d50bf5711d5b", + "Points": [ + { + "Pressure": 0.353994042, + "Position": { + "X": 424.33076292245289, + "Y": 574.85363847942006, + "IsEmpty": false + }, + "Timestamp": 637320034937556050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.40209049, + "Position": { + "X": 424.33076292245289, + "Y": 574.70920634187166, + "IsEmpty": false + }, + "Timestamp": 637320034939021290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.491203159, + "Position": { + "X": 424.33076292245289, + "Y": 569.54464964404451, + "IsEmpty": false + }, + "Timestamp": 637320034939609810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520744622, + "Position": { + "X": 424.33076292245289, + "Y": 566.36646953617401, + "IsEmpty": false + }, + "Timestamp": 637320034940006640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544182479, + "Position": { + "X": 424.33076292245289, + "Y": 562.06867393408857, + "IsEmpty": false + }, + "Timestamp": 637320034940470610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54833293, + "Position": { + "X": 424.33076292245289, + "Y": 559.82949903580936, + "IsEmpty": false + }, + "Timestamp": 637320034940863930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.559319437, + "Position": { + "X": 424.33076292245289, + "Y": 556.83187312241193, + "IsEmpty": false + }, + "Timestamp": 637320034941096560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.561272621, + "Position": { + "X": 424.33076292245289, + "Y": 555.42333726294976, + "IsEmpty": false + }, + "Timestamp": 637320034941394090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573723972, + "Position": { + "X": 424.33076292245289, + "Y": 549.82542806232698, + "IsEmpty": false + }, + "Timestamp": 637320034941774590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575677097, + "Position": { + "X": 424.33076292245289, + "Y": 546.93616831970371, + "IsEmpty": false + }, + "Timestamp": 637320034942118390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579583406, + "Position": { + "X": 424.33076292245289, + "Y": 542.71061683146775, + "IsEmpty": false + }, + "Timestamp": 637320034942637480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.581536591, + "Position": { + "X": 424.33076292245289, + "Y": 537.72661432811367, + "IsEmpty": false + }, + "Timestamp": 637320034943146810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.583489716, + "Position": { + "X": 424.33076292245289, + "Y": 533.89834937589922, + "IsEmpty": false + }, + "Timestamp": 637320034943749750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.585442901, + "Position": { + "X": 424.33076292245289, + "Y": 529.96171825291049, + "IsEmpty": false + }, + "Timestamp": 637320034944158130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587396026, + "Position": { + "X": 424.33076292245289, + "Y": 527.43362298938393, + "IsEmpty": false + }, + "Timestamp": 637320034944520520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587396026, + "Position": { + "X": 424.33076292245289, + "Y": 524.9055277258575, + "IsEmpty": false + }, + "Timestamp": 637320034945007000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.591302335, + "Position": { + "X": 424.33076292245289, + "Y": 520.31881175852482, + "IsEmpty": false + }, + "Timestamp": 637320034945312370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595208645, + "Position": { + "X": 424.33076292245289, + "Y": 518.29631311164337, + "IsEmpty": false + }, + "Timestamp": 637320034945584340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597161829, + "Position": { + "X": 424.33076292245289, + "Y": 515.51541953979427, + "IsEmpty": false + }, + "Timestamp": 637320034945942110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605706871, + "Position": { + "X": 424.33076292245289, + "Y": 511.54266635988091, + "IsEmpty": false + }, + "Timestamp": 637320034946300910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.611566365, + "Position": { + "X": 424.33076292245289, + "Y": 507.1726266439461, + "IsEmpty": false + }, + "Timestamp": 637320034946608980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.618402362, + "Position": { + "X": 424.33076292245289, + "Y": 504.10281270684976, + "IsEmpty": false + }, + "Timestamp": 637320034947006900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630365431, + "Position": { + "X": 424.33076292245289, + "Y": 499.44385262566766, + "IsEmpty": false + }, + "Timestamp": 637320034947513040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632318616, + "Position": { + "X": 424.33076292245289, + "Y": 497.89088462865709, + "IsEmpty": false + }, + "Timestamp": 637320034947804860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640131235, + "Position": { + "X": 424.33076292245289, + "Y": 494.1709858472168, + "IsEmpty": false + }, + "Timestamp": 637320034948214730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644281685, + "Position": { + "X": 424.33076292245289, + "Y": 492.87081615852878, + "IsEmpty": false + }, + "Timestamp": 637320034948477580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 424.33076292245289, + "Y": 490.48715303255068, + "IsEmpty": false + }, + "Timestamp": 637320034948809270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658930361, + "Position": { + "X": 424.33076292245289, + "Y": 487.16448469698128, + "IsEmpty": false + }, + "Timestamp": 637320034949290390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.662836671, + "Position": { + "X": 424.33076292245289, + "Y": 485.21423016394925, + "IsEmpty": false + }, + "Timestamp": 637320034949682670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668696105, + "Position": { + "X": 424.33076292245289, + "Y": 482.90283919689585, + "IsEmpty": false + }, + "Timestamp": 637320034950090690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67064929, + "Position": { + "X": 424.33076292245289, + "Y": 481.56654745128316, + "IsEmpty": false + }, + "Timestamp": 637320034950441750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67064929, + "Position": { + "X": 424.33076292245289, + "Y": 479.72463104395007, + "IsEmpty": false + }, + "Timestamp": 637320034950788580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672602415, + "Position": { + "X": 424.33076292245289, + "Y": 478.64116565173515, + "IsEmpty": false + }, + "Timestamp": 637320034951106250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6745556, + "Position": { + "X": 424.33076292245289, + "Y": 476.97983148395048, + "IsEmpty": false + }, + "Timestamp": 637320034951524880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6745556, + "Position": { + "X": 424.33076292245289, + "Y": 475.31852536124103, + "IsEmpty": false + }, + "Timestamp": 637320034951894370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676508725, + "Position": { + "X": 424.33076292245289, + "Y": 472.79040205263925, + "IsEmpty": false + }, + "Timestamp": 637320034952359250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680903316, + "Position": { + "X": 424.33076292245289, + "Y": 471.45411030702655, + "IsEmpty": false + }, + "Timestamp": 637320034952660330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6828565, + "Position": { + "X": 424.33076292245289, + "Y": 470.37064491481163, + "IsEmpty": false + }, + "Timestamp": 637320034953035280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.68676281, + "Position": { + "X": 424.33076292245289, + "Y": 469.25105746567203, + "IsEmpty": false + }, + "Timestamp": 637320034953407170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697260976, + "Position": { + "X": 424.33076292245289, + "Y": 467.5897232978873, + "IsEmpty": false + }, + "Timestamp": 637320034953812870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705561936, + "Position": { + "X": 424.33076292245289, + "Y": 466.93963845354335, + "IsEmpty": false + }, + "Timestamp": 637320034954332100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709468246, + "Position": { + "X": 424.33076292245289, + "Y": 466.54237996259718, + "IsEmpty": false + }, + "Timestamp": 637320034954763180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714351118, + "Position": { + "X": 424.33076292245289, + "Y": 466.36179772304877, + "IsEmpty": false + }, + "Timestamp": 637320034955073610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.722652018, + "Position": { + "X": 424.33076292245289, + "Y": 465.60337475300588, + "IsEmpty": false + }, + "Timestamp": 637320034955448360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 424.33076292245289, + "Y": 465.20608821698443, + "IsEmpty": false + }, + "Timestamp": 637320034955872550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733394384, + "Position": { + "X": 424.33076292245289, + "Y": 464.55600337264048, + "IsEmpty": false + }, + "Timestamp": 637320034956084110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.735347509, + "Position": { + "X": 424.33076292245289, + "Y": 463.14749555825358, + "IsEmpty": false + }, + "Timestamp": 637320034956411760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739253819, + "Position": { + "X": 424.33076292245289, + "Y": 461.7389596987914, + "IsEmpty": false + }, + "Timestamp": 637320034956717840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741207004, + "Position": { + "X": 424.33076292245289, + "Y": 459.75261115390998, + "IsEmpty": false + }, + "Timestamp": 637320034957094760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743160129, + "Position": { + "X": 424.33076292245289, + "Y": 457.08002766268459, + "IsEmpty": false + }, + "Timestamp": 637320034957604430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743160129, + "Position": { + "X": 424.33076292245289, + "Y": 456.14102245309329, + "IsEmpty": false + }, + "Timestamp": 637320034957949930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742671847, + "Position": { + "X": 424.33076292245289, + "Y": 455.74373591707183, + "IsEmpty": false + }, + "Timestamp": 637320034958604510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.4225986, + "Position": { + "X": 424.33076292245289, + "Y": 455.67151984829769, + "IsEmpty": false + }, + "Timestamp": 637320034959615270, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "0a17e37c-90ba-4e76-b590-7e98181f1d3d", + "Points": [ + { + "Pressure": 0.110826276, + "Position": { + "X": 596.7846422203412, + "Y": 574.6008401710975, + "IsEmpty": false + }, + "Timestamp": 637320034974963240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.383779645, + "Position": { + "X": 596.7846422203412, + "Y": 574.05912149752771, + "IsEmpty": false + }, + "Timestamp": 637320034975400790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.454093218, + "Position": { + "X": 596.7846422203412, + "Y": 571.422660063227, + "IsEmpty": false + }, + "Timestamp": 637320034975924320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.486320287, + "Position": { + "X": 596.7846422203412, + "Y": 567.23323063191583, + "IsEmpty": false + }, + "Timestamp": 637320034976306860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498283356, + "Position": { + "X": 596.7846422203412, + "Y": 563.80219612557221, + "IsEmpty": false + }, + "Timestamp": 637320034976676370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51195544, + "Position": { + "X": 596.7846422203412, + "Y": 559.79337697888468, + "IsEmpty": false + }, + "Timestamp": 637320034977046310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534416735, + "Position": { + "X": 596.7846422203412, + "Y": 554.80937447553049, + "IsEmpty": false + }, + "Timestamp": 637320034977412520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 596.7846422203412, + "Y": 547.26121074187574, + "IsEmpty": false + }, + "Timestamp": 637320034977840270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.571526647, + "Position": { + "X": 596.7846422203412, + "Y": 543.50513381336009, + "IsEmpty": false + }, + "Timestamp": 637320034978084940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579095125, + "Position": { + "X": 596.7846422203412, + "Y": 541.51875722340344, + "IsEmpty": false + }, + "Timestamp": 637320034978390680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.606439292, + "Position": { + "X": 596.7846422203412, + "Y": 535.01790877996348, + "IsEmpty": false + }, + "Timestamp": 637320034978800680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619623125, + "Position": { + "X": 596.7846422203412, + "Y": 529.74504200151262, + "IsEmpty": false + }, + "Timestamp": 637320034979236060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623529434, + "Position": { + "X": 596.7846422203412, + "Y": 525.12220397725525, + "IsEmpty": false + }, + "Timestamp": 637320034979611740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627435744, + "Position": { + "X": 596.7846422203412, + "Y": 521.87177975553527, + "IsEmpty": false + }, + "Timestamp": 637320034980077180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629388869, + "Position": { + "X": 596.7846422203412, + "Y": 517.61010621037462, + "IsEmpty": false + }, + "Timestamp": 637320034980400020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.639154673, + "Position": { + "X": 596.7846422203412, + "Y": 512.73446987779471, + "IsEmpty": false + }, + "Timestamp": 637320034980792940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 596.7846422203412, + "Y": 509.8452101351715, + "IsEmpty": false + }, + "Timestamp": 637320034981027130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 596.7846422203412, + "Y": 507.75052346459114, + "IsEmpty": false + }, + "Timestamp": 637320034981278760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 596.7846422203412, + "Y": 503.45272786250575, + "IsEmpty": false + }, + "Timestamp": 637320034981632680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 596.7846422203412, + "Y": 493.44865688902331, + "IsEmpty": false + }, + "Timestamp": 637320034982696820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 596.7846422203412, + "Y": 484.99755391255144, + "IsEmpty": false + }, + "Timestamp": 637320034982959910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 596.7846422203412, + "Y": 480.08579552304678, + "IsEmpty": false + }, + "Timestamp": 637320034983301380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 596.7846422203412, + "Y": 474.41561416349924, + "IsEmpty": false + }, + "Timestamp": 637320034983666330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 596.7846422203412, + "Y": 470.80402546268255, + "IsEmpty": false + }, + "Timestamp": 637320034984015880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 596.7846422203412, + "Y": 466.57850201952186, + "IsEmpty": false + }, + "Timestamp": 637320034984373020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 596.7846422203412, + "Y": 465.16996616005974, + "IsEmpty": false + }, + "Timestamp": 637320034984676100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 596.7846422203412, + "Y": 460.90832065997432, + "IsEmpty": false + }, + "Timestamp": 637320034985069020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 596.7846422203412, + "Y": 458.66911771661984, + "IsEmpty": false + }, + "Timestamp": 637320034985378490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638422191, + "Position": { + "X": 596.7846422203412, + "Y": 457.29673195915763, + "IsEmpty": false + }, + "Timestamp": 637320034985790530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640375376, + "Position": { + "X": 596.7846422203412, + "Y": 455.41872153997514, + "IsEmpty": false + }, + "Timestamp": 637320034986215600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640375376, + "Position": { + "X": 596.7846422203412, + "Y": 454.62414846793223, + "IsEmpty": false + }, + "Timestamp": 637320034986700720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640375376, + "Position": { + "X": 596.7846422203412, + "Y": 453.68514325834099, + "IsEmpty": false + }, + "Timestamp": 637320034987057950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640375376, + "Position": { + "X": 596.7846422203412, + "Y": 452.45721768350245, + "IsEmpty": false + }, + "Timestamp": 637320034987507050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640375376, + "Position": { + "X": 596.7846422203412, + "Y": 451.66267265653482, + "IsEmpty": false + }, + "Timestamp": 637320034987874780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640375376, + "Position": { + "X": 596.7846422203412, + "Y": 450.61530127616936, + "IsEmpty": false + }, + "Timestamp": 637320034988179540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642328501, + "Position": { + "X": 596.7846422203412, + "Y": 449.60405195272864, + "IsEmpty": false + }, + "Timestamp": 637320034988559340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 596.7846422203412, + "Y": 450.54308520739517, + "IsEmpty": false + }, + "Timestamp": 637320034989245930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.24950026, + "Position": { + "X": 596.7846422203412, + "Y": 452.059931147481, + "IsEmpty": false + }, + "Timestamp": 637320034989645540, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "add4a7c4-f9e6-49a5-8090-36ac2d336284", + "Points": [ + { + "Pressure": 0.446036458, + "Position": { + "X": 442.7708718113206, + "Y": 559.6899706313643, + "IsEmpty": false + }, + "Timestamp": 637320035135662030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.535393298, + "Position": { + "X": 442.14369179359625, + "Y": 559.66585687560359, + "IsEmpty": false + }, + "Timestamp": 637320035137087700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645502388, + "Position": { + "X": 444.89366585278464, + "Y": 559.77563673269208, + "IsEmpty": false + }, + "Timestamp": 637320035138345150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.702143908, + "Position": { + "X": 454.67591168771054, + "Y": 560.12899005416466, + "IsEmpty": false + }, + "Timestamp": 637320035138943860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716060102, + "Position": { + "X": 460.20465151120862, + "Y": 560.29922447927629, + "IsEmpty": false + }, + "Timestamp": 637320035139363820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724116862, + "Position": { + "X": 468.55846327166796, + "Y": 560.51546859940959, + "IsEmpty": false + }, + "Timestamp": 637320035139879880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726070046, + "Position": { + "X": 478.2272161924418, + "Y": 560.70075772401196, + "IsEmpty": false + }, + "Timestamp": 637320035140356940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 483.80062867222506, + "Y": 560.77299765025987, + "IsEmpty": false + }, + "Timestamp": 637320035140676950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 494.04527410190695, + "Y": 560.8430135136789, + "IsEmpty": false + }, + "Timestamp": 637320035141158030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 499.33341226128243, + "Y": 560.85125485719561, + "IsEmpty": false + }, + "Timestamp": 637320035141455920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732906103, + "Position": { + "X": 500.66658773871757, + "Y": 560.85125485719561, + "IsEmpty": false + }, + "Timestamp": 637320035141706250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 507.96392856819801, + "Y": 560.83490343052631, + "IsEmpty": false + }, + "Timestamp": 637320035142101280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730952919, + "Position": { + "X": 511.43221323610567, + "Y": 560.81695379302039, + "IsEmpty": false + }, + "Timestamp": 637320035142444060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 519.62996139058725, + "Y": 560.73060727679717, + "IsEmpty": false + }, + "Timestamp": 637320035142897980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736812413, + "Position": { + "X": 523.12585260477204, + "Y": 560.67877606483421, + "IsEmpty": false + }, + "Timestamp": 637320035143296230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736812413, + "Position": { + "X": 529.34427272367418, + "Y": 560.5615264003934, + "IsEmpty": false + }, + "Timestamp": 637320035143705460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738765538, + "Position": { + "X": 533.54127611308297, + "Y": 560.4659789885452, + "IsEmpty": false + }, + "Timestamp": 637320035144136130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740718722, + "Position": { + "X": 541.90419192579748, + "Y": 560.23649875795809, + "IsEmpty": false + }, + "Timestamp": 637320035144561470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740718722, + "Position": { + "X": 548.1234964658538, + "Y": 560.0344294454701, + "IsEmpty": false + }, + "Timestamp": 637320035144895460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740718722, + "Position": { + "X": 552.29880553373198, + "Y": 559.88384049452952, + "IsEmpty": false + }, + "Timestamp": 637320035145306480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744625032, + "Position": { + "X": 555.10633414721542, + "Y": 559.77563673269208, + "IsEmpty": false + }, + "Timestamp": 637320035145599120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746578157, + "Position": { + "X": 557.91690501085827, + "Y": 559.66201139227167, + "IsEmpty": false + }, + "Timestamp": 637320035145883450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748531342, + "Position": { + "X": 561.41897149120564, + "Y": 559.51349494866008, + "IsEmpty": false + }, + "Timestamp": 637320035146252050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748531342, + "Position": { + "X": 565.61468720917969, + "Y": 559.32550679461815, + "IsEmpty": false + }, + "Timestamp": 637320035146760610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748531342, + "Position": { + "X": 570.50627321258639, + "Y": 559.09271189087553, + "IsEmpty": false + }, + "Timestamp": 637320035147381620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750484467, + "Position": { + "X": 572.57838037627505, + "Y": 558.9905717863702, + "IsEmpty": false + }, + "Timestamp": 637320035147763080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750484467, + "Position": { + "X": 572.63983780543128, + "Y": 558.98532967021674, + "IsEmpty": false + }, + "Timestamp": 637320035148604460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752437651, + "Position": { + "X": 573.26932112559643, + "Y": 558.95594928496621, + "IsEmpty": false + }, + "Timestamp": 637320035149343810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 573.3308100061538, + "Y": 558.95065304222226, + "IsEmpty": false + }, + "Timestamp": 637320035149910660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 573.96037773415026, + "Y": 558.92104009666014, + "IsEmpty": false + }, + "Timestamp": 637320035150541550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.305897623, + "Position": { + "X": 574.71309930619498, + "Y": 558.88044085460001, + "IsEmpty": false + }, + "Timestamp": 637320035150890640, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c4b9847a-843c-4a5d-896b-fef0590be4a7", + "Points": [ + { + "Pressure": 0.140611887, + "Position": { + "X": 449.52868795504298, + "Y": 537.72512579689328, + "IsEmpty": false + }, + "Timestamp": 637320035162585180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619623125, + "Position": { + "X": 455.8158575489087, + "Y": 537.86683939353748, + "IsEmpty": false + }, + "Timestamp": 637320035163282940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 506.13620078192139, + "Y": 538.37844476807948, + "IsEmpty": false + }, + "Timestamp": 637320035163659640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789059281, + "Position": { + "X": 536.08159296434383, + "Y": 538.03100257151368, + "IsEmpty": false + }, + "Timestamp": 637320035163900640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795162916, + "Position": { + "X": 548.4577496397319, + "Y": 537.77410974555869, + "IsEmpty": false + }, + "Timestamp": 637320035164217230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797116041, + "Position": { + "X": 553.27100616476082, + "Y": 537.65712527041251, + "IsEmpty": false + }, + "Timestamp": 637320035164616360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797116041, + "Position": { + "X": 555.93985587039106, + "Y": 537.586078690656, + "IsEmpty": false + }, + "Timestamp": 637320035164951490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799069226, + "Position": { + "X": 557.35675868529256, + "Y": 537.54942220806311, + "IsEmpty": false + }, + "Timestamp": 637320035165401330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799069226, + "Position": { + "X": 559.56998826652637, + "Y": 537.49303120520244, + "IsEmpty": false + }, + "Timestamp": 637320035165716780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801022351, + "Position": { + "X": 562.11828176873405, + "Y": 537.41523720956241, + "IsEmpty": false + }, + "Timestamp": 637320035166011270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801022351, + "Position": { + "X": 563.5558395358488, + "Y": 537.37523152764015, + "IsEmpty": false + }, + "Timestamp": 637320035166325890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801022351, + "Position": { + "X": 563.7161204755447, + "Y": 537.37523152764015, + "IsEmpty": false + }, + "Timestamp": 637320035166577450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801022351, + "Position": { + "X": 565.64036710437665, + "Y": 537.31384736155064, + "IsEmpty": false + }, + "Timestamp": 637320035166889290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801022351, + "Position": { + "X": 567.08946486159425, + "Y": 537.27201278375753, + "IsEmpty": false + }, + "Timestamp": 637320035167160000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801022351, + "Position": { + "X": 567.73372000974541, + "Y": 537.25082331633052, + "IsEmpty": false + }, + "Timestamp": 637320035167432670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801022351, + "Position": { + "X": 569.18928025365437, + "Y": 537.20790229373165, + "IsEmpty": false + }, + "Timestamp": 637320035167685390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801022351, + "Position": { + "X": 570.64957821773692, + "Y": 537.1642615132273, + "IsEmpty": false + }, + "Timestamp": 637320035168978270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801022351, + "Position": { + "X": 572.76421715762581, + "Y": 537.0974587390042, + "IsEmpty": false + }, + "Timestamp": 637320035169452060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802975535, + "Position": { + "X": 573.41442749948067, + "Y": 537.07483520212486, + "IsEmpty": false + }, + "Timestamp": 637320035169892280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.805172801, + "Position": { + "X": 574.71647419713247, + "Y": 537.02905693333787, + "IsEmpty": false + }, + "Timestamp": 637320035170219110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.805172801, + "Position": { + "X": 575.3683041513433, + "Y": 537.00590310915641, + "IsEmpty": false + }, + "Timestamp": 637320035170568160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.807125986, + "Position": { + "X": 576.02066757475359, + "Y": 536.98257343026751, + "IsEmpty": false + }, + "Timestamp": 637320035170869740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809567392, + "Position": { + "X": 576.84564969225573, + "Y": 536.95906835053415, + "IsEmpty": false + }, + "Timestamp": 637320035171230030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809079111, + "Position": { + "X": 577.49953926743513, + "Y": 536.93538832381967, + "IsEmpty": false + }, + "Timestamp": 637320035171637600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.325673312, + "Position": { + "X": 578.80888125838135, + "Y": 536.88750524489944, + "IsEmpty": false + }, + "Timestamp": 637320035172071400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.325673312, + "Position": { + "X": 579.4643272725624, + "Y": 536.86330310042035, + "IsEmpty": false + }, + "Timestamp": 637320035172928810, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7e8399dd-42cf-42f8-92c2-01a1129c2388", + "Points": [ + { + "Pressure": 0.0764019191, + "Position": { + "X": 446.03908092186498, + "Y": 520.74704693608896, + "IsEmpty": false + }, + "Timestamp": 637320035187483290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.462394148, + "Position": { + "X": 445.17206101452285, + "Y": 520.73719971757328, + "IsEmpty": false + }, + "Timestamp": 637320035188102020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 450.83398438568634, + "Y": 520.81303785259706, + "IsEmpty": false + }, + "Timestamp": 637320035190154450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814694464, + "Position": { + "X": 483.12585848020166, + "Y": 521.12079814375852, + "IsEmpty": false + }, + "Timestamp": 637320035190491170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814694464, + "Position": { + "X": 495.19433511178215, + "Y": 521.16745361103926, + "IsEmpty": false + }, + "Timestamp": 637320035191195490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.816647589, + "Position": { + "X": 501.76099133037229, + "Y": 521.17247159413046, + "IsEmpty": false + }, + "Timestamp": 637320035191574660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 509.23684175408545, + "Y": 521.15395564713151, + "IsEmpty": false + }, + "Timestamp": 637320035192158590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 517.94590525640774, + "Y": 521.1132224769317, + "IsEmpty": false + }, + "Timestamp": 637320035192476240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 526.87066303627171, + "Y": 521.05258941183297, + "IsEmpty": false + }, + "Timestamp": 637320035193161380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 530.74119478653063, + "Y": 521.01804529632932, + "IsEmpty": false + }, + "Timestamp": 637320035193592710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 533.72377848404835, + "Y": 520.99275264102062, + "IsEmpty": false + }, + "Timestamp": 637320035193684120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 540.45997557598275, + "Y": 520.92171644629275, + "IsEmpty": false + }, + "Timestamp": 637320035194024960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 545.02944788715024, + "Y": 520.86546148184345, + "IsEmpty": false + }, + "Timestamp": 637320035194424390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 549.16601561431366, + "Y": 520.81303785259706, + "IsEmpty": false + }, + "Timestamp": 637320035194898660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 551.12292948693687, + "Y": 520.78538845120693, + "IsEmpty": false + }, + "Timestamp": 637320035195279550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 556.26887249650702, + "Y": 520.71719282487311, + "IsEmpty": false + }, + "Timestamp": 637320035195669160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 560.02226910641139, + "Y": 520.65469052213848, + "IsEmpty": false + }, + "Timestamp": 637320035196159680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.816403449, + "Position": { + "X": 565.06065824694463, + "Y": 520.57712336270902, + "IsEmpty": false + }, + "Timestamp": 637320035196570890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.816403449, + "Position": { + "X": 567.1584067620264, + "Y": 520.54236807358677, + "IsEmpty": false + }, + "Timestamp": 637320035196933370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814450264, + "Position": { + "X": 569.27262218327598, + "Y": 520.50671521320976, + "IsEmpty": false + }, + "Timestamp": 637320035197293990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814450264, + "Position": { + "X": 571.66824938819627, + "Y": 520.45779352418344, + "IsEmpty": false + }, + "Timestamp": 637320035197714430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812497139, + "Position": { + "X": 573.81472995664797, + "Y": 520.42007261109188, + "IsEmpty": false + }, + "Timestamp": 637320035198042140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810543954, + "Position": { + "X": 575.63395569258239, + "Y": 520.38147665264319, + "IsEmpty": false + }, + "Timestamp": 637320035198470800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810543954, + "Position": { + "X": 577.19652046456395, + "Y": 520.35526321453756, + "IsEmpty": false + }, + "Timestamp": 637320035198869090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808590829, + "Position": { + "X": 578.15449468130635, + "Y": 520.34201240660616, + "IsEmpty": false + }, + "Timestamp": 637320035199259630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806637645, + "Position": { + "X": 578.76765844192585, + "Y": 520.32866587313924, + "IsEmpty": false + }, + "Timestamp": 637320035199767300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.453849077, + "Position": { + "X": 579.99685072331795, + "Y": 520.30168663075017, + "IsEmpty": false + }, + "Timestamp": 637320035200164130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.453849077, + "Position": { + "X": 580.61287033139649, + "Y": 520.28805442240355, + "IsEmpty": false + }, + "Timestamp": 637320035200772150, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "f59c0d63-c5a4-4239-b9d6-8ed1d372df46", + "Points": [ + { + "Pressure": 0.0842145383, + "Position": { + "X": 451.27189788559764, + "Y": 501.21876869221273, + "IsEmpty": false + }, + "Timestamp": 637320035210705760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.393789589, + "Position": { + "X": 452.21281788304907, + "Y": 501.21982992738549, + "IsEmpty": false + }, + "Timestamp": 637320035211223780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.751216888, + "Position": { + "X": 484.59998346223642, + "Y": 501.23754364441049, + "IsEmpty": false + }, + "Timestamp": 637320035213286520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757076383, + "Position": { + "X": 497.65581909416028, + "Y": 501.24029668543523, + "IsEmpty": false + }, + "Timestamp": 637320035213644850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771725059, + "Position": { + "X": 507.20892851471183, + "Y": 501.23965633242881, + "IsEmpty": false + }, + "Timestamp": 637320035214114360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781002522, + "Position": { + "X": 513.74252047899085, + "Y": 501.23813649465825, + "IsEmpty": false + }, + "Timestamp": 637320035214541330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785641253, + "Position": { + "X": 520.53767923852706, + "Y": 501.23565832642527, + "IsEmpty": false + }, + "Timestamp": 637320035214844320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.78466469, + "Position": { + "X": 530.3964530042748, + "Y": 501.23131249318317, + "IsEmpty": false + }, + "Timestamp": 637320035215282670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.78466469, + "Position": { + "X": 535.55208158691312, + "Y": 501.22824404782966, + "IsEmpty": false + }, + "Timestamp": 637320035215609900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788571, + "Position": { + "X": 541.04207616335054, + "Y": 501.22475945058642, + "IsEmpty": false + }, + "Timestamp": 637320035215946070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790524125, + "Position": { + "X": 541.48378847615459, + "Y": 501.22429498915147, + "IsEmpty": false + }, + "Timestamp": 637320035216141860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790524125, + "Position": { + "X": 546.86896295392694, + "Y": 501.22035119463771, + "IsEmpty": false + }, + "Timestamp": 637320035216481490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790524125, + "Position": { + "X": 550.13754277300973, + "Y": 501.2176826205673, + "IsEmpty": false + }, + "Timestamp": 637320035216885500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 554.46160785017253, + "Y": 501.21427655981432, + "IsEmpty": false + }, + "Timestamp": 637320035217248430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 558.4334495625053, + "Y": 501.21065119367972, + "IsEmpty": false + }, + "Timestamp": 637320035217634120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 559.96248249160305, + "Y": 501.20875726083023, + "IsEmpty": false + }, + "Timestamp": 637320035217978350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 562.51314164686255, + "Y": 501.20680968931839, + "IsEmpty": false + }, + "Timestamp": 637320035218446720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 563.55732018792264, + "Y": 501.20548170455697, + "IsEmpty": false + }, + "Timestamp": 637320035218733420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 564.60800836021815, + "Y": 501.20413017364513, + "IsEmpty": false + }, + "Timestamp": 637320035219061340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 567.23184041762386, + "Y": 501.20205898484369, + "IsEmpty": false + }, + "Timestamp": 637320035219659490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 568.84384092034634, + "Y": 501.19993547702762, + "IsEmpty": false + }, + "Timestamp": 637320035220039590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 570.45441841399838, + "Y": 501.19849093453456, + "IsEmpty": false + }, + "Timestamp": 637320035220448040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 571.54625497701784, + "Y": 501.19702343240124, + "IsEmpty": false + }, + "Timestamp": 637320035220787930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794430435, + "Position": { + "X": 573.73279920018501, + "Y": 501.19477938647401, + "IsEmpty": false + }, + "Timestamp": 637320035221199900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.79247731, + "Position": { + "X": 574.8274068846423, + "Y": 501.19402001842207, + "IsEmpty": false + }, + "Timestamp": 637320035221562800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.79247731, + "Position": { + "X": 575.94357516735374, + "Y": 501.19248434118026, + "IsEmpty": false + }, + "Timestamp": 637320035221975370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.79247731, + "Position": { + "X": 576.50389982169793, + "Y": 501.19170806131604, + "IsEmpty": false + }, + "Timestamp": 637320035222736590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790035844, + "Position": { + "X": 577.06571027194457, + "Y": 501.1909261735064, + "IsEmpty": false + }, + "Timestamp": 637320035223047530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790035844, + "Position": { + "X": 577.62900060852667, + "Y": 501.19013869241428, + "IsEmpty": false + }, + "Timestamp": 637320035223406190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790035844, + "Position": { + "X": 578.17820627726064, + "Y": 501.19013869241428, + "IsEmpty": false + }, + "Timestamp": 637320035223791480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.290028214, + "Position": { + "X": 579.31213011793386, + "Y": 501.18854700903358, + "IsEmpty": false + }, + "Timestamp": 637320035224740660, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "f04f7a00-42a9-4693-859e-c49350583c06", + "Points": [ + { + "Pressure": 0.444815755, + "Position": { + "X": 578.585399477181, + "Y": 485.43657636903464, + "IsEmpty": false + }, + "Timestamp": 637320035237574600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724116862, + "Position": { + "X": 575.79382637200013, + "Y": 485.39874281128942, + "IsEmpty": false + }, + "Timestamp": 637320035240528480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 567.01493391262363, + "Y": 485.28348045534273, + "IsEmpty": false + }, + "Timestamp": 637320035241040230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788571, + "Position": { + "X": 556.90196044641834, + "Y": 485.17286645134425, + "IsEmpty": false + }, + "Timestamp": 637320035241481660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803952098, + "Position": { + "X": 545.41150680334169, + "Y": 485.05808430833531, + "IsEmpty": false + }, + "Timestamp": 637320035241917410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 527.52525697280237, + "Y": 484.92187924708333, + "IsEmpty": false + }, + "Timestamp": 637320035242305770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.824704349, + "Position": { + "X": 512.36240487052112, + "Y": 484.8548513950567, + "IsEmpty": false + }, + "Timestamp": 637320035242842620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.826657534, + "Position": { + "X": 504.46972864770811, + "Y": 484.83567017874515, + "IsEmpty": false + }, + "Timestamp": 637320035243210480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.828610659, + "Position": { + "X": 495.18150976475755, + "Y": 484.83567017874515, + "IsEmpty": false + }, + "Timestamp": 637320035243611400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.828610659, + "Position": { + "X": 486.50990934422435, + "Y": 484.85701174451657, + "IsEmpty": false + }, + "Timestamp": 637320035244000220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.830563843, + "Position": { + "X": 479.99031913006962, + "Y": 484.88329429527556, + "IsEmpty": false + }, + "Timestamp": 637320035244434980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 474.4150305914024, + "Y": 484.91412019217108, + "IsEmpty": false + }, + "Timestamp": 637320035244784590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 467.86311851668404, + "Y": 484.95160468244256, + "IsEmpty": false + }, + "Timestamp": 637320035245231070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 463.82032992201994, + "Y": 484.98022901109852, + "IsEmpty": false + }, + "Timestamp": 637320035245593730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 461.7429810369274, + "Y": 484.99561705220384, + "IsEmpty": false + }, + "Timestamp": 637320035245961810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 459.12663321152911, + "Y": 485.01723928652791, + "IsEmpty": false + }, + "Timestamp": 637320035246410210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 456.45846282303921, + "Y": 485.04011368293459, + "IsEmpty": false + }, + "Timestamp": 637320035246776880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 454.58849319665831, + "Y": 485.05808430833531, + "IsEmpty": false + }, + "Timestamp": 637320035247159720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 452.17236765796673, + "Y": 485.08312237530225, + "IsEmpty": false + }, + "Timestamp": 637320035247629230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 448.68876458147759, + "Y": 485.1093810465411, + "IsEmpty": false + }, + "Timestamp": 637320035248221210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.834470153, + "Position": { + "X": 447.96371706436514, + "Y": 485.12296452264769, + "IsEmpty": false + }, + "Timestamp": 637320035248541440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.834470153, + "Position": { + "X": 447.61543816868937, + "Y": 485.12296452264769, + "IsEmpty": false + }, + "Timestamp": 637320035248921500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675776303, + "Position": { + "X": 447.07674918506609, + "Y": 485.12986916825264, + "IsEmpty": false + }, + "Timestamp": 637320035249287300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675776303, + "Position": { + "X": 446.72585764701142, + "Y": 485.12986916825264, + "IsEmpty": false + }, + "Timestamp": 637320035250322830, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "0f4d74b0-8aee-41c7-919d-e5285bc376c4", + "Points": [ + { + "Pressure": 0.301014721, + "Position": { + "X": 575.09265480994372, + "Y": 466.98655592529468, + "IsEmpty": false + }, + "Timestamp": 637320035260711620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.629388869, + "Position": { + "X": 574.45211921579528, + "Y": 466.96590009972351, + "IsEmpty": false + }, + "Timestamp": 637320035262017850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.731929481, + "Position": { + "X": 571.25922278910434, + "Y": 466.86498837710604, + "IsEmpty": false + }, + "Timestamp": 637320035262455940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.775143027, + "Position": { + "X": 566.20888935991184, + "Y": 466.73041439140229, + "IsEmpty": false + }, + "Timestamp": 637320035263014730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.800045788, + "Position": { + "X": 553.23784014646901, + "Y": 466.40559222505976, + "IsEmpty": false + }, + "Timestamp": 637320035263584320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.816647589, + "Position": { + "X": 527.70459830254231, + "Y": 465.95151380633644, + "IsEmpty": false + }, + "Timestamp": 637320035264522900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.826901674, + "Position": { + "X": 513.32040340793446, + "Y": 465.80503399616953, + "IsEmpty": false + }, + "Timestamp": 637320035264984170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.831052125, + "Position": { + "X": 507.27566107360059, + "Y": 465.76813689585202, + "IsEmpty": false + }, + "Timestamp": 637320035265300670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.831052125, + "Position": { + "X": 505.32300117260985, + "Y": 465.7593686935524, + "IsEmpty": false + }, + "Timestamp": 637320035265402160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.831052125, + "Position": { + "X": 497.43809251140948, + "Y": 465.75045419147551, + "IsEmpty": false + }, + "Timestamp": 637320035265700010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.83300525, + "Position": { + "X": 489.21740227502045, + "Y": 465.78668450932105, + "IsEmpty": false + }, + "Timestamp": 637320035266032320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840085447, + "Position": { + "X": 477.55332438760763, + "Y": 465.88589779705563, + "IsEmpty": false + }, + "Timestamp": 637320035266463520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840085447, + "Position": { + "X": 471.02547326102211, + "Y": 465.96977410823621, + "IsEmpty": false + }, + "Timestamp": 637320035266806100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840085447, + "Position": { + "X": 464.24828166489567, + "Y": 466.07205145632622, + "IsEmpty": false + }, + "Timestamp": 637320035267172960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840085447, + "Position": { + "X": 461.43809887745033, + "Y": 466.1180239889207, + "IsEmpty": false + }, + "Timestamp": 637320035267508360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840085447, + "Position": { + "X": 457.23425397914872, + "Y": 466.19232494411102, + "IsEmpty": false + }, + "Timestamp": 637320035267874930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840085447, + "Position": { + "X": 455.87268280440361, + "Y": 466.21850354747653, + "IsEmpty": false + }, + "Timestamp": 637320035268333190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842038631, + "Position": { + "X": 455.10300547472633, + "Y": 466.23185570555347, + "IsEmpty": false + }, + "Timestamp": 637320035268829720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842038631, + "Position": { + "X": 454.33031477689889, + "Y": 466.2453825613635, + "IsEmpty": false + }, + "Timestamp": 637320035269217980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.843991756, + "Position": { + "X": 453.12857877974284, + "Y": 466.27295874659421, + "IsEmpty": false + }, + "Timestamp": 637320035269846020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.843991756, + "Position": { + "X": 451.74618939088646, + "Y": 466.30122886399113, + "IsEmpty": false + }, + "Timestamp": 637320035270124730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.843991756, + "Position": { + "X": 450.96295643309816, + "Y": 466.31562313500888, + "IsEmpty": false + }, + "Timestamp": 637320035270483760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.843991756, + "Position": { + "X": 448.96109451276999, + "Y": 466.35983793857224, + "IsEmpty": false + }, + "Timestamp": 637320035270939090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.843991756, + "Position": { + "X": 447.55853248456924, + "Y": 466.39017041740095, + "IsEmpty": false + }, + "Timestamp": 637320035271276510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.843991756, + "Position": { + "X": 446.9472268873451, + "Y": 466.40559222505976, + "IsEmpty": false + }, + "Timestamp": 637320035271648250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.843991756, + "Position": { + "X": 446.33514226672696, + "Y": 466.42118387168489, + "IsEmpty": false + }, + "Timestamp": 637320035271965570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.845944941, + "Position": { + "X": 446.14938970431302, + "Y": 466.42118387168489, + "IsEmpty": false + }, + "Timestamp": 637320035272303800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683100641, + "Position": { + "X": 445.53584633492397, + "Y": 466.43694495237958, + "IsEmpty": false + }, + "Timestamp": 637320035272934200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683100641, + "Position": { + "X": 444.92153324815519, + "Y": 466.45287506224645, + "IsEmpty": false + }, + "Timestamp": 637320035273169410, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "72304a80-3ffc-41a6-a28b-88bd94137077", + "Points": [ + { + "Pressure": 0.438223839, + "Position": { + "X": 595.83427898724517, + "Y": 451.69833385961437, + "IsEmpty": false + }, + "Timestamp": 637320035294812790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655024052, + "Position": { + "X": 594.45358078402091, + "Y": 451.62376884177036, + "IsEmpty": false + }, + "Timestamp": 637320035296138690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 586.7770428105631, + "Y": 451.22937307399349, + "IsEmpty": false + }, + "Timestamp": 637320035296671130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736812413, + "Position": { + "X": 580.49823888217554, + "Y": 450.92686178694601, + "IsEmpty": false + }, + "Timestamp": 637320035297028300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746089876, + "Position": { + "X": 570.77550672116706, + "Y": 450.49348475836763, + "IsEmpty": false + }, + "Timestamp": 637320035297374520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754146636, + "Position": { + "X": 562.42583973660385, + "Y": 450.15916001653284, + "IsEmpty": false + }, + "Timestamp": 637320035297732000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.767818749, + "Position": { + "X": 552.69733445860629, + "Y": 449.81391312211167, + "IsEmpty": false + }, + "Timestamp": 637320035298140310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.784908831, + "Position": { + "X": 543.01758695808894, + "Y": 449.51849091276881, + "IsEmpty": false + }, + "Timestamp": 637320035298452010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806881845, + "Position": { + "X": 529.24362763489626, + "Y": 449.1861787373528, + "IsEmpty": false + }, + "Timestamp": 637320035298894920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811764717, + "Position": { + "X": 525.16901519209898, + "Y": 449.10769658036554, + "IsEmpty": false + }, + "Timestamp": 637320035299304420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814206123, + "Position": { + "X": 523.14098193255438, + "Y": 449.07220562142072, + "IsEmpty": false + }, + "Timestamp": 637320035299346760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822262883, + "Position": { + "X": 510.18146702021676, + "Y": 448.90666631032832, + "IsEmpty": false + }, + "Timestamp": 637320035300165510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842038631, + "Position": { + "X": 492.57624611911882, + "Y": 448.88509471567806, + "IsEmpty": false + }, + "Timestamp": 637320035300481000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842038631, + "Position": { + "X": 484.39464085204384, + "Y": 448.9637720328592, + "IsEmpty": false + }, + "Timestamp": 637320035300779640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842038631, + "Position": { + "X": 474.17237707017443, + "Y": 449.12008448858433, + "IsEmpty": false + }, + "Timestamp": 637320035301246470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842038631, + "Position": { + "X": 470.03483943595097, + "Y": 449.20022429650317, + "IsEmpty": false + }, + "Timestamp": 637320035301455010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.845944941, + "Position": { + "X": 463.16984406306324, + "Y": 449.35565888019744, + "IsEmpty": false + }, + "Timestamp": 637320035301782380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.845944941, + "Position": { + "X": 456.2764884542554, + "Y": 449.53790478131594, + "IsEmpty": false + }, + "Timestamp": 637320035302102440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.847898066, + "Position": { + "X": 451.46266668412272, + "Y": 449.68110588738557, + "IsEmpty": false + }, + "Timestamp": 637320035302418440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.849851251, + "Position": { + "X": 448.69120115715879, + "Y": 449.76862076458929, + "IsEmpty": false + }, + "Timestamp": 637320035302725530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.849851251, + "Position": { + "X": 444.4810021449797, + "Y": 449.90754349135017, + "IsEmpty": false + }, + "Timestamp": 637320035303084700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.849851251, + "Position": { + "X": 438.93392614005541, + "Y": 450.10685141817578, + "IsEmpty": false + }, + "Timestamp": 637320035303475830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.849851251, + "Position": { + "X": 435.49125549205195, + "Y": 450.23946447734255, + "IsEmpty": false + }, + "Timestamp": 637320035303760230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.851804376, + "Position": { + "X": 432.72335348991641, + "Y": 450.34994928370446, + "IsEmpty": false + }, + "Timestamp": 637320035304098230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.851804376, + "Position": { + "X": 431.31634307280075, + "Y": 450.406643172222, + "IsEmpty": false + }, + "Timestamp": 637320035304480550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.851804376, + "Position": { + "X": 429.90780257564955, + "Y": 450.46429826865801, + "IsEmpty": false + }, + "Timestamp": 637320035304922570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.85375756, + "Position": { + "X": 427.85722767571576, + "Y": 450.55257259781365, + "IsEmpty": false + }, + "Timestamp": 637320035305241310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.85375756, + "Position": { + "X": 426.48911453446095, + "Y": 450.61260955335428, + "IsEmpty": false + }, + "Timestamp": 637320035305485450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.85375756, + "Position": { + "X": 425.71721904145068, + "Y": 450.64298243818223, + "IsEmpty": false + }, + "Timestamp": 637320035305738640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.85375756, + "Position": { + "X": 423.70635064372482, + "Y": 450.73551146580184, + "IsEmpty": false + }, + "Timestamp": 637320035306101420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.855710685, + "Position": { + "X": 421.6053294356858, + "Y": 450.83014335671049, + "IsEmpty": false + }, + "Timestamp": 637320035306487330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.855710685, + "Position": { + "X": 421.56066223536817, + "Y": 450.83014335671049, + "IsEmpty": false + }, + "Timestamp": 637320035306857590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.474113077, + "Position": { + "X": 422.29113384929673, + "Y": 450.79836674924962, + "IsEmpty": false + }, + "Timestamp": 637320035307582130, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "cd77b7d1-2e47-4afe-b297-f7b5b951e338", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 601.67671296701883, + "Y": 448.23166619526648, + "IsEmpty": false + }, + "Timestamp": 637320035378073800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.165758759, + "Position": { + "X": 601.74918144147034, + "Y": 448.41224843481484, + "IsEmpty": false + }, + "Timestamp": 637320035378418420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.280750751, + "Position": { + "X": 601.38681102413773, + "Y": 447.94274583001919, + "IsEmpty": false + }, + "Timestamp": 637320035379260710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.293202102, + "Position": { + "X": 598.48781964040199, + "Y": 445.70357093173999, + "IsEmpty": false + }, + "Timestamp": 637320035379604140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.319325536, + "Position": { + "X": 592.11003298716844, + "Y": 442.7420670752673, + "IsEmpty": false + }, + "Timestamp": 637320035380027800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.382070661, + "Position": { + "X": 574.64358816522736, + "Y": 437.50526626359061, + "IsEmpty": false + }, + "Timestamp": 637320035380462210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.390371561, + "Position": { + "X": 567.10619374046939, + "Y": 434.86880482928996, + "IsEmpty": false + }, + "Timestamp": 637320035380870360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.396719307, + "Position": { + "X": 560.03990048979631, + "Y": 432.16012732621505, + "IsEmpty": false + }, + "Timestamp": 637320035381213200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.396719307, + "Position": { + "X": 553.26350918200444, + "Y": 429.37920570929077, + "IsEmpty": false + }, + "Timestamp": 637320035381557560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.404531926, + "Position": { + "X": 547.9728337807685, + "Y": 426.81498838883954, + "IsEmpty": false + }, + "Timestamp": 637320035381854750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.416983277, + "Position": { + "X": 541.26891094742803, + "Y": 425.00919403843119, + "IsEmpty": false + }, + "Timestamp": 637320035382164780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.421133757, + "Position": { + "X": 538.9497234494545, + "Y": 424.03406677191521, + "IsEmpty": false + }, + "Timestamp": 637320035382440560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.432852685, + "Position": { + "X": 532.06461540744772, + "Y": 420.96422478974358, + "IsEmpty": false + }, + "Timestamp": 637320035382841320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.436758995, + "Position": { + "X": 528.76700534661609, + "Y": 419.84463734060398, + "IsEmpty": false + }, + "Timestamp": 637320035383242340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.443595022, + "Position": { + "X": 526.66523729453456, + "Y": 419.05009231363636, + "IsEmpty": false + }, + "Timestamp": 637320035383658990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.443595022, + "Position": { + "X": 524.23733306234624, + "Y": 417.74992262494834, + "IsEmpty": false + }, + "Timestamp": 637320035384005850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.451163501, + "Position": { + "X": 523.36764125624052, + "Y": 417.24429796322801, + "IsEmpty": false + }, + "Timestamp": 637320035384272960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.451163501, + "Position": { + "X": 521.73694633316882, + "Y": 416.30529275363676, + "IsEmpty": false + }, + "Timestamp": 637320035384591720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.451163501, + "Position": { + "X": 520.57735258418199, + "Y": 415.69132996621749, + "IsEmpty": false + }, + "Timestamp": 637320035384960810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.447501332, + "Position": { + "X": 517.96826314332736, + "Y": 413.70495337626079, + "IsEmpty": false + }, + "Timestamp": 637320035385532590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.447501332, + "Position": { + "X": 517.67836120044626, + "Y": 413.4160330110135, + "IsEmpty": false + }, + "Timestamp": 637320035385851830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.458243698, + "Position": { + "X": 517.38845925756516, + "Y": 412.98265246314259, + "IsEmpty": false + }, + "Timestamp": 637320035386263430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.273182273, + "Position": { + "X": 517.09855731468406, + "Y": 412.72982610974481, + "IsEmpty": false + }, + "Timestamp": 637320035386655690, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "495fffa3-47df-4376-86bf-66dd7ac34dd1", + "Points": [ + { + "Pressure": 0.0222018771, + "Position": { + "X": 427.91827492616562, + "Y": 438.33593334748298, + "IsEmpty": false + }, + "Timestamp": 637320035400938690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.12059205, + "Position": { + "X": 424.98303528266655, + "Y": 437.90255279961207, + "IsEmpty": false + }, + "Timestamp": 637320035401511170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.338612944, + "Position": { + "X": 422.51889681325247, + "Y": 439.88890134449355, + "IsEmpty": false + }, + "Timestamp": 637320035403184140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.457022965, + "Position": { + "X": 427.15728583173717, + "Y": 438.26368923363356, + "IsEmpty": false + }, + "Timestamp": 637320035403588400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.461173415, + "Position": { + "X": 427.48342201184403, + "Y": 438.2275952217841, + "IsEmpty": false + }, + "Timestamp": 637320035403884550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.464347303, + "Position": { + "X": 432.04932853333958, + "Y": 437.25246795526812, + "IsEmpty": false + }, + "Timestamp": 637320035404254780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.486564428, + "Position": { + "X": 445.16728627967706, + "Y": 431.79896284711833, + "IsEmpty": false + }, + "Timestamp": 637320035404644970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.490470737, + "Position": { + "X": 457.66919188048894, + "Y": 427.24839698178567, + "IsEmpty": false + }, + "Timestamp": 637320035405011790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.492423892, + "Position": { + "X": 470.67841887007398, + "Y": 423.20342773309807, + "IsEmpty": false + }, + "Timestamp": 637320035405324700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503166258, + "Position": { + "X": 487.6737765404676, + "Y": 417.20820395137855, + "IsEmpty": false + }, + "Timestamp": 637320035405736650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.505119383, + "Position": { + "X": 501.29904165304055, + "Y": 411.42965642105679, + "IsEmpty": false + }, + "Timestamp": 637320035406140460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.505119383, + "Position": { + "X": 502.85725407912327, + "Y": 410.85181569056226, + "IsEmpty": false + }, + "Timestamp": 637320035406398190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.507072568, + "Position": { + "X": 508.94513878947578, + "Y": 409.08214339707865, + "IsEmpty": false + }, + "Timestamp": 637320035406779000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.507072568, + "Position": { + "X": 512.42393405897371, + "Y": 407.78197370839064, + "IsEmpty": false + }, + "Timestamp": 637320035407114810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.507072568, + "Position": { + "X": 516.73618689735156, + "Y": 406.95130662449833, + "IsEmpty": false + }, + "Timestamp": 637320035407750280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498039216, + "Position": { + "X": 514.16333169372263, + "Y": 408.17923219933687, + "IsEmpty": false + }, + "Timestamp": 637320035408176240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.477042794, + "Position": { + "X": 512.17026635331831, + "Y": 408.82931704368082, + "IsEmpty": false + }, + "Timestamp": 637320035408498390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.255359739, + "Position": { + "X": 510.90195587011675, + "Y": 409.91281048097102, + "IsEmpty": false + }, + "Timestamp": 637320035409101850, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "4cfa46bb-b70f-4fdb-b9fe-71b86796f4e5", + "Points": [ + { + "Pressure": 0.110582128, + "Position": { + "X": 443.8627275367121, + "Y": 441.04461085055789, + "IsEmpty": false + }, + "Timestamp": 637320035414748840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.309315622, + "Position": { + "X": 433.71625769363709, + "Y": 440.14172769789133, + "IsEmpty": false + }, + "Timestamp": 637320035414768550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.492423892, + "Position": { + "X": 476.22274795442769, + "Y": 439.85280733264403, + "IsEmpty": false + }, + "Timestamp": 637320035417429300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.496330202, + "Position": { + "X": 480.39004982136498, + "Y": 439.4193987396979, + "IsEmpty": false + }, + "Timestamp": 637320035417461320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498283356, + "Position": { + "X": 489.12327223233547, + "Y": 439.05826230567641, + "IsEmpty": false + }, + "Timestamp": 637320035417470520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.502189696, + "Position": { + "X": 504.08933032509907, + "Y": 438.62485371273027, + "IsEmpty": false + }, + "Timestamp": 637320035417490970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506096005, + "Position": { + "X": 518.65676974076678, + "Y": 438.44427147318191, + "IsEmpty": false + }, + "Timestamp": 637320035417560090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506096005, + "Position": { + "X": 522.60665216181212, + "Y": 438.62485371273027, + "IsEmpty": false + }, + "Timestamp": 637320035417581400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510002315, + "Position": { + "X": 546.45088363698676, + "Y": 440.57510824576224, + "IsEmpty": false + }, + "Timestamp": 637320035418327890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510002315, + "Position": { + "X": 549.67601120082929, + "Y": 441.08073290748257, + "IsEmpty": false + }, + "Timestamp": 637320035418606130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510002315, + "Position": { + "X": 555.14785778819396, + "Y": 442.45314671002001, + "IsEmpty": false + }, + "Timestamp": 637320035418870530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506584287, + "Position": { + "X": 557.53951376061889, + "Y": 443.35602986268657, + "IsEmpty": false + }, + "Timestamp": 637320035419265230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.489738315, + "Position": { + "X": 555.51022820552646, + "Y": 443.50049004531019, + "IsEmpty": false + }, + "Timestamp": 637320035419593720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.476554513, + "Position": { + "X": 541.16020823575082, + "Y": 441.44189738657929, + "IsEmpty": false + }, + "Timestamp": 637320035419895760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.462394148, + "Position": { + "X": 524.01991361645423, + "Y": 440.0694835840419, + "IsEmpty": false + }, + "Timestamp": 637320035420284320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.458243698, + "Position": { + "X": 494.45016784825953, + "Y": 439.02214024875173, + "IsEmpty": false + }, + "Timestamp": 637320035420687710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.466056317, + "Position": { + "X": 480.02767940403243, + "Y": 439.67222509309568, + "IsEmpty": false + }, + "Timestamp": 637320035421123770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.466056317, + "Position": { + "X": 473.2150398364771, + "Y": 439.96114545834297, + "IsEmpty": false + }, + "Timestamp": 637320035421467410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.468009472, + "Position": { + "X": 467.41705706900569, + "Y": 440.17784975481607, + "IsEmpty": false + }, + "Timestamp": 637320035421827750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469962627, + "Position": { + "X": 465.64142519703097, + "Y": 440.17784975481607, + "IsEmpty": false + }, + "Timestamp": 637320035422178340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471915781, + "Position": { + "X": 464.51806568526996, + "Y": 440.17784975481607, + "IsEmpty": false + }, + "Timestamp": 637320035422649430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481681556, + "Position": { + "X": 467.48952554345715, + "Y": 439.4193987396979, + "IsEmpty": false + }, + "Timestamp": 637320035422909810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.48363471, + "Position": { + "X": 479.33917280659301, + "Y": 438.15535110793462, + "IsEmpty": false + }, + "Timestamp": 637320035423228740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.489494175, + "Position": { + "X": 512.64135350486572, + "Y": 431.11278399092492, + "IsEmpty": false + }, + "Timestamp": 637320035424053740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.489494175, + "Position": { + "X": 517.93202890610166, + "Y": 428.47632255662421, + "IsEmpty": false + }, + "Timestamp": 637320035424416000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49144733, + "Position": { + "X": 518.07696585500457, + "Y": 427.21227492486094, + "IsEmpty": false + }, + "Timestamp": 637320035424706700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49144733, + "Position": { + "X": 512.64135350486572, + "Y": 426.30936372711915, + "IsEmpty": false + }, + "Timestamp": 637320035424943080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49144733, + "Position": { + "X": 501.48022686170685, + "Y": 426.74277232006534, + "IsEmpty": false + }, + "Timestamp": 637320035425288230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49144733, + "Position": { + "X": 496.11709700855704, + "Y": 427.60953341580716, + "IsEmpty": false + }, + "Timestamp": 637320035425538150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49144733, + "Position": { + "X": 485.31834078273073, + "Y": 429.63203206268855, + "IsEmpty": false + }, + "Timestamp": 637320035425872280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49144733, + "Position": { + "X": 482.6730171046504, + "Y": 429.77649224531217, + "IsEmpty": false + }, + "Timestamp": 637320035426328450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49144733, + "Position": { + "X": 491.08008931297644, + "Y": 427.21227492486094, + "IsEmpty": false + }, + "Timestamp": 637320035426658780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49144733, + "Position": { + "X": 501.91507977602851, + "Y": 423.20342773309807, + "IsEmpty": false + }, + "Timestamp": 637320035427024350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.507072568, + "Position": { + "X": 509.74236212112999, + "Y": 418.94175418793742, + "IsEmpty": false + }, + "Timestamp": 637320035427508030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 504.45170074243163, + "Y": 419.08621437056104, + "IsEmpty": false + }, + "Timestamp": 637320035427790400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 502.24121595613531, + "Y": 419.48350090658249, + "IsEmpty": false + }, + "Timestamp": 637320035428047320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 493.58047604215386, + "Y": 422.1921784096574, + "IsEmpty": false + }, + "Timestamp": 637320035428377680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 493.39929083348761, + "Y": 422.40885466105522, + "IsEmpty": false + }, + "Timestamp": 637320035428645730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.512932003, + "Position": { + "X": 497.78401214631691, + "Y": 421.46984945146397, + "IsEmpty": false + }, + "Timestamp": 637320035428895220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514885187, + "Position": { + "X": 504.92278789397903, + "Y": 418.32779140051815, + "IsEmpty": false + }, + "Timestamp": 637320035429209980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514885187, + "Position": { + "X": 508.32910066648788, + "Y": 414.86066288232513, + "IsEmpty": false + }, + "Timestamp": 637320035429677560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514885187, + "Position": { + "X": 508.36534892625122, + "Y": 414.71620269970151, + "IsEmpty": false + }, + "Timestamp": 637320035430013090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514885187, + "Position": { + "X": 508.69148510635802, + "Y": 414.57174251707784, + "IsEmpty": false + }, + "Timestamp": 637320035430691700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514885187, + "Position": { + "X": 511.1556235757721, + "Y": 413.52437113671243, + "IsEmpty": false + }, + "Timestamp": 637320035431416130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514885187, + "Position": { + "X": 511.98908114465206, + "Y": 413.45215506793824, + "IsEmpty": false + }, + "Timestamp": 637320035431794770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514885187, + "Position": { + "X": 513.14868891617641, + "Y": 413.81331954703495, + "IsEmpty": false + }, + "Timestamp": 637320035432227330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.516838312, + "Position": { + "X": 511.7354274615343, + "Y": 414.68008064277677, + "IsEmpty": false + }, + "Timestamp": 637320035432630070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.516838312, + "Position": { + "X": 501.04538796992284, + "Y": 419.51959491843195, + "IsEmpty": false + }, + "Timestamp": 637320035433016000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.512199581, + "Position": { + "X": 475.35305614832203, + "Y": 426.63440614929112, + "IsEmpty": false + }, + "Timestamp": 637320035433684050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514152765, + "Position": { + "X": 459.37235527801215, + "Y": 432.48516974838708, + "IsEmpty": false + }, + "Timestamp": 637320035434214890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514152765, + "Position": { + "X": 449.22587141239956, + "Y": 437.0718857157197, + "IsEmpty": false + }, + "Timestamp": 637320035434563170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514152765, + "Position": { + "X": 441.50730580151287, + "Y": 439.20272248830008, + "IsEmpty": false + }, + "Timestamp": 637320035434898900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514152765, + "Position": { + "X": 439.33305525244225, + "Y": 439.92502340141823, + "IsEmpty": false + }, + "Timestamp": 637320035435130810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51610589, + "Position": { + "X": 434.2235790824102, + "Y": 441.98364410522436, + "IsEmpty": false + }, + "Timestamp": 637320035435381770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.518059075, + "Position": { + "X": 431.83190908744757, + "Y": 442.99486538358985, + "IsEmpty": false + }, + "Timestamp": 637320035436134600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 433.82497442785188, + "Y": 442.23644241354691, + "IsEmpty": false + }, + "Timestamp": 637320035436376810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 437.73860858913383, + "Y": 441.00851683870837, + "IsEmpty": false + }, + "Timestamp": 637320035436683730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 444.08016100514175, + "Y": 439.27493855707428, + "IsEmpty": false + }, + "Timestamp": 637320035436984030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 451.50882467314733, + "Y": 437.0718857157197, + "IsEmpty": false + }, + "Timestamp": 637320035437338530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 461.54659180454513, + "Y": 434.07425980232233, + "IsEmpty": false + }, + "Timestamp": 637320035437662270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 469.08397220676557, + "Y": 431.29336623047328, + "IsEmpty": false + }, + "Timestamp": 637320035438229110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533440173, + "Position": { + "X": 470.24357997828992, + "Y": 431.04053987707545, + "IsEmpty": false + }, + "Timestamp": 637320035438590310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533440173, + "Position": { + "X": 467.48952554345715, + "Y": 431.83508490404307, + "IsEmpty": false + }, + "Timestamp": 637320035438968070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537346482, + "Position": { + "X": 456.36464716006162, + "Y": 435.41055154793503, + "IsEmpty": false + }, + "Timestamp": 637320035439274870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537346482, + "Position": { + "X": 446.36311426588952, + "Y": 438.33593334748298, + "IsEmpty": false + }, + "Timestamp": 637320035439585780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537346482, + "Position": { + "X": 442.59443107604818, + "Y": 439.05826230567641, + "IsEmpty": false + }, + "Timestamp": 637320035439881700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534905016, + "Position": { + "X": 435.63684053705231, + "Y": 440.6834744165364, + "IsEmpty": false + }, + "Timestamp": 637320035440197220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534905016, + "Position": { + "X": 433.9336771395291, + "Y": 441.29743720395567, + "IsEmpty": false + }, + "Timestamp": 637320035440562190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531975269, + "Position": { + "X": 433.71625769363709, + "Y": 441.36965327272986, + "IsEmpty": false + }, + "Timestamp": 637320035440841210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529778004, + "Position": { + "X": 433.53507248497078, + "Y": 442.05586017399855, + "IsEmpty": false + }, + "Timestamp": 637320035441365650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529778004, + "Position": { + "X": 432.19427950478013, + "Y": 442.99486538358985, + "IsEmpty": false + }, + "Timestamp": 637320035441738960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529778004, + "Position": { + "X": 430.02004297824715, + "Y": 444.04223676395526, + "IsEmpty": false + }, + "Timestamp": 637320035441988660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529778004, + "Position": { + "X": 428.78796673227129, + "Y": 444.43949525490149, + "IsEmpty": false + }, + "Timestamp": 637320035442221470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529778004, + "Position": { + "X": 426.93985236330752, + "Y": 444.8006597339982, + "IsEmpty": false + }, + "Timestamp": 637320035442592410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529778004, + "Position": { + "X": 426.86738388885607, + "Y": 444.54786142567565, + "IsEmpty": false + }, + "Timestamp": 637320035442962770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 426.72243291741552, + "Y": 444.22281900350362, + "IsEmpty": false + }, + "Timestamp": 637320035443355350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 426.57748194597497, + "Y": 444.11445283272946, + "IsEmpty": false + }, + "Timestamp": 637320035443672430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522941947, + "Position": { + "X": 430.30994492112825, + "Y": 443.46436798838545, + "IsEmpty": false + }, + "Timestamp": 637320035444045740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522941947, + "Position": { + "X": 438.49959768356229, + "Y": 441.47801944350402, + "IsEmpty": false + }, + "Timestamp": 637320035444313330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522941947, + "Position": { + "X": 446.90668391442603, + "Y": 440.14172769789133, + "IsEmpty": false + }, + "Timestamp": 637320035444709830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525139213, + "Position": { + "X": 455.13257091408576, + "Y": 438.80543595227863, + "IsEmpty": false + }, + "Timestamp": 637320035445061820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525139213, + "Position": { + "X": 464.98915283681737, + "Y": 437.46914420666593, + "IsEmpty": false + }, + "Timestamp": 637320035445455610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525139213, + "Position": { + "X": 472.52653323903775, + "Y": 436.09675844920372, + "IsEmpty": false + }, + "Timestamp": 637320035445885140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525139213, + "Position": { + "X": 480.39004982136498, + "Y": 434.54376240711798, + "IsEmpty": false + }, + "Timestamp": 637320035446095270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525139213, + "Position": { + "X": 484.23121550819542, + "Y": 433.20749870658051, + "IsEmpty": false + }, + "Timestamp": 637320035446385050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 488.65218508078812, + "Y": 431.87120696096781, + "IsEmpty": false + }, + "Timestamp": 637320035446693760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 489.55812514665712, + "Y": 431.65450266449471, + "IsEmpty": false + }, + "Timestamp": 637320035446708920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 490.68148465841819, + "Y": 431.29336623047328, + "IsEmpty": false + }, + "Timestamp": 637320035447121160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 490.46405118998854, + "Y": 431.18500005969906, + "IsEmpty": false + }, + "Timestamp": 637320035447418470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 485.42705751694558, + "Y": 431.5100424818711, + "IsEmpty": false + }, + "Timestamp": 637320035447784510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 476.25898219165339, + "Y": 433.9659216766234, + "IsEmpty": false + }, + "Timestamp": 637320035448080040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527580678, + "Position": { + "X": 463.21352096484264, + "Y": 436.99964160187028, + "IsEmpty": false + }, + "Timestamp": 637320035448480600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 455.13257091408576, + "Y": 438.80543595227863, + "IsEmpty": false + }, + "Timestamp": 637320035448975330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 451.69000988181358, + "Y": 439.4193987396979, + "IsEmpty": false + }, + "Timestamp": 637320035449263520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 446.72548468322208, + "Y": 440.14172769789133, + "IsEmpty": false + }, + "Timestamp": 637320035449530920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 444.5150139194634, + "Y": 440.35843199436442, + "IsEmpty": false + }, + "Timestamp": 637320035449801530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 438.2821642151327, + "Y": 441.33355926088041, + "IsEmpty": false + }, + "Timestamp": 637320035450095480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 434.65843199673185, + "Y": 442.20032035662223, + "IsEmpty": false + }, + "Timestamp": 637320035450503520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 432.77408339054233, + "Y": 442.7420670752673, + "IsEmpty": false + }, + "Timestamp": 637320035450847770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 431.86814332467333, + "Y": 442.92264931481566, + "IsEmpty": false + }, + "Timestamp": 637320035451137900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 431.10716825278246, + "Y": 443.17544762313821, + "IsEmpty": false + }, + "Timestamp": 637320035451473130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 430.27369666136491, + "Y": 443.31990780576183, + "IsEmpty": false + }, + "Timestamp": 637320035451803230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 428.8604352067228, + "Y": 443.03098744051454, + "IsEmpty": false + }, + "Timestamp": 637320035452140050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 427.41093951485493, + "Y": 442.5253627787942, + "IsEmpty": false + }, + "Timestamp": 637320035452482020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528801382, + "Position": { + "X": 426.54124770874927, + "Y": 441.98364410522436, + "IsEmpty": false + }, + "Timestamp": 637320035452755500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528801382, + "Position": { + "X": 426.14262903165331, + "Y": 441.76693980875132, + "IsEmpty": false + }, + "Timestamp": 637320035452982180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 424.43947965666774, + "Y": 441.44189738657929, + "IsEmpty": false + }, + "Timestamp": 637320035453329800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528801382, + "Position": { + "X": 423.35235438213243, + "Y": 441.36965327272986, + "IsEmpty": false + }, + "Timestamp": 637320035453717020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 427.08480333474807, + "Y": 440.5389861888375, + "IsEmpty": false + }, + "Timestamp": 637320035454456900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 435.56435804006321, + "Y": 439.4193987396979, + "IsEmpty": false + }, + "Timestamp": 637320035454781730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 454.40783007942065, + "Y": 436.53013899707463, + "IsEmpty": false + }, + "Timestamp": 637320035455155200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 488.65218508078812, + "Y": 429.99319654178527, + "IsEmpty": false + }, + "Timestamp": 637320035455811470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 498.11014832642377, + "Y": 428.51244461354895, + "IsEmpty": false + }, + "Timestamp": 637320035456141910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 504.41546650520593, + "Y": 427.97069789490388, + "IsEmpty": false + }, + "Timestamp": 637320035456495130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 508.00296448638102, + "Y": 427.97069789490388, + "IsEmpty": false + }, + "Timestamp": 637320035456859990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 508.94513878947578, + "Y": 427.68177752965659, + "IsEmpty": false + }, + "Timestamp": 637320035457140480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529533863, + "Position": { + "X": 509.19880649513112, + "Y": 427.60953341580716, + "IsEmpty": false + }, + "Timestamp": 637320035457390450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537346482, + "Position": { + "X": 509.12632399814208, + "Y": 426.30936372711915, + "IsEmpty": false + }, + "Timestamp": 637320035457833880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532707691, + "Position": { + "X": 509.27127496958258, + "Y": 426.12878148757079, + "IsEmpty": false + }, + "Timestamp": 637320035458084480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530754566, + "Position": { + "X": 515.43164217692424, + "Y": 426.59831213744167, + "IsEmpty": false + }, + "Timestamp": 637320035458571080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530754566, + "Position": { + "X": 523.25892452202572, + "Y": 429.01806927526928, + "IsEmpty": false + }, + "Timestamp": 637320035458956070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530754566, + "Position": { + "X": 530.65135395280561, + "Y": 431.58228659572052, + "IsEmpty": false + }, + "Timestamp": 637320035459358180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528801382, + "Position": { + "X": 536.88418963459867, + "Y": 434.54376240711798, + "IsEmpty": false + }, + "Timestamp": 637320035459851180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530754566, + "Position": { + "X": 533.33292589064934, + "Y": 430.96832380830125, + "IsEmpty": false + }, + "Timestamp": 637320035460605480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 524.09238209090563, + "Y": 426.88723250268896, + "IsEmpty": false + }, + "Timestamp": 637320035460977930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528801382, + "Position": { + "X": 512.96748968497252, + "Y": 423.20342773309807, + "IsEmpty": false + }, + "Timestamp": 637320035461459910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523918509, + "Position": { + "X": 511.22810607276119, + "Y": 422.58943690060357, + "IsEmpty": false + }, + "Timestamp": 637320035462004210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 518.18568258921937, + "Y": 423.92572864621627, + "IsEmpty": false + }, + "Timestamp": 637320035462307830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5200122, + "Position": { + "X": 530.39770026968779, + "Y": 427.46507323318349, + "IsEmpty": false + }, + "Timestamp": 637320035462723970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 537.06537484326498, + "Y": 430.1015346674842, + "IsEmpty": false + }, + "Timestamp": 637320035463048240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 538.9497234494545, + "Y": 431.11278399092492, + "IsEmpty": false + }, + "Timestamp": 637320035463338720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523918509, + "Position": { + "X": 539.8918977525492, + "Y": 431.58228659572052, + "IsEmpty": false + }, + "Timestamp": 637320035463695530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525871694, + "Position": { + "X": 536.55805345449187, + "Y": 430.1737507362584, + "IsEmpty": false + }, + "Timestamp": 637320035464032380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527824819, + "Position": { + "X": 527.06385597163046, + "Y": 426.52606802359225, + "IsEmpty": false + }, + "Timestamp": 637320035464338620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527824819, + "Position": { + "X": 518.25816508620846, + "Y": 424.21464901146356, + "IsEmpty": false + }, + "Timestamp": 637320035464743760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525871694, + "Position": { + "X": 515.68529586004195, + "Y": 423.23952174494758, + "IsEmpty": false + }, + "Timestamp": 637320035464954050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525871694, + "Position": { + "X": 514.27204842793742, + "Y": 422.69780307137773, + "IsEmpty": false + }, + "Timestamp": 637320035465210510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525871694, + "Position": { + "X": 513.47482509628321, + "Y": 422.1921784096574, + "IsEmpty": false + }, + "Timestamp": 637320035465501840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523918509, + "Position": { + "X": 516.55500168868525, + "Y": 422.01159617010904, + "IsEmpty": false + }, + "Timestamp": 637320035465947370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 517.13480557444746, + "Y": 421.9754741131843, + "IsEmpty": false + }, + "Timestamp": 637320035466323550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 517.64212696322056, + "Y": 421.86713598748537, + "IsEmpty": false + }, + "Timestamp": 637320035466729410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 518.43935029487477, + "Y": 422.15605635273266, + "IsEmpty": false + }, + "Timestamp": 637320035467039620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 517.31599078311376, + "Y": 425.40648057445259, + "IsEmpty": false + }, + "Timestamp": 637320035467524800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 512.56888503041421, + "Y": 429.09028534404348, + "IsEmpty": false + }, + "Timestamp": 637320035467824380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 509.56117691246368, + "Y": 431.83508490404307, + "IsEmpty": false + }, + "Timestamp": 637320035468194550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51610589, + "Position": { + "X": 506.29981511139545, + "Y": 432.34070956576346, + "IsEmpty": false + }, + "Timestamp": 637320035468672240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.512199581, + "Position": { + "X": 512.64135350486572, + "Y": 428.33186237400059, + "IsEmpty": false + }, + "Timestamp": 637320035469133370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514152765, + "Position": { + "X": 512.53265079318851, + "Y": 423.34788791572174, + "IsEmpty": false + }, + "Timestamp": 637320035469800940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.508293271, + "Position": { + "X": 511.80789593598575, + "Y": 422.11993429580792, + "IsEmpty": false + }, + "Timestamp": 637320035470493310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.512199581, + "Position": { + "X": 523.11397355058523, + "Y": 426.67052820621586, + "IsEmpty": false + }, + "Timestamp": 637320035471088680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5200122, + "Position": { + "X": 529.74542790947419, + "Y": 429.2347455266671, + "IsEmpty": false + }, + "Timestamp": 637320035471382320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521965384, + "Position": { + "X": 537.31904254892027, + "Y": 432.48516974838708, + "IsEmpty": false + }, + "Timestamp": 637320035471813180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523918509, + "Position": { + "X": 541.0515055240736, + "Y": 434.79658876051576, + "IsEmpty": false + }, + "Timestamp": 637320035472120040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570550084, + "Position": { + "X": 545.83484551399886, + "Y": 436.06063639227904, + "IsEmpty": false + }, + "Timestamp": 637320035472409190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592278957, + "Position": { + "X": 546.30591864300857, + "Y": 436.34955675752627, + "IsEmpty": false + }, + "Timestamp": 637320035472796210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530022144, + "Position": { + "X": 541.0877397612993, + "Y": 436.13288050612846, + "IsEmpty": false + }, + "Timestamp": 637320035473149660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.515129328, + "Position": { + "X": 521.62824362149161, + "Y": 432.5574138622365, + "IsEmpty": false + }, + "Timestamp": 637320035473576560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.515129328, + "Position": { + "X": 518.87418918665878, + "Y": 432.12400526929036, + "IsEmpty": false + }, + "Timestamp": 637320035473855360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.515129328, + "Position": { + "X": 514.34451690238893, + "Y": 431.58228659572052, + "IsEmpty": false + }, + "Timestamp": 637320035473868270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 509.37999170379743, + "Y": 431.00441782015071, + "IsEmpty": false + }, + "Timestamp": 637320035474159210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.511223018, + "Position": { + "X": 508.94513878947578, + "Y": 431.61840865264526, + "IsEmpty": false + }, + "Timestamp": 637320035474470610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 514.88807252838774, + "Y": 432.48516974838708, + "IsEmpty": false + }, + "Timestamp": 637320035474863460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 523.69377743634732, + "Y": 432.73799610178486, + "IsEmpty": false + }, + "Timestamp": 637320035475177390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 532.86183873910193, + "Y": 432.77409011363437, + "IsEmpty": false + }, + "Timestamp": 637320035475515420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 536.48558498004036, + "Y": 433.4964190718278, + "IsEmpty": false + }, + "Timestamp": 637320035475870120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.511223018, + "Position": { + "X": 535.03608928817255, + "Y": 432.95467235318273, + "IsEmpty": false + }, + "Timestamp": 637320035476172660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 527.20880694307107, + "Y": 429.88483037101111, + "IsEmpty": false + }, + "Timestamp": 637320035476469990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 517.82331217188687, + "Y": 425.26202039182897, + "IsEmpty": false + }, + "Timestamp": 637320035476859690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 512.38769982174801, + "Y": 422.48109877490464, + "IsEmpty": false + }, + "Timestamp": 637320035477177500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 512.53265079318851, + "Y": 422.1921784096574, + "IsEmpty": false + }, + "Timestamp": 637320035477543930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 515.28669120548363, + "Y": 421.2531732000661, + "IsEmpty": false + }, + "Timestamp": 637320035477907470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 515.57659314836474, + "Y": 421.1086849723672, + "IsEmpty": false + }, + "Timestamp": 637320035478197370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 513.22115739062792, + "Y": 419.80854332875452, + "IsEmpty": false + }, + "Timestamp": 637320035478505230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 511.0469068415573, + "Y": 418.94175418793742, + "IsEmpty": false + }, + "Timestamp": 637320035478808780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 509.09008976091633, + "Y": 417.28042002015275, + "IsEmpty": false + }, + "Timestamp": 637320035479134780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 510.72077066145044, + "Y": 418.29166934359341, + "IsEmpty": false + }, + "Timestamp": 637320035479489660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 518.94667168364788, + "Y": 421.9754741131843, + "IsEmpty": false + }, + "Timestamp": 637320035479828600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513176143, + "Position": { + "X": 527.46246062618877, + "Y": 424.39523125101192, + "IsEmpty": false + }, + "Timestamp": 637320035480148870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521721244, + "Position": { + "X": 538.58735303212188, + "Y": 428.18740219137692, + "IsEmpty": false + }, + "Timestamp": 637320035480591030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.564202309, + "Position": { + "X": 549.2049100267443, + "Y": 434.21871998494595, + "IsEmpty": false + }, + "Timestamp": 637320035480980580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521232903, + "Position": { + "X": 554.53181966520594, + "Y": 436.92742553309608, + "IsEmpty": false + }, + "Timestamp": 637320035481262940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521232903, + "Position": { + "X": 559.49633084125981, + "Y": 438.51651558703134, + "IsEmpty": false + }, + "Timestamp": 637320035481526410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521232903, + "Position": { + "X": 562.57652145619954, + "Y": 439.31106061399896, + "IsEmpty": false + }, + "Timestamp": 637320035481911150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521232903, + "Position": { + "X": 567.50482644010287, + "Y": 440.25006582359026, + "IsEmpty": false + }, + "Timestamp": 637320035482244750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521232903, + "Position": { + "X": 571.81706525594313, + "Y": 441.47801944350402, + "IsEmpty": false + }, + "Timestamp": 637320035482576610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521232903, + "Position": { + "X": 575.36832899989247, + "Y": 442.41702465309527, + "IsEmpty": false + }, + "Timestamp": 637320035482989950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.52806896, + "Position": { + "X": 579.20949468672302, + "Y": 443.31990780576183, + "IsEmpty": false + }, + "Timestamp": 637320035483455720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525871694, + "Position": { + "X": 582.14472030768445, + "Y": 444.22281900350362, + "IsEmpty": false + }, + "Timestamp": 637320035483749360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525871694, + "Position": { + "X": 583.81166349051955, + "Y": 444.94511991662182, + "IsEmpty": false + }, + "Timestamp": 637320035484167100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527824819, + "Position": { + "X": 582.57958724454363, + "Y": 443.96999265010584, + "IsEmpty": false + }, + "Timestamp": 637320035484600670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527824819, + "Position": { + "X": 575.83943017397746, + "Y": 441.08073290748257, + "IsEmpty": false + }, + "Timestamp": 637320035484981240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527824819, + "Position": { + "X": 562.03295180766304, + "Y": 437.54138832051535, + "IsEmpty": false + }, + "Timestamp": 637320035485340010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527824819, + "Position": { + "X": 557.86564994072569, + "Y": 436.60238311092411, + "IsEmpty": false + }, + "Timestamp": 637320035485666730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.517082453, + "Position": { + "X": 548.15403301197239, + "Y": 432.70187404486018, + "IsEmpty": false + }, + "Timestamp": 637320035485967340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.515129328, + "Position": { + "X": 543.55189225325103, + "Y": 431.47392042494636, + "IsEmpty": false + }, + "Timestamp": 637320035486272480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.511223018, + "Position": { + "X": 541.77624635873872, + "Y": 431.18500005969906, + "IsEmpty": false + }, + "Timestamp": 637320035486590120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.507316709, + "Position": { + "X": 541.34140746695471, + "Y": 432.19624938313979, + "IsEmpty": false + }, + "Timestamp": 637320035486939740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 544.16790233116365, + "Y": 434.6160065209674, + "IsEmpty": false + }, + "Timestamp": 637320035487282810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 550.618185503924, + "Y": 437.54138832051535, + "IsEmpty": false + }, + "Timestamp": 637320035487643200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 558.01061493470388, + "Y": 440.10560564096659, + "IsEmpty": false + }, + "Timestamp": 637320035487942610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501457214, + "Position": { + "X": 564.93197123647394, + "Y": 441.51411345535348, + "IsEmpty": false + }, + "Timestamp": 637320035488510140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501457214, + "Position": { + "X": 568.51946921764909, + "Y": 442.20032035662223, + "IsEmpty": false + }, + "Timestamp": 637320035488733230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501457214, + "Position": { + "X": 572.36063490447953, + "Y": 442.70594501834256, + "IsEmpty": false + }, + "Timestamp": 637320035488992410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501457214, + "Position": { + "X": 579.6443616235822, + "Y": 443.28378574883709, + "IsEmpty": false + }, + "Timestamp": 637320035489307220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 581.96354912155573, + "Y": 443.71719434178328, + "IsEmpty": false + }, + "Timestamp": 637320035489639740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.505363524, + "Position": { + "X": 583.66669849654136, + "Y": 444.33115712920255, + "IsEmpty": false + }, + "Timestamp": 637320035490083090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 582.14472030768445, + "Y": 444.07835882088, + "IsEmpty": false + }, + "Timestamp": 637320035490577290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.505363524, + "Position": { + "X": 580.44157093269882, + "Y": 443.75331639870802, + "IsEmpty": false + }, + "Timestamp": 637320035490994430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.493644625, + "Position": { + "X": 575.94813288565467, + "Y": 442.63370090449314, + "IsEmpty": false + }, + "Timestamp": 637320035491270880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.476066232, + "Position": { + "X": 563.19255957918745, + "Y": 440.43064806313862, + "IsEmpty": false + }, + "Timestamp": 637320035491613070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.476066232, + "Position": { + "X": 559.71376430968951, + "Y": 440.03338957219239, + "IsEmpty": false + }, + "Timestamp": 637320035491901780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.470206767, + "Position": { + "X": 554.74925313363565, + "Y": 439.1304783744506, + "IsEmpty": false + }, + "Timestamp": 637320035492176450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.468253613, + "Position": { + "X": 554.02448425389525, + "Y": 438.80543595227863, + "IsEmpty": false + }, + "Timestamp": 637320035492461620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.464347303, + "Position": { + "X": 557.57574799784459, + "Y": 439.05826230567641, + "IsEmpty": false + }, + "Timestamp": 637320035492748860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.46703288, + "Position": { + "X": 567.28739297167328, + "Y": 439.99726751526771, + "IsEmpty": false + }, + "Timestamp": 637320035493134600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.46703288, + "Position": { + "X": 574.02755004223945, + "Y": 441.22519309010625, + "IsEmpty": false + }, + "Timestamp": 637320035493449510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.46703288, + "Position": { + "X": 576.31050330298729, + "Y": 441.69469569490184, + "IsEmpty": false + }, + "Timestamp": 637320035493706440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.472892344, + "Position": { + "X": 580.98514058123533, + "Y": 442.85040520096618, + "IsEmpty": false + }, + "Timestamp": 637320035494038910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.474845499, + "Position": { + "X": 583.92036620219676, + "Y": 443.68107228485854, + "IsEmpty": false + }, + "Timestamp": 637320035494344780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471915781, + "Position": { + "X": 586.89182606038389, + "Y": 444.54786142567565, + "IsEmpty": false + }, + "Timestamp": 637320035494637150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471915781, + "Position": { + "X": 587.87023460070441, + "Y": 444.8006597339982, + "IsEmpty": false + }, + "Timestamp": 637320035494875540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471915781, + "Position": { + "X": 588.48627272369231, + "Y": 444.94511991662182, + "IsEmpty": false + }, + "Timestamp": 637320035495103490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471915781, + "Position": { + "X": 590.91419097841833, + "Y": 445.1979462700196, + "IsEmpty": false + }, + "Timestamp": 637320035495360850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471915781, + "Position": { + "X": 592.07379874994263, + "Y": 445.34240645264327, + "IsEmpty": false + }, + "Timestamp": 637320035495667650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471915781, + "Position": { + "X": 593.41457770759575, + "Y": 445.88412512621306, + "IsEmpty": false + }, + "Timestamp": 637320035496043980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471915781, + "Position": { + "X": 595.55256597436539, + "Y": 446.89537444965379, + "IsEmpty": false + }, + "Timestamp": 637320035496437920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471915781, + "Position": { + "X": 596.7846422203412, + "Y": 447.50933723707305, + "IsEmpty": false + }, + "Timestamp": 637320035496689540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471915781, + "Position": { + "X": 597.29197763165189, + "Y": 448.08720601264287, + "IsEmpty": false + }, + "Timestamp": 637320035497011770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 597.3644461061034, + "Y": 448.26778825219122, + "IsEmpty": false + }, + "Timestamp": 637320035497304520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 595.91496443677318, + "Y": 447.76216359047083, + "IsEmpty": false + }, + "Timestamp": 637320035498122040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 586.56568988027709, + "Y": 443.6449502279338, + "IsEmpty": false + }, + "Timestamp": 637320035498530780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 578.33981690315488, + "Y": 440.21394376666552, + "IsEmpty": false + }, + "Timestamp": 637320035498830960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 561.16327402409502, + "Y": 435.19384725146193, + "IsEmpty": false + }, + "Timestamp": 637320035499266670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 542.02991406439412, + "Y": 427.10390875408677, + "IsEmpty": false + }, + "Timestamp": 637320035499876050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 533.84024727942244, + "Y": 423.88960658929153, + "IsEmpty": false + }, + "Timestamp": 637320035500296980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 522.09933077303901, + "Y": 420.71142648142103, + "IsEmpty": false + }, + "Timestamp": 637320035500904820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 516.69995266012586, + "Y": 415.61908585236802, + "IsEmpty": false + }, + "Timestamp": 637320035501324660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 512.75007023908051, + "Y": 411.68248277445463, + "IsEmpty": false + }, + "Timestamp": 637320035501674950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 511.7354274615343, + "Y": 409.6238620706485, + "IsEmpty": false + }, + "Timestamp": 637320035502083360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 511.7354274615343, + "Y": 409.40718581925063, + "IsEmpty": false + }, + "Timestamp": 637320035502360960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 511.69917920177096, + "Y": 409.15435946585285, + "IsEmpty": false + }, + "Timestamp": 637320035502747040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473868936, + "Position": { + "X": 514.30828266516323, + "Y": 409.11826545400339, + "IsEmpty": false + }, + "Timestamp": 637320035503076700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471671611, + "Position": { + "X": 522.17179924749041, + "Y": 412.04364725355134, + "IsEmpty": false + }, + "Timestamp": 637320035503407000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469718456, + "Position": { + "X": 526.84642250320087, + "Y": 414.02999579843276, + "IsEmpty": false + }, + "Timestamp": 637320035503738860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469718456, + "Position": { + "X": 537.97131490913398, + "Y": 420.45862817309848, + "IsEmpty": false + }, + "Timestamp": 637320035504180080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469718456, + "Position": { + "X": 544.96513968535555, + "Y": 423.78126846359265, + "IsEmpty": false + }, + "Timestamp": 637320035504559280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469718456, + "Position": { + "X": 554.38685467122775, + "Y": 428.47632255662421, + "IsEmpty": false + }, + "Timestamp": 637320035504968870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469718456, + "Position": { + "X": 558.5179223009394, + "Y": 430.85995763752709, + "IsEmpty": false + }, + "Timestamp": 637320035505281870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469718456, + "Position": { + "X": 561.19950826132072, + "Y": 432.52129180531182, + "IsEmpty": false + }, + "Timestamp": 637320035505571920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469718456, + "Position": { + "X": 565.25810741658086, + "Y": 435.01329305698886, + "IsEmpty": false + }, + "Timestamp": 637320035505854310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469718456, + "Position": { + "X": 565.72918054559057, + "Y": 435.33833547916083, + "IsEmpty": false + }, + "Timestamp": 637320035505887160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.471671611, + "Position": { + "X": 572.10696719882424, + "Y": 438.26368923363356, + "IsEmpty": false + }, + "Timestamp": 637320035506287700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473624766, + "Position": { + "X": 576.56417100864257, + "Y": 439.74444116186987, + "IsEmpty": false + }, + "Timestamp": 637320035506642740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.473624766, + "Position": { + "X": 579.20949468672302, + "Y": 440.6834744165364, + "IsEmpty": false + }, + "Timestamp": 637320035506966480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.475577921, + "Position": { + "X": 582.72452419344665, + "Y": 441.98364410522436, + "IsEmpty": false + }, + "Timestamp": 637320035507315190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.475577921, + "Position": { + "X": 586.13085098849308, + "Y": 443.50049004531019, + "IsEmpty": false + }, + "Timestamp": 637320035507705430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.475577921, + "Position": { + "X": 589.71834896966811, + "Y": 444.83678179092288, + "IsEmpty": false + }, + "Timestamp": 637320035508197040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.475577921, + "Position": { + "X": 592.72607111015634, + "Y": 446.06470736576142, + "IsEmpty": false + }, + "Timestamp": 637320035508605780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.475577921, + "Position": { + "X": 595.98743291122457, + "Y": 447.18429481490108, + "IsEmpty": false + }, + "Timestamp": 637320035508977640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.475577921, + "Position": { + "X": 596.7484079831155, + "Y": 447.61770340784722, + "IsEmpty": false + }, + "Timestamp": 637320035509242550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.477531075, + "Position": { + "X": 597.3644461061034, + "Y": 447.97883984186871, + "IsEmpty": false + }, + "Timestamp": 637320035509554960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481437385, + "Position": { + "X": 596.02366714845039, + "Y": 446.31753371915926, + "IsEmpty": false + }, + "Timestamp": 637320035510760720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481437385, + "Position": { + "X": 588.6674719548962, + "Y": 441.8752779344502, + "IsEmpty": false + }, + "Timestamp": 637320035511112380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481437385, + "Position": { + "X": 581.56494446699742, + "Y": 438.11922905100988, + "IsEmpty": false + }, + "Timestamp": 637320035511374750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481437385, + "Position": { + "X": 568.0121338063384, + "Y": 432.88245628440853, + "IsEmpty": false + }, + "Timestamp": 637320035511673800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481437385, + "Position": { + "X": 561.81554638430862, + "Y": 430.60715932920453, + "IsEmpty": false + }, + "Timestamp": 637320035511981040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.468253613, + "Position": { + "X": 535.03608928817255, + "Y": 423.74514640666791, + "IsEmpty": false + }, + "Timestamp": 637320035512400630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.466300458, + "Position": { + "X": 522.96902257914462, + "Y": 422.01159617010904, + "IsEmpty": false + }, + "Timestamp": 637320035512739150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.464347303, + "Position": { + "X": 516.33758224279325, + "Y": 421.21705114314142, + "IsEmpty": false + }, + "Timestamp": 637320035513094920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.403067052, + "Position": { + "X": 512.78630447630621, + "Y": 421.9754741131843, + "IsEmpty": false + }, + "Timestamp": 637320035513747660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.395986885, + "Position": { + "X": 518.18568258921937, + "Y": 422.69780307137773, + "IsEmpty": false + }, + "Timestamp": 637320035514067370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.39403373, + "Position": { + "X": 520.35993313828999, + "Y": 423.13118361924865, + "IsEmpty": false + }, + "Timestamp": 637320035514549550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.392080575, + "Position": { + "X": 512.0253294044154, + "Y": 423.23952174494758, + "IsEmpty": false + }, + "Timestamp": 637320035514954570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.392080575, + "Position": { + "X": 508.80018781803523, + "Y": 424.50359742178608, + "IsEmpty": false + }, + "Timestamp": 637320035515372280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.16209659, + "Position": { + "X": 508.80018781803523, + "Y": 425.18977627797955, + "IsEmpty": false + }, + "Timestamp": 637320035515669090, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "af910e91-88cc-4e39-8840-a9ce0a05d46e", + "Points": [ + { + "Pressure": 0.16234073, + "Position": { + "X": 514.85183829116204, + "Y": 389.61569207860839, + "IsEmpty": false + }, + "Timestamp": 637320035601548860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.311757088, + "Position": { + "X": 514.63441884527003, + "Y": 389.47123189598477, + "IsEmpty": false + }, + "Timestamp": 637320035602518620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.403311193, + "Position": { + "X": 514.38075113961463, + "Y": 389.47123189598477, + "IsEmpty": false + }, + "Timestamp": 637320035603257170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.448722064, + "Position": { + "X": 515.17797447126884, + "Y": 389.54347600983419, + "IsEmpty": false + }, + "Timestamp": 637320035603917040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.482658118, + "Position": { + "X": 517.75082967489777, + "Y": 390.41023710557602, + "IsEmpty": false + }, + "Timestamp": 637320035604376890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.497306794, + "Position": { + "X": 524.56346924245304, + "Y": 393.40786301897344, + "IsEmpty": false + }, + "Timestamp": 637320035604859740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.502189696, + "Position": { + "X": 527.31750965474816, + "Y": 394.9247370041345, + "IsEmpty": false + }, + "Timestamp": 637320035605095110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.523674369, + "Position": { + "X": 549.67599717829171, + "Y": 403.15913568413328, + "IsEmpty": false + }, + "Timestamp": 637320035605938060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.569817662, + "Position": { + "X": 555.22032626264536, + "Y": 405.39831058241253, + "IsEmpty": false + }, + "Timestamp": 637320035606314770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530022144, + "Position": { + "X": 564.24343659395936, + "Y": 409.6238620706485, + "IsEmpty": false + }, + "Timestamp": 637320035606669910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573235691, + "Position": { + "X": 570.47628629829012, + "Y": 411.71857678630408, + "IsEmpty": false + }, + "Timestamp": 637320035606960280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530998707, + "Position": { + "X": 576.45546829696536, + "Y": 414.28279410675532, + "IsEmpty": false + }, + "Timestamp": 637320035607304250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532951832, + "Position": { + "X": 582.47085648779125, + "Y": 415.83576210376583, + "IsEmpty": false + }, + "Timestamp": 637320035607680210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.536858141, + "Position": { + "X": 587.21796224049069, + "Y": 417.67767851109892, + "IsEmpty": false + }, + "Timestamp": 637320035608086990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544914901, + "Position": { + "X": 593.19714423916605, + "Y": 420.89198067589416, + "IsEmpty": false + }, + "Timestamp": 637320035608623400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558831155, + "Position": { + "X": 598.95889276941182, + "Y": 424.82861179888283, + "IsEmpty": false + }, + "Timestamp": 637320035608976280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56078434, + "Position": { + "X": 600.40840248381733, + "Y": 425.73149495154934, + "IsEmpty": false + }, + "Timestamp": 637320035609272670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 605.98895178285909, + "Y": 428.51241656847367, + "IsEmpty": false + }, + "Timestamp": 637320035609687170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 608.81547469214331, + "Y": 430.13762867933366, + "IsEmpty": false + }, + "Timestamp": 637320035610090970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 612.11307073043736, + "Y": 431.14887800277438, + "IsEmpty": false + }, + "Timestamp": 637320035610395500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 615.44692905103238, + "Y": 432.12400526929036, + "IsEmpty": false + }, + "Timestamp": 637320035610760170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589593351, + "Position": { + "X": 617.9835500174355, + "Y": 433.24356467335474, + "IsEmpty": false + }, + "Timestamp": 637320035611074220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589593351, + "Position": { + "X": 620.48390870153764, + "Y": 434.72434464666634, + "IsEmpty": false + }, + "Timestamp": 637320035611385440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589593351, + "Position": { + "X": 620.73757640719305, + "Y": 434.86877678421467, + "IsEmpty": false + }, + "Timestamp": 637320035611402210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589593351, + "Position": { + "X": 621.96965265316896, + "Y": 435.55498368548342, + "IsEmpty": false + }, + "Timestamp": 637320035611696380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589593351, + "Position": { + "X": 624.14390320223947, + "Y": 436.78290926032196, + "IsEmpty": false + }, + "Timestamp": 637320035612268660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589593351, + "Position": { + "X": 626.02825180842899, + "Y": 438.1553230628594, + "IsEmpty": false + }, + "Timestamp": 637320035612698950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589593351, + "Position": { + "X": 627.69516694618892, + "Y": 439.0582062155259, + "IsEmpty": false + }, + "Timestamp": 637320035613096620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589593351, + "Position": { + "X": 628.96347742939042, + "Y": 439.63610303617099, + "IsEmpty": false + }, + "Timestamp": 637320035613442780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589593351, + "Position": { + "X": 630.12308520091483, + "Y": 440.32230993743968, + "IsEmpty": false + }, + "Timestamp": 637320035613839250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.591546476, + "Position": { + "X": 630.88406027280575, + "Y": 440.64735235961166, + "IsEmpty": false + }, + "Timestamp": 637320035614204000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.591546476, + "Position": { + "X": 631.28266492736395, + "Y": 440.82790655408479, + "IsEmpty": false + }, + "Timestamp": 637320035614682350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.598626673, + "Position": { + "X": 631.64503534469657, + "Y": 441.22519309010625, + "IsEmpty": false + }, + "Timestamp": 637320035615100510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.246570528, + "Position": { + "X": 630.23178791259204, + "Y": 440.82790655408479, + "IsEmpty": false + }, + "Timestamp": 637320035615546510, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "eece94ea-5e4e-4bff-95ef-eca80551bfec", + "Points": [ + { + "Pressure": 0.0771343559, + "Position": { + "X": 512.67758774209142, + "Y": 387.37651718032913, + "IsEmpty": false + }, + "Timestamp": 637320035667272490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.306385905, + "Position": { + "X": 513.69224454217522, + "Y": 386.54585009643677, + "IsEmpty": false + }, + "Timestamp": 637320035667981580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.363515675, + "Position": { + "X": 514.19956593094832, + "Y": 386.22080767426479, + "IsEmpty": false + }, + "Timestamp": 637320035668379520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.407705814, + "Position": { + "X": 514.67065308249573, + "Y": 385.96800936594224, + "IsEmpty": false + }, + "Timestamp": 637320035668699790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.460929275, + "Position": { + "X": 514.48946787382943, + "Y": 386.14859160549059, + "IsEmpty": false + }, + "Timestamp": 637320035669350570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.492179751, + "Position": { + "X": 512.24274885030741, + "Y": 386.83479850675934, + "IsEmpty": false + }, + "Timestamp": 637320035669678730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525139213, + "Position": { + "X": 509.16255823536778, + "Y": 387.70155960250116, + "IsEmpty": false + }, + "Timestamp": 637320035670001700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543938339, + "Position": { + "X": 506.26356685163205, + "Y": 388.89339116549019, + "IsEmpty": false + }, + "Timestamp": 637320035670295210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55687803, + "Position": { + "X": 503.03843928778952, + "Y": 390.51860327635018, + "IsEmpty": false + }, + "Timestamp": 637320035670594250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.567620337, + "Position": { + "X": 499.55964401829158, + "Y": 392.7216561177047, + "IsEmpty": false + }, + "Timestamp": 637320035670922670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573723972, + "Position": { + "X": 493.97908069671217, + "Y": 395.39423960893009, + "IsEmpty": false + }, + "Timestamp": 637320035671228450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579583406, + "Position": { + "X": 490.28286598132223, + "Y": 397.01945171979008, + "IsEmpty": false + }, + "Timestamp": 637320035671527890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.585687041, + "Position": { + "X": 485.10092133683872, + "Y": 399.04192232159625, + "IsEmpty": false + }, + "Timestamp": 637320035671813510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587640166, + "Position": { + "X": 483.03538752198295, + "Y": 399.87258940548861, + "IsEmpty": false + }, + "Timestamp": 637320035672091700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 477.6360094090698, + "Y": 401.42555740249912, + "IsEmpty": false + }, + "Timestamp": 637320035672479890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597894251, + "Position": { + "X": 476.04156274576138, + "Y": 402.00342617806893, + "IsEmpty": false + }, + "Timestamp": 637320035672770680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604242027, + "Position": { + "X": 472.49029900181199, + "Y": 403.30359586675689, + "IsEmpty": false + }, + "Timestamp": 637320035673122280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.603997886, + "Position": { + "X": 467.12715512612459, + "Y": 405.94002925598238, + "IsEmpty": false + }, + "Timestamp": 637320035673517240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.605951011, + "Position": { + "X": 462.6699513163062, + "Y": 407.96252790286377, + "IsEmpty": false + }, + "Timestamp": 637320035673903170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.607904196, + "Position": { + "X": 458.5388836865946, + "Y": 409.84053832204631, + "IsEmpty": false + }, + "Timestamp": 637320035674299910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.607904196, + "Position": { + "X": 455.71237479984796, + "Y": 411.03236988503539, + "IsEmpty": false + }, + "Timestamp": 637320035674604420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.618402362, + "Position": { + "X": 449.66072432672115, + "Y": 412.87428629236842, + "IsEmpty": false + }, + "Timestamp": 637320035674908240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625238419, + "Position": { + "X": 443.8627275367121, + "Y": 414.31891616368006, + "IsEmpty": false + }, + "Timestamp": 637320035675335840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628168166, + "Position": { + "X": 439.55047469833426, + "Y": 415.87188416069057, + "IsEmpty": false + }, + "Timestamp": 637320035675653970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630121291, + "Position": { + "X": 432.12180401905988, + "Y": 418.68892783453964, + "IsEmpty": false + }, + "Timestamp": 637320035676116470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 427.37470527762918, + "Y": 420.42247807109851, + "IsEmpty": false + }, + "Timestamp": 637320035676499400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6340276, + "Position": { + "X": 423.20740341069188, + "Y": 422.19215036458212, + "IsEmpty": false + }, + "Timestamp": 637320035676783240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635980785, + "Position": { + "X": 418.89515057231404, + "Y": 424.35910919408718, + "IsEmpty": false + }, + "Timestamp": 637320035677151590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641840219, + "Position": { + "X": 412.08251100475877, + "Y": 426.27324167019441, + "IsEmpty": false + }, + "Timestamp": 637320035677528190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645746529, + "Position": { + "X": 408.56748149803508, + "Y": 427.64562742765662, + "IsEmpty": false + }, + "Timestamp": 637320035677924370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649652839, + "Position": { + "X": 404.83502553415065, + "Y": 428.94579711634458, + "IsEmpty": false + }, + "Timestamp": 637320035678379140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 402.29841157901626, + "Y": 429.30696159544129, + "IsEmpty": false + }, + "Timestamp": 637320035678813640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655512333, + "Position": { + "X": 401.0301010958147, + "Y": 429.34308365236603, + "IsEmpty": false + }, + "Timestamp": 637320035679167350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663813233, + "Position": { + "X": 399.58060540394683, + "Y": 429.7403421433122, + "IsEmpty": false + }, + "Timestamp": 637320035679499530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 398.31229492074527, + "Y": 429.99314045163476, + "IsEmpty": false + }, + "Timestamp": 637320035679890710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684809625, + "Position": { + "X": 397.22516964620996, + "Y": 430.28211690703256, + "IsEmpty": false + }, + "Timestamp": 637320035680172570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 396.39171207733, + "Y": 430.46267110150563, + "IsEmpty": false + }, + "Timestamp": 637320035680480380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 395.23211131707444, + "Y": 430.71546940982819, + "IsEmpty": false + }, + "Timestamp": 637320035680881410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709712386, + "Position": { + "X": 394.83349965124734, + "Y": 430.75159146675293, + "IsEmpty": false + }, + "Timestamp": 637320035681209880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.377187759, + "Position": { + "X": 395.9568591630084, + "Y": 430.67934735290351, + "IsEmpty": false + }, + "Timestamp": 637320035681491550, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "a137ec80-edb3-461f-9ded-4953030ac948", + "Points": [ + { + "Pressure": 0.19896239, + "Position": { + "X": 627.00666034874951, + "Y": 443.8616545244069, + "IsEmpty": false + }, + "Timestamp": 637320035718362170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.276356131, + "Position": { + "X": 627.69516694618892, + "Y": 443.64492218285858, + "IsEmpty": false + }, + "Timestamp": 637320035718581110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.34520486, + "Position": { + "X": 627.98506888907002, + "Y": 443.60880012593384, + "IsEmpty": false + }, + "Timestamp": 637320035718893710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.456534684, + "Position": { + "X": 629.86941749525954, + "Y": 443.3198797606866, + "IsEmpty": false + }, + "Timestamp": 637320035719284180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.493888766, + "Position": { + "X": 630.34049062426925, + "Y": 444.6561715062993, + "IsEmpty": false + }, + "Timestamp": 637320035719644210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.500236511, + "Position": { + "X": 630.44922138102163, + "Y": 446.10082942268616, + "IsEmpty": false + }, + "Timestamp": 637320035719906890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.516838312, + "Position": { + "X": 630.99276298448285, + "Y": 454.22688997698606, + "IsEmpty": false + }, + "Timestamp": 637320035720168930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521721244, + "Position": { + "X": 631.02899722170866, + "Y": 458.6329956596951, + "IsEmpty": false + }, + "Timestamp": 637320035720443120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527824819, + "Position": { + "X": 630.88406027280575, + "Y": 468.81762082765061, + "IsEmpty": false + }, + "Timestamp": 637320035720662200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.529778004, + "Position": { + "X": 630.70286104160175, + "Y": 472.89874017833819, + "IsEmpty": false + }, + "Timestamp": 637320035720951620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.538811326, + "Position": { + "X": 631.06525950400965, + "Y": 467.22853077371536, + "IsEmpty": false + }, + "Timestamp": 637320035721714960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543205917, + "Position": { + "X": 631.21019645291256, + "Y": 458.95803808186707, + "IsEmpty": false + }, + "Timestamp": 637320035722064400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543205917, + "Position": { + "X": 632.76840887899516, + "Y": 446.02858530883674, + "IsEmpty": false + }, + "Timestamp": 637320035722914880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543205917, + "Position": { + "X": 633.52938395088609, + "Y": 445.08958009924544, + "IsEmpty": false + }, + "Timestamp": 637320035723239850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.549065411, + "Position": { + "X": 633.85552013099289, + "Y": 444.72841562014872, + "IsEmpty": false + }, + "Timestamp": 637320035723504520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.538323045, + "Position": { + "X": 633.60188047041277, + "Y": 444.69229356322398, + "IsEmpty": false + }, + "Timestamp": 637320035724117710, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "90200dcb-c476-47d0-93e4-a35678a61a35", + "Points": [ + { + "Pressure": 0.140123591, + "Position": { + "X": 599.18859141743781, + "Y": 579.71302135283327, + "IsEmpty": false + }, + "Timestamp": 637320036034643020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.286121905, + "Position": { + "X": 598.75050476993613, + "Y": 579.39958931674346, + "IsEmpty": false + }, + "Timestamp": 637320036035849980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.452628374, + "Position": { + "X": 599.18859141743781, + "Y": 579.71302135283327, + "IsEmpty": false + }, + "Timestamp": 637320036037076690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.513908625, + "Position": { + "X": 599.58132106490086, + "Y": 580.00242574896561, + "IsEmpty": false + }, + "Timestamp": 637320036037431800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54027617, + "Position": { + "X": 605.36945380425755, + "Y": 584.09956370129999, + "IsEmpty": false + }, + "Timestamp": 637320036039615170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55687803, + "Position": { + "X": 610.38606181851037, + "Y": 587.59221859720401, + "IsEmpty": false + }, + "Timestamp": 637320036039971310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573479831, + "Position": { + "X": 615.04077258614564, + "Y": 590.78485975642036, + "IsEmpty": false + }, + "Timestamp": 637320036040509040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 618.77923978601279, + "Y": 593.32436397149922, + "IsEmpty": false + }, + "Timestamp": 637320036040852210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624017715, + "Position": { + "X": 622.19009500259551, + "Y": 595.59928854919849, + "IsEmpty": false + }, + "Timestamp": 637320036041362210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.634760022, + "Position": { + "X": 626.52469764805187, + "Y": 598.47452237475409, + "IsEmpty": false + }, + "Timestamp": 637320036041818820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636713207, + "Position": { + "X": 628.99160535627607, + "Y": 600.08856931339938, + "IsEmpty": false + }, + "Timestamp": 637320036042151590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 629.48763267068136, + "Y": 600.41158629004065, + "IsEmpty": false + }, + "Timestamp": 637320036042426870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.65844208, + "Position": { + "X": 629.98454099356411, + "Y": 600.73466646521797, + "IsEmpty": false + }, + "Timestamp": 637320036042916310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660395205, + "Position": { + "X": 631.53217090246028, + "Y": 601.72925908296952, + "IsEmpty": false + }, + "Timestamp": 637320036043505480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.660395205, + "Position": { + "X": 632.48228399850177, + "Y": 602.35092535263607, + "IsEmpty": false + }, + "Timestamp": 637320036043781910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66234839, + "Position": { + "X": 635.50856685682641, + "Y": 604.29198434061891, + "IsEmpty": false + }, + "Timestamp": 637320036044241880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664301515, + "Position": { + "X": 637.54361997083561, + "Y": 605.58670499637969, + "IsEmpty": false + }, + "Timestamp": 637320036044641170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.670161009, + "Position": { + "X": 643.21210561471059, + "Y": 609.14851284028271, + "IsEmpty": false + }, + "Timestamp": 637320036045035150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.674067318, + "Position": { + "X": 646.34843122914003, + "Y": 611.09121919448648, + "IsEmpty": false + }, + "Timestamp": 637320036045502330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 648.98591106722688, + "Y": 612.70956997551821, + "IsEmpty": false + }, + "Timestamp": 637320036045864340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 649.51600688798271, + "Y": 613.03314697542919, + "IsEmpty": false + }, + "Timestamp": 637320036046311520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683833063, + "Position": { + "X": 651.11148699196895, + "Y": 614.00364539407701, + "IsEmpty": false + }, + "Timestamp": 637320036046639580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 652.17946367130548, + "Y": 614.65042481755336, + "IsEmpty": false + }, + "Timestamp": 637320036046945430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 653.78790575582036, + "Y": 615.62021325989679, + "IsEmpty": false + }, + "Timestamp": 637320036047399240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 654.32577876489302, + "Y": 615.94336427402482, + "IsEmpty": false + }, + "Timestamp": 637320036047701260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691157401, + "Position": { + "X": 656.48588857301206, + "Y": 617.2353407846897, + "IsEmpty": false + }, + "Timestamp": 637320036048438050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691157401, + "Position": { + "X": 657.02806850562183, + "Y": 617.55816517353446, + "IsEmpty": false + }, + "Timestamp": 637320036048872040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691157401, + "Position": { + "X": 657.6264526136174, + "Y": 617.90587065508998, + "IsEmpty": false + }, + "Timestamp": 637320036049183080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691157401, + "Position": { + "X": 658.65976797723658, + "Y": 618.52618983934849, + "IsEmpty": false + }, + "Timestamp": 637320036049784180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693110526, + "Position": { + "X": 659.20538638411881, + "Y": 618.84870665947324, + "IsEmpty": false + }, + "Timestamp": 637320036050085110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.707515061, + "Position": { + "X": 659.75186342838049, + "Y": 619.17114016123844, + "IsEmpty": false + }, + "Timestamp": 637320036050569480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724116862, + "Position": { + "X": 660.84739185914123, + "Y": 619.81574692780225, + "IsEmpty": false + }, + "Timestamp": 637320036050931210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734859228, + "Position": { + "X": 661.39644246068929, + "Y": 620.13791505165716, + "IsEmpty": false + }, + "Timestamp": 637320036051429260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.561516762, + "Position": { + "X": 660.35490171096376, + "Y": 619.51840936656185, + "IsEmpty": false + }, + "Timestamp": 637320036052203530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.561516762, + "Position": { + "X": 659.86319780055362, + "Y": 619.22099026194599, + "IsEmpty": false + }, + "Timestamp": 637320036052259820, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "cfc576a6-8ba2-438a-96f1-acf5d43b05d9", + "Points": [ + { + "Pressure": 0.208239868, + "Position": { + "X": 732.46726868071596, + "Y": 595.87625914258524, + "IsEmpty": false + }, + "Timestamp": 637320036083731270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.448477924, + "Position": { + "X": 733.59762426943371, + "Y": 595.59997840392475, + "IsEmpty": false + }, + "Timestamp": 637320036084309410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.469718456, + "Position": { + "X": 734.25349880111094, + "Y": 595.43062755887786, + "IsEmpty": false + }, + "Timestamp": 637320036084978900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.519523919, + "Position": { + "X": 734.43537573210563, + "Y": 595.36873550220344, + "IsEmpty": false + }, + "Timestamp": 637320036085333840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 734.90904559880744, + "Y": 595.26100265107198, + "IsEmpty": false + }, + "Timestamp": 637320036085715000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641107798, + "Position": { + "X": 735.09075807702345, + "Y": 595.19901186360676, + "IsEmpty": false + }, + "Timestamp": 637320036086421400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.662104189, + "Position": { + "X": 734.90904559880744, + "Y": 595.26100265107198, + "IsEmpty": false + }, + "Timestamp": 637320036086487550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 731.15358394998509, + "Y": 596.21321964198944, + "IsEmpty": false + }, + "Timestamp": 637320036087113170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749752045, + "Position": { + "X": 721.73811837130825, + "Y": 598.59962030984877, + "IsEmpty": false + }, + "Timestamp": 637320036087574640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771480858, + "Position": { + "X": 713.11386103573909, + "Y": 600.70526370433333, + "IsEmpty": false + }, + "Timestamp": 637320036087943020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781734943, + "Position": { + "X": 703.77646982594638, + "Y": 602.91138690223511, + "IsEmpty": false + }, + "Timestamp": 637320036088405820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.792233169, + "Position": { + "X": 693.04889157706964, + "Y": 605.34912705689317, + "IsEmpty": false + }, + "Timestamp": 637320036088866810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.796139479, + "Position": { + "X": 681.78787410990435, + "Y": 607.78233587747741, + "IsEmpty": false + }, + "Timestamp": 637320036089487750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80053407, + "Position": { + "X": 674.15499270029397, + "Y": 609.38185023830351, + "IsEmpty": false + }, + "Timestamp": 637320036089985270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80053407, + "Position": { + "X": 668.73352305610956, + "Y": 610.47555421219272, + "IsEmpty": false + }, + "Timestamp": 637320036090493960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802487195, + "Position": { + "X": 666.21680365212944, + "Y": 610.96334443433932, + "IsEmpty": false + }, + "Timestamp": 637320036090884580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802487195, + "Position": { + "X": 664.18043246848015, + "Y": 611.36169406512408, + "IsEmpty": false + }, + "Timestamp": 637320036091246760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804440379, + "Position": { + "X": 660.7841437593612, + "Y": 612.01678761628921, + "IsEmpty": false + }, + "Timestamp": 637320036091716960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806393504, + "Position": { + "X": 660.10455349273514, + "Y": 612.14646867329179, + "IsEmpty": false + }, + "Timestamp": 637320036092126970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806393504, + "Position": { + "X": 657.38515062375347, + "Y": 612.66068117494456, + "IsEmpty": false + }, + "Timestamp": 637320036092507560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.806393504, + "Position": { + "X": 656.50591280624542, + "Y": 612.83463914637309, + "IsEmpty": false + }, + "Timestamp": 637320036092905110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.81274128, + "Position": { + "X": 655.34456053478152, + "Y": 613.04155881741383, + "IsEmpty": false + }, + "Timestamp": 637320036093228270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814694464, + "Position": { + "X": 653.98370286239594, + "Y": 613.2931764326305, + "IsEmpty": false + }, + "Timestamp": 637320036093630280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 652.62249241800862, + "Y": 613.54293859033874, + "IsEmpty": false + }, + "Timestamp": 637320036094203970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820798039, + "Position": { + "X": 651.94175990232907, + "Y": 613.66711990645797, + "IsEmpty": false + }, + "Timestamp": 637320036094678170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 650.0994023215917, + "Y": 613.99181926682627, + "IsEmpty": false + }, + "Timestamp": 637320036095026680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.335927367, + "Position": { + "X": 649.4184837240922, + "Y": 614.11428768714381, + "IsEmpty": false + }, + "Timestamp": 637320036095461160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.335927367, + "Position": { + "X": 649.89907716221808, + "Y": 614.03684576626392, + "IsEmpty": false + }, + "Timestamp": 637320036095870390, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "17490132-0479-4ed2-9817-213db04f3ece", + "Points": [ + { + "Pressure": 0.201403826, + "Position": { + "X": 653.66963889275326, + "Y": 614.93612509283105, + "IsEmpty": false + }, + "Timestamp": 637320036148014810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.331776917, + "Position": { + "X": 653.66963889275326, + "Y": 615.01183593521023, + "IsEmpty": false + }, + "Timestamp": 637320036148347580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.551018536, + "Position": { + "X": 653.66963889275326, + "Y": 615.12534341706908, + "IsEmpty": false + }, + "Timestamp": 637320036148947170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597894251, + "Position": { + "X": 653.66963889275326, + "Y": 615.20105425944826, + "IsEmpty": false + }, + "Timestamp": 637320036149323780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 653.66963889275326, + "Y": 614.10342339008002, + "IsEmpty": false + }, + "Timestamp": 637320036149704280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 653.66963889275326, + "Y": 610.92415582725391, + "IsEmpty": false + }, + "Timestamp": 637320036150202450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 653.66963889275326, + "Y": 605.54956774398147, + "IsEmpty": false + }, + "Timestamp": 637320036150679170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 653.66963889275326, + "Y": 601.57545389959387, + "IsEmpty": false + }, + "Timestamp": 637320036151023950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717769146, + "Position": { + "X": 653.66963889275326, + "Y": 597.10927836145163, + "IsEmpty": false + }, + "Timestamp": 637320036151393290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728023171, + "Position": { + "X": 653.66963889275326, + "Y": 585.30044431014778, + "IsEmpty": false + }, + "Timestamp": 637320036151998220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728023171, + "Position": { + "X": 653.66963889275326, + "Y": 584.8084413981029, + "IsEmpty": false + }, + "Timestamp": 637320036152323500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.735835791, + "Position": { + "X": 653.66963889275326, + "Y": 576.63308118219027, + "IsEmpty": false + }, + "Timestamp": 637320036152690750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7397421, + "Position": { + "X": 653.66963889275326, + "Y": 573.07525940746837, + "IsEmpty": false + }, + "Timestamp": 637320036153095360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741695285, + "Position": { + "X": 653.66963889275326, + "Y": 570.69077934449388, + "IsEmpty": false + }, + "Timestamp": 637320036153399160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745601594, + "Position": { + "X": 653.66963889275326, + "Y": 568.11708095728125, + "IsEmpty": false + }, + "Timestamp": 637320036153810300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745601594, + "Position": { + "X": 653.66963889275326, + "Y": 564.89989919155573, + "IsEmpty": false + }, + "Timestamp": 637320036154155410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747554719, + "Position": { + "X": 653.66963889275326, + "Y": 559.48751446880351, + "IsEmpty": false + }, + "Timestamp": 637320036154549270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 653.66963889275326, + "Y": 555.96760689698112, + "IsEmpty": false + }, + "Timestamp": 637320036154923030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 653.66963889275326, + "Y": 551.23650219222168, + "IsEmpty": false + }, + "Timestamp": 637320036155202780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 653.66963889275326, + "Y": 546.77032665407933, + "IsEmpty": false + }, + "Timestamp": 637320036155587740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769527733, + "Position": { + "X": 653.66963889275326, + "Y": 544.42370201229448, + "IsEmpty": false + }, + "Timestamp": 637320036155940200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 539.76824936820424, + "IsEmpty": false + }, + "Timestamp": 637320036156254280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 535.22642176939269, + "IsEmpty": false + }, + "Timestamp": 637320036156706200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 532.80408628522855, + "IsEmpty": false + }, + "Timestamp": 637320036156977690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 528.33791074708631, + "IsEmpty": false + }, + "Timestamp": 637320036157266130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 523.37973229689931, + "IsEmpty": false + }, + "Timestamp": 637320036157665260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 518.42149506500232, + "IsEmpty": false + }, + "Timestamp": 637320036158087900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 516.3020029503549, + "IsEmpty": false + }, + "Timestamp": 637320036158366490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 514.86373207199028, + "IsEmpty": false + }, + "Timestamp": 637320036158630190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 512.02504573645058, + "IsEmpty": false + }, + "Timestamp": 637320036158886710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 507.18040415897735, + "IsEmpty": false + }, + "Timestamp": 637320036159256250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 504.45528408700648, + "IsEmpty": false + }, + "Timestamp": 637320036159577740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 503.50907490239661, + "IsEmpty": false + }, + "Timestamp": 637320036159864560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 501.31384255451502, + "IsEmpty": false + }, + "Timestamp": 637320036160183460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 499.19429165815768, + "IsEmpty": false + }, + "Timestamp": 637320036160443470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 497.64248390707928, + "IsEmpty": false + }, + "Timestamp": 637320036160736480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770260155, + "Position": { + "X": 653.66963889275326, + "Y": 494.9173638351084, + "IsEmpty": false + }, + "Timestamp": 637320036161038370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.77221334, + "Position": { + "X": 653.66963889275326, + "Y": 492.797842329606, + "IsEmpty": false + }, + "Timestamp": 637320036161326570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774166465, + "Position": { + "X": 653.66963889275326, + "Y": 489.54283453354577, + "IsEmpty": false + }, + "Timestamp": 637320036161680810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776119649, + "Position": { + "X": 653.66963889275326, + "Y": 487.08264362819205, + "IsEmpty": false + }, + "Timestamp": 637320036162045980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.778072774, + "Position": { + "X": 653.66963889275326, + "Y": 484.6603375348829, + "IsEmpty": false + }, + "Timestamp": 637320036162350580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.780025959, + "Position": { + "X": 653.66963889275326, + "Y": 482.73003435361858, + "IsEmpty": false + }, + "Timestamp": 637320036162645730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781979084, + "Position": { + "X": 653.66963889275326, + "Y": 480.23201741793025, + "IsEmpty": false + }, + "Timestamp": 637320036163025740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.783932269, + "Position": { + "X": 653.66963889275326, + "Y": 477.73400048224192, + "IsEmpty": false + }, + "Timestamp": 637320036163336170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787838578, + "Position": { + "X": 653.66963889275326, + "Y": 475.12241728298483, + "IsEmpty": false + }, + "Timestamp": 637320036163644310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789791703, + "Position": { + "X": 653.66963889275326, + "Y": 472.70008179882075, + "IsEmpty": false + }, + "Timestamp": 637320036163964800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791744888, + "Position": { + "X": 653.66963889275326, + "Y": 471.71601719302123, + "IsEmpty": false + }, + "Timestamp": 637320036164294790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791744888, + "Position": { + "X": 653.66963889275326, + "Y": 469.5207848451397, + "IsEmpty": false + }, + "Timestamp": 637320036164611990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791744888, + "Position": { + "X": 653.66963889275326, + "Y": 467.55265563354067, + "IsEmpty": false + }, + "Timestamp": 637320036164909560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793698013, + "Position": { + "X": 653.66963889275326, + "Y": 464.71396929800108, + "IsEmpty": false + }, + "Timestamp": 637320036165209030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793698013, + "Position": { + "X": 653.66963889275326, + "Y": 463.50280155591901, + "IsEmpty": false + }, + "Timestamp": 637320036165469190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795651197, + "Position": { + "X": 653.66963889275326, + "Y": 460.73985545361347, + "IsEmpty": false + }, + "Timestamp": 637320036165775010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795651197, + "Position": { + "X": 653.66963889275326, + "Y": 458.43105684216317, + "IsEmpty": false + }, + "Timestamp": 637320036166010430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795651197, + "Position": { + "X": 653.66963889275326, + "Y": 457.03067077584313, + "IsEmpty": false + }, + "Timestamp": 637320036166308720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797604322, + "Position": { + "X": 653.66963889275326, + "Y": 452.79159837398339, + "IsEmpty": false + }, + "Timestamp": 637320036166675330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797604322, + "Position": { + "X": 653.66963889275326, + "Y": 451.65611208342557, + "IsEmpty": false + }, + "Timestamp": 637320036167010410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797604322, + "Position": { + "X": 653.66963889275326, + "Y": 448.93099201145469, + "IsEmpty": false + }, + "Timestamp": 637320036167282770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797604322, + "Position": { + "X": 653.66963889275326, + "Y": 447.26564738766245, + "IsEmpty": false + }, + "Timestamp": 637320036167605440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797604322, + "Position": { + "X": 653.66963889275326, + "Y": 444.46484586416739, + "IsEmpty": false + }, + "Timestamp": 637320036167874860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797604322, + "Position": { + "X": 653.66963889275326, + "Y": 442.53454268290301, + "IsEmpty": false + }, + "Timestamp": 637320036168205180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797604322, + "Position": { + "X": 653.66963889275326, + "Y": 441.32337494082094, + "IsEmpty": false + }, + "Timestamp": 637320036168530740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797604322, + "Position": { + "X": 653.66963889275326, + "Y": 439.46878260193574, + "IsEmpty": false + }, + "Timestamp": 637320036168763490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799557507, + "Position": { + "X": 653.66963889275326, + "Y": 438.52257341732587, + "IsEmpty": false + }, + "Timestamp": 637320036168963550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801510632, + "Position": { + "X": 653.66963889275326, + "Y": 436.5165887845373, + "IsEmpty": false + }, + "Timestamp": 637320036169332910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801510632, + "Position": { + "X": 653.66963889275326, + "Y": 434.7376778971763, + "IsEmpty": false + }, + "Timestamp": 637320036169724720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803463817, + "Position": { + "X": 653.66963889275326, + "Y": 434.13210872156276, + "IsEmpty": false + }, + "Timestamp": 637320036170074090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.807858407, + "Position": { + "X": 653.66963889275326, + "Y": 434.16993475189742, + "IsEmpty": false + }, + "Timestamp": 637320036170967330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811764717, + "Position": { + "X": 653.66963889275326, + "Y": 434.20779017308701, + "IsEmpty": false + }, + "Timestamp": 637320036171359500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811764717, + "Position": { + "X": 653.66963889275326, + "Y": 434.28350101546613, + "IsEmpty": false + }, + "Timestamp": 637320036171756580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811764717, + "Position": { + "X": 653.66963889275326, + "Y": 434.35918246699038, + "IsEmpty": false + }, + "Timestamp": 637320036172335530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.326649874, + "Position": { + "X": 653.66963889275326, + "Y": 434.7376778971763, + "IsEmpty": false + }, + "Timestamp": 637320036173016890, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "24a760ad-dd7f-4720-939a-ddbd3162de6c", + "Points": [ + { + "Pressure": 0.340566099, + "Position": { + "X": 635.02117596997425, + "Y": 469.73422932510096, + "IsEmpty": false + }, + "Timestamp": 637320036248793550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6745556, + "Position": { + "X": 634.63956283332709, + "Y": 469.79173423723836, + "IsEmpty": false + }, + "Timestamp": 637320036250788250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715815961, + "Position": { + "X": 635.56566161174226, + "Y": 469.626521412415, + "IsEmpty": false + }, + "Timestamp": 637320036251712750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 636.81996088036624, + "Y": 469.36072284091483, + "IsEmpty": false + }, + "Timestamp": 637320036252346390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 639.01262501866825, + "Y": 468.92900184476099, + "IsEmpty": false + }, + "Timestamp": 637320036252650260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752193511, + "Position": { + "X": 641.77050116604141, + "Y": 468.38843847173979, + "IsEmpty": false + }, + "Timestamp": 637320036253030990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 644.93825860617687, + "Y": 467.789085806012, + "IsEmpty": false + }, + "Timestamp": 637320036253452320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 647.34208334743369, + "Y": 467.30468904106499, + "IsEmpty": false + }, + "Timestamp": 637320036253843970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 648.29755104669198, + "Y": 467.1381778145406, + "IsEmpty": false + }, + "Timestamp": 637320036254255120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 649.59118976709249, + "Y": 466.87036609001291, + "IsEmpty": false + }, + "Timestamp": 637320036254516290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 650.72006346894045, + "Y": 466.65305636161645, + "IsEmpty": false + }, + "Timestamp": 637320036254889770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 651.68289226416391, + "Y": 466.48632301790605, + "IsEmpty": false + }, + "Timestamp": 637320036255426100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 652.81705014100237, + "Y": 466.26886051756054, + "IsEmpty": false + }, + "Timestamp": 637320036255672350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.416006714, + "Position": { + "X": 653.55471541794475, + "Y": 466.10940606816149, + "IsEmpty": false + }, + "Timestamp": 637320036256122760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.416006714, + "Position": { + "X": 652.81705014100237, + "Y": 466.26886051756054, + "IsEmpty": false + }, + "Timestamp": 637320036257008420, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "751fe534-fa78-4d48-ad05-32564065fece", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 632.59893984706844, + "Y": 441.5314503046497, + "IsEmpty": false + }, + "Timestamp": 637320036263469880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773678184, + "Position": { + "X": 636.3087856714759, + "Y": 440.09116730826258, + "IsEmpty": false + }, + "Timestamp": 637320036266925600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 651.75124646090296, + "Y": 434.1885615256852, + "IsEmpty": false + }, + "Timestamp": 637320036267936820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704585314, + "Position": { + "X": 653.65368543659019, + "Y": 433.45270839323609, + "IsEmpty": false + }, + "Timestamp": 637320036268472070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704585314, + "Position": { + "X": 652.54304117997674, + "Y": 433.86732178242642, + "IsEmpty": false + }, + "Timestamp": 637320036268620720, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "f15694d3-78ab-47d7-82fa-061704a8c5ef", + "Points": [ + { + "Pressure": 0.127183944, + "Position": { + "X": 637.35146903744908, + "Y": 469.18911282696587, + "IsEmpty": false + }, + "Timestamp": 637320036308523630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.300038159, + "Position": { + "X": 637.89925516851383, + "Y": 469.08097071877188, + "IsEmpty": false + }, + "Timestamp": 637320036309103890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.448722064, + "Position": { + "X": 638.28263061301868, + "Y": 469.02354601237164, + "IsEmpty": false + }, + "Timestamp": 637320036309778880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.490470737, + "Position": { + "X": 637.73431001142046, + "Y": 469.13171039774272, + "IsEmpty": false + }, + "Timestamp": 637320036310090180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.557610452, + "Position": { + "X": 635.16799064246311, + "Y": 469.62123675214627, + "IsEmpty": false + }, + "Timestamp": 637320036310540130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599603236, + "Position": { + "X": 631.37673921320277, + "Y": 470.37560652108311, + "IsEmpty": false + }, + "Timestamp": 637320036311059210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628900588, + "Position": { + "X": 624.59801380576721, + "Y": 471.71930218990178, + "IsEmpty": false + }, + "Timestamp": 637320036311644220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.635004222, + "Position": { + "X": 620.23736172542169, + "Y": 472.62184641972812, + "IsEmpty": false + }, + "Timestamp": 637320036312318490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644769967, + "Position": { + "X": 617.12117011588407, + "Y": 473.25817236729546, + "IsEmpty": false + }, + "Timestamp": 637320036312929250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644769967, + "Position": { + "X": 615.72941332408925, + "Y": 473.52576779638269, + "IsEmpty": false + }, + "Timestamp": 637320036313233010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.652826726, + "Position": { + "X": 613.16725464207423, + "Y": 474.05291435171245, + "IsEmpty": false + }, + "Timestamp": 637320036313670390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.656733036, + "Position": { + "X": 612.14839473028258, + "Y": 474.2631932842778, + "IsEmpty": false + }, + "Timestamp": 637320036314107460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.658686221, + "Position": { + "X": 611.13299045057158, + "Y": 474.47313038806061, + "IsEmpty": false + }, + "Timestamp": 637320036314433360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66674298, + "Position": { + "X": 610.7792146929188, + "Y": 474.52878809634319, + "IsEmpty": false + }, + "Timestamp": 637320036314877550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.668696105, + "Position": { + "X": 610.12105848679903, + "Y": 474.68271861132632, + "IsEmpty": false + }, + "Timestamp": 637320036315223400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67064929, + "Position": { + "X": 609.6163998370954, + "Y": 474.78737968909809, + "IsEmpty": false + }, + "Timestamp": 637320036315562310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672602415, + "Position": { + "X": 609.11261552282292, + "Y": 474.8919509023404, + "IsEmpty": false + }, + "Timestamp": 637320036316044140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.678461909, + "Position": { + "X": 608.60970762946408, + "Y": 474.99643136958622, + "IsEmpty": false + }, + "Timestamp": 637320036316530730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680415034, + "Position": { + "X": 608.10767824250081, + "Y": 475.10082020936869, + "IsEmpty": false + }, + "Timestamp": 637320036316937900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682368219, + "Position": { + "X": 607.75755497973068, + "Y": 475.15619417369618, + "IsEmpty": false + }, + "Timestamp": 637320036317298750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 607.25701970397893, + "Y": 475.26044160751923, + "IsEmpty": false + }, + "Timestamp": 637320036317633950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.686274529, + "Position": { + "X": 606.75736846849759, + "Y": 475.36459519198178, + "IsEmpty": false + }, + "Timestamp": 637320036318018550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.686274529, + "Position": { + "X": 606.25860335876916, + "Y": 475.46865404561834, + "IsEmpty": false + }, + "Timestamp": 637320036318391660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.690180838, + "Position": { + "X": 606.10838746825038, + "Y": 475.51744166452937, + "IsEmpty": false + }, + "Timestamp": 637320036318877320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692133963, + "Position": { + "X": 605.61078189549949, + "Y": 475.62135914499311, + "IsEmpty": false + }, + "Timestamp": 637320036319254100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 605.26373985849955, + "Y": 475.67648403454336, + "IsEmpty": false + }, + "Timestamp": 637320036319670050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 605.11406734203774, + "Y": 475.72517970919296, + "IsEmpty": false + }, + "Timestamp": 637320036320897680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706294358, + "Position": { + "X": 604.76764563892277, + "Y": 475.78025340689851, + "IsEmpty": false + }, + "Timestamp": 637320036321267600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706294358, + "Position": { + "X": 604.61824589334742, + "Y": 475.82890247566155, + "IsEmpty": false + }, + "Timestamp": 637320036321881000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708247483, + "Position": { + "X": 604.27244588702774, + "Y": 475.88392452255999, + "IsEmpty": false + }, + "Timestamp": 637320036322769040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.586907744, + "Position": { + "X": 603.77814268829661, + "Y": 475.98749650006027, + "IsEmpty": false + }, + "Timestamp": 637320036323249630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.586907744, + "Position": { + "X": 603.1361610307265, + "Y": 476.13947517401402, + "IsEmpty": false + }, + "Timestamp": 637320036323297260, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "0eda655a-fa44-46d1-8a94-056105142b4b", + "Points": [ + { + "Pressure": 0.416006714, + "Position": { + "X": 732.89635998804704, + "Y": 452.1401571161008, + "IsEmpty": false + }, + "Timestamp": 637320036439963490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.458731979, + "Position": { + "X": 733.55979876180049, + "Y": 452.22818859339196, + "IsEmpty": false + }, + "Timestamp": 637320036441466260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537346482, + "Position": { + "X": 732.89635998804704, + "Y": 452.1401571161008, + "IsEmpty": false + }, + "Timestamp": 637320036442015290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.545403242, + "Position": { + "X": 730.23923821617564, + "Y": 451.78930245392439, + "IsEmpty": false + }, + "Timestamp": 637320036442350830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.555901408, + "Position": { + "X": 726.12944563323458, + "Y": 451.24078662945772, + "IsEmpty": false + }, + "Timestamp": 637320036442698330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.561760902, + "Position": { + "X": 721.45322606736863, + "Y": 450.63775486069915, + "IsEmpty": false + }, + "Timestamp": 637320036442984980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58910507, + "Position": { + "X": 714.07507293304513, + "Y": 449.70409294293643, + "IsEmpty": false + }, + "Timestamp": 637320036443331620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599114954, + "Position": { + "X": 702.60644478099744, + "Y": 448.29690421033774, + "IsEmpty": false + }, + "Timestamp": 637320036443958480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.603509545, + "Position": { + "X": 693.10765242063133, + "Y": 447.17302226092727, + "IsEmpty": false + }, + "Timestamp": 637320036444283190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620355546, + "Position": { + "X": 681.40029769842045, + "Y": 445.83128364242611, + "IsEmpty": false + }, + "Timestamp": 637320036444685140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624261856, + "Position": { + "X": 675.81031125700156, + "Y": 445.20719751600751, + "IsEmpty": false + }, + "Timestamp": 637320036445118150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630121291, + "Position": { + "X": 666.08959293391479, + "Y": 444.16350047669084, + "IsEmpty": false + }, + "Timestamp": 637320036445538540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 661.27679837032872, + "Y": 443.66765452350688, + "IsEmpty": false + }, + "Timestamp": 637320036445977340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640131235, + "Position": { + "X": 654.39100582057881, + "Y": 442.97721272923633, + "IsEmpty": false + }, + "Timestamp": 637320036446458460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64208436, + "Position": { + "X": 651.51747739210657, + "Y": 442.68718637447023, + "IsEmpty": false + }, + "Timestamp": 637320036446831910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66234839, + "Position": { + "X": 650.13824071672536, + "Y": 442.55358570908203, + "IsEmpty": false + }, + "Timestamp": 637320036447247100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.273914695, + "Position": { + "X": 649.44848459849652, + "Y": 442.48711910046922, + "IsEmpty": false + }, + "Timestamp": 637320036449432900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.273914695, + "Position": { + "X": 650.13824071672536, + "Y": 442.55358570908203, + "IsEmpty": false + }, + "Timestamp": 637320036450137750, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "ce748049-f114-459c-a541-ab4795704071", + "Points": [ + { + "Pressure": 0.18455787, + "Position": { + "X": 420.45386734062885, + "Y": 578.22893656403789, + "IsEmpty": false + }, + "Timestamp": 637320036584909190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.434073389, + "Position": { + "X": 421.12815195853022, + "Y": 578.27427352091149, + "IsEmpty": false + }, + "Timestamp": 637320036585201150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.461173415, + "Position": { + "X": 419.77939829104207, + "Y": 578.18321002361472, + "IsEmpty": false + }, + "Timestamp": 637320036586755360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.46312657, + "Position": { + "X": 419.10474696166125, + "Y": 578.13709489129883, + "IsEmpty": false + }, + "Timestamp": 637320036586903450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.465079725, + "Position": { + "X": 418.42991550437762, + "Y": 578.09059215874709, + "IsEmpty": false + }, + "Timestamp": 637320036587214000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498283356, + "Position": { + "X": 419.77939829104207, + "Y": 578.18321002361472, + "IsEmpty": false + }, + "Timestamp": 637320036588282780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.505363524, + "Position": { + "X": 420.45386734062885, + "Y": 578.22893656403789, + "IsEmpty": false + }, + "Timestamp": 637320036588619720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.525627553, + "Position": { + "X": 413.40942865464729, + "Y": 577.72513690709354, + "IsEmpty": false + }, + "Timestamp": 637320036589966170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54857707, + "Position": { + "X": 405.66816373271814, + "Y": 577.1245371514932, + "IsEmpty": false + }, + "Timestamp": 637320036590615940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.562737465, + "Position": { + "X": 400.62468944518628, + "Y": 576.70390081459323, + "IsEmpty": false + }, + "Timestamp": 637320036591241190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.570550084, + "Position": { + "X": 398.97191156034768, + "Y": 576.55508140212316, + "IsEmpty": false + }, + "Timestamp": 637320036591551610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 398.58708287630031, + "Y": 576.5320447016536, + "IsEmpty": false + }, + "Timestamp": 637320036591774720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.576409578, + "Position": { + "X": 395.57368162683122, + "Y": 576.26216494390303, + "IsEmpty": false + }, + "Timestamp": 637320036592367720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588128507, + "Position": { + "X": 396.93330308887232, + "Y": 576.38039554022612, + "IsEmpty": false + }, + "Timestamp": 637320036592965890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592034817, + "Position": { + "X": 398.97191156034768, + "Y": 576.55508140212316, + "IsEmpty": false + }, + "Timestamp": 637320036593422270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592034817, + "Position": { + "X": 400.62468944518628, + "Y": 576.70390081459323, + "IsEmpty": false + }, + "Timestamp": 637320036593794140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589837492, + "Position": { + "X": 402.66120747793428, + "Y": 576.87251757241256, + "IsEmpty": false + }, + "Timestamp": 637320036594218460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.589837492, + "Position": { + "X": 405.37477115489162, + "Y": 577.09225464199085, + "IsEmpty": false + }, + "Timestamp": 637320036594569550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.585687041, + "Position": { + "X": 408.37908175745054, + "Y": 577.3374568984367, + "IsEmpty": false + }, + "Timestamp": 637320036595005850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577630281, + "Position": { + "X": 415.43742008475232, + "Y": 577.87229260566073, + "IsEmpty": false + }, + "Timestamp": 637320036595409660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573723972, + "Position": { + "X": 418.42991550437762, + "Y": 578.09059215874709, + "IsEmpty": false + }, + "Timestamp": 637320036595781120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.569817662, + "Position": { + "X": 419.10474696166125, + "Y": 578.13709489129883, + "IsEmpty": false + }, + "Timestamp": 637320036596108570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.550286114, + "Position": { + "X": 417.07972081366927, + "Y": 577.99642785956428, + "IsEmpty": false + }, + "Timestamp": 637320036596948540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.569817662, + "Position": { + "X": 401.30365260708402, + "Y": 576.76046765108913, + "IsEmpty": false + }, + "Timestamp": 637320036597668510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600335717, + "Position": { + "X": 392.85319821630486, + "Y": 576.02148339876817, + "IsEmpty": false + }, + "Timestamp": 637320036598063020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.671381712, + "Position": { + "X": 388.47360594522729, + "Y": 575.61183411133152, + "IsEmpty": false + }, + "Timestamp": 637320036598951560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.393057138, + "Position": { + "X": 387.79262051620128, + "Y": 575.54850184409611, + "IsEmpty": false + }, + "Timestamp": 637320036599954410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.393057138, + "Position": { + "X": 387.11155502627167, + "Y": 575.48482875754439, + "IsEmpty": false + }, + "Timestamp": 637320036600011920, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "2515520c-a368-4de7-89ba-9dce310d0773", + "Points": [ + { + "Pressure": 0.0458838791, + "Position": { + "X": 184.12449681036821, + "Y": 659.50382026629927, + "IsEmpty": false + }, + "Timestamp": 637320036662640800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0678568706, + "Position": { + "X": 184.59552637002295, + "Y": 659.3836345130353, + "IsEmpty": false + }, + "Timestamp": 637320036663538320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0678568706, + "Position": { + "X": 185.30965120636921, + "Y": 659.18353590270613, + "IsEmpty": false + }, + "Timestamp": 637320036664246900, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "7aa0766a-8eb7-491f-b495-0ed2e71eecf0", + "Points": [ + { + "Pressure": 0.181872278, + "Position": { + "X": 183.37324467829387, + "Y": 657.07044530111455, + "IsEmpty": false + }, + "Timestamp": 637320036669038450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.653559148, + "Position": { + "X": 186.22047951226929, + "Y": 656.28092079746443, + "IsEmpty": false + }, + "Timestamp": 637320036669212600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697505176, + "Position": { + "X": 189.05836117174164, + "Y": 655.48211044018456, + "IsEmpty": false + }, + "Timestamp": 637320036669279380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703364611, + "Position": { + "X": 189.76636426511632, + "Y": 655.28097356636113, + "IsEmpty": false + }, + "Timestamp": 637320036669326560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 190.47377885976627, + "Y": 655.0792674134367, + "IsEmpty": false + }, + "Timestamp": 637320036669366900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720943034, + "Position": { + "X": 192.59248380073154, + "Y": 654.47075545355824, + "IsEmpty": false + }, + "Timestamp": 637320036669406610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736812413, + "Position": { + "X": 196.81389823350312, + "Y": 653.23866034034393, + "IsEmpty": false + }, + "Timestamp": 637320036669464350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774410605, + "Position": { + "X": 232.6707627452941, + "Y": 641.70807836777772, + "IsEmpty": false + }, + "Timestamp": 637320036671845320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789303422, + "Position": { + "X": 248.73606130388981, + "Y": 635.92481455679763, + "IsEmpty": false + }, + "Timestamp": 637320036672408150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791256607, + "Position": { + "X": 253.29608169305888, + "Y": 634.21873082933348, + "IsEmpty": false + }, + "Timestamp": 637320036672759280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797360182, + "Position": { + "X": 264.41210748596927, + "Y": 629.91837571093401, + "IsEmpty": false + }, + "Timestamp": 637320036673460230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.801266491, + "Position": { + "X": 268.85821262989748, + "Y": 628.15400149149036, + "IsEmpty": false + }, + "Timestamp": 637320036673747930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.805172801, + "Position": { + "X": 274.97862749175403, + "Y": 625.69390793121943, + "IsEmpty": false + }, + "Timestamp": 637320036674110630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811032295, + "Position": { + "X": 281.20578383990119, + "Y": 623.11973682399412, + "IsEmpty": false + }, + "Timestamp": 637320036674472220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 286.13741763026968, + "Y": 621.04128238053602, + "IsEmpty": false + }, + "Timestamp": 637320036674879380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.826657534, + "Position": { + "X": 295.86540014410934, + "Y": 616.83821829375415, + "IsEmpty": false + }, + "Timestamp": 637320036675441120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 308.51529339382182, + "Y": 611.15091268449009, + "IsEmpty": false + }, + "Timestamp": 637320036675972460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.832516968, + "Position": { + "X": 316.08265949514845, + "Y": 607.64789747713257, + "IsEmpty": false + }, + "Timestamp": 637320036676361490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.834470153, + "Position": { + "X": 321.8184866054898, + "Y": 604.93752401060942, + "IsEmpty": false + }, + "Timestamp": 637320036676679790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.834470153, + "Position": { + "X": 332.1036294942424, + "Y": 599.94016989863735, + "IsEmpty": false + }, + "Timestamp": 637320036677188370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.834470153, + "Position": { + "X": 334.17230236987035, + "Y": 598.93821236572467, + "IsEmpty": false + }, + "Timestamp": 637320036677529370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.834470153, + "Position": { + "X": 341.98679038696696, + "Y": 595.01085064737936, + "IsEmpty": false + }, + "Timestamp": 637320036677899440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.834470153, + "Position": { + "X": 346.83412201896135, + "Y": 592.54149719650422, + "IsEmpty": false + }, + "Timestamp": 637320036678267280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.834470153, + "Position": { + "X": 353.19820541616792, + "Y": 589.24779027760269, + "IsEmpty": false + }, + "Timestamp": 637320036678668370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.835446715, + "Position": { + "X": 376.39292974837582, + "Y": 576.76580432363994, + "IsEmpty": false + }, + "Timestamp": 637320036680862710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.835446715, + "Position": { + "X": 378.69672044066959, + "Y": 575.50070811784644, + "IsEmpty": false + }, + "Timestamp": 637320036681422990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.833493531, + "Position": { + "X": 379.79177377746271, + "Y": 574.86850702183347, + "IsEmpty": false + }, + "Timestamp": 637320036681751490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.833493531, + "Position": { + "X": 380.75535922937701, + "Y": 574.32757118682957, + "IsEmpty": false + }, + "Timestamp": 637320036682248890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.833493531, + "Position": { + "X": 382.19445315358001, + "Y": 573.51719154513626, + "IsEmpty": false + }, + "Timestamp": 637320036682716920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.833493531, + "Position": { + "X": 383.27525842532378, + "Y": 572.88738895454514, + "IsEmpty": false + }, + "Timestamp": 637320036683198560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.819821477, + "Position": { + "X": 383.14965044152734, + "Y": 572.97764706030102, + "IsEmpty": false + }, + "Timestamp": 637320036684755050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791744888, + "Position": { + "X": 382.67247218708167, + "Y": 573.24734696352266, + "IsEmpty": false + }, + "Timestamp": 637320036685554790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.369863421, + "Position": { + "X": 382.32056499572042, + "Y": 573.42683127284874, + "IsEmpty": false + }, + "Timestamp": 637320036686069190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.369863421, + "Position": { + "X": 383.02379048274236, + "Y": 573.06795661400486, + "IsEmpty": false + }, + "Timestamp": 637320036686116780, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "875b18c6-2b29-4504-bf57-c9c18ca17120", + "Points": [ + { + "Pressure": 0.0561379418, + "Position": { + "X": 398.52653248937406, + "Y": 428.85946779853873, + "IsEmpty": false + }, + "Timestamp": 637320036893651680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0773784965, + "Position": { + "X": 399.64798466934752, + "Y": 429.60123832464024, + "IsEmpty": false + }, + "Timestamp": 637320036893862040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.0773784965, + "Position": { + "X": 400.30332308933049, + "Y": 429.99751857666394, + "IsEmpty": false + }, + "Timestamp": 637320036893927340, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "bb36d0e1-9b76-4b44-802b-f5141d734a52", + "Points": [ + { + "Pressure": 0.0702983141, + "Position": { + "X": 385.87018160775807, + "Y": 444.32995975571509, + "IsEmpty": false + }, + "Timestamp": 637320037766746650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.136705577, + "Position": { + "X": 387.41747643714706, + "Y": 445.48655510296959, + "IsEmpty": false + }, + "Timestamp": 637320037766915040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.139391169, + "Position": { + "X": 388.41215527853313, + "Y": 446.42281399004605, + "IsEmpty": false + }, + "Timestamp": 637320037767169950, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "057eb1eb-006d-44be-a960-299e2fbef5de", + "Points": [], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8441538f-9131-4341-be34-11319edc8a41", + "Points": [], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "f6539fa4-c959-403f-8752-43796fcc59df", + "Points": [], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "fd8523e3-d8e4-46be-bbd3-1016077f50b9", + "Points": [ + { + "Pressure": 0.0610208288, + "Position": { + "X": 512.20781033757123, + "Y": 388.22003439200824, + "IsEmpty": false + }, + "Timestamp": 637320038477236610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.42650491, + "Position": { + "X": 512.39362849062456, + "Y": 386.94310442334739, + "IsEmpty": false + }, + "Timestamp": 637320038478136130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.535393298, + "Position": { + "X": 512.95616386673078, + "Y": 383.13152222682925, + "IsEmpty": false + }, + "Timestamp": 637320038478573580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.57689786, + "Position": { + "X": 513.33541823955159, + "Y": 380.606433260232, + "IsEmpty": false + }, + "Timestamp": 637320038478900080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643793404, + "Position": { + "X": 513.910639364497, + "Y": 376.84266737001491, + "IsEmpty": false + }, + "Timestamp": 637320038479278570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661127627, + "Position": { + "X": 514.29834263144733, + "Y": 374.34935445727177, + "IsEmpty": false + }, + "Timestamp": 637320038479531910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.695796132, + "Position": { + "X": 515.0811812976508, + "Y": 369.70899813294187, + "IsEmpty": false + }, + "Timestamp": 637320038479860230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730464637, + "Position": { + "X": 516.07879263195207, + "Y": 363.89555916842932, + "IsEmpty": false + }, + "Timestamp": 637320038480159340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743404269, + "Position": { + "X": 516.48783406281541, + "Y": 361.16459199149284, + "IsEmpty": false + }, + "Timestamp": 637320038480453900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75194931, + "Position": { + "X": 516.89729445997375, + "Y": 358.75147072447959, + "IsEmpty": false + }, + "Timestamp": 637320038480695480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757076383, + "Position": { + "X": 517.93207935479984, + "Y": 353.07177654828121, + "IsEmpty": false + }, + "Timestamp": 637320038480948930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.767086267, + "Position": { + "X": 518.3531297620716, + "Y": 350.70060898032972, + "IsEmpty": false + }, + "Timestamp": 637320038481198610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.783443987, + "Position": { + "X": 518.99097259703717, + "Y": 347.16697745494218, + "IsEmpty": false + }, + "Timestamp": 637320038481476990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785397112, + "Position": { + "X": 519.20136131295772, + "Y": 346.29032074334134, + "IsEmpty": false + }, + "Timestamp": 637320038481762970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.79662776, + "Position": { + "X": 519.6363281599796, + "Y": 343.66099229706958, + "IsEmpty": false + }, + "Timestamp": 637320038482036520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814694464, + "Position": { + "X": 520.50412648003123, + "Y": 339.31987388818709, + "IsEmpty": false + }, + "Timestamp": 637320038482316890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818600774, + "Position": { + "X": 520.94503902151848, + "Y": 337.0207892720108, + "IsEmpty": false + }, + "Timestamp": 637320038482584860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.833737671, + "Position": { + "X": 521.83683445140207, + "Y": 332.45902169430548, + "IsEmpty": false + }, + "Timestamp": 637320038482836830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.841062009, + "Position": { + "X": 522.5143946549382, + "Y": 329.06941958940587, + "IsEmpty": false + }, + "Timestamp": 637320038483106340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.845944941, + "Position": { + "X": 523.42940944979728, + "Y": 324.59203984088936, + "IsEmpty": false + }, + "Timestamp": 637320038483374260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.856931388, + "Position": { + "X": 524.58603320193663, + "Y": 319.34113061795017, + "IsEmpty": false + }, + "Timestamp": 637320038483665610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.861325979, + "Position": { + "X": 525.05659015461413, + "Y": 317.14876381256835, + "IsEmpty": false + }, + "Timestamp": 637320038483951320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.865476489, + "Position": { + "X": 526.00759469609795, + "Y": 312.79956575302566, + "IsEmpty": false + }, + "Timestamp": 637320038484200660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.874265671, + "Position": { + "X": 526.72299864908314, + "Y": 309.84152903901622, + "IsEmpty": false + }, + "Timestamp": 637320038484473400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.880125105, + "Position": { + "X": 527.69665327605298, + "Y": 305.57189907640372, + "IsEmpty": false + }, + "Timestamp": 637320038484761510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.880125105, + "Position": { + "X": 528.92490073544593, + "Y": 300.5678493617051, + "IsEmpty": false + }, + "Timestamp": 637320038485032690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.88207829, + "Position": { + "X": 529.1817320126911, + "Y": 299.25498021488414, + "IsEmpty": false + }, + "Timestamp": 637320038485271100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.884031415, + "Position": { + "X": 530.18815148665601, + "Y": 295.10167282306503, + "IsEmpty": false + }, + "Timestamp": 637320038485536790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.884031415, + "Position": { + "X": 530.95154370352884, + "Y": 292.01694279972997, + "IsEmpty": false + }, + "Timestamp": 637320038485816350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.884031415, + "Position": { + "X": 532.49160871564413, + "Y": 286.1824742284328, + "IsEmpty": false + }, + "Timestamp": 637320038486081680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.884031415, + "Position": { + "X": 534.85907363461502, + "Y": 277.48204127025531, + "IsEmpty": false + }, + "Timestamp": 637320038486360070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.884031415, + "Position": { + "X": 535.66568714959249, + "Y": 274.5464731315289, + "IsEmpty": false + }, + "Timestamp": 637320038486618000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8859846, + "Position": { + "X": 537.84138473267592, + "Y": 267.08657682003991, + "IsEmpty": false + }, + "Timestamp": 637320038486894780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8859846, + "Position": { + "X": 539.78446549877663, + "Y": 260.72641029966934, + "IsEmpty": false + }, + "Timestamp": 637320038487259540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8859846, + "Position": { + "X": 540.63383857902886, + "Y": 257.93624052474939, + "IsEmpty": false + }, + "Timestamp": 637320038487509970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.8859846, + "Position": { + "X": 543.19933215068772, + "Y": 250.18181210095165, + "IsEmpty": false + }, + "Timestamp": 637320038487780950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 544.94767234963399, + "Y": 245.04442242495176, + "IsEmpty": false + }, + "Timestamp": 637320038488053540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 546.42298634719828, + "Y": 240.86943397911807, + "IsEmpty": false + }, + "Timestamp": 637320038488331080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 548.22077689108619, + "Y": 235.89384652154811, + "IsEmpty": false + }, + "Timestamp": 637320038488601720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 549.13730209135406, + "Y": 233.32661457344096, + "IsEmpty": false + }, + "Timestamp": 637320038488843090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 550.99162290168681, + "Y": 228.26255562233263, + "IsEmpty": false + }, + "Timestamp": 637320038489127740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 552.5753624353365, + "Y": 223.89657314462343, + "IsEmpty": false + }, + "Timestamp": 637320038489409030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 553.82614613911392, + "Y": 220.84083552281896, + "IsEmpty": false + }, + "Timestamp": 637320038489651990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 556.39898478211819, + "Y": 214.41729466129723, + "IsEmpty": false + }, + "Timestamp": 637320038489943800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 557.70414702276821, + "Y": 211.26609296775226, + "IsEmpty": false + }, + "Timestamp": 637320038490206260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 561.000680939414, + "Y": 203.76440187120136, + "IsEmpty": false + }, + "Timestamp": 637320038490463750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 563.73135106501604, + "Y": 197.57733992137193, + "IsEmpty": false + }, + "Timestamp": 637320038490751640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 565.08187002563068, + "Y": 194.8376559128784, + "IsEmpty": false + }, + "Timestamp": 637320038490993020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 568.21567380150407, + "Y": 188.3710685465212, + "IsEmpty": false + }, + "Timestamp": 637320038491263760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 569.62846422482755, + "Y": 185.55901024113558, + "IsEmpty": false + }, + "Timestamp": 637320038491531660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 572.87909799255158, + "Y": 179.18788092422304, + "IsEmpty": false + }, + "Timestamp": 637320038491833250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 575.45909592067346, + "Y": 174.33104799374007, + "IsEmpty": false + }, + "Timestamp": 637320038492075790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 576.56459714969913, + "Y": 172.36167248443599, + "IsEmpty": false + }, + "Timestamp": 637320038492358430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 579.23257575496825, + "Y": 167.50475442614649, + "IsEmpty": false + }, + "Timestamp": 637320038492623190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 580.74018886374881, + "Y": 164.97855501825302, + "IsEmpty": false + }, + "Timestamp": 637320038492898380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 583.4750439167434, + "Y": 160.31654470935774, + "IsEmpty": false + }, + "Timestamp": 637320038493191390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 586.25398219929923, + "Y": 155.77999885896006, + "IsEmpty": false + }, + "Timestamp": 637320038493449480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 587.85651696811317, + "Y": 153.265553275732, + "IsEmpty": false + }, + "Timestamp": 637320038493718080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 591.58349389154671, + "Y": 147.49039629900383, + "IsEmpty": false + }, + "Timestamp": 637320038494000890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 593.27536454626068, + "Y": 144.96130773432881, + "IsEmpty": false + }, + "Timestamp": 637320038494262170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 598.45258792276354, + "Y": 137.6357753224778, + "IsEmpty": false + }, + "Timestamp": 637320038494534810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 600.30753253144951, + "Y": 135.01396020050143, + "IsEmpty": false + }, + "Timestamp": 637320038494776200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 604.4664617968532, + "Y": 129.56706656756941, + "IsEmpty": false + }, + "Timestamp": 637320038495055910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 609.13494090796883, + "Y": 123.55518494947681, + "IsEmpty": false + }, + "Timestamp": 637320038495309600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 610.43231660169408, + "Y": 121.83789787985368, + "IsEmpty": false + }, + "Timestamp": 637320038495593890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 616.5548160032306, + "Y": 114.66887266607765, + "IsEmpty": false + }, + "Timestamp": 637320038495855540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 620.4352852548825, + "Y": 110.72003234885656, + "IsEmpty": false + }, + "Timestamp": 637320038496124060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 625.67408215445653, + "Y": 106.39791766735314, + "IsEmpty": false + }, + "Timestamp": 637320038496398760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 634.45733838059061, + "Y": 100.51470573595607, + "IsEmpty": false + }, + "Timestamp": 637320038496655510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 636.68930774356295, + "Y": 99.133950160535747, + "IsEmpty": false + }, + "Timestamp": 637320038496930160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.887937725, + "Position": { + "X": 641.13838739386517, + "Y": 96.524464315115026, + "IsEmpty": false + }, + "Timestamp": 637320038497225910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.889890909, + "Position": { + "X": 645.19701864108595, + "Y": 94.200756523881722, + "IsEmpty": false + }, + "Timestamp": 637320038497488540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.889890909, + "Position": { + "X": 646.92658993115333, + "Y": 93.168867364167383, + "IsEmpty": false + }, + "Timestamp": 637320038497766690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.889890909, + "Position": { + "X": 649.07132527459817, + "Y": 92.043364586522841, + "IsEmpty": false + }, + "Timestamp": 637320038498047810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.889890909, + "Position": { + "X": 650.28652983486199, + "Y": 91.365540516142033, + "IsEmpty": false + }, + "Timestamp": 637320038498302700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.889890909, + "Position": { + "X": 651.50735992521561, + "Y": 90.695316268607897, + "IsEmpty": false + }, + "Timestamp": 637320038498571980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.891844034, + "Position": { + "X": 652.1892948186246, + "Y": 90.345929520239991, + "IsEmpty": false + }, + "Timestamp": 637320038498834750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.330067903, + "Position": { + "X": 652.60803350685001, + "Y": 90.244616800851858, + "IsEmpty": false + }, + "Timestamp": 637320038499633030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.330067903, + "Position": { + "X": 658.0830898729406, + "Y": 87.016188425650867, + "IsEmpty": false + }, + "Timestamp": 637320038499675140, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "a79def1f-ecbc-4db1-8c5a-007745a46865", + "Points": [ + { + "Pressure": 0.177477688, + "Position": { + "X": 661.90131979762305, + "Y": 89.422586251907831, + "IsEmpty": false + }, + "Timestamp": 637320038540831290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.196032658, + "Position": { + "X": 661.77848639477588, + "Y": 89.447546565180417, + "IsEmpty": false + }, + "Timestamp": 637320038541693490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.294422835, + "Position": { + "X": 661.65602862895321, + "Y": 89.472708848069018, + "IsEmpty": false + }, + "Timestamp": 637320038541993210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.306385905, + "Position": { + "X": 660.98111050315458, + "Y": 89.797599405969592, + "IsEmpty": false + }, + "Timestamp": 637320038542228870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.329823762, + "Position": { + "X": 659.51721474804162, + "Y": 90.480397623889388, + "IsEmpty": false + }, + "Timestamp": 637320038542784560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.33299762, + "Position": { + "X": 658.84881595696879, + "Y": 90.812143530484448, + "IsEmpty": false + }, + "Timestamp": 637320038543044170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648676276, + "Position": { + "X": 659.0873922542977, + "Y": 90.758324907607573, + "IsEmpty": false + }, + "Timestamp": 637320038544413470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 660.85977619691653, + "Y": 89.823372084641633, + "IsEmpty": false + }, + "Timestamp": 637320038544692450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.743160129, + "Position": { + "X": 664.55852751329473, + "Y": 87.974649276471894, + "IsEmpty": false + }, + "Timestamp": 637320038544966040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769283593, + "Position": { + "X": 666.48832673006461, + "Y": 87.062376441689722, + "IsEmpty": false + }, + "Timestamp": 637320038545218330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80468452, + "Position": { + "X": 672.53311460988914, + "Y": 84.213765860913384, + "IsEmpty": false + }, + "Timestamp": 637320038545506470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 677.12193515443676, + "Y": 82.093572770371665, + "IsEmpty": false + }, + "Timestamp": 637320038545776560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.819821477, + "Position": { + "X": 680.28979105508722, + "Y": 80.778184159135336, + "IsEmpty": false + }, + "Timestamp": 637320038546062550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.824216068, + "Position": { + "X": 684.24043732041173, + "Y": 79.064758906372447, + "IsEmpty": false + }, + "Timestamp": 637320038546325980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.824216068, + "Position": { + "X": 685.41552117373067, + "Y": 78.582360469805096, + "IsEmpty": false + }, + "Timestamp": 637320038546574350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.824216068, + "Position": { + "X": 690.14750495639021, + "Y": 76.706503758648168, + "IsEmpty": false + }, + "Timestamp": 637320038546829770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822018743, + "Position": { + "X": 695.83849393666412, + "Y": 74.50779350791116, + "IsEmpty": false + }, + "Timestamp": 637320038547107770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.813961983, + "Position": { + "X": 699.91973686973608, + "Y": 73.036499986986968, + "IsEmpty": false + }, + "Timestamp": 637320038547400880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80468452, + "Position": { + "X": 706.33344356746852, + "Y": 70.848970842067843, + "IsEmpty": false + }, + "Timestamp": 637320038547678140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80468452, + "Position": { + "X": 714.53512098444548, + "Y": 68.272007081056202, + "IsEmpty": false + }, + "Timestamp": 637320038548007610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80468452, + "Position": { + "X": 720.48862261049089, + "Y": 66.562854456684335, + "IsEmpty": false + }, + "Timestamp": 637320038548345060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80468452, + "Position": { + "X": 728.08624369186714, + "Y": 64.511138031482488, + "IsEmpty": false + }, + "Timestamp": 637320038548683150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80468452, + "Position": { + "X": 731.5969643298572, + "Y": 63.622865894994248, + "IsEmpty": false + }, + "Timestamp": 637320038548956800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80468452, + "Position": { + "X": 739.49325942679604, + "Y": 61.809176816128229, + "IsEmpty": false + }, + "Timestamp": 637320038549222410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80468452, + "Position": { + "X": 749.28586562218186, + "Y": 59.796984607736668, + "IsEmpty": false + }, + "Timestamp": 637320038549519790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802731335, + "Position": { + "X": 753.56810131008842, + "Y": 58.989815874535346, + "IsEmpty": false + }, + "Timestamp": 637320038549725600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802731335, + "Position": { + "X": 757.87478644743533, + "Y": 58.224465522066723, + "IsEmpty": false + }, + "Timestamp": 637320038549926840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809079111, + "Position": { + "X": 769.76571062658081, + "Y": 56.346944182786359, + "IsEmpty": false + }, + "Timestamp": 637320038550184350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811032295, + "Position": { + "X": 779.07618558322986, + "Y": 55.062383704814401, + "IsEmpty": false + }, + "Timestamp": 637320038550538470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811032295, + "Position": { + "X": 785.40268321492886, + "Y": 54.293921797859028, + "IsEmpty": false + }, + "Timestamp": 637320038550787090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811032295, + "Position": { + "X": 794.17423438396645, + "Y": 53.330238164594178, + "IsEmpty": false + }, + "Timestamp": 637320038551062350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811032295, + "Position": { + "X": 799.19265798661945, + "Y": 52.834279153359439, + "IsEmpty": false + }, + "Timestamp": 637320038551314450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811032295, + "Position": { + "X": 811.23354520151815, + "Y": 51.803050389340008, + "IsEmpty": false + }, + "Timestamp": 637320038551606090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811032295, + "Position": { + "X": 819.50355917846343, + "Y": 51.206618255308328, + "IsEmpty": false + }, + "Timestamp": 637320038551875890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811032295, + "Position": { + "X": 825.87148927360647, + "Y": 50.802348746121169, + "IsEmpty": false + }, + "Timestamp": 637320038552129270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809079111, + "Position": { + "X": 835.48381011547599, + "Y": 50.276645329885469, + "IsEmpty": false + }, + "Timestamp": 637320038552397290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809079111, + "Position": { + "X": 840.46153465819725, + "Y": 50.031171967372735, + "IsEmpty": false + }, + "Timestamp": 637320038552636840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809079111, + "Position": { + "X": 851.43056500538137, + "Y": 49.584903589580726, + "IsEmpty": false + }, + "Timestamp": 637320038552954210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809323251, + "Position": { + "X": 860.98584693266821, + "Y": 49.261340543447865, + "IsEmpty": false + }, + "Timestamp": 637320038553258800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803219676, + "Position": { + "X": 874.40310549234766, + "Y": 48.89748007752641, + "IsEmpty": false + }, + "Timestamp": 637320038553556870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803219676, + "Position": { + "X": 883.5595890491411, + "Y": 48.700366883004811, + "IsEmpty": false + }, + "Timestamp": 637320038553918280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.803219676, + "Position": { + "X": 890.71469916452884, + "Y": 48.562360405971674, + "IsEmpty": false + }, + "Timestamp": 637320038554190550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799313366, + "Position": { + "X": 902.02104022089566, + "Y": 48.35283718502518, + "IsEmpty": false + }, + "Timestamp": 637320038554456560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799313366, + "Position": { + "X": 913.10101168320023, + "Y": 48.165727512604889, + "IsEmpty": false + }, + "Timestamp": 637320038554719530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799313366, + "Position": { + "X": 920.60216193542033, + "Y": 48.025955320639561, + "IsEmpty": false + }, + "Timestamp": 637320038554991380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799313366, + "Position": { + "X": 930.9678809125711, + "Y": 47.824754189138886, + "IsEmpty": false + }, + "Timestamp": 637320038555246570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.799313366, + "Position": { + "X": 939.79669466515293, + "Y": 47.620321314251058, + "IsEmpty": false + }, + "Timestamp": 637320038555515960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797360182, + "Position": { + "X": 950.2057677669419, + "Y": 47.345962793377502, + "IsEmpty": false + }, + "Timestamp": 637320038555774160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797360182, + "Position": { + "X": 954.63131173048589, + "Y": 47.207419159185498, + "IsEmpty": false + }, + "Timestamp": 637320038556017740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793453872, + "Position": { + "X": 966.61138447345309, + "Y": 46.765436263866107, + "IsEmpty": false + }, + "Timestamp": 637320038556295310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789547563, + "Position": { + "X": 971.83141146924447, + "Y": 46.54711461526913, + "IsEmpty": false + }, + "Timestamp": 637320038556540380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.789547563, + "Position": { + "X": 980.69277025779604, + "Y": 46.1098768813142, + "IsEmpty": false + }, + "Timestamp": 637320038556796740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791500747, + "Position": { + "X": 991.3692168070578, + "Y": 45.474834055787007, + "IsEmpty": false + }, + "Timestamp": 637320038557092520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.795651197, + "Position": { + "X": 995.79633191395851, + "Y": 45.176686912596949, + "IsEmpty": false + }, + "Timestamp": 637320038557374230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80468452, + "Position": { + "X": 1002.3885297211518, + "Y": 45.041845681869965, + "IsEmpty": false + }, + "Timestamp": 637320038557668520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810299814, + "Position": { + "X": 1006.0194852577094, + "Y": 45.30731254160095, + "IsEmpty": false + }, + "Timestamp": 637320038557909290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.816647589, + "Position": { + "X": 1012.2651893152367, + "Y": 45.713131922600368, + "IsEmpty": false + }, + "Timestamp": 637320038558203910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.816647589, + "Position": { + "X": 1013.5711625824991, + "Y": 45.788953664361031, + "IsEmpty": false + }, + "Timestamp": 637320038558466800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.331532776, + "Position": { + "X": 1014.0832417769747, + "Y": 45.826500401156729, + "IsEmpty": false + }, + "Timestamp": 637320038558761660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.331532776, + "Position": { + "X": 1013.2889773960811, + "Y": 45.789466373425675, + "IsEmpty": false + }, + "Timestamp": 637320038558807220, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "08437d38-2edf-4fe9-bbe0-b3fc5155da57", + "Points": [ + { + "Pressure": 0.107896544, + "Position": { + "X": 1006.4801283426125, + "Y": 47.776332631041313, + "IsEmpty": false + }, + "Timestamp": 637320038586046200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.107896544, + "Position": { + "X": 1005.721519639276, + "Y": 47.731525576980474, + "IsEmpty": false + }, + "Timestamp": 637320038586182500, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "b7fa16c2-9893-40d8-826c-9b55af1fe9ca", + "Points": [ + { + "Pressure": 0.0561379418, + "Position": { + "X": 1007.0191853196187, + "Y": 47.705614524888709, + "IsEmpty": false + }, + "Timestamp": 637320038590971740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.796139479, + "Position": { + "X": 1019.2358803497497, + "Y": 48.460982346957643, + "IsEmpty": false + }, + "Timestamp": 637320038591072490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.817868292, + "Position": { + "X": 1037.5219216788519, + "Y": 49.338201856295569, + "IsEmpty": false + }, + "Timestamp": 637320038591134400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822018743, + "Position": { + "X": 1047.6967163681975, + "Y": 49.706026336320619, + "IsEmpty": false + }, + "Timestamp": 637320038591179870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.82909894, + "Position": { + "X": 1095.6979919614998, + "Y": 50.810274218270457, + "IsEmpty": false + }, + "Timestamp": 637320038593190900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.855710685, + "Position": { + "X": 1133.6968476344505, + "Y": 51.658954360248678, + "IsEmpty": false + }, + "Timestamp": 637320038593733750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.85766387, + "Position": { + "X": 1140.2114463912449, + "Y": 51.859440054332381, + "IsEmpty": false + }, + "Timestamp": 637320038594011960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.859616995, + "Position": { + "X": 1154.2472617208587, + "Y": 52.399695629448303, + "IsEmpty": false + }, + "Timestamp": 637320038594391910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.851560235, + "Position": { + "X": 1176.6581180005826, + "Y": 53.61340556193273, + "IsEmpty": false + }, + "Timestamp": 637320038594814220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.84960705, + "Position": { + "X": 1188.2410078259295, + "Y": 54.451242789865063, + "IsEmpty": false + }, + "Timestamp": 637320038595164350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.847653925, + "Position": { + "X": 1199.3933925437345, + "Y": 55.462656322064738, + "IsEmpty": false + }, + "Timestamp": 637320038595538590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.847653925, + "Position": { + "X": 1211.4335351229263, + "Y": 56.742593365551748, + "IsEmpty": false + }, + "Timestamp": 637320038596055920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.847898066, + "Position": { + "X": 1219.3031023621224, + "Y": 57.754321237417834, + "IsEmpty": false + }, + "Timestamp": 637320038596495150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.851804376, + "Position": { + "X": 1224.7408058043313, + "Y": 58.524895825187905, + "IsEmpty": false + }, + "Timestamp": 637320038596901930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.85375756, + "Position": { + "X": 1232.5113279127797, + "Y": 59.744565624819352, + "IsEmpty": false + }, + "Timestamp": 637320038597284110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.84936291, + "Position": { + "X": 1238.5364553449683, + "Y": 60.774720048012135, + "IsEmpty": false + }, + "Timestamp": 637320038597643210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.847165644, + "Position": { + "X": 1244.5216722764537, + "Y": 61.887913059057873, + "IsEmpty": false + }, + "Timestamp": 637320038597969570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.847165644, + "Position": { + "X": 1262.7291978022276, + "Y": 65.902897702122132, + "IsEmpty": false + }, + "Timestamp": 637320038598724480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.847165644, + "Position": { + "X": 1273.945611943489, + "Y": 68.831541557423776, + "IsEmpty": false + }, + "Timestamp": 637320038599083730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838376462, + "Position": { + "X": 1287.4422253005985, + "Y": 72.898996056779808, + "IsEmpty": false + }, + "Timestamp": 637320038599543170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.836423278, + "Position": { + "X": 1304.1136743688987, + "Y": 78.906056726030727, + "IsEmpty": false + }, + "Timestamp": 637320038600038970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.836423278, + "Position": { + "X": 1325.8849071320997, + "Y": 88.482622916342152, + "IsEmpty": false + }, + "Timestamp": 637320038600550610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.836423278, + "Position": { + "X": 1342.2451049402835, + "Y": 97.260353512393323, + "IsEmpty": false + }, + "Timestamp": 637320038601036060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.836423278, + "Position": { + "X": 1356.3701704511652, + "Y": 105.83527456709746, + "IsEmpty": false + }, + "Timestamp": 637320038601448990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.836423278, + "Position": { + "X": 1384.4478025536391, + "Y": 131.24915637965699, + "IsEmpty": false + }, + "Timestamp": 637320038601927840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.836423278, + "Position": { + "X": 1397.9893018105856, + "Y": 148.07309046821973, + "IsEmpty": false + }, + "Timestamp": 637320038602355230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.836423278, + "Position": { + "X": 1404.3444799627687, + "Y": 156.71462687447388, + "IsEmpty": false + }, + "Timestamp": 637320038602833240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838376462, + "Position": { + "X": 1411.7192198207215, + "Y": 167.58856593606609, + "IsEmpty": false + }, + "Timestamp": 637320038603101810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838376462, + "Position": { + "X": 1417.258300910659, + "Y": 176.33322812584746, + "IsEmpty": false + }, + "Timestamp": 637320038603373780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838376462, + "Position": { + "X": 1420.3369596277726, + "Y": 181.34659663429176, + "IsEmpty": false + }, + "Timestamp": 637320038603664820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838376462, + "Position": { + "X": 1426.7633158382866, + "Y": 192.749249727798, + "IsEmpty": false + }, + "Timestamp": 637320038603945300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.838376462, + "Position": { + "X": 1431.8786045909555, + "Y": 202.45232445958652, + "IsEmpty": false + }, + "Timestamp": 637320038604215190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840329587, + "Position": { + "X": 1437.5661644147353, + "Y": 214.28882800934608, + "IsEmpty": false + }, + "Timestamp": 637320038604500890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.840329587, + "Position": { + "X": 1439.6463259346729, + "Y": 218.84927300016597, + "IsEmpty": false + }, + "Timestamp": 637320038604775840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842282772, + "Position": { + "X": 1445.0564814721274, + "Y": 231.38432109434299, + "IsEmpty": false + }, + "Timestamp": 637320038605059740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842282772, + "Position": { + "X": 1447.0360245883182, + "Y": 236.26382860852016, + "IsEmpty": false + }, + "Timestamp": 637320038605328220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.842282772, + "Position": { + "X": 1450.5996498958941, + "Y": 245.57014199659667, + "IsEmpty": false + }, + "Timestamp": 637320038605590870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.844235897, + "Position": { + "X": 1454.982735072012, + "Y": 257.5904265770755, + "IsEmpty": false + }, + "Timestamp": 637320038605854200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.846189082, + "Position": { + "X": 1456.5184082046626, + "Y": 262.17592754697375, + "IsEmpty": false + }, + "Timestamp": 637320038606113500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.846189082, + "Position": { + "X": 1460.4019040339533, + "Y": 274.08522500736939, + "IsEmpty": false + }, + "Timestamp": 637320038606395860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.846189082, + "Position": { + "X": 1461.5729491846878, + "Y": 277.94257622720767, + "IsEmpty": false + }, + "Timestamp": 637320038606669710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.846189082, + "Position": { + "X": 1464.1478655476624, + "Y": 286.44246695007229, + "IsEmpty": false + }, + "Timestamp": 637320038606960090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.846189082, + "Position": { + "X": 1466.6664981885892, + "Y": 295.50632742796853, + "IsEmpty": false + }, + "Timestamp": 637320038607234880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.846189082, + "Position": { + "X": 1467.4907508319541, + "Y": 298.57904010009196, + "IsEmpty": false + }, + "Timestamp": 637320038607524350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.839841306, + "Position": { + "X": 1469.3841249691, + "Y": 305.8496011162751, + "IsEmpty": false + }, + "Timestamp": 637320038607792630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.839841306, + "Position": { + "X": 1470.9696753434155, + "Y": 312.01255940021554, + "IsEmpty": false + }, + "Timestamp": 637320038608062210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.839841306, + "Position": { + "X": 1471.7529570197296, + "Y": 315.2232603012348, + "IsEmpty": false + }, + "Timestamp": 637320038608338190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.839841306, + "Position": { + "X": 1473.5503414643235, + "Y": 322.81805560808783, + "IsEmpty": false + }, + "Timestamp": 637320038608622440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.839841306, + "Position": { + "X": 1474.3076315040412, + "Y": 326.11744416658354, + "IsEmpty": false + }, + "Timestamp": 637320038608880190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.824460208, + "Position": { + "X": 1475.0540196664424, + "Y": 329.25441107036937, + "IsEmpty": false + }, + "Timestamp": 637320038609145100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.824460208, + "Position": { + "X": 1475.2959619700682, + "Y": 329.99060667689997, + "IsEmpty": false + }, + "Timestamp": 637320038609190500, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "607dd10a-59a8-4d4c-8544-55d4fe3a1044", + "Points": [ + { + "Pressure": 0.179430842, + "Position": { + "X": 399.42894442439729, + "Y": 426.75695503064162, + "IsEmpty": false + }, + "Timestamp": 637320038811809720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.591790617, + "Position": { + "X": 397.92538979421465, + "Y": 425.78960476877461, + "IsEmpty": false + }, + "Timestamp": 637320038814099680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.607171714, + "Position": { + "X": 396.58238251144127, + "Y": 424.90894897324307, + "IsEmpty": false + }, + "Timestamp": 637320038814339660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624261856, + "Position": { + "X": 390.84512400071003, + "Y": 421.16163552824952, + "IsEmpty": false + }, + "Timestamp": 637320038814625260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628412306, + "Position": { + "X": 382.89609824610147, + "Y": 416.10013459265485, + "IsEmpty": false + }, + "Timestamp": 637320038814865560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630365431, + "Position": { + "X": 377.43618913677216, + "Y": 412.7121195253153, + "IsEmpty": false + }, + "Timestamp": 637320038815114690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632318616, + "Position": { + "X": 361.29223630151472, + "Y": 402.96386031335891, + "IsEmpty": false + }, + "Timestamp": 637320038815367680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632318616, + "Position": { + "X": 354.56019417667011, + "Y": 399.02679635222955, + "IsEmpty": false + }, + "Timestamp": 637320038815633750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632318616, + "Position": { + "X": 334.63018142625168, + "Y": 387.83881668026964, + "IsEmpty": false + }, + "Timestamp": 637320038815906470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.634271741, + "Position": { + "X": 317.64954410324742, + "Y": 378.8513850495674, + "IsEmpty": false + }, + "Timestamp": 637320038816228700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636224926, + "Position": { + "X": 309.47823253536245, + "Y": 374.70309570988911, + "IsEmpty": false + }, + "Timestamp": 637320038816491630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.646723151, + "Position": { + "X": 288.99104753684458, + "Y": 364.80150010115415, + "IsEmpty": false + }, + "Timestamp": 637320038816761660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651117742, + "Position": { + "X": 281.54602078743994, + "Y": 361.37863667555024, + "IsEmpty": false + }, + "Timestamp": 637320038817027880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.667231262, + "Position": { + "X": 261.80519848753147, + "Y": 352.7510811355437, + "IsEmpty": false + }, + "Timestamp": 637320038817363130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.681879938, + "Position": { + "X": 246.26674436772723, + "Y": 346.3991167260595, + "IsEmpty": false + }, + "Timestamp": 637320038817659420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691889822, + "Position": { + "X": 229.1421392484159, + "Y": 339.89127884411505, + "IsEmpty": false + }, + "Timestamp": 637320038817945340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691889822, + "Position": { + "X": 219.73642567931992, + "Y": 336.49844902430027, + "IsEmpty": false + }, + "Timestamp": 637320038818229000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.691889822, + "Position": { + "X": 203.5796294449855, + "Y": 331.03100363474528, + "IsEmpty": false + }, + "Timestamp": 637320038818498570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693843007, + "Position": { + "X": 182.68071922420057, + "Y": 324.58540351478734, + "IsEmpty": false + }, + "Timestamp": 637320038818764060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693843007, + "Position": { + "X": 173.38380111900656, + "Y": 321.93339939848789, + "IsEmpty": false + }, + "Timestamp": 637320038819044640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693843007, + "Position": { + "X": 150.63750474961765, + "Y": 316.06684896073887, + "IsEmpty": false + }, + "Timestamp": 637320038819312280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.695796132, + "Position": { + "X": 132.99417915639998, + "Y": 312.07789017437136, + "IsEmpty": false + }, + "Timestamp": 637320038819586420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 124.43459195103642, + "Y": 310.32155981674964, + "IsEmpty": false + }, + "Timestamp": 637320038819835190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696284413, + "Position": { + "X": 104.69361078166891, + "Y": 306.71573429531304, + "IsEmpty": false + }, + "Timestamp": 637320038820094810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696284413, + "Position": { + "X": 96.686961301620116, + "Y": 305.42994673954956, + "IsEmpty": false + }, + "Timestamp": 637320038820379090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 81.303522434816031, + "Y": 303.2453982427844, + "IsEmpty": false + }, + "Timestamp": 637320038820726840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 67.898328770693226, + "Y": 301.65363066566465, + "IsEmpty": false + }, + "Timestamp": 637320038820989750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 62.106341939362935, + "Y": 301.05156243903144, + "IsEmpty": false + }, + "Timestamp": 637320038821229490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 51.827236232855761, + "Y": 300.11918285921917, + "IsEmpty": false + }, + "Timestamp": 637320038821525520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 42.587066613948679, + "Y": 299.41944046694624, + "IsEmpty": false + }, + "Timestamp": 637320038821778450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 36.6700795917086, + "Y": 299.04259721686157, + "IsEmpty": false + }, + "Timestamp": 637320038822090220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 29.587929305307767, + "Y": 298.66906003344093, + "IsEmpty": false + }, + "Timestamp": 637320038822378340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 23.609436254385514, + "Y": 298.41190725942636, + "IsEmpty": false + }, + "Timestamp": 637320038822632970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 18.462698590092685, + "Y": 298.23606345591298, + "IsEmpty": false + }, + "Timestamp": 637320038822895030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 12.432306599503844, + "Y": 298.08364834635427, + "IsEmpty": false + }, + "Timestamp": 637320038823170150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 6.0862400592179711, + "Y": 297.98963678315386, + "IsEmpty": false + }, + "Timestamp": 637320038823484680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 4.3501082927945589, + "Y": 297.97398050245118, + "IsEmpty": false + }, + "Timestamp": 637320038823733770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 1.7417169018903422, + "Y": 297.95948494131898, + "IsEmpty": false + }, + "Timestamp": 637320038824009650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 0.8711370091941717, + "Y": 297.95705980032233, + "IsEmpty": false + }, + "Timestamp": 637320038824273450, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "1dc71719-48d2-407e-8123-7c6f7b3a9908", + "Points": [ + { + "Pressure": 0.535393298, + "Position": { + "X": 635.28231414910294, + "Y": 440.59555118179378, + "IsEmpty": false + }, + "Timestamp": 637320039004604240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588860929, + "Position": { + "X": 635.81404305681701, + "Y": 440.38997845861161, + "IsEmpty": false + }, + "Timestamp": 637320039007669700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.60546273, + "Position": { + "X": 636.34653241063143, + "Y": 440.18433611056525, + "IsEmpty": false + }, + "Timestamp": 637320039007945130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644037545, + "Position": { + "X": 637.94854559348187, + "Y": 439.56700828952808, + "IsEmpty": false + }, + "Timestamp": 637320039008209730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655024052, + "Position": { + "X": 638.79365229547716, + "Y": 439.2674696102024, + "IsEmpty": false + }, + "Timestamp": 637320039008468500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680415034, + "Position": { + "X": 640.94478088611129, + "Y": 438.44316725575959, + "IsEmpty": false + }, + "Timestamp": 637320039008749130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.697749317, + "Position": { + "X": 643.33729584396099, + "Y": 437.50542196226417, + "IsEmpty": false + }, + "Timestamp": 637320039009023520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 644.96835023736389, + "Y": 436.88597449869144, + "IsEmpty": false + }, + "Timestamp": 637320039009271610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717280865, + "Position": { + "X": 649.03296033695983, + "Y": 435.32640850465685, + "IsEmpty": false + }, + "Timestamp": 637320039009539510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71947813, + "Position": { + "X": 650.68678511564349, + "Y": 434.7058659016929, + "IsEmpty": false + }, + "Timestamp": 637320039009811570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726070046, + "Position": { + "X": 653.45738868823128, + "Y": 433.67119330513333, + "IsEmpty": false + }, + "Timestamp": 637320039010065820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.73949796, + "Position": { + "X": 657.04379230371546, + "Y": 432.31612120488137, + "IsEmpty": false + }, + "Timestamp": 637320039010340930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741695285, + "Position": { + "X": 658.72815880135192, + "Y": 431.69500109638562, + "IsEmpty": false + }, + "Timestamp": 637320039010589700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.750240326, + "Position": { + "X": 664.06105201585012, + "Y": 429.7189350589648, + "IsEmpty": false + }, + "Timestamp": 637320039010855750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754146636, + "Position": { + "X": 666.34216876847961, + "Y": 428.89130844304253, + "IsEmpty": false + }, + "Timestamp": 637320039011155270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758052945, + "Position": { + "X": 672.33903647494878, + "Y": 426.71144766244316, + "IsEmpty": false + }, + "Timestamp": 637320039011430620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76025027, + "Position": { + "X": 675.23956018391971, + "Y": 425.6794801402869, + "IsEmpty": false + }, + "Timestamp": 637320039011677170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.766842127, + "Position": { + "X": 681.67651187623142, + "Y": 423.41395341797607, + "IsEmpty": false + }, + "Timestamp": 637320039011970930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.772945762, + "Position": { + "X": 686.99885977949873, + "Y": 421.56652452529124, + "IsEmpty": false + }, + "Timestamp": 637320039012245420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.774898887, + "Position": { + "X": 688.78388369837648, + "Y": 420.95218588793165, + "IsEmpty": false + }, + "Timestamp": 637320039012517890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776852071, + "Position": { + "X": 692.62903250829049, + "Y": 419.61454112692866, + "IsEmpty": false + }, + "Timestamp": 637320039012775860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776852071, + "Position": { + "X": 697.18429847083257, + "Y": 418.09674755679885, + "IsEmpty": false + }, + "Timestamp": 637320039013071300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776852071, + "Position": { + "X": 699.60524276646311, + "Y": 417.28480725747869, + "IsEmpty": false + }, + "Timestamp": 637320039013326430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776852071, + "Position": { + "X": 704.12849089451299, + "Y": 415.75836596462767, + "IsEmpty": false + }, + "Timestamp": 637320039013581800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776852071, + "Position": { + "X": 706.30916531955063, + "Y": 415.0622606953047, + "IsEmpty": false + }, + "Timestamp": 637320039013845250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.778805196, + "Position": { + "X": 710.87807333138949, + "Y": 413.54713423375017, + "IsEmpty": false + }, + "Timestamp": 637320039014106320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.780758381, + "Position": { + "X": 712.73017226845366, + "Y": 412.94717282363359, + "IsEmpty": false + }, + "Timestamp": 637320039014370580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.78466469, + "Position": { + "X": 716.09843814349142, + "Y": 411.84175666111844, + "IsEmpty": false + }, + "Timestamp": 637320039014641470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788815141, + "Position": { + "X": 720.45859542160122, + "Y": 410.45394574685815, + "IsEmpty": false + }, + "Timestamp": 637320039014893490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788815141, + "Position": { + "X": 721.98277141812457, + "Y": 409.95130450491507, + "IsEmpty": false + }, + "Timestamp": 637320039015193630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788815141, + "Position": { + "X": 727.28290724788417, + "Y": 408.27302259204464, + "IsEmpty": false + }, + "Timestamp": 637320039015503050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788815141, + "Position": { + "X": 733.25378589694333, + "Y": 406.41550021310155, + "IsEmpty": false + }, + "Timestamp": 637320039015783020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788815141, + "Position": { + "X": 736.43381367362792, + "Y": 405.4502020802297, + "IsEmpty": false + }, + "Timestamp": 637320039016031970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 744.39705518151447, + "Y": 403.05313307591132, + "IsEmpty": false + }, + "Timestamp": 637320039016297720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 752.14294655482638, + "Y": 400.79605681499578, + "IsEmpty": false + }, + "Timestamp": 637320039016589210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 758.64427775687352, + "Y": 398.94404966170993, + "IsEmpty": false + }, + "Timestamp": 637320039016835630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 765.8422545020311, + "Y": 396.93933233906625, + "IsEmpty": false + }, + "Timestamp": 637320039017114370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 768.10773396327977, + "Y": 396.30092651961712, + "IsEmpty": false + }, + "Timestamp": 637320039017412140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 776.69192096713323, + "Y": 393.99305712598323, + "IsEmpty": false + }, + "Timestamp": 637320039017662970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 784.36859831095182, + "Y": 392.00514307208408, + "IsEmpty": false + }, + "Timestamp": 637320039017943060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 789.71173947937382, + "Y": 390.64370323200683, + "IsEmpty": false + }, + "Timestamp": 637320039018261210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 797.09189671880279, + "Y": 388.80957383744584, + "IsEmpty": false + }, + "Timestamp": 637320039018501990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 800.45871288734736, + "Y": 387.99090995702699, + "IsEmpty": false + }, + "Timestamp": 637320039018761500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 806.90549705861372, + "Y": 386.46947783373048, + "IsEmpty": false + }, + "Timestamp": 637320039019040610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 812.32781750811239, + "Y": 385.2103024969602, + "IsEmpty": false + }, + "Timestamp": 637320039019317450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790768266, + "Position": { + "X": 817.08610856492396, + "Y": 384.13040216467527, + "IsEmpty": false + }, + "Timestamp": 637320039019577230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788815141, + "Position": { + "X": 823.22177194007554, + "Y": 382.77294071797218, + "IsEmpty": false + }, + "Timestamp": 637320039019857170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788815141, + "Position": { + "X": 832.11744321401954, + "Y": 380.87604258008395, + "IsEmpty": false + }, + "Timestamp": 637320039020139010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788815141, + "Position": { + "X": 835.23069250331707, + "Y": 380.24404180437006, + "IsEmpty": false + }, + "Timestamp": 637320039020457720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788815141, + "Position": { + "X": 840.72913242365689, + "Y": 379.13267356641603, + "IsEmpty": false + }, + "Timestamp": 637320039020748970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 848.6771958185102, + "Y": 377.59611974141279, + "IsEmpty": false + }, + "Timestamp": 637320039021161070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 852.12925260879956, + "Y": 376.94604141122431, + "IsEmpty": false + }, + "Timestamp": 637320039021423930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 860.10477612663556, + "Y": 375.5060216169432, + "IsEmpty": false + }, + "Timestamp": 637320039021708530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 866.3416930792522, + "Y": 374.42345861856171, + "IsEmpty": false + }, + "Timestamp": 637320039021984470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 870.50522336718439, + "Y": 373.7264372392338, + "IsEmpty": false + }, + "Timestamp": 637320039022235610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 876.75794929780443, + "Y": 372.71885260294039, + "IsEmpty": false + }, + "Timestamp": 637320039022537410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 883.38285667779269, + "Y": 371.711143350908, + "IsEmpty": false + }, + "Timestamp": 637320039022820250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 886.16702008325524, + "Y": 371.300437869387, + "IsEmpty": false + }, + "Timestamp": 637320039023078980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 889.64882869162045, + "Y": 370.80053727475058, + "IsEmpty": false + }, + "Timestamp": 637320039023315490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 899.43132989252729, + "Y": 369.4919837541309, + "IsEmpty": false + }, + "Timestamp": 637320039023598060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 909.55023804950633, + "Y": 368.26097013739144, + "IsEmpty": false + }, + "Timestamp": 637320039023887850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 918.96984229514919, + "Y": 367.2383683462578, + "IsEmpty": false + }, + "Timestamp": 637320039024181480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 923.50668151836635, + "Y": 366.79199810920386, + "IsEmpty": false + }, + "Timestamp": 637320039024449710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 931.52105134676958, + "Y": 366.06993772277167, + "IsEmpty": false + }, + "Timestamp": 637320039024703870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 935.0007891866095, + "Y": 365.78302525334067, + "IsEmpty": false + }, + "Timestamp": 637320039024974550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 946.12795479254373, + "Y": 364.9945603169266, + "IsEmpty": false + }, + "Timestamp": 637320039025236500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 949.94554841672743, + "Y": 364.76825537477083, + "IsEmpty": false + }, + "Timestamp": 637320039025494290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 958.94951883378326, + "Y": 364.32238272550342, + "IsEmpty": false + }, + "Timestamp": 637320039025772850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 965.51257581532877, + "Y": 364.07677280325277, + "IsEmpty": false + }, + "Timestamp": 637320039026042950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 970.34287806925875, + "Y": 363.93815572898109, + "IsEmpty": false + }, + "Timestamp": 637320039026310430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 979.61052727097717, + "Y": 363.79432839948151, + "IsEmpty": false + }, + "Timestamp": 637320039026629770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 984.06023651644171, + "Y": 363.77640433035845, + "IsEmpty": false + }, + "Timestamp": 637320039026845800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 993.93659645859032, + "Y": 363.86731840454564, + "IsEmpty": false + }, + "Timestamp": 637320039027073470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.786617815, + "Position": { + "X": 997.343332526567, + "Y": 363.93562552380735, + "IsEmpty": false + }, + "Timestamp": 637320039027338650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788571, + "Position": { + "X": 1007.0728132785666, + "Y": 363.84658783276222, + "IsEmpty": false + }, + "Timestamp": 637320039027615070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788571, + "Position": { + "X": 1013.199653492581, + "Y": 363.78022698062284, + "IsEmpty": false + }, + "Timestamp": 637320039027909950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788571, + "Position": { + "X": 1019.7027918270192, + "Y": 363.7886446847258, + "IsEmpty": false + }, + "Timestamp": 637320039028155250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790524125, + "Position": { + "X": 1031.7264111458064, + "Y": 363.99277847709499, + "IsEmpty": false + }, + "Timestamp": 637320039028438430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790524125, + "Position": { + "X": 1036.2100107977071, + "Y": 364.1314885706127, + "IsEmpty": false + }, + "Timestamp": 637320039028711880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790524125, + "Position": { + "X": 1044.856165380904, + "Y": 364.49467221966427, + "IsEmpty": false + }, + "Timestamp": 637320039029004840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790524125, + "Position": { + "X": 1056.9993456792902, + "Y": 365.19561237683888, + "IsEmpty": false + }, + "Timestamp": 637320039029281010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.790524125, + "Position": { + "X": 1062.9119982891682, + "Y": 365.61946779936591, + "IsEmpty": false + }, + "Timestamp": 637320039029546220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.79247731, + "Position": { + "X": 1074.7584238445479, + "Y": 366.62176603758968, + "IsEmpty": false + }, + "Timestamp": 637320039029862270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.79247731, + "Position": { + "X": 1084.1754771609499, + "Y": 367.5626829747826, + "IsEmpty": false + }, + "Timestamp": 637320039030143640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.79247731, + "Position": { + "X": 1090.1116356256166, + "Y": 368.21605161529669, + "IsEmpty": false + }, + "Timestamp": 637320039030405400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.79247731, + "Position": { + "X": 1105.1116751206666, + "Y": 370.08417447861723, + "IsEmpty": false + }, + "Timestamp": 637320039030654150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794674575, + "Position": { + "X": 1115.9212164496889, + "Y": 371.60757501895677, + "IsEmpty": false + }, + "Timestamp": 637320039030932670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.794674575, + "Position": { + "X": 1125.3272202135277, + "Y": 373.04959339045774, + "IsEmpty": false + }, + "Timestamp": 637320039031197250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.798580885, + "Position": { + "X": 1136.7985675944335, + "Y": 374.95345431886273, + "IsEmpty": false + }, + "Timestamp": 637320039031451490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.798580885, + "Position": { + "X": 1142.3392898832178, + "Y": 375.93281469428518, + "IsEmpty": false + }, + "Timestamp": 637320039031726920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80053407, + "Position": { + "X": 1160.646641990031, + "Y": 379.40762365341652, + "IsEmpty": false + }, + "Timestamp": 637320039032106820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.802487195, + "Position": { + "X": 1165.4557207285677, + "Y": 380.38511399258272, + "IsEmpty": false + }, + "Timestamp": 637320039032363720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804440379, + "Position": { + "X": 1179.5075999764072, + "Y": 383.37188599436405, + "IsEmpty": false + }, + "Timestamp": 637320039032642400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804440379, + "Position": { + "X": 1184.5860443471015, + "Y": 384.52071897180684, + "IsEmpty": false + }, + "Timestamp": 637320039032925120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.804440379, + "Position": { + "X": 1195.4310120998209, + "Y": 387.03586061311921, + "IsEmpty": false + }, + "Timestamp": 637320039033183820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.808346689, + "Position": { + "X": 1204.8615394111191, + "Y": 389.32036410662027, + "IsEmpty": false + }, + "Timestamp": 637320039033456480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.810299814, + "Position": { + "X": 1209.9214794895802, + "Y": 390.56696526326516, + "IsEmpty": false + }, + "Timestamp": 637320039033706570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812252998, + "Position": { + "X": 1218.8934286930612, + "Y": 392.88308638811833, + "IsEmpty": false + }, + "Timestamp": 637320039034060130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812252998, + "Position": { + "X": 1228.8246240429739, + "Y": 395.52014464293416, + "IsEmpty": false + }, + "Timestamp": 637320039034350300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812252998, + "Position": { + "X": 1233.7944965737506, + "Y": 396.85720250450834, + "IsEmpty": false + }, + "Timestamp": 637320039034614670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.812252998, + "Position": { + "X": 1243.238511171274, + "Y": 399.51354347935217, + "IsEmpty": false + }, + "Timestamp": 637320039034849850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814206123, + "Position": { + "X": 1254.5269459496219, + "Y": 402.79489649797296, + "IsEmpty": false + }, + "Timestamp": 637320039035138200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814206123, + "Position": { + "X": 1259.0197400411739, + "Y": 404.12562419055212, + "IsEmpty": false + }, + "Timestamp": 637320039035430230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.816159308, + "Position": { + "X": 1266.0350412759308, + "Y": 406.23969421478438, + "IsEmpty": false + }, + "Timestamp": 637320039035694030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.816159308, + "Position": { + "X": 1270.4698907444842, + "Y": 407.59871005361691, + "IsEmpty": false + }, + "Timestamp": 637320039035939490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818112433, + "Position": { + "X": 1277.0386972769268, + "Y": 409.66480303246499, + "IsEmpty": false + }, + "Timestamp": 637320039036234250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820065618, + "Position": { + "X": 1286.7307174053167, + "Y": 412.72908481553998, + "IsEmpty": false + }, + "Timestamp": 637320039036511660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820065618, + "Position": { + "X": 1290.0860837598123, + "Y": 413.83837146558608, + "IsEmpty": false + }, + "Timestamp": 637320039036767580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822018743, + "Position": { + "X": 1296.8270045674053, + "Y": 416.05187942143357, + "IsEmpty": false + }, + "Timestamp": 637320039037046110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.823971927, + "Position": { + "X": 1301.6873711062995, + "Y": 417.67179508089333, + "IsEmpty": false + }, + "Timestamp": 637320039037316180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.823971927, + "Position": { + "X": 1306.7709038208723, + "Y": 419.410570885678, + "IsEmpty": false + }, + "Timestamp": 637320039037580060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1310.3624568817688, + "Y": 420.6358780887154, + "IsEmpty": false + }, + "Timestamp": 637320039037858440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1310.9589766783183, + "Y": 420.84043075158087, + "IsEmpty": false + }, + "Timestamp": 637320039038106340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1312.7449483056889, + "Y": 421.45462873108352, + "IsEmpty": false + }, + "Timestamp": 637320039038374420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1313.5949455616624, + "Y": 421.77147656668842, + "IsEmpty": false + }, + "Timestamp": 637320039038624160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1315.3727291124774, + "Y": 422.38682641651525, + "IsEmpty": false + }, + "Timestamp": 637320039038883210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1315.9641069534614, + "Y": 422.5921019509081, + "IsEmpty": false + }, + "Timestamp": 637320039039163430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1317.4809200838708, + "Y": 423.09615123087855, + "IsEmpty": false + }, + "Timestamp": 637320039039432250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1318.3234881237688, + "Y": 423.41395341797607, + "IsEmpty": false + }, + "Timestamp": 637320039039681750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1320.6729767193328, + "Y": 424.236922345278, + "IsEmpty": false + }, + "Timestamp": 637320039039968330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1322.0950483533591, + "Y": 424.76129774270231, + "IsEmpty": false + }, + "Timestamp": 637320039040198140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1326.502680875529, + "Y": 426.29852071614914, + "IsEmpty": false + }, + "Timestamp": 637320039040467950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1330.7915003777512, + "Y": 427.8573457080069, + "IsEmpty": false + }, + "Timestamp": 637320039040762080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1331.9400117523533, + "Y": 428.27084285010699, + "IsEmpty": false + }, + "Timestamp": 637320039041014870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1336.1818003353155, + "Y": 429.83192156471517, + "IsEmpty": false + }, + "Timestamp": 637320039041277640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1337.0754850955723, + "Y": 430.13286317053337, + "IsEmpty": false + }, + "Timestamp": 637320039041534690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1339.5812862065889, + "Y": 431.07389723674919, + "IsEmpty": false + }, + "Timestamp": 637320039041783910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1341.271841198648, + "Y": 431.69500109638562, + "IsEmpty": false + }, + "Timestamp": 637320039042042220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1341.8339866490442, + "Y": 431.90204159009335, + "IsEmpty": false + }, + "Timestamp": 637320039042312510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.825925052, + "Position": { + "X": 1343.5162797820897, + "Y": 432.52315693150501, + "IsEmpty": false + }, + "Timestamp": 637320039042545600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.827878237, + "Position": { + "X": 1344.8717890462076, + "Y": 433.0502034702734, + "IsEmpty": false + }, + "Timestamp": 637320039042806680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.827878237, + "Position": { + "X": 1345.4294307153498, + "Y": 433.25721164477102, + "IsEmpty": false + }, + "Timestamp": 637320039043050880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.827878237, + "Position": { + "X": 1346.542611311769, + "Y": 433.67119330513333, + "IsEmpty": false + }, + "Timestamp": 637320039043474680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.831784546, + "Position": { + "X": 1347.0981467280062, + "Y": 433.87816339654148, + "IsEmpty": false + }, + "Timestamp": 637320039043759970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.831784546, + "Position": { + "X": 1348.2070990189407, + "Y": 434.29205361567023, + "IsEmpty": false + }, + "Timestamp": 637320039044015290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.827389956, + "Position": { + "X": 1348.7605123825983, + "Y": 434.49897034893394, + "IsEmpty": false + }, + "Timestamp": 637320039044258800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814938605, + "Position": { + "X": 1350.9670396630402, + "Y": 435.32640850465685, + "IsEmpty": false + }, + "Timestamp": 637320039044820420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.81298542, + "Position": { + "X": 1352.8466903321046, + "Y": 436.05948165991521, + "IsEmpty": false + }, + "Timestamp": 637320039045085210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.796383619, + "Position": { + "X": 1359.0552191138884, + "Y": 438.44316725575959, + "IsEmpty": false + }, + "Timestamp": 637320039045355310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.798336744, + "Position": { + "X": 1365.3891560082002, + "Y": 440.93159726253964, + "IsEmpty": false + }, + "Timestamp": 637320039045623150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80492866, + "Position": { + "X": 1367.5041282272548, + "Y": 441.75261976718707, + "IsEmpty": false + }, + "Timestamp": 637320039045902270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740962863, + "Position": { + "X": 1364.6346763091997, + "Y": 440.61413650576839, + "IsEmpty": false + }, + "Timestamp": 637320039046174600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740962863, + "Position": { + "X": 1365.7788553059459, + "Y": 441.0064809646538, + "IsEmpty": false + }, + "Timestamp": 637320039046217630, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "96da50d8-5c56-4903-b4eb-9c04e866ed55", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 431.41249628578782, + "Y": 460.00566047985632, + "IsEmpty": false + }, + "Timestamp": 637320039395328840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.538323045, + "Position": { + "X": 431.41249628578782, + "Y": 460.17719484650513, + "IsEmpty": false + }, + "Timestamp": 637320039397243030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.55663383, + "Position": { + "X": 431.41249628578782, + "Y": 460.39154621538808, + "IsEmpty": false + }, + "Timestamp": 637320039397535110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573479831, + "Position": { + "X": 431.41249628578782, + "Y": 460.73454835925764, + "IsEmpty": false + }, + "Timestamp": 637320039398045180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.575432956, + "Position": { + "X": 431.41249628578782, + "Y": 461.07755050312716, + "IsEmpty": false + }, + "Timestamp": 637320039398270080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579339266, + "Position": { + "X": 431.41249628578782, + "Y": 461.42055264699673, + "IsEmpty": false + }, + "Timestamp": 637320039398508940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58519876, + "Position": { + "X": 431.41249628578782, + "Y": 462.10662352416387, + "IsEmpty": false + }, + "Timestamp": 637320039398751260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 431.41249628578782, + "Y": 462.44962566803343, + "IsEmpty": false + }, + "Timestamp": 637320039399214890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587151885, + "Position": { + "X": 431.41249628578782, + "Y": 463.13562995577252, + "IsEmpty": false + }, + "Timestamp": 637320039399431330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.59349966, + "Position": { + "X": 431.41249628578782, + "Y": 461.84932197419067, + "IsEmpty": false + }, + "Timestamp": 637320039399987710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.599847436, + "Position": { + "X": 431.41249628578782, + "Y": 459.44830696710386, + "IsEmpty": false + }, + "Timestamp": 637320039400283500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.607660055, + "Position": { + "X": 431.41249628578782, + "Y": 458.33346676274272, + "IsEmpty": false + }, + "Timestamp": 637320039400524300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619867265, + "Position": { + "X": 431.41249628578782, + "Y": 457.73322965832807, + "IsEmpty": false + }, + "Timestamp": 637320039400777610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640131235, + "Position": { + "X": 431.41249628578782, + "Y": 459.0624212315721, + "IsEmpty": false + }, + "Timestamp": 637320039401474310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64208436, + "Position": { + "X": 431.41249628578782, + "Y": 460.5201969903747, + "IsEmpty": false + }, + "Timestamp": 637320039401709900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644037545, + "Position": { + "X": 431.41249628578782, + "Y": 463.60728287462865, + "IsEmpty": false + }, + "Timestamp": 637320039401945670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644037545, + "Position": { + "X": 431.41249628578782, + "Y": 464.59340571457511, + "IsEmpty": false + }, + "Timestamp": 637320039402197920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644037545, + "Position": { + "X": 431.41249628578782, + "Y": 466.78006935277904, + "IsEmpty": false + }, + "Timestamp": 637320039402430620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64599067, + "Position": { + "X": 431.41249628578782, + "Y": 468.58091384487921, + "IsEmpty": false + }, + "Timestamp": 637320039402650550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64599067, + "Position": { + "X": 431.41249628578782, + "Y": 471.53934895414659, + "IsEmpty": false + }, + "Timestamp": 637320039402937900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64599067, + "Position": { + "X": 431.41249628578782, + "Y": 472.99712471294919, + "IsEmpty": false + }, + "Timestamp": 637320039403188430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64599067, + "Position": { + "X": 431.41249628578782, + "Y": 474.45490047175178, + "IsEmpty": false + }, + "Timestamp": 637320039403413410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.64599067, + "Position": { + "X": 431.41249628578782, + "Y": 476.2986285555142, + "IsEmpty": false + }, + "Timestamp": 637320039403669350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 431.41249628578782, + "Y": 477.37051857878504, + "IsEmpty": false + }, + "Timestamp": 637320039403935840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.647943854, + "Position": { + "X": 431.41249628578782, + "Y": 479.90018436085847, + "IsEmpty": false + }, + "Timestamp": 637320039404181150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649896979, + "Position": { + "X": 431.41249628578782, + "Y": 481.05784156745369, + "IsEmpty": false + }, + "Timestamp": 637320039404401520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.651850164, + "Position": { + "X": 431.41249628578782, + "Y": 482.17261518238678, + "IsEmpty": false + }, + "Timestamp": 637320039404615180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655756474, + "Position": { + "X": 431.41249628578782, + "Y": 485.17400047274441, + "IsEmpty": false + }, + "Timestamp": 637320039404878960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659906924, + "Position": { + "X": 431.41249628578782, + "Y": 486.84612760042995, + "IsEmpty": false + }, + "Timestamp": 637320039405082170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664545655, + "Position": { + "X": 431.41249628578782, + "Y": 488.21820276533617, + "IsEmpty": false + }, + "Timestamp": 637320039405265140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 431.41249628578782, + "Y": 491.81975857068045, + "IsEmpty": false + }, + "Timestamp": 637320039405537450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672846556, + "Position": { + "X": 431.41249628578782, + "Y": 493.14895014392454, + "IsEmpty": false + }, + "Timestamp": 637320039405789190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.67479974, + "Position": { + "X": 431.41249628578782, + "Y": 495.85015029264679, + "IsEmpty": false + }, + "Timestamp": 637320039406069240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.676752865, + "Position": { + "X": 431.41249628578782, + "Y": 497.30792605144933, + "IsEmpty": false + }, + "Timestamp": 637320039406301720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680903316, + "Position": { + "X": 431.41249628578782, + "Y": 500.30924475237896, + "IsEmpty": false + }, + "Timestamp": 637320039406546500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6828565, + "Position": { + "X": 431.41249628578782, + "Y": 502.15290624671331, + "IsEmpty": false + }, + "Timestamp": 637320039406735500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 431.41249628578782, + "Y": 503.61074859494391, + "IsEmpty": false + }, + "Timestamp": 637320039406968060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694087148, + "Position": { + "X": 431.41249628578782, + "Y": 505.84029582481003, + "IsEmpty": false + }, + "Timestamp": 637320039407222180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696284413, + "Position": { + "X": 431.41249628578782, + "Y": 507.34095517527481, + "IsEmpty": false + }, + "Timestamp": 637320039407429740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70312047, + "Position": { + "X": 431.41249628578782, + "Y": 509.61338599680312, + "IsEmpty": false + }, + "Timestamp": 637320039407670400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70727092, + "Position": { + "X": 431.41249628578782, + "Y": 510.68527602007396, + "IsEmpty": false + }, + "Timestamp": 637320039407894930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709224105, + "Position": { + "X": 431.41249628578782, + "Y": 511.71434904111067, + "IsEmpty": false + }, + "Timestamp": 637320039408135530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718013287, + "Position": { + "X": 431.41249628578782, + "Y": 513.38647616879621, + "IsEmpty": false + }, + "Timestamp": 637320039408356170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721919596, + "Position": { + "X": 431.41249628578782, + "Y": 516.00190913419408, + "IsEmpty": false + }, + "Timestamp": 637320039408717020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726070046, + "Position": { + "X": 431.41249628578782, + "Y": 516.94521497190635, + "IsEmpty": false + }, + "Timestamp": 637320039408942910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730220497, + "Position": { + "X": 431.41249628578782, + "Y": 519.68929871229079, + "IsEmpty": false + }, + "Timestamp": 637320039409203740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732173622, + "Position": { + "X": 431.41249628578782, + "Y": 521.44719302330077, + "IsEmpty": false + }, + "Timestamp": 637320039409440840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734126806, + "Position": { + "X": 431.41249628578782, + "Y": 522.39049886101304, + "IsEmpty": false + }, + "Timestamp": 637320039409667620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736079931, + "Position": { + "X": 431.41249628578782, + "Y": 525.34893397028043, + "IsEmpty": false + }, + "Timestamp": 637320039409891320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738033116, + "Position": { + "X": 431.41249628578782, + "Y": 526.54947476853783, + "IsEmpty": false + }, + "Timestamp": 637320039410154380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 431.41249628578782, + "Y": 528.56467062952095, + "IsEmpty": false + }, + "Timestamp": 637320039410392900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 431.41249628578782, + "Y": 529.63656065279179, + "IsEmpty": false + }, + "Timestamp": 637320039410634530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 431.41249628578782, + "Y": 531.13722000325663, + "IsEmpty": false + }, + "Timestamp": 637320039410846600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.74389255, + "Position": { + "X": 431.41249628578782, + "Y": 533.62400219366793, + "IsEmpty": false + }, + "Timestamp": 637320039411127010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753414214, + "Position": { + "X": 431.41249628578782, + "Y": 537.18274099677797, + "IsEmpty": false + }, + "Timestamp": 637320039411397770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753414214, + "Position": { + "X": 431.41249628578782, + "Y": 538.51193257002205, + "IsEmpty": false + }, + "Timestamp": 637320039411612620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753414214, + "Position": { + "X": 431.41249628578782, + "Y": 539.71247336827946, + "IsEmpty": false + }, + "Timestamp": 637320039411851080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.755367339, + "Position": { + "X": 431.41249628578782, + "Y": 542.4565571086639, + "IsEmpty": false + }, + "Timestamp": 637320039412060380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757320523, + "Position": { + "X": 431.41249628578782, + "Y": 543.39979635694817, + "IsEmpty": false + }, + "Timestamp": 637320039412299840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757320523, + "Position": { + "X": 431.41249628578782, + "Y": 545.41499221793129, + "IsEmpty": false + }, + "Timestamp": 637320039412572510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757320523, + "Position": { + "X": 431.41249628578782, + "Y": 546.95853516005832, + "IsEmpty": false + }, + "Timestamp": 637320039412824040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757320523, + "Position": { + "X": 431.41249628578782, + "Y": 547.90177440834259, + "IsEmpty": false + }, + "Timestamp": 637320039413061280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757320523, + "Position": { + "X": 431.41249628578782, + "Y": 549.87408667766351, + "IsEmpty": false + }, + "Timestamp": 637320039413371240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757320523, + "Position": { + "X": 431.41249628578782, + "Y": 552.18940109085406, + "IsEmpty": false + }, + "Timestamp": 637320039413660500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757320523, + "Position": { + "X": 431.41249628578782, + "Y": 554.07594617685061, + "IsEmpty": false + }, + "Timestamp": 637320039413960140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.759273648, + "Position": { + "X": 431.41249628578782, + "Y": 556.34837699837885, + "IsEmpty": false + }, + "Timestamp": 637320039414293540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.759273648, + "Position": { + "X": 431.41249628578782, + "Y": 557.89191994050589, + "IsEmpty": false + }, + "Timestamp": 637320039414595400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.759273648, + "Position": { + "X": 431.41249628578782, + "Y": 559.43546288263281, + "IsEmpty": false + }, + "Timestamp": 637320039414934970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.759273648, + "Position": { + "X": 431.41249628578782, + "Y": 560.12153375979995, + "IsEmpty": false + }, + "Timestamp": 637320039415216440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.759273648, + "Position": { + "X": 431.41249628578782, + "Y": 561.62219311026479, + "IsEmpty": false + }, + "Timestamp": 637320039415459200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.759273648, + "Position": { + "X": 431.41249628578782, + "Y": 562.47966517522468, + "IsEmpty": false + }, + "Timestamp": 637320039415803970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.759273648, + "Position": { + "X": 431.41249628578782, + "Y": 563.03708527740514, + "IsEmpty": false + }, + "Timestamp": 637320039416048620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 431.41249628578782, + "Y": 564.49486103620779, + "IsEmpty": false + }, + "Timestamp": 637320039416280250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 431.41249628578782, + "Y": 565.09516473005056, + "IsEmpty": false + }, + "Timestamp": 637320039416529750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 431.41249628578782, + "Y": 565.39528328225788, + "IsEmpty": false + }, + "Timestamp": 637320039416768240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 431.41249628578782, + "Y": 566.85305904106042, + "IsEmpty": false + }, + "Timestamp": 637320039417005090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 431.41249628578782, + "Y": 567.15317759326786, + "IsEmpty": false + }, + "Timestamp": 637320039417235180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 431.41249628578782, + "Y": 567.71059769544831, + "IsEmpty": false + }, + "Timestamp": 637320039417450340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 431.41249628578782, + "Y": 568.56813634983621, + "IsEmpty": false + }, + "Timestamp": 637320039417722790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 431.41249628578782, + "Y": 569.8114941503278, + "IsEmpty": false + }, + "Timestamp": 637320039417980960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 431.41249628578782, + "Y": 570.41179784417056, + "IsEmpty": false + }, + "Timestamp": 637320039418223460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.761226833, + "Position": { + "X": 431.41249628578782, + "Y": 570.96915135692313, + "IsEmpty": false + }, + "Timestamp": 637320039418458610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763179958, + "Position": { + "X": 431.41249628578782, + "Y": 571.5694550507659, + "IsEmpty": false + }, + "Timestamp": 637320039418711280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763179958, + "Position": { + "X": 431.41249628578782, + "Y": 571.82669001131103, + "IsEmpty": false + }, + "Timestamp": 637320039418948570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.304188609, + "Position": { + "X": 431.41249628578782, + "Y": 571.22645290689627, + "IsEmpty": false + }, + "Timestamp": 637320039419312270, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "2361a515-ce2d-4796-8671-dd14ed8d6f51", + "Points": [ + { + "Pressure": 0.172350645, + "Position": { + "X": 433.52163288616345, + "Y": 458.93530080757881, + "IsEmpty": false + }, + "Timestamp": 637320039478413040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.384023815, + "Position": { + "X": 432.86634324054705, + "Y": 458.95843366220487, + "IsEmpty": false + }, + "Timestamp": 637320039479500030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412344545, + "Position": { + "X": 432.21058220483951, + "Y": 458.9817661540161, + "IsEmpty": false + }, + "Timestamp": 637320039480075040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.553948283, + "Position": { + "X": 431.55435269673217, + "Y": 459.00529778324744, + "IsEmpty": false + }, + "Timestamp": 637320039480359900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566399634, + "Position": { + "X": 432.21058220483951, + "Y": 458.9817661540161, + "IsEmpty": false + }, + "Timestamp": 637320039481464060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.586175323, + "Position": { + "X": 434.17644822399677, + "Y": 458.9123680899034, + "IsEmpty": false + }, + "Timestamp": 637320039481755270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602532983, + "Position": { + "X": 436.262419667774, + "Y": 458.84477575623282, + "IsEmpty": false + }, + "Timestamp": 637320039482031720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61351949, + "Position": { + "X": 437.69011779080245, + "Y": 458.800724047568, + "IsEmpty": false + }, + "Timestamp": 637320039482276860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631097913, + "Position": { + "X": 440.53350609065814, + "Y": 458.71506225486405, + "IsEmpty": false + }, + "Timestamp": 637320039482541340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.63793391, + "Position": { + "X": 441.94909510696948, + "Y": 458.67346016706847, + "IsEmpty": false + }, + "Timestamp": 637320039482814100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.649408698, + "Position": { + "X": 446.69790310332576, + "Y": 458.53437232266128, + "IsEmpty": false + }, + "Timestamp": 637320039483078930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.665033937, + "Position": { + "X": 450.88034159379538, + "Y": 458.4233233404762, + "IsEmpty": false + }, + "Timestamp": 637320039483339460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.672114134, + "Position": { + "X": 453.64648348486941, + "Y": 458.35353664377908, + "IsEmpty": false + }, + "Timestamp": 637320039483601110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.682124078, + "Position": { + "X": 457.76145906246217, + "Y": 458.25530549831041, + "IsEmpty": false + }, + "Timestamp": 637320039483874930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.686518669, + "Position": { + "X": 459.85450604489318, + "Y": 458.2091211666521, + "IsEmpty": false + }, + "Timestamp": 637320039484157190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692622244, + "Position": { + "X": 464.6226334231024, + "Y": 458.10905052952791, + "IsEmpty": false + }, + "Timestamp": 637320039484408910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694575429, + "Position": { + "X": 466.05485001075749, + "Y": 458.08245505991812, + "IsEmpty": false + }, + "Timestamp": 637320039484663610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696528554, + "Position": { + "X": 470.21068991921851, + "Y": 458.00805166557666, + "IsEmpty": false + }, + "Timestamp": 637320039484927620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.698481739, + "Position": { + "X": 472.1323937893082, + "Y": 457.97390265243428, + "IsEmpty": false + }, + "Timestamp": 637320039485176170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704341173, + "Position": { + "X": 474.9046302294077, + "Y": 457.93156670040219, + "IsEmpty": false + }, + "Timestamp": 637320039485433680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706294358, + "Position": { + "X": 478.9947311473552, + "Y": 457.87497645360099, + "IsEmpty": false + }, + "Timestamp": 637320039485723120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.706294358, + "Position": { + "X": 481.00830967116707, + "Y": 457.84982172302784, + "IsEmpty": false + }, + "Timestamp": 637320039486004880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708247483, + "Position": { + "X": 485.10436389267409, + "Y": 457.80586051584328, + "IsEmpty": false + }, + "Timestamp": 637320039486279170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710200667, + "Position": { + "X": 488.50612564754704, + "Y": 457.77575612728185, + "IsEmpty": false + }, + "Timestamp": 637320039486544510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716060102, + "Position": { + "X": 490.45382392457765, + "Y": 457.76057091405676, + "IsEmpty": false + }, + "Timestamp": 637320039486844920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.716060102, + "Position": { + "X": 495.23941182169904, + "Y": 457.73361868352384, + "IsEmpty": false + }, + "Timestamp": 637320039487150820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718013287, + "Position": { + "X": 498.65599661756363, + "Y": 457.72171056963612, + "IsEmpty": false + }, + "Timestamp": 637320039487512210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 502.73020016517046, + "Y": 457.72573446960376, + "IsEmpty": false + }, + "Timestamp": 637320039487876750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 506.03791751911331, + "Y": 457.74010123818829, + "IsEmpty": false + }, + "Timestamp": 637320039488164650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719966412, + "Position": { + "X": 510.06304870073365, + "Y": 457.76539170068702, + "IsEmpty": false + }, + "Timestamp": 637320039488498780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 513.53527642045162, + "Y": 457.7931024040322, + "IsEmpty": false + }, + "Timestamp": 637320039488794250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723872721, + "Position": { + "X": 515.54770534352497, + "Y": 457.81259625064638, + "IsEmpty": false + }, + "Timestamp": 637320039489064400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725825906, + "Position": { + "X": 520.92821647170285, + "Y": 457.87497645360099, + "IsEmpty": false + }, + "Timestamp": 637320039489361380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729732215, + "Position": { + "X": 527.08463113874404, + "Y": 457.96297522930746, + "IsEmpty": false + }, + "Timestamp": 637320039489620640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733638525, + "Position": { + "X": 529.26706430690649, + "Y": 457.9964413703342, + "IsEmpty": false + }, + "Timestamp": 637320039489862280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.739986241, + "Position": { + "X": 533.94514998924251, + "Y": 458.08245505991812, + "IsEmpty": false + }, + "Timestamp": 637320039490178020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741939425, + "Position": { + "X": 537.44137514350439, + "Y": 458.15061218242585, + "IsEmpty": false + }, + "Timestamp": 637320039490438110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741939425, + "Position": { + "X": 538.89239617046735, + "Y": 458.17942641941897, + "IsEmpty": false + }, + "Timestamp": 637320039490697340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.74389255, + "Position": { + "X": 542.97431277409942, + "Y": 458.27113619935108, + "IsEmpty": false + }, + "Timestamp": 637320039490983830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.745845735, + "Position": { + "X": 544.34435529662255, + "Y": 458.30344848857311, + "IsEmpty": false + }, + "Timestamp": 637320039491241810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.74779886, + "Position": { + "X": 547.09824234208975, + "Y": 458.37066262215274, + "IsEmpty": false + }, + "Timestamp": 637320039491492220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754879057, + "Position": { + "X": 549.7578926941344, + "Y": 458.44130284176725, + "IsEmpty": false + }, + "Timestamp": 637320039491750780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752437651, + "Position": { + "X": 553.30209689667424, + "Y": 458.53437232266128, + "IsEmpty": false + }, + "Timestamp": 637320039492022300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 555.99407492783587, + "Y": 458.61260429078879, + "IsEmpty": false + }, + "Timestamp": 637320039492274080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 562.961483718002, + "Y": 458.82264858401214, + "IsEmpty": false + }, + "Timestamp": 637320039492535980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 567.13365675945295, + "Y": 458.95843366220487, + "IsEmpty": false + }, + "Timestamp": 637320039492795070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 569.23025231470672, + "Y": 459.02902805013372, + "IsEmpty": false + }, + "Timestamp": 637320039493046560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 571.33367813097141, + "Y": 459.10140567906916, + "IsEmpty": false + }, + "Timestamp": 637320039493321280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 572.65269347190713, + "Y": 459.15064145760437, + "IsEmpty": false + }, + "Timestamp": 637320039493591000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 574.10479285851079, + "Y": 459.20065979239342, + "IsEmpty": false + }, + "Timestamp": 637320039493830130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 574.89826287579695, + "Y": 459.22596116896989, + "IsEmpty": false + }, + "Timestamp": 637320039494086660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 576.88624304221423, + "Y": 459.30302813824494, + "IsEmpty": false + }, + "Timestamp": 637320039494359610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 577.54975660382388, + "Y": 459.32910307530091, + "IsEmpty": false + }, + "Timestamp": 637320039494624740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 579.01262704922829, + "Y": 459.38182887176811, + "IsEmpty": false + }, + "Timestamp": 637320039494882610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 581.00924159205397, + "Y": 459.46234987587798, + "IsEmpty": false + }, + "Timestamp": 637320039495094940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 582.34235215762897, + "Y": 459.51697958762952, + "IsEmpty": false + }, + "Timestamp": 637320039495338290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.756343961, + "Position": { + "X": 583.14655820627547, + "Y": 459.54457765691325, + "IsEmpty": false + }, + "Timestamp": 637320039495605040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758297086, + "Position": { + "X": 585.15143610375264, + "Y": 459.62849872121251, + "IsEmpty": false + }, + "Timestamp": 637320039495851720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758297086, + "Position": { + "X": 585.95927608169836, + "Y": 459.65684636224432, + "IsEmpty": false + }, + "Timestamp": 637320039496116260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758297086, + "Position": { + "X": 587.96979461484864, + "Y": 459.74300414742231, + "IsEmpty": false + }, + "Timestamp": 637320039496490540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758297086, + "Position": { + "X": 588.64071899753651, + "Y": 459.77209336395839, + "IsEmpty": false + }, + "Timestamp": 637320039496875920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.307606608, + "Position": { + "X": 588.78117309604613, + "Y": 459.77209336395839, + "IsEmpty": false + }, + "Timestamp": 637320039497160180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.307606608, + "Position": { + "X": 589.31201428655731, + "Y": 459.80136672495757, + "IsEmpty": false + }, + "Timestamp": 637320039497841450, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "6aa63726-ab6d-4f46-a60e-6422d38e305f", + "Points": [], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "a0f59ba4-7929-4dc6-8910-7d878efc4769", + "Points": [ + { + "Pressure": 0.62157625, + "Position": { + "X": 572.77359516740148, + "Y": 473.65040879927301, + "IsEmpty": false + }, + "Timestamp": 637320039526311060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636224926, + "Position": { + "X": 570.64419621097375, + "Y": 473.60255137070203, + "IsEmpty": false + }, + "Timestamp": 637320039527015490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.655512333, + "Position": { + "X": 566.08435126849031, + "Y": 473.49534121140329, + "IsEmpty": false + }, + "Timestamp": 637320039527373700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675043881, + "Position": { + "X": 559.86135986285126, + "Y": 473.36681571218861, + "IsEmpty": false + }, + "Timestamp": 637320039527605420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.6828565, + "Position": { + "X": 554.94505923842837, + "Y": 473.27423580581655, + "IsEmpty": false + }, + "Timestamp": 637320039527887390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 542.67636226560364, + "Y": 473.06666508161965, + "IsEmpty": false + }, + "Timestamp": 637320039528313130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.711421371, + "Position": { + "X": 537.13547338083947, + "Y": 472.98887447296408, + "IsEmpty": false + }, + "Timestamp": 637320039528775000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720698833, + "Position": { + "X": 530.5096598544892, + "Y": 472.90450068221793, + "IsEmpty": false + }, + "Timestamp": 637320039529040840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724605143, + "Position": { + "X": 525.3544132513249, + "Y": 472.85410381215263, + "IsEmpty": false + }, + "Timestamp": 637320039529384270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 518.81338315302742, + "Y": 472.79473330914232, + "IsEmpty": false + }, + "Timestamp": 637320039529699540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 513.98021886045763, + "Y": 472.76216501677214, + "IsEmpty": false + }, + "Timestamp": 637320039529973130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.730708778, + "Position": { + "X": 510.52483269865223, + "Y": 472.74350622291161, + "IsEmpty": false + }, + "Timestamp": 637320039530237690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 505.80238151712615, + "Y": 472.72391569523103, + "IsEmpty": false + }, + "Timestamp": 637320039530507980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 503.15874560849517, + "Y": 472.71618036634055, + "IsEmpty": false + }, + "Timestamp": 637320039530770720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 497.36400010818579, + "Y": 472.71464285732606, + "IsEmpty": false + }, + "Timestamp": 637320039531065700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736568272, + "Position": { + "X": 493.30813520560366, + "Y": 472.72624423782787, + "IsEmpty": false + }, + "Timestamp": 637320039531311050, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736568272, + "Position": { + "X": 490.04379391747818, + "Y": 472.74023908471924, + "IsEmpty": false + }, + "Timestamp": 637320039531593230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 485.88302115955543, + "Y": 472.76216501677214, + "IsEmpty": false + }, + "Timestamp": 637320039531898710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 480.53585816796067, + "Y": 472.79999423412994, + "IsEmpty": false + }, + "Timestamp": 637320039532156310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 478.55497906858045, + "Y": 472.81668238031176, + "IsEmpty": false + }, + "Timestamp": 637320039532432660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 474.98201184281885, + "Y": 472.84749450733921, + "IsEmpty": false + }, + "Timestamp": 637320039532697970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 471.83748011469498, + "Y": 472.88201987720623, + "IsEmpty": false + }, + "Timestamp": 637320039532966070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 468.22704372302911, + "Y": 472.92021816906765, + "IsEmpty": false + }, + "Timestamp": 637320039533216370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 464.37785721398757, + "Y": 472.97084760458364, + "IsEmpty": false + }, + "Timestamp": 637320039533494710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 462.10158901880459, + "Y": 472.99810215370553, + "IsEmpty": false + }, + "Timestamp": 637320039533769230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 458.66988047516048, + "Y": 473.04637012025393, + "IsEmpty": false + }, + "Timestamp": 637320039534028710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 455.96822769634821, + "Y": 473.08752061489645, + "IsEmpty": false + }, + "Timestamp": 637320039534306310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 452.42285299002958, + "Y": 473.14209501544423, + "IsEmpty": false + }, + "Timestamp": 637320039534598090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 449.05682104366258, + "Y": 473.20011654125256, + "IsEmpty": false + }, + "Timestamp": 637320039534854150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742427707, + "Position": { + "X": 446.23124029841659, + "Y": 473.24898859647897, + "IsEmpty": false + }, + "Timestamp": 637320039535118360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.749507904, + "Position": { + "X": 443.62376221507117, + "Y": 473.30002036225835, + "IsEmpty": false + }, + "Timestamp": 637320039535380800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753658354, + "Position": { + "X": 442.77855752059725, + "Y": 473.31311333922639, + "IsEmpty": false + }, + "Timestamp": 637320039535639180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.755611479, + "Position": { + "X": 440.73661346192557, + "Y": 473.35319119431807, + "IsEmpty": false + }, + "Timestamp": 637320039535911840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757564664, + "Position": { + "X": 440.13864013714874, + "Y": 473.36681571218861, + "IsEmpty": false + }, + "Timestamp": 637320039536163730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.417471588, + "Position": { + "X": 439.28082342652726, + "Y": 473.38057230886778, + "IsEmpty": false + }, + "Timestamp": 637320039536411660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.417471588, + "Position": { + "X": 438.68012402329788, + "Y": 473.39446066178891, + "IsEmpty": false + }, + "Timestamp": 637320039536463610, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "3f08668e-17a9-46a0-9f9b-a506384119bd", + "Points": [ + { + "Pressure": 0.0910505801, + "Position": { + "X": 575.72754629198562, + "Y": 491.14187720729666, + "IsEmpty": false + }, + "Timestamp": 637320039544768350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.25584802, + "Position": { + "X": 576.19112443606025, + "Y": 491.14187720729666, + "IsEmpty": false + }, + "Timestamp": 637320039545305720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534172595, + "Position": { + "X": 575.72754629198562, + "Y": 491.14187720729666, + "IsEmpty": false + }, + "Timestamp": 637320039546237300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588616788, + "Position": { + "X": 573.4243831246182, + "Y": 491.11941289643954, + "IsEmpty": false + }, + "Timestamp": 637320039546548560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617914081, + "Position": { + "X": 568.54999676698912, + "Y": 491.08173246358109, + "IsEmpty": false + }, + "Timestamp": 637320039546928890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.641840219, + "Position": { + "X": 561.71626627862167, + "Y": 491.03157140113115, + "IsEmpty": false + }, + "Timestamp": 637320039547628450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.688960075, + "Position": { + "X": 542.55872888948704, + "Y": 490.91494720213632, + "IsEmpty": false + }, + "Timestamp": 637320039548014240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701899767, + "Position": { + "X": 530.53425627496972, + "Y": 490.85935757646405, + "IsEmpty": false + }, + "Timestamp": 637320039548398180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708491623, + "Position": { + "X": 522.58357138080612, + "Y": 490.83110404347963, + "IsEmpty": false + }, + "Timestamp": 637320039548759040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712397933, + "Position": { + "X": 516.35685895121981, + "Y": 490.81467087876655, + "IsEmpty": false + }, + "Timestamp": 637320039549094220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.718745708, + "Position": { + "X": 510.52078762265648, + "Y": 490.80240329738706, + "IsEmpty": false + }, + "Timestamp": 637320039549417200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 504.69558907751053, + "Y": 490.79438065017939, + "IsEmpty": false + }, + "Timestamp": 637320039549733680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729976356, + "Position": { + "X": 498.81337202547189, + "Y": 490.79178706255226, + "IsEmpty": false + }, + "Timestamp": 637320039550120220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 491.67972847693932, + "Y": 490.7992535037389, + "IsEmpty": false + }, + "Timestamp": 637320039550440210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.746334016, + "Position": { + "X": 486.40700467119967, + "Y": 490.80869963404314, + "IsEmpty": false + }, + "Timestamp": 637320039550790240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.752437651, + "Position": { + "X": 481.82211420297773, + "Y": 490.81968967630479, + "IsEmpty": false + }, + "Timestamp": 637320039551122730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754390776, + "Position": { + "X": 477.41642861919382, + "Y": 490.83110404347963, + "IsEmpty": false + }, + "Timestamp": 637320039551441290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758297086, + "Position": { + "X": 469.78396384362037, + "Y": 490.85935757646405, + "IsEmpty": false + }, + "Timestamp": 637320039552604630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76025027, + "Position": { + "X": 461.72398919107798, + "Y": 490.89468743189872, + "IsEmpty": false + }, + "Timestamp": 637320039552860010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762203395, + "Position": { + "X": 458.7661686076691, + "Y": 490.90800405694296, + "IsEmpty": false + }, + "Timestamp": 637320039553199270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.76415658, + "Position": { + "X": 454.74788319295953, + "Y": 490.92939880391003, + "IsEmpty": false + }, + "Timestamp": 637320039553502770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.770016015, + "Position": { + "X": 451.10612348673351, + "Y": 490.94851428494468, + "IsEmpty": false + }, + "Timestamp": 637320039553821150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.767330408, + "Position": { + "X": 448.67918061145741, + "Y": 490.96463896261338, + "IsEmpty": false + }, + "Timestamp": 637320039554103950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769283593, + "Position": { + "X": 447.7665488763933, + "Y": 490.96878482118439, + "IsEmpty": false + }, + "Timestamp": 637320039554355910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769283593, + "Position": { + "X": 446.32889281425855, + "Y": 490.97721340336886, + "IsEmpty": false + }, + "Timestamp": 637320039554592520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769039452, + "Position": { + "X": 443.82631153135657, + "Y": 490.99461498013864, + "IsEmpty": false + }, + "Timestamp": 637320039554987810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.767086267, + "Position": { + "X": 442.88388275854811, + "Y": 490.9990781586294, + "IsEmpty": false + }, + "Timestamp": 637320039555208360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 442.23801831581181, + "Y": 491.00813909482684, + "IsEmpty": false + }, + "Timestamp": 637320039555426600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 440.7515553527482, + "Y": 491.01737874431933, + "IsEmpty": false + }, + "Timestamp": 637320039555480460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.572503269, + "Position": { + "X": 440.32987275527506, + "Y": 491.01737874431933, + "IsEmpty": false + }, + "Timestamp": 637320039555529300, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "3dbc728f-a9de-4e62-9f8c-465542c25ed3", + "Points": [ + { + "Pressure": 0.156237125, + "Position": { + "X": 575.67085829617679, + "Y": 507.59061745371167, + "IsEmpty": false + }, + "Timestamp": 637320039568579260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.198229954, + "Position": { + "X": 576.24654680443757, + "Y": 507.58571509467862, + "IsEmpty": false + }, + "Timestamp": 637320039569280160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.32494086, + "Position": { + "X": 577.30292203960244, + "Y": 507.58077696871658, + "IsEmpty": false + }, + "Timestamp": 637320039569640910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.440909445, + "Position": { + "X": 577.88253948832573, + "Y": 507.57580316909957, + "IsEmpty": false + }, + "Timestamp": 637320039569968620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.540764451, + "Position": { + "X": 577.40187409353064, + "Y": 507.57580316909957, + "IsEmpty": false + }, + "Timestamp": 637320039571010080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.574456394, + "Position": { + "X": 574.52345867589111, + "Y": 507.60031449789653, + "IsEmpty": false + }, + "Timestamp": 637320039571376700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.601800561, + "Position": { + "X": 568.60569379217941, + "Y": 507.63765334273427, + "IsEmpty": false + }, + "Timestamp": 637320039571788090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636957347, + "Position": { + "X": 553.22352858849047, + "Y": 507.73171957809393, + "IsEmpty": false + }, + "Timestamp": 637320039572170790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645502388, + "Position": { + "X": 549.36384355398843, + "Y": 507.75291695343287, + "IsEmpty": false + }, + "Timestamp": 637320039572477540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.66234839, + "Position": { + "X": 541.20212167690772, + "Y": 507.79102578610599, + "IsEmpty": false + }, + "Timestamp": 637320039572790850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.679926753, + "Position": { + "X": 531.69920987200874, + "Y": 507.82808244994089, + "IsEmpty": false + }, + "Timestamp": 637320039573014190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684809625, + "Position": { + "X": 527.86878211722626, + "Y": 507.84146342135142, + "IsEmpty": false + }, + "Timestamp": 637320039573246700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689204216, + "Position": { + "X": 523.63343719395914, + "Y": 507.85331501778614, + "IsEmpty": false + }, + "Timestamp": 637320039573495680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.70312047, + "Position": { + "X": 515.17033554823365, + "Y": 507.87365087668263, + "IsEmpty": false + }, + "Timestamp": 637320039573745980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.708003342, + "Position": { + "X": 511.95699726874921, + "Y": 507.87949208595387, + "IsEmpty": false + }, + "Timestamp": 637320039573978990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715815961, + "Position": { + "X": 503.93526893733173, + "Y": 507.88892722583728, + "IsEmpty": false + }, + "Timestamp": 637320039574196210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715815961, + "Position": { + "X": 501.18196611866705, + "Y": 507.89061333605127, + "IsEmpty": false + }, + "Timestamp": 637320039574428470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.717769146, + "Position": { + "X": 498.67308003134031, + "Y": 507.89061333605127, + "IsEmpty": false + }, + "Timestamp": 637320039574670420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.719722271, + "Position": { + "X": 492.32214483526519, + "Y": 507.88502471120387, + "IsEmpty": false + }, + "Timestamp": 637320039574906490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.721675456, + "Position": { + "X": 489.68945517738194, + "Y": 507.88151617412251, + "IsEmpty": false + }, + "Timestamp": 637320039575124850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723628581, + "Position": { + "X": 486.74852493224972, + "Y": 507.87728911295324, + "IsEmpty": false + }, + "Timestamp": 637320039575351390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723628581, + "Position": { + "X": 479.68655204137349, + "Y": 507.86200854043932, + "IsEmpty": false + }, + "Timestamp": 637320039575578470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.723628581, + "Position": { + "X": 477.43141344694965, + "Y": 507.85692220660565, + "IsEmpty": false + }, + "Timestamp": 637320039575825670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725581765, + "Position": { + "X": 472.13121788277368, + "Y": 507.84146342135142, + "IsEmpty": false + }, + "Timestamp": 637320039576049750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725581765, + "Position": { + "X": 468.30079012799126, + "Y": 507.82808244994089, + "IsEmpty": false + }, + "Timestamp": 637320039576297120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.725581765, + "Position": { + "X": 466.31786986222687, + "Y": 507.82082474459736, + "IsEmpty": false + }, + "Timestamp": 637320039576530800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.72753489, + "Position": { + "X": 463.03382191261312, + "Y": 507.80789694918371, + "IsEmpty": false + }, + "Timestamp": 637320039576776650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729488075, + "Position": { + "X": 459.2682920422132, + "Y": 507.79393973362414, + "IsEmpty": false + }, + "Timestamp": 637320039577134090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729488075, + "Position": { + "X": 457.95000165279771, + "Y": 507.78807122142433, + "IsEmpty": false + }, + "Timestamp": 637320039577374390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.729488075, + "Position": { + "X": 454.29608478795393, + "Y": 507.7694960962329, + "IsEmpty": false + }, + "Timestamp": 637320039577837180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.7314412, + "Position": { + "X": 450.53787266056349, + "Y": 507.74948225814245, + "IsEmpty": false + }, + "Timestamp": 637320039578170970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.282459766, + "Position": { + "X": 447.70158382778749, + "Y": 507.73535036367065, + "IsEmpty": false + }, + "Timestamp": 637320039578550650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.282459766, + "Position": { + "X": 447.28899231358469, + "Y": 507.73535036367065, + "IsEmpty": false + }, + "Timestamp": 637320039578630860, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "a3f1801b-81e5-49f5-833d-7fabbd7e37e7", + "Points": [ + { + "Pressure": 0.126695663, + "Position": { + "X": 579.58972673382664, + "Y": 526.40654668384718, + "IsEmpty": false + }, + "Timestamp": 637320039587313510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.310292214, + "Position": { + "X": 579.87467761577511, + "Y": 526.40654668384718, + "IsEmpty": false + }, + "Timestamp": 637320039588092380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.483146399, + "Position": { + "X": 579.24455040031262, + "Y": 526.42401914848824, + "IsEmpty": false + }, + "Timestamp": 637320039588430800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547356367, + "Position": { + "X": 577.07700962425622, + "Y": 526.47569062562741, + "IsEmpty": false + }, + "Timestamp": 637320039588817780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630609572, + "Position": { + "X": 566.43285375410039, + "Y": 526.71698672302318, + "IsEmpty": false + }, + "Timestamp": 637320039589259220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.664057374, + "Position": { + "X": 555.5400068495901, + "Y": 526.94211260268639, + "IsEmpty": false + }, + "Timestamp": 637320039589594330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.683344781, + "Position": { + "X": 542.45740094754456, + "Y": 527.16439940310215, + "IsEmpty": false + }, + "Timestamp": 637320039589967320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693598866, + "Position": { + "X": 532.31209808208393, + "Y": 527.30395654904146, + "IsEmpty": false + }, + "Timestamp": 637320039590456880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.726802468, + "Position": { + "X": 512.18279791637917, + "Y": 527.48327076511873, + "IsEmpty": false + }, + "Timestamp": 637320039591069520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 501.25142498905092, + "Y": 527.52206112423539, + "IsEmpty": false + }, + "Timestamp": 637320039591337690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.740474582, + "Position": { + "X": 495.44996757128166, + "Y": 527.51430925341231, + "IsEmpty": false + }, + "Timestamp": 637320039591720160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 481.98354164442458, + "Y": 527.44381743978101, + "IsEmpty": false + }, + "Timestamp": 637320039592128350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 479.2176989585156, + "Y": 527.4222890406536, + "IsEmpty": false + }, + "Timestamp": 637320039592428130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754634917, + "Position": { + "X": 467.68790191791601, + "Y": 527.30395654904146, + "IsEmpty": false + }, + "Timestamp": 637320039592807040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 461.54562675915417, + "Y": 527.22410007223971, + "IsEmpty": false + }, + "Timestamp": 637320039593140350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 458.10540942262327, + "Y": 527.17470477561233, + "IsEmpty": false + }, + "Timestamp": 637320039593474080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 454.60039128821006, + "Y": 527.12176771358077, + "IsEmpty": false + }, + "Timestamp": 637320039593840470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 452.65288709440705, + "Y": 527.08832234634065, + "IsEmpty": false + }, + "Timestamp": 637320039594144000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 451.50190150681703, + "Y": 527.06532955290709, + "IsEmpty": false + }, + "Timestamp": 637320039594457680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 449.05360342552137, + "Y": 527.02980304652829, + "IsEmpty": false + }, + "Timestamp": 637320039594801660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 448.47080617822496, + "Y": 527.01768556141087, + "IsEmpty": false + }, + "Timestamp": 637320039594856710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.765865564, + "Position": { + "X": 445.88530899990911, + "Y": 526.96784771489479, + "IsEmpty": false + }, + "Timestamp": 637320039595189060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.769771874, + "Position": { + "X": 445.29670513494688, + "Y": 526.95504790342466, + "IsEmpty": false + }, + "Timestamp": 637320039595242910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.311757088, + "Position": { + "X": 443.8685702464702, + "Y": 526.92904213801398, + "IsEmpty": false + }, + "Timestamp": 637320039595501590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.311757088, + "Position": { + "X": 443.61965152850024, + "Y": 526.92904213801398, + "IsEmpty": false + }, + "Timestamp": 637320039595582670, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "6bfc280e-bf97-4a01-bce8-e103aad826e5", + "Points": [ + { + "Pressure": 0.0702983141, + "Position": { + "X": 571.46290078394441, + "Y": 542.02855838450853, + "IsEmpty": false + }, + "Timestamp": 637320039602671490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.222156093, + "Position": { + "X": 572.66990909294532, + "Y": 541.97796229857613, + "IsEmpty": false + }, + "Timestamp": 637320039603013370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.422110319, + "Position": { + "X": 574.78118558209235, + "Y": 541.90056162162887, + "IsEmpty": false + }, + "Timestamp": 637320039603695550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 576.11135019774235, + "Y": 541.84796279664965, + "IsEmpty": false + }, + "Timestamp": 637320039604318610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.628900588, + "Position": { + "X": 574.78118558209235, + "Y": 541.90056162162887, + "IsEmpty": false + }, + "Timestamp": 637320039604796080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.659906924, + "Position": { + "X": 571.34451486240368, + "Y": 542.02855838450853, + "IsEmpty": false + }, + "Timestamp": 637320039605115730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.68676281, + "Position": { + "X": 562.31976993375395, + "Y": 542.33754737825075, + "IsEmpty": false + }, + "Timestamp": 637320039605575540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.704097033, + "Position": { + "X": 552.01856120482375, + "Y": 542.6501641897305, + "IsEmpty": false + }, + "Timestamp": 637320039605894440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 531.29402010880835, + "Y": 543.1275597730571, + "IsEmpty": false + }, + "Timestamp": 637320039606409350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.757076383, + "Position": { + "X": 510.0713741338825, + "Y": 543.40148433527202, + "IsEmpty": false + }, + "Timestamp": 637320039606857140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.764889002, + "Position": { + "X": 497.93098348866107, + "Y": 543.44443174164667, + "IsEmpty": false + }, + "Timestamp": 637320039607231550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771725059, + "Position": { + "X": 479.73365026029643, + "Y": 543.29772874649871, + "IsEmpty": false + }, + "Timestamp": 637320039607642810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773678184, + "Position": { + "X": 470.81384499717836, + "Y": 543.16405112536052, + "IsEmpty": false + }, + "Timestamp": 637320039607981430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.775631368, + "Position": { + "X": 462.46013581093058, + "Y": 543.0056208153519, + "IsEmpty": false + }, + "Timestamp": 637320039608390280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785397112, + "Position": { + "X": 454.27380481594855, + "Y": 542.81446845143978, + "IsEmpty": false + }, + "Timestamp": 637320039608724680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787594438, + "Position": { + "X": 447.44004114263441, + "Y": 542.63081905574631, + "IsEmpty": false + }, + "Timestamp": 637320039609573040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.788326859, + "Position": { + "X": 441.82174755538415, + "Y": 542.46832736031661, + "IsEmpty": false + }, + "Timestamp": 637320039609878930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.401113898, + "Position": { + "X": 440.40753313766601, + "Y": 542.42557587203532, + "IsEmpty": false + }, + "Timestamp": 637320039610245890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.401113898, + "Position": { + "X": 439.8649302049738, + "Y": 542.40388366788261, + "IsEmpty": false + }, + "Timestamp": 637320039610310230, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8f7aca78-c437-4649-a122-4782c5c3e4bd", + "Points": [ + { + "Pressure": 0.729243934, + "Position": { + "X": 575.09649175107847, + "Y": 564.59432054603406, + "IsEmpty": false + }, + "Timestamp": 637320039698327750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.747310579, + "Position": { + "X": 572.91114493424459, + "Y": 564.71690957673263, + "IsEmpty": false + }, + "Timestamp": 637320039700431410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 570.85514669745226, + "Y": 564.82548292000104, + "IsEmpty": false + }, + "Timestamp": 637320039700638640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 564.56844595256291, + "Y": 565.14302119924446, + "IsEmpty": false + }, + "Timestamp": 637320039700884390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 561.70874096376838, + "Y": 565.27973157119345, + "IsEmpty": false + }, + "Timestamp": 637320039701112750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.763912439, + "Position": { + "X": 558.17056885129966, + "Y": 565.43963438104561, + "IsEmpty": false + }, + "Timestamp": 637320039701353190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.771725059, + "Position": { + "X": 548.26912582817863, + "Y": 565.83622432904485, + "IsEmpty": false + }, + "Timestamp": 637320039701623000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.779537678, + "Position": { + "X": 539.21693221835221, + "Y": 566.12972658852857, + "IsEmpty": false + }, + "Timestamp": 637320039701878290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791012406, + "Position": { + "X": 532.22868576346923, + "Y": 566.31034234318713, + "IsEmpty": false + }, + "Timestamp": 637320039702154380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.800289929, + "Position": { + "X": 523.93213220583232, + "Y": 566.47037393413643, + "IsEmpty": false + }, + "Timestamp": 637320039702400730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.80492866, + "Position": { + "X": 519.68140639112346, + "Y": 566.52684210792881, + "IsEmpty": false + }, + "Timestamp": 637320039702653890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.811032295, + "Position": { + "X": 510.55969672070682, + "Y": 566.58902895774008, + "IsEmpty": false + }, + "Timestamp": 637320039702912420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.81298542, + "Position": { + "X": 507.1328975020146, + "Y": 566.59275765211839, + "IsEmpty": false + }, + "Timestamp": 637320039703142720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.81298542, + "Position": { + "X": 503.71600867241409, + "Y": 566.58487580796714, + "IsEmpty": false + }, + "Timestamp": 637320039703368550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 498.25955386737672, + "Y": 566.5776337064633, + "IsEmpty": false + }, + "Timestamp": 637320039703609020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 495.62475938678648, + "Y": 566.58647864868681, + "IsEmpty": false + }, + "Timestamp": 637320039703866890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 490.10286731236488, + "Y": 566.59132231692865, + "IsEmpty": false + }, + "Timestamp": 637320039704095720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 487.99588577485684, + "Y": 566.58586362923779, + "IsEmpty": false + }, + "Timestamp": 637320039704332160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 484.4362057345669, + "Y": 566.56720309594402, + "IsEmpty": false + }, + "Timestamp": 637320039704577670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 481.10553047049251, + "Y": 566.53399928108138, + "IsEmpty": false + }, + "Timestamp": 637320039704795870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 480.31859360887654, + "Y": 566.52684210792881, + "IsEmpty": false + }, + "Timestamp": 637320039705007600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 475.39839442542177, + "Y": 566.45948384883332, + "IsEmpty": false + }, + "Timestamp": 637320039705242190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 473.26699099198072, + "Y": 566.42341335919104, + "IsEmpty": false + }, + "Timestamp": 637320039705471790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 471.25398827078578, + "Y": 566.38468455507564, + "IsEmpty": false + }, + "Timestamp": 637320039705699090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 467.77131423653083, + "Y": 566.31034234318713, + "IsEmpty": false + }, + "Timestamp": 637320039705922480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820798039, + "Position": { + "X": 464.95505454002193, + "Y": 566.24256004720792, + "IsEmpty": false + }, + "Timestamp": 637320039706174860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820798039, + "Position": { + "X": 463.60650630406525, + "Y": 566.20770372743141, + "IsEmpty": false + }, + "Timestamp": 637320039706421940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820798039, + "Position": { + "X": 459.98382105966778, + "Y": 566.10601606783996, + "IsEmpty": false + }, + "Timestamp": 637320039706662380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 455.79967451807255, + "Y": 565.97535765087787, + "IsEmpty": false + }, + "Timestamp": 637320039706956840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 453.76627840950181, + "Y": 565.90737530138745, + "IsEmpty": false + }, + "Timestamp": 637320039707172920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 452.4095619777072, + "Y": 565.86029204769329, + "IsEmpty": false + }, + "Timestamp": 637320039707406120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 450.92713050371293, + "Y": 565.80575398528435, + "IsEmpty": false + }, + "Timestamp": 637320039707647520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 449.44341609498116, + "Y": 565.74920119682133, + "IsEmpty": false + }, + "Timestamp": 637320039707870270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 448.08378578412453, + "Y": 565.69743873240532, + "IsEmpty": false + }, + "Timestamp": 637320039708101630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 446.04280147411066, + "Y": 565.61720899317538, + "IsEmpty": false + }, + "Timestamp": 637320039708332550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 445.23640380985904, + "Y": 565.58249803356819, + "IsEmpty": false + }, + "Timestamp": 637320039708568910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 444.55539557182658, + "Y": 565.5546052364914, + "IsEmpty": false + }, + "Timestamp": 637320039708754710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 443.19279557590562, + "Y": 565.49779813259033, + "IsEmpty": false + }, + "Timestamp": 637320039708961100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 442.51120789657421, + "Y": 565.46888543537193, + "IsEmpty": false + }, + "Timestamp": 637320039709193600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.590814054, + "Position": { + "X": 441.82943114870034, + "Y": 565.43963438104561, + "IsEmpty": false + }, + "Timestamp": 637320039709640290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.590814054, + "Position": { + "X": 441.70328954125415, + "Y": 565.4316294135682, + "IsEmpty": false + }, + "Timestamp": 637320039709979200, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "40e6861d-bc50-491c-9f92-e21798c73d38", + "Points": [ + { + "Pressure": 0.108873121, + "Position": { + "X": 1479.9888002451053, + "Y": 331.9253837379199, + "IsEmpty": false + }, + "Timestamp": 637320040052996550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.372304887, + "Position": { + "X": 1479.1361427806298, + "Y": 332.11426030757241, + "IsEmpty": false + }, + "Timestamp": 637320040054009110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.386709392, + "Position": { + "X": 1479.1361427806298, + "Y": 332.49186680357798, + "IsEmpty": false + }, + "Timestamp": 637320040054741700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.453849077, + "Position": { + "X": 1478.8518747447049, + "Y": 333.43610300854101, + "IsEmpty": false + }, + "Timestamp": 637320040055701640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480216682, + "Position": { + "X": 1477.3360229586042, + "Y": 332.30299023392547, + "IsEmpty": false + }, + "Timestamp": 637320040056214680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.497306794, + "Position": { + "X": 1474.6833189937527, + "Y": 332.11426030757241, + "IsEmpty": false + }, + "Timestamp": 637320040056458840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526848257, + "Position": { + "X": 1475.1570501725278, + "Y": 331.83094545309365, + "IsEmpty": false + }, + "Timestamp": 637320040056955390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.555901408, + "Position": { + "X": 1481.5993102809814, + "Y": 333.81385614784597, + "IsEmpty": false + }, + "Timestamp": 637320040057441920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566155493, + "Position": { + "X": 1486.5257919249841, + "Y": 337.11860954356689, + "IsEmpty": false + }, + "Timestamp": 637320040057679710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 1491.8312731763369, + "Y": 341.27316085942459, + "IsEmpty": false + }, + "Timestamp": 637320040057907550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577386141, + "Position": { + "X": 1518.2636545750765, + "Y": 366.48378360904951, + "IsEmpty": false + }, + "Timestamp": 637320040058136930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.581780732, + "Position": { + "X": 1529.6324696491827, + "Y": 375.26507766489613, + "IsEmpty": false + }, + "Timestamp": 637320040058412320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.588616788, + "Position": { + "X": 1552.8437576545202, + "Y": 396.51002566831585, + "IsEmpty": false + }, + "Timestamp": 637320040058643620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.591058195, + "Position": { + "X": 1561.84406347805, + "Y": 403.87489209506822, + "IsEmpty": false + }, + "Timestamp": 637320040058900270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.594964504, + "Position": { + "X": 1575.6760460525077, + "Y": 415.11114162649898, + "IsEmpty": false + }, + "Timestamp": 637320040059134610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.598870814, + "Position": { + "X": 1582.7815738042366, + "Y": 420.87085049780399, + "IsEmpty": false + }, + "Timestamp": 637320040059397370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.598870814, + "Position": { + "X": 1586.4763983764137, + "Y": 423.42024425821438, + "IsEmpty": false + }, + "Timestamp": 637320040059620300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1592.2555374848919, + "Y": 427.00831250841401, + "IsEmpty": false + }, + "Timestamp": 637320040059966730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1600.7821121296465, + "Y": 432.48470652524031, + "IsEmpty": false + }, + "Timestamp": 637320040060239000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1605.045399452024, + "Y": 435.22297685530316, + "IsEmpty": false + }, + "Timestamp": 637320040060504910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1608.0771030242254, + "Y": 437.6779323308873, + "IsEmpty": false + }, + "Timestamp": 637320040060771260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 1610.3508807033766, + "Y": 439.56640474081337, + "IsEmpty": false + }, + "Timestamp": 637320040061006350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608636618, + "Position": { + "X": 1610.8245385605021, + "Y": 440.03844952164513, + "IsEmpty": false + }, + "Timestamp": 637320040061261680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610589743, + "Position": { + "X": 1610.0666126674516, + "Y": 439.84957295199268, + "IsEmpty": false + }, + "Timestamp": 637320040062114330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610589743, + "Position": { + "X": 1609.3087600960509, + "Y": 439.66084302563956, + "IsEmpty": false + }, + "Timestamp": 637320040062403140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610589743, + "Position": { + "X": 1608.6455657744257, + "Y": 439.28308988633461, + "IsEmpty": false + }, + "Timestamp": 637320040062843140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612542927, + "Position": { + "X": 1607.9823714528004, + "Y": 438.90548339032904, + "IsEmpty": false + }, + "Timestamp": 637320040063062650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612542927, + "Position": { + "X": 1606.8455192740496, + "Y": 437.7723706157135, + "IsEmpty": false + }, + "Timestamp": 637320040063317860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614496052, + "Position": { + "X": 1606.0875933809991, + "Y": 436.45038127144551, + "IsEmpty": false + }, + "Timestamp": 637320040063531740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614496052, + "Position": { + "X": 1605.7085937736492, + "Y": 435.78945992096124, + "IsEmpty": false + }, + "Timestamp": 637320040063757880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.603509545, + "Position": { + "X": 1605.3296674879489, + "Y": 435.22297685530316, + "IsEmpty": false + }, + "Timestamp": 637320040063994300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.488029301, + "Position": { + "X": 1602.1085007728971, + "Y": 433.8066958695083, + "IsEmpty": false + }, + "Timestamp": 637320040064248420, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "fb91e56c-b0f0-476a-9ec5-e46174b34771", + "Points": [ + { + "Pressure": 0.107164107, + "Position": { + "X": 1463.8829666698468, + "Y": 335.23013713364082, + "IsEmpty": false + }, + "Timestamp": 637320040083227730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.155016407, + "Position": { + "X": 1465.4935500273725, + "Y": 335.51345198811953, + "IsEmpty": false + }, + "Timestamp": 637320040083504170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.226306558, + "Position": { + "X": 1466.251475920423, + "Y": 335.60789027294578, + "IsEmpty": false + }, + "Timestamp": 637320040083733230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.306630045, + "Position": { + "X": 1466.7252070991981, + "Y": 335.98549676895135, + "IsEmpty": false + }, + "Timestamp": 637320040083977600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.34129855, + "Position": { + "X": 1467.1988649563236, + "Y": 336.36324990825636, + "IsEmpty": false + }, + "Timestamp": 637320040084200690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.408194095, + "Position": { + "X": 1466.4409390632732, + "Y": 338.53489052936175, + "IsEmpty": false + }, + "Timestamp": 637320040084694470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.426749051, + "Position": { + "X": 1464.6408925628971, + "Y": 342.21739706438763, + "IsEmpty": false + }, + "Timestamp": 637320040084933430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.457999527, + "Position": { + "X": 1449.5772529166138, + "Y": 358.45799583181287, + "IsEmpty": false + }, + "Timestamp": 637320040085230090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.46703288, + "Position": { + "X": 1413.0076768547688, + "Y": 387.16224854681116, + "IsEmpty": false + }, + "Timestamp": 637320040085472700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.468986034, + "Position": { + "X": 1395.6702595293345, + "Y": 400.38126212969479, + "IsEmpty": false + }, + "Timestamp": 637320040085698290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.470939189, + "Position": { + "X": 1378.6170735790001, + "Y": 412.27843301160988, + "IsEmpty": false + }, + "Timestamp": 637320040085970800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.433340967, + "Position": { + "X": 1345.0791644285318, + "Y": 436.54481955627176, + "IsEmpty": false + }, + "Timestamp": 637320040086211840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.419180602, + "Position": { + "X": 1334.563043479726, + "Y": 444.00412426785039, + "IsEmpty": false + }, + "Timestamp": 637320040086458470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.40209049, + "Position": { + "X": 1317.5098575293919, + "Y": 454.29613759431805, + "IsEmpty": false + }, + "Timestamp": 637320040086694870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.384756237, + "Position": { + "X": 1311.8254499923387, + "Y": 455.42925036893359, + "IsEmpty": false + }, + "Timestamp": 637320040086937360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.379140913, + "Position": { + "X": 1309.9306719205376, + "Y": 455.24037379928109, + "IsEmpty": false + }, + "Timestamp": 637320040087148680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.370595872, + "Position": { + "X": 1308.699051509537, + "Y": 455.05149722962864, + "IsEmpty": false + }, + "Timestamp": 637320040087391810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.38597697, + "Position": { + "X": 1312.7728390282393, + "Y": 450.61377770259162, + "IsEmpty": false + }, + "Timestamp": 637320040087735020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.390859842, + "Position": { + "X": 1315.1413482788155, + "Y": 449.29178835832357, + "IsEmpty": false + }, + "Timestamp": 637320040087965890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.160631716, + "Position": { + "X": 1316.7519316363414, + "Y": 448.72530529266555, + "IsEmpty": false + }, + "Timestamp": 637320040087979530, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "c57a4819-6287-471d-a518-02b339377fb8", + "Points": [ + { + "Pressure": 0.142320901, + "Position": { + "X": 1484.3468191389079, + "Y": 328.43175377254653, + "IsEmpty": false + }, + "Timestamp": 637320040095028790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.156237125, + "Position": { + "X": 1483.9678195315578, + "Y": 329.28155169268331, + "IsEmpty": false + }, + "Timestamp": 637320040095058650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.180895701, + "Position": { + "X": 1479.32560592348, + "Y": 335.41901370329333, + "IsEmpty": false + }, + "Timestamp": 637320040095314630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.291981369, + "Position": { + "X": 1470.7990312787254, + "Y": 343.35036319570372, + "IsEmpty": false + }, + "Timestamp": 637320040095838430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.358632803, + "Position": { + "X": 1462.9355776339462, + "Y": 352.22609553637659, + "IsEmpty": false + }, + "Timestamp": 637320040096111550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.412100405, + "Position": { + "X": 1447.3982434697127, + "Y": 367.33358152918629, + "IsEmpty": false + }, + "Timestamp": 637320040096451210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.428213924, + "Position": { + "X": 1434.7978446454308, + "Y": 376.87023522034349, + "IsEmpty": false + }, + "Timestamp": 637320040096739630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.444571614, + "Position": { + "X": 1399.5545839051867, + "Y": 407.84056684127341, + "IsEmpty": false + }, + "Timestamp": 637320040096995190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.448477924, + "Position": { + "X": 1373.5958603635725, + "Y": 429.84087448000366, + "IsEmpty": false + }, + "Timestamp": 637320040097338990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.450431079, + "Position": { + "X": 1345.8370903215823, + "Y": 448.53642872301305, + "IsEmpty": false + }, + "Timestamp": 637320040097654280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.447745472, + "Position": { + "X": 1341.479034766955, + "Y": 451.18026076824964, + "IsEmpty": false + }, + "Timestamp": 637320040097917130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.431387812, + "Position": { + "X": 1328.6891727998229, + "Y": 460.71691445940684, + "IsEmpty": false + }, + "Timestamp": 637320040098250610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.345937282, + "Position": { + "X": 1326.794358067197, + "Y": 461.37783580989111, + "IsEmpty": false + }, + "Timestamp": 637320040098657320, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "9aa35231-5e08-4134-aaa7-1ac1938b44e2", + "Points": [ + { + "Pressure": 0.0280613415, + "Position": { + "X": 1475.251781743953, + "Y": 333.2472264388885, + "IsEmpty": false + }, + "Timestamp": 637320040109897500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.030502785, + "Position": { + "X": 1473.167467207652, + "Y": 332.01982202274615, + "IsEmpty": false + }, + "Timestamp": 637320040109953560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.15403983, + "Position": { + "X": 1470.1358369571001, + "Y": 330.41466446729879, + "IsEmpty": false + }, + "Timestamp": 637320040110161940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.267566949, + "Position": { + "X": 1468.6199851709994, + "Y": 330.22578789764634, + "IsEmpty": false + }, + "Timestamp": 637320040110388290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.46727702, + "Position": { + "X": 1487.2837178180346, + "Y": 336.0799350537776, + "IsEmpty": false + }, + "Timestamp": 637320040110992420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.488029301, + "Position": { + "X": 1495.0524398913885, + "Y": 340.42336293928781, + "IsEmpty": false + }, + "Timestamp": 637320040111198290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522697806, + "Position": { + "X": 1508.9791540372714, + "Y": 350.71537626575548, + "IsEmpty": false + }, + "Timestamp": 637320040111433980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531731129, + "Position": { + "X": 1537.1169236866117, + "Y": 372.43236905000703, + "IsEmpty": false + }, + "Timestamp": 637320040111649870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.533684313, + "Position": { + "X": 1552.5595629402449, + "Y": 382.6299440916485, + "IsEmpty": false + }, + "Timestamp": 637320040111899610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.535637438, + "Position": { + "X": 1577.3813609814588, + "Y": 400.5701386993473, + "IsEmpty": false + }, + "Timestamp": 637320040112145320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537590623, + "Position": { + "X": 1581.0762588752855, + "Y": 404.34693687590004, + "IsEmpty": false + }, + "Timestamp": 637320040112379450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530754566, + "Position": { + "X": 1587.8027870196643, + "Y": 409.72903925119948, + "IsEmpty": false + }, + "Timestamp": 637320040112667150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.51586175, + "Position": { + "X": 1590.2660278416656, + "Y": 410.95659031064127, + "IsEmpty": false + }, + "Timestamp": 637320040112940810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.445792317, + "Position": { + "X": 1596.3293616644189, + "Y": 413.41154578622536, + "IsEmpty": false + }, + "Timestamp": 637320040113255740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.224353403, + "Position": { + "X": 1598.2241397362202, + "Y": 413.88359056705718, + "IsEmpty": false + }, + "Timestamp": 637320040113500560, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "aa25058c-aa0f-4ce3-9539-2541e389f46b", + "Points": [ + { + "Pressure": 0.21092546, + "Position": { + "X": 1482.830967352807, + "Y": 329.0926751230308, + "IsEmpty": false + }, + "Timestamp": 637320040119501630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.257312894, + "Position": { + "X": 1479.7045322091803, + "Y": 329.37598997750956, + "IsEmpty": false + }, + "Timestamp": 637320040121183040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49559778, + "Position": { + "X": 1580.0340649463103, + "Y": 407.74612855644716, + "IsEmpty": false + }, + "Timestamp": 637320040121454660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.521721244, + "Position": { + "X": 1593.5819261281424, + "Y": 419.45442286870974, + "IsEmpty": false + }, + "Timestamp": 637320040121689860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.518547356, + "Position": { + "X": 1601.7295011655472, + "Y": 429.08551484469314, + "IsEmpty": false + }, + "Timestamp": 637320040122015300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.44701305, + "Position": { + "X": 1602.5821586300226, + "Y": 432.20139167076155, + "IsEmpty": false + }, + "Timestamp": 637320040122464260, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "73e574c2-d179-41c3-952e-aa9f720a98be", + "Points": [ + { + "Pressure": 0.107896544, + "Position": { + "X": 1356.6855093908625, + "Y": 439.58677970726637, + "IsEmpty": false + }, + "Timestamp": 637320040524590940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.502433836, + "Position": { + "X": 1356.6855093908625, + "Y": 438.9991041577976, + "IsEmpty": false + }, + "Timestamp": 637320040526126290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544670761, + "Position": { + "X": 1356.6855093908625, + "Y": 438.50924775880998, + "IsEmpty": false + }, + "Timestamp": 637320040526388720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.577142, + "Position": { + "X": 1356.6855093908625, + "Y": 439.09692330827869, + "IsEmpty": false + }, + "Timestamp": 637320040526865920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 1356.6855093908625, + "Y": 443.79878409197795, + "IsEmpty": false + }, + "Timestamp": 637320040527153420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610833883, + "Position": { + "X": 1356.6855093908625, + "Y": 447.91281719689198, + "IsEmpty": false + }, + "Timestamp": 637320040527414790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.617425799, + "Position": { + "X": 1356.6855093908625, + "Y": 453.2023535300599, + "IsEmpty": false + }, + "Timestamp": 637320040527688520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62597084, + "Position": { + "X": 1356.6855093908625, + "Y": 461.23462930960937, + "IsEmpty": false + }, + "Timestamp": 637320040527998990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630853713, + "Position": { + "X": 1356.6855093908625, + "Y": 472.00964453554036, + "IsEmpty": false + }, + "Timestamp": 637320040528274960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630853713, + "Position": { + "X": 1356.6855093908625, + "Y": 475.92773508085935, + "IsEmpty": false + }, + "Timestamp": 637320040528527900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630853713, + "Position": { + "X": 1356.6855093908625, + "Y": 483.17639275134502, + "IsEmpty": false + }, + "Timestamp": 637320040528816510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630853713, + "Position": { + "X": 1356.6855093908625, + "Y": 492.28620047935084, + "IsEmpty": false + }, + "Timestamp": 637320040529082610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630853713, + "Position": { + "X": 1356.6855093908625, + "Y": 495.81255803479615, + "IsEmpty": false + }, + "Timestamp": 637320040529313870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630853713, + "Position": { + "X": 1356.6855093908625, + "Y": 504.92221363348557, + "IsEmpty": false + }, + "Timestamp": 637320040529592200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630853713, + "Position": { + "X": 1356.6855093908625, + "Y": 508.3507520384498, + "IsEmpty": false + }, + "Timestamp": 637320040529858020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632806897, + "Position": { + "X": 1356.6855093908625, + "Y": 512.26884258376879, + "IsEmpty": false + }, + "Timestamp": 637320040530087070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.634760022, + "Position": { + "X": 1356.6855093908625, + "Y": 516.48084696848036, + "IsEmpty": false + }, + "Timestamp": 637320040530349140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636713207, + "Position": { + "X": 1356.6855093908625, + "Y": 523.23980036929481, + "IsEmpty": false + }, + "Timestamp": 637320040530590260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 526.17833024595495, + "IsEmpty": false + }, + "Timestamp": 637320040530833760, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 530.29251548018544, + "IsEmpty": false + }, + "Timestamp": 637320040531077110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 536.46364120221472, + "IsEmpty": false + }, + "Timestamp": 637320040531360780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 544.78967869184032, + "IsEmpty": false + }, + "Timestamp": 637320040531640730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 547.53241813822183, + "IsEmpty": false + }, + "Timestamp": 637320040531899060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 553.50760130065601, + "IsEmpty": false + }, + "Timestamp": 637320040532138740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 558.20946208435521, + "IsEmpty": false + }, + "Timestamp": 637320040532386890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 563.49899841752324, + "IsEmpty": false + }, + "Timestamp": 637320040532636090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 565.65391018511957, + "IsEmpty": false + }, + "Timestamp": 637320040532874700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 568.49462091129863, + "IsEmpty": false + }, + "Timestamp": 637320040533109330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 572.11894974654138, + "IsEmpty": false + }, + "Timestamp": 637320040533387880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 574.17604236365662, + "IsEmpty": false + }, + "Timestamp": 637320040533639490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 574.86168919292288, + "IsEmpty": false + }, + "Timestamp": 637320040533892460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 576.33095413125295, + "IsEmpty": false + }, + "Timestamp": 637320040534106860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 579.17166485743201, + "IsEmpty": false + }, + "Timestamp": 637320040534353900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 581.03281491495227, + "IsEmpty": false + }, + "Timestamp": 637320040534595950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 582.99193625226997, + "IsEmpty": false + }, + "Timestamp": 637320040534843080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 584.9509054602712, + "IsEmpty": false + }, + "Timestamp": 637320040535122820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 586.9100267975889, + "IsEmpty": false + }, + "Timestamp": 637320040535350170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 587.69364490665271, + "IsEmpty": false + }, + "Timestamp": 637320040535579950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 591.22000246209802, + "IsEmpty": false + }, + "Timestamp": 637320040535836630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 592.78723868022564, + "IsEmpty": false + }, + "Timestamp": 637320040536069850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 594.25665574787206, + "IsEmpty": false + }, + "Timestamp": 637320040536299280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 597.58707074372239, + "IsEmpty": false + }, + "Timestamp": 637320040536540000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 599.74198251131872, + "IsEmpty": false + }, + "Timestamp": 637320040536778020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 601.99501768802895, + "IsEmpty": false + }, + "Timestamp": 637320040537035720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 603.36631134656147, + "IsEmpty": false + }, + "Timestamp": 637320040537253150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 604.0521103051442, + "IsEmpty": false + }, + "Timestamp": 637320040537504350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 605.32543268387917, + "IsEmpty": false + }, + "Timestamp": 637320040537759360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 606.59890719193072, + "IsEmpty": false + }, + "Timestamp": 637320040537985170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1356.6855093908625, + "Y": 607.77425829086815, + "IsEmpty": false + }, + "Timestamp": 637320040538272490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 1356.6855093908625, + "Y": 608.36208596965332, + "IsEmpty": false + }, + "Timestamp": 637320040538503720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 1356.6855093908625, + "Y": 610.22323602717347, + "IsEmpty": false + }, + "Timestamp": 637320040538733900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640863657, + "Position": { + "X": 1356.6855093908625, + "Y": 610.90888285643973, + "IsEmpty": false + }, + "Timestamp": 637320040538961830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1356.6855093908625, + "Y": 612.08423395537727, + "IsEmpty": false + }, + "Timestamp": 637320040539204500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.642816842, + "Position": { + "X": 1356.6855093908625, + "Y": 612.67206163416245, + "IsEmpty": false + }, + "Timestamp": 637320040539433540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644769967, + "Position": { + "X": 1356.6855093908625, + "Y": 613.35770846342871, + "IsEmpty": false + }, + "Timestamp": 637320040539665820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.644769967, + "Position": { + "X": 1356.6855093908625, + "Y": 613.94538401289742, + "IsEmpty": false + }, + "Timestamp": 637320040540395600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.568596959, + "Position": { + "X": 1356.6855093908625, + "Y": 614.23929785229006, + "IsEmpty": false + }, + "Timestamp": 637320040540699030, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "f9e86129-9728-476d-93f3-739e4552d3f6", + "Points": [ + { + "Pressure": 0.167711914, + "Position": { + "X": 1352.361005376632, + "Y": 610.51699773724965, + "IsEmpty": false + }, + "Timestamp": 637320040551154340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.309315622, + "Position": { + "X": 1352.361005376632, + "Y": 610.32105517765456, + "IsEmpty": false + }, + "Timestamp": 637320040552369500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.38597697, + "Position": { + "X": 1352.361005376632, + "Y": 614.72900212196123, + "IsEmpty": false + }, + "Timestamp": 637320040552826720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.448722064, + "Position": { + "X": 1352.361005376632, + "Y": 620.9001278439905, + "IsEmpty": false + }, + "Timestamp": 637320040553096330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.488273442, + "Position": { + "X": 1352.361005376632, + "Y": 623.0551917409033, + "IsEmpty": false + }, + "Timestamp": 637320040553403500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.490959018, + "Position": { + "X": 1352.361005376632, + "Y": 623.74083857016956, + "IsEmpty": false + }, + "Timestamp": 637320040553678700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510490596, + "Position": { + "X": 1352.361005376632, + "Y": 611.20264456651591, + "IsEmpty": false + }, + "Timestamp": 637320040554724000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510490596, + "Position": { + "X": 1352.361005376632, + "Y": 608.55787639993196, + "IsEmpty": false + }, + "Timestamp": 637320040554743100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.512443721, + "Position": { + "X": 1352.361005376632, + "Y": 605.71731780306936, + "IsEmpty": false + }, + "Timestamp": 637320040554997690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.514396906, + "Position": { + "X": 1352.361005376632, + "Y": 587.49770234705761, + "IsEmpty": false + }, + "Timestamp": 637320040555336660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.516350031, + "Position": { + "X": 1352.361005376632, + "Y": 573.68618596466899, + "IsEmpty": false + }, + "Timestamp": 637320040555661490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.516350031, + "Position": { + "X": 1352.361005376632, + "Y": 563.10711329833305, + "IsEmpty": false + }, + "Timestamp": 637320040555937640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.516350031, + "Position": { + "X": 1352.361005376632, + "Y": 550.47110014419843, + "IsEmpty": false + }, + "Timestamp": 637320040556260890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.518303216, + "Position": { + "X": 1352.361005376632, + "Y": 540.96940729700236, + "IsEmpty": false + }, + "Timestamp": 637320040556582540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.518303216, + "Position": { + "X": 1352.361005376632, + "Y": 529.70468780140027, + "IsEmpty": false + }, + "Timestamp": 637320040556982280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 522.45603013091454, + "IsEmpty": false + }, + "Timestamp": 637320040557375570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 513.83607880189641, + "IsEmpty": false + }, + "Timestamp": 637320040557682900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 506.29365942133455, + "IsEmpty": false + }, + "Timestamp": 637320040557996450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 498.45732620138017, + "IsEmpty": false + }, + "Timestamp": 637320040558326230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 492.0902579197558, + "IsEmpty": false + }, + "Timestamp": 637320040558634060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 486.80072158658783, + "IsEmpty": false + }, + "Timestamp": 637320040558912060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 479.16033092622848, + "IsEmpty": false + }, + "Timestamp": 637320040559201470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 470.54037959721029, + "IsEmpty": false + }, + "Timestamp": 637320040559518170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 461.52854314900196, + "IsEmpty": false + }, + "Timestamp": 637320040559809780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 458.39391858343032, + "IsEmpty": false + }, + "Timestamp": 637320040560099720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520256341, + "Position": { + "X": 1352.361005376632, + "Y": 452.81062054018622, + "IsEmpty": false + }, + "Timestamp": 637320040560421660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 443.99472665157299, + "IsEmpty": false + }, + "Timestamp": 637320040560721330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 440.46836909612767, + "IsEmpty": false + }, + "Timestamp": 637320040560978060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 439.97851269714005, + "IsEmpty": false + }, + "Timestamp": 637320040561347190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 440.86010208600135, + "IsEmpty": false + }, + "Timestamp": 637320040561912250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 445.26804903030796, + "IsEmpty": false + }, + "Timestamp": 637320040562275080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 448.79440658575328, + "IsEmpty": false + }, + "Timestamp": 637320040562514570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 457.51232919456902, + "IsEmpty": false + }, + "Timestamp": 637320040562830970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 462.21418997826822, + "IsEmpty": false + }, + "Timestamp": 637320040563034090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 468.28734442050001, + "IsEmpty": false + }, + "Timestamp": 637320040563233570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 475.14411697179554, + "IsEmpty": false + }, + "Timestamp": 637320040563472130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 497.28182297312622, + "IsEmpty": false + }, + "Timestamp": 637320040563710200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 508.15480947885476, + "IsEmpty": false + }, + "Timestamp": 637320040563943420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522209525, + "Position": { + "X": 1352.361005376632, + "Y": 520.00720452392568, + "IsEmpty": false + }, + "Timestamp": 637320040564164360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528557241, + "Position": { + "X": 1352.361005376632, + "Y": 546.84677130895557, + "IsEmpty": false + }, + "Timestamp": 637320040564395480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530510426, + "Position": { + "X": 1352.361005376632, + "Y": 556.93598757630377, + "IsEmpty": false + }, + "Timestamp": 637320040564637070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532463551, + "Position": { + "X": 1352.361005376632, + "Y": 579.17166485743201, + "IsEmpty": false + }, + "Timestamp": 637320040564874510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534416735, + "Position": { + "X": 1352.361005376632, + "Y": 586.02843740872754, + "IsEmpty": false + }, + "Timestamp": 637320040565088470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534416735, + "Position": { + "X": 1352.361005376632, + "Y": 591.80767801156674, + "IsEmpty": false + }, + "Timestamp": 637320040565293690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534416735, + "Position": { + "X": 1352.361005376632, + "Y": 596.99939519425357, + "IsEmpty": false + }, + "Timestamp": 637320040565498770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 1352.361005376632, + "Y": 607.6762870110706, + "IsEmpty": false + }, + "Timestamp": 637320040565742870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 1352.361005376632, + "Y": 610.02729346757849, + "IsEmpty": false + }, + "Timestamp": 637320040565965260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 1352.361005376632, + "Y": 611.49655840590856, + "IsEmpty": false + }, + "Timestamp": 637320040566191730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 1352.361005376632, + "Y": 615.70856279062002, + "IsEmpty": false + }, + "Timestamp": 637320040566408640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 1352.361005376632, + "Y": 616.29639046940531, + "IsEmpty": false + }, + "Timestamp": 637320040566716190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 1352.361005376632, + "Y": 617.27579900874764, + "IsEmpty": false + }, + "Timestamp": 637320040566976800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 1352.361005376632, + "Y": 618.05956924712791, + "IsEmpty": false + }, + "Timestamp": 637320040567177070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53221941, + "Position": { + "X": 1352.361005376632, + "Y": 617.27579900874764, + "IsEmpty": false + }, + "Timestamp": 637320040567401910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 1352.361005376632, + "Y": 609.34164663831223, + "IsEmpty": false + }, + "Timestamp": 637320040567613230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 1352.361005376632, + "Y": 601.99501768802895, + "IsEmpty": false + }, + "Timestamp": 637320040567824650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526359975, + "Position": { + "X": 1352.361005376632, + "Y": 585.24481929966373, + "IsEmpty": false + }, + "Timestamp": 637320040568068840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526359975, + "Position": { + "X": 1352.361005376632, + "Y": 570.55171352841387, + "IsEmpty": false + }, + "Timestamp": 637320040568305220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526359975, + "Position": { + "X": 1352.361005376632, + "Y": 558.99308019341902, + "IsEmpty": false + }, + "Timestamp": 637320040568506140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526359975, + "Position": { + "X": 1352.361005376632, + "Y": 546.55285746956292, + "IsEmpty": false + }, + "Timestamp": 637320040568731150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526359975, + "Position": { + "X": 1352.361005376632, + "Y": 518.43996830579806, + "IsEmpty": false + }, + "Timestamp": 637320040568972850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 1352.361005376632, + "Y": 502.5713593062942, + "IsEmpty": false + }, + "Timestamp": 637320040569245630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 1352.361005376632, + "Y": 495.81255803479615, + "IsEmpty": false + }, + "Timestamp": 637320040569467970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 1352.361005376632, + "Y": 484.64580981899149, + "IsEmpty": false + }, + "Timestamp": 637320040569686790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 1352.361005376632, + "Y": 477.88685641817705, + "IsEmpty": false + }, + "Timestamp": 637320040569913090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 1352.361005376632, + "Y": 467.69966887103124, + "IsEmpty": false + }, + "Timestamp": 637320040570143960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 1352.361005376632, + "Y": 462.21418997826822, + "IsEmpty": false + }, + "Timestamp": 637320040570358590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 1352.361005376632, + "Y": 455.0635035875801, + "IsEmpty": false + }, + "Timestamp": 637320040570608630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 1352.361005376632, + "Y": 451.83105987152737, + "IsEmpty": false + }, + "Timestamp": 637320040570839340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 1352.361005376632, + "Y": 443.79878409197795, + "IsEmpty": false + }, + "Timestamp": 637320040571147360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 1352.361005376632, + "Y": 440.46836909612767, + "IsEmpty": false + }, + "Timestamp": 637320040571365420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532463551, + "Position": { + "X": 1352.361005376632, + "Y": 437.72562964974617, + "IsEmpty": false + }, + "Timestamp": 637320040571591720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.54027617, + "Position": { + "X": 1352.361005376632, + "Y": 433.02376886604696, + "IsEmpty": false + }, + "Timestamp": 637320040571812290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544182479, + "Position": { + "X": 1352.361005376632, + "Y": 432.43609331657819, + "IsEmpty": false + }, + "Timestamp": 637320040572227750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.224597543, + "Position": { + "X": 1352.361005376632, + "Y": 435.27680404275725, + "IsEmpty": false + }, + "Timestamp": 637320040572682730, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "bdb69e5c-b00c-4b6e-b00e-49a63df52ade", + "Points": [ + { + "Pressure": 0.122301057, + "Position": { + "X": 1470.7934500434928, + "Y": 341.73043360831736, + "IsEmpty": false + }, + "Timestamp": 637320040631004810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.402822912, + "Position": { + "X": 1470.7934500434928, + "Y": 341.63246232851986, + "IsEmpty": false + }, + "Timestamp": 637320040632036910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.510978878, + "Position": { + "X": 1476.7887523080283, + "Y": 336.93067760947883, + "IsEmpty": false + }, + "Timestamp": 637320040632560440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.531242847, + "Position": { + "X": 1478.2630375138015, + "Y": 337.91016221347945, + "IsEmpty": false + }, + "Timestamp": 637320040632800450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.538811326, + "Position": { + "X": 1479.6389711164859, + "Y": 338.59588510740394, + "IsEmpty": false + }, + "Timestamp": 637320040633040290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.556389689, + "Position": { + "X": 1480.8184297069677, + "Y": 342.70991821231803, + "IsEmpty": false + }, + "Timestamp": 637320040633306490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.573479831, + "Position": { + "X": 1479.4424200396249, + "Y": 345.15874381930695, + "IsEmpty": false + }, + "Timestamp": 637320040633564900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602532983, + "Position": { + "X": 1491.7279272486455, + "Y": 345.64860021829458, + "IsEmpty": false + }, + "Timestamp": 637320040633804640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615472674, + "Position": { + "X": 1497.5267164686493, + "Y": 348.29336838487853, + "IsEmpty": false + }, + "Timestamp": 637320040634036420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62157625, + "Position": { + "X": 1507.4534586260227, + "Y": 355.73781648564284, + "IsEmpty": false + }, + "Timestamp": 637320040634295230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623529434, + "Position": { + "X": 1513.0556207045074, + "Y": 361.02735281881081, + "IsEmpty": false + }, + "Timestamp": 637320040634548240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.627435744, + "Position": { + "X": 1524.1617453877043, + "Y": 373.5655468224644, + "IsEmpty": false + }, + "Timestamp": 637320040634786490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 1545.6859899204271, + "Y": 387.08330149477689, + "IsEmpty": false + }, + "Timestamp": 637320040635286570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.631342053, + "Position": { + "X": 1556.8903901420545, + "Y": 395.11557727432637, + "IsEmpty": false + }, + "Timestamp": 637320040635707700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638666332, + "Position": { + "X": 1567.6033366068716, + "Y": 404.61711799220592, + "IsEmpty": false + }, + "Timestamp": 637320040636096900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.638910532, + "Position": { + "X": 1577.2351760842955, + "Y": 411.08200542431132, + "IsEmpty": false + }, + "Timestamp": 637320040636350690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 1580.8716752648547, + "Y": 413.43301188081915, + "IsEmpty": false + }, + "Timestamp": 637320040636606320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 1589.1275811395942, + "Y": 419.60413760284843, + "IsEmpty": false + }, + "Timestamp": 637320040637092990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 1597.1868598728147, + "Y": 426.06902503495388, + "IsEmpty": false + }, + "Timestamp": 637320040637534200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 1600.1354302843608, + "Y": 428.61582192174029, + "IsEmpty": false + }, + "Timestamp": 637320040637895450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 1601.9045421054252, + "Y": 429.79132514999424, + "IsEmpty": false + }, + "Timestamp": 637320040638203350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.636469066, + "Position": { + "X": 1602.3959197975776, + "Y": 430.18321026918437, + "IsEmpty": false + }, + "Timestamp": 637320040638615770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.632074475, + "Position": { + "X": 1601.5113638870453, + "Y": 428.61582192174029, + "IsEmpty": false + }, + "Timestamp": 637320040639330120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624750137, + "Position": { + "X": 1595.0246458980284, + "Y": 422.34687704922993, + "IsEmpty": false + }, + "Timestamp": 637320040639600120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.619867265, + "Position": { + "X": 1580.9700268679435, + "Y": 412.4534512121603, + "IsEmpty": false + }, + "Timestamp": 637320040639925340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1567.3085099915802, + "Y": 401.9723498256219, + "IsEmpty": false + }, + "Timestamp": 637320040640227970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1562.4925522205392, + "Y": 397.07454648232766, + "IsEmpty": false + }, + "Timestamp": 637320040640486460, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1545.8825409972881, + "Y": 382.77332583026782, + "IsEmpty": false + }, + "Timestamp": 637320040640726000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1538.6095426361694, + "Y": 378.16943632636611, + "IsEmpty": false + }, + "Timestamp": 637320040640980990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1528.1914227866437, + "Y": 371.8023680447418, + "IsEmpty": false + }, + "Timestamp": 637320040641277000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1512.4658914092665, + "Y": 357.30520483308686, + "IsEmpty": false + }, + "Timestamp": 637320040641525320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1507.0602804076427, + "Y": 352.50537276959011, + "IsEmpty": false + }, + "Timestamp": 637320040641778570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1496.1507828659649, + "Y": 345.55062893849703, + "IsEmpty": false + }, + "Timestamp": 637320040642109340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1487.1085966191235, + "Y": 341.24065327398796, + "IsEmpty": false + }, + "Timestamp": 637320040642476870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1479.6389711164859, + "Y": 335.46133660649053, + "IsEmpty": false + }, + "Timestamp": 637320040642795240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1476.2973746158762, + "Y": 332.13092161064031, + "IsEmpty": false + }, + "Timestamp": 637320040643039890, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.61766994, + "Position": { + "X": 1475.4128187053439, + "Y": 331.15136094198147, + "IsEmpty": false + }, + "Timestamp": 637320040643300550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.615716815, + "Position": { + "X": 1475.0196404869639, + "Y": 332.13092161064031, + "IsEmpty": false + }, + "Timestamp": 637320040644049990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.367421985, + "Position": { + "X": 1473.1522531274691, + "Y": 338.39994254780891, + "IsEmpty": false + }, + "Timestamp": 637320040644340290, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "12a3016e-0e2a-454e-bf87-3473915a4554", + "Points": [ + { + "Pressure": 0.112291142, + "Position": { + "X": 1462.6358577395129, + "Y": 336.44089727514944, + "IsEmpty": false + }, + "Timestamp": 637320040663255530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.122301057, + "Position": { + "X": 1463.4221381116147, + "Y": 336.5387924902887, + "IsEmpty": false + }, + "Timestamp": 637320040663299670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.134996563, + "Position": { + "X": 1466.3706324585028, + "Y": 336.44089727514944, + "IsEmpty": false + }, + "Timestamp": 637320040663599480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.197009236, + "Position": { + "X": 1469.0243001900992, + "Y": 336.34292599535189, + "IsEmpty": false + }, + "Timestamp": 637320040663790880, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.250476837, + "Position": { + "X": 1471.0882766587843, + "Y": 335.85314566102244, + "IsEmpty": false + }, + "Timestamp": 637320040663997740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.269520104, + "Position": { + "X": 1472.3659727553672, + "Y": 335.46133660649053, + "IsEmpty": false + }, + "Timestamp": 637320040664246250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.309315622, + "Position": { + "X": 1473.74198242271, + "Y": 334.57974721762923, + "IsEmpty": false + }, + "Timestamp": 637320040664508850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.393545419, + "Position": { + "X": 1474.1350845764316, + "Y": 333.99199560350229, + "IsEmpty": false + }, + "Timestamp": 637320040664747830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.408194095, + "Position": { + "X": 1474.1350845764316, + "Y": 333.69815782876793, + "IsEmpty": false + }, + "Timestamp": 637320040665377870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.4142977, + "Position": { + "X": 1473.8402579611404, + "Y": 333.60018654897038, + "IsEmpty": false + }, + "Timestamp": 637320040665611320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.453360796, + "Position": { + "X": 1465.2895254711095, + "Y": 337.71429571854264, + "IsEmpty": false + }, + "Timestamp": 637320040665861310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.45922026, + "Position": { + "X": 1457.5250733531805, + "Y": 339.9672548305947, + "IsEmpty": false + }, + "Timestamp": 637320040666097040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.477775246, + "Position": { + "X": 1440.227057296258, + "Y": 354.85622709678148, + "IsEmpty": false + }, + "Timestamp": 637320040666364160, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480704963, + "Position": { + "X": 1435.6076886344069, + "Y": 365.33732848331988, + "IsEmpty": false + }, + "Timestamp": 637320040666626000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.482658118, + "Position": { + "X": 1430.595217818834, + "Y": 372.09628188413438, + "IsEmpty": false + }, + "Timestamp": 637320040666831420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.488517582, + "Position": { + "X": 1408.4812820231996, + "Y": 386.49547381599172, + "IsEmpty": false + }, + "Timestamp": 637320040667073770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.492423892, + "Position": { + "X": 1394.5249004992161, + "Y": 406.87000103959974, + "IsEmpty": false + }, + "Timestamp": 637320040667355710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.498283356, + "Position": { + "X": 1389.3158405744532, + "Y": 413.04112676162902, + "IsEmpty": false + }, + "Timestamp": 637320040667557910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.49559778, + "Position": { + "X": 1380.3720059307007, + "Y": 419.1142812038608, + "IsEmpty": false + }, + "Timestamp": 637320040667774410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.497550935, + "Position": { + "X": 1364.941377233273, + "Y": 423.03252387849619, + "IsEmpty": false + }, + "Timestamp": 637320040668044150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.497550935, + "Position": { + "X": 1355.8992290187607, + "Y": 425.67729204508021, + "IsEmpty": false + }, + "Timestamp": 637320040668364380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.497550935, + "Position": { + "X": 1353.5404259347845, + "Y": 428.90973576113294, + "IsEmpty": false + }, + "Timestamp": 637320040668636110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501457214, + "Position": { + "X": 1350.6901690939978, + "Y": 435.3747753225548, + "IsEmpty": false + }, + "Timestamp": 637320040668876400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501457214, + "Position": { + "X": 1349.0193328113639, + "Y": 438.60721903860747, + "IsEmpty": false + }, + "Timestamp": 637320040669149130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501457214, + "Position": { + "X": 1348.626192625313, + "Y": 439.09692330827869, + "IsEmpty": false + }, + "Timestamp": 637320040669362730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501457214, + "Position": { + "X": 1346.7588052658182, + "Y": 441.34995848498903, + "IsEmpty": false + }, + "Timestamp": 637320040669626550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501457214, + "Position": { + "X": 1344.203413072652, + "Y": 447.03122780803062, + "IsEmpty": false + }, + "Timestamp": 637320040669876610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501457214, + "Position": { + "X": 1340.1737737060419, + "Y": 452.22279286140105, + "IsEmpty": false + }, + "Timestamp": 637320040670121520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 1342.925716976069, + "Y": 449.28426298474096, + "IsEmpty": false + }, + "Timestamp": 637320040670644800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 1344.400002181842, + "Y": 446.83543737775204, + "IsEmpty": false + }, + "Timestamp": 637320040670886420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 1352.4592809150624, + "Y": 427.34249954300532, + "IsEmpty": false + }, + "Timestamp": 637320040671153660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 1365.7276576053746, + "Y": 420.97543126138095, + "IsEmpty": false + }, + "Timestamp": 637320040671384040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.503410399, + "Position": { + "X": 1387.3501776765279, + "Y": 411.96359481317268, + "IsEmpty": false + }, + "Timestamp": 637320040671632140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.512443721, + "Position": { + "X": 1399.4391338086875, + "Y": 390.21777393103207, + "IsEmpty": false + }, + "Timestamp": 637320040671925700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.516838312, + "Position": { + "X": 1407.8915527279587, + "Y": 384.0466482090028, + "IsEmpty": false + }, + "Timestamp": 637320040672191300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520744622, + "Position": { + "X": 1423.3221814253864, + "Y": 377.87552248697352, + "IsEmpty": false + }, + "Timestamp": 637320040672458940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.520744622, + "Position": { + "X": 1427.9415500872374, + "Y": 374.74105005071834, + "IsEmpty": false + }, + "Timestamp": 637320040672713370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.522697806, + "Position": { + "X": 1432.5608807167594, + "Y": 369.7452754276265, + "IsEmpty": false + }, + "Timestamp": 637320040672950350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.524650931, + "Position": { + "X": 1434.4283061085835, + "Y": 367.19847854084009, + "IsEmpty": false + }, + "Timestamp": 637320040673197150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526604116, + "Position": { + "X": 1436.6888336541292, + "Y": 360.63561982893714, + "IsEmpty": false + }, + "Timestamp": 637320040673419650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526604116, + "Position": { + "X": 1448.8760653247193, + "Y": 358.3825846522268, + "IsEmpty": false + }, + "Timestamp": 637320040673703490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528557241, + "Position": { + "X": 1460.6701568092585, + "Y": 349.46887161313248, + "IsEmpty": false + }, + "Timestamp": 637320040673962270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528557241, + "Position": { + "X": 1464.4049695605775, + "Y": 346.43221832735838, + "IsEmpty": false + }, + "Timestamp": 637320040674196520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.528557241, + "Position": { + "X": 1467.2551883690348, + "Y": 343.78745016077437, + "IsEmpty": false + }, + "Timestamp": 637320040674432190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532463551, + "Position": { + "X": 1474.3316356532926, + "Y": 337.81226699834019, + "IsEmpty": false + }, + "Timestamp": 637320040674719970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534416735, + "Position": { + "X": 1477.771583756991, + "Y": 335.36336532669304, + "IsEmpty": false + }, + "Timestamp": 637320040674983270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53636986, + "Position": { + "X": 1478.3613130522319, + "Y": 335.06952755195869, + "IsEmpty": false + }, + "Timestamp": 637320040675264100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.542229354, + "Position": { + "X": 1478.9510423474728, + "Y": 334.77568977722427, + "IsEmpty": false + }, + "Timestamp": 637320040675507360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.544182479, + "Position": { + "X": 1476.2973746158762, + "Y": 339.37950321646775, + "IsEmpty": false + }, + "Timestamp": 637320040675808820, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 1472.0711461400761, + "Y": 343.68947888097688, + "IsEmpty": false + }, + "Timestamp": 637320040676127680, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 1469.0243001900992, + "Y": 347.41177899601723, + "IsEmpty": false + }, + "Timestamp": 637320040676421840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 1458.7044939113332, + "Y": 358.28461337242931, + "IsEmpty": false + }, + "Timestamp": 637320040676668030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 1453.9868497110517, + "Y": 362.30082732686225, + "IsEmpty": false + }, + "Timestamp": 637320040676929390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.548088789, + "Position": { + "X": 1440.4236083731189, + "Y": 372.19425316393188, + "IsEmpty": false + }, + "Timestamp": 637320040677146250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.548088789, + "Position": { + "X": 1430.2020776327831, + "Y": 379.83464382429122, + "IsEmpty": false + }, + "Timestamp": 637320040677379390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543450058, + "Position": { + "X": 1415.0663135829761, + "Y": 391.29530587948847, + "IsEmpty": false + }, + "Timestamp": 637320040677660780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543450058, + "Position": { + "X": 1407.7932771895282, + "Y": 398.25004971058155, + "IsEmpty": false + }, + "Timestamp": 637320040677897720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.543450058, + "Position": { + "X": 1393.0506533257719, + "Y": 412.35547993236275, + "IsEmpty": false + }, + "Timestamp": 637320040678156000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.541496933, + "Position": { + "X": 1387.1535885673379, + "Y": 417.35110242613814, + "IsEmpty": false + }, + "Timestamp": 637320040678425080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566399634, + "Position": { + "X": 1379.2908609109784, + "Y": 423.32628558857238, + "IsEmpty": false + }, + "Timestamp": 637320040678662440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.539787889, + "Position": { + "X": 1367.2019047788187, + "Y": 431.55450392771689, + "IsEmpty": false + }, + "Timestamp": 637320040678911360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.539787889, + "Position": { + "X": 1362.8774007645879, + "Y": 434.78694764376962, + "IsEmpty": false + }, + "Timestamp": 637320040679178800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537590623, + "Position": { + "X": 1360.0271819561306, + "Y": 438.21533391941739, + "IsEmpty": false + }, + "Timestamp": 637320040679412070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537590623, + "Position": { + "X": 1356.6855093908625, + "Y": 441.8396627546602, + "IsEmpty": false + }, + "Timestamp": 637320040679674920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.537590623, + "Position": { + "X": 1356.1940936663811, + "Y": 442.23154787385033, + "IsEmpty": false + }, + "Timestamp": 637320040679901470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.532951832, + "Position": { + "X": 1356.1940936663811, + "Y": 440.56634037592522, + "IsEmpty": false + }, + "Timestamp": 637320040680249000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.204089418, + "Position": { + "X": 1358.061481025876, + "Y": 437.62765836994862, + "IsEmpty": false + }, + "Timestamp": 637320040680491850, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "92bde34f-01da-4d24-b73e-10c061c7cd67", + "Points": [ + { + "Pressure": 0.246326387, + "Position": { + "X": 385.0631178937191, + "Y": 575.95168360077776, + "IsEmpty": false + }, + "Timestamp": 637320036730952220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.455558091, + "Position": { + "X": 385.0631178937191, + "Y": 575.68675443416055, + "IsEmpty": false + }, + "Timestamp": 637320036732189430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592034817, + "Position": { + "X": 385.0631178937191, + "Y": 568.11696339386151, + "IsEmpty": false + }, + "Timestamp": 637320036732843620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.666254699, + "Position": { + "X": 385.0631178937191, + "Y": 553.5072984282076, + "IsEmpty": false + }, + "Timestamp": 637320036733544250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.688227654, + "Position": { + "X": 385.0631178937191, + "Y": 543.89372611564022, + "IsEmpty": false + }, + "Timestamp": 637320036733917840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.720943034, + "Position": { + "X": 385.0631178937191, + "Y": 531.10076867682699, + "IsEmpty": false + }, + "Timestamp": 637320036734491400, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.733638525, + "Position": { + "X": 385.0631178937191, + "Y": 520.73020550388776, + "IsEmpty": false + }, + "Timestamp": 637320036735013860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.751216888, + "Position": { + "X": 385.0631178937191, + "Y": 510.62454210671069, + "IsEmpty": false + }, + "Timestamp": 637320036735400080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.754146636, + "Position": { + "X": 385.0631178937191, + "Y": 509.18630061920106, + "IsEmpty": false + }, + "Timestamp": 637320036735709520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773678184, + "Position": { + "X": 385.0631178937191, + "Y": 493.93321105674403, + "IsEmpty": false + }, + "Timestamp": 637320036736409360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.773678184, + "Position": { + "X": 385.0631178937191, + "Y": 492.07861871785877, + "IsEmpty": false + }, + "Timestamp": 637320036736794080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.779537678, + "Position": { + "X": 385.0631178937191, + "Y": 484.0925062170391, + "IsEmpty": false + }, + "Timestamp": 637320036737378200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.781490803, + "Position": { + "X": 385.0631178937191, + "Y": 476.18207516774368, + "IsEmpty": false + }, + "Timestamp": 637320036737781170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.784908831, + "Position": { + "X": 385.0631178937191, + "Y": 473.07848905644181, + "IsEmpty": false + }, + "Timestamp": 637320036738146210, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 385.0631178937191, + "Y": 470.39122440566047, + "IsEmpty": false + }, + "Timestamp": 637320036738499300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 385.0631178937191, + "Y": 466.30354429770415, + "IsEmpty": false + }, + "Timestamp": 637320036738934560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 385.0631178937191, + "Y": 463.84335339235048, + "IsEmpty": false + }, + "Timestamp": 637320036739302110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.787350297, + "Position": { + "X": 385.0631178937191, + "Y": 462.06447189584446, + "IsEmpty": false + }, + "Timestamp": 637320036739739310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.791500747, + "Position": { + "X": 385.0631178937191, + "Y": 457.52261490617798, + "IsEmpty": false + }, + "Timestamp": 637320036740438340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797360182, + "Position": { + "X": 385.0631178937191, + "Y": 455.74370401881703, + "IsEmpty": false + }, + "Timestamp": 637320036740777450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.805172801, + "Position": { + "X": 385.0631178937191, + "Y": 454.75963941301751, + "IsEmpty": false + }, + "Timestamp": 637320036741224710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.807125986, + "Position": { + "X": 385.0631178937191, + "Y": 453.85125625874224, + "IsEmpty": false + }, + "Timestamp": 637320036741570670, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.81298542, + "Position": { + "X": 385.0631178937191, + "Y": 453.66200854364928, + "IsEmpty": false + }, + "Timestamp": 637320036741968640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.81689173, + "Position": { + "X": 385.0631178937191, + "Y": 453.16997624074952, + "IsEmpty": false + }, + "Timestamp": 637320036742417140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.81689173, + "Position": { + "X": 385.0631178937191, + "Y": 452.98072852565656, + "IsEmpty": false + }, + "Timestamp": 637320036742693930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 385.0631178937191, + "Y": 452.82933623175313, + "IsEmpty": false + }, + "Timestamp": 637320036743085170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 385.0631178937191, + "Y": 451.65602391086065, + "IsEmpty": false + }, + "Timestamp": 637320036743377070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 385.0631178937191, + "Y": 450.25560845368568, + "IsEmpty": false + }, + "Timestamp": 637320036743868350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 385.0631178937191, + "Y": 449.19586239636197, + "IsEmpty": false + }, + "Timestamp": 637320036744224090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.818844914, + "Position": { + "X": 385.0631178937191, + "Y": 446.62213461829447, + "IsEmpty": false + }, + "Timestamp": 637320036744683220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.820798039, + "Position": { + "X": 385.0631178937191, + "Y": 444.69183143703009, + "IsEmpty": false + }, + "Timestamp": 637320036745170990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 385.0631178937191, + "Y": 444.08626226141655, + "IsEmpty": false + }, + "Timestamp": 637320036745595140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 385.0631178937191, + "Y": 443.02648681323785, + "IsEmpty": false + }, + "Timestamp": 637320036746132410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.822751224, + "Position": { + "X": 385.0631178937191, + "Y": 441.66392677725241, + "IsEmpty": false + }, + "Timestamp": 637320036746891220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.793453872, + "Position": { + "X": 385.0631178937191, + "Y": 441.43682364096986, + "IsEmpty": false + }, + "Timestamp": 637320036747442370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.380361646, + "Position": { + "X": 385.0631178937191, + "Y": 440.9447913380701, + "IsEmpty": false + }, + "Timestamp": 637320036747867240, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "34f25789-e94a-4980-8c1b-07b56640e271", + "Points": [ + { + "Pressure": 0.209948882, + "Position": { + "X": 402.91444269073537, + "Y": 433.78533943707504, + "IsEmpty": false + }, + "Timestamp": 637320035698697310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.353749901, + "Position": { + "X": 402.98691817645567, + "Y": 433.53248503860198, + "IsEmpty": false + }, + "Timestamp": 637320035698724790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.580315888, + "Position": { + "X": 403.71166602238958, + "Y": 437.14407373941867, + "IsEmpty": false + }, + "Timestamp": 637320035699778790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608636618, + "Position": { + "X": 404.36394539387209, + "Y": 447.1842667698258, + "IsEmpty": false + }, + "Timestamp": 637320035700158060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.610589743, + "Position": { + "X": 404.79879129692489, + "Y": 450.29025885399739, + "IsEmpty": false + }, + "Timestamp": 637320035700428950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 404.69008157397889, + "Y": 455.05752901580314, + "IsEmpty": false + }, + "Timestamp": 637320035700712860, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.612787068, + "Position": { + "X": 404.32770414537754, + "Y": 456.93553943498569, + "IsEmpty": false + }, + "Timestamp": 637320035701073040, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.614740193, + "Position": { + "X": 404.00156796527068, + "Y": 457.65786839317911, + "IsEmpty": false + }, + "Timestamp": 637320035701404340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620599687, + "Position": { + "X": 404.07404345099098, + "Y": 454.44356622838387, + "IsEmpty": false + }, + "Timestamp": 637320035702109090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.620599687, + "Position": { + "X": 404.14651893671123, + "Y": 449.96521643182541, + "IsEmpty": false + }, + "Timestamp": 637320035702445380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622552812, + "Position": { + "X": 403.74790727088413, + "Y": 443.3198797606866, + "IsEmpty": false + }, + "Timestamp": 637320035702807830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622552812, + "Position": { + "X": 403.74790727088413, + "Y": 437.68584850313897, + "IsEmpty": false + }, + "Timestamp": 637320035703327970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622552812, + "Position": { + "X": 403.82038275660443, + "Y": 436.60235506584883, + "IsEmpty": false + }, + "Timestamp": 637320035703882580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622552812, + "Position": { + "X": 403.60295629944358, + "Y": 438.08307894900992, + "IsEmpty": false + }, + "Timestamp": 637320035704389110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622552812, + "Position": { + "X": 403.53048081372333, + "Y": 438.37205540440772, + "IsEmpty": false + }, + "Timestamp": 637320035704771180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.622552812, + "Position": { + "X": 402.87820845350967, + "Y": 437.14407373941867, + "IsEmpty": false + }, + "Timestamp": 637320035705065120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624505997, + "Position": { + "X": 402.66078199634882, + "Y": 435.59110574240816, + "IsEmpty": false + }, + "Timestamp": 637320035705356590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624505997, + "Position": { + "X": 402.51583102490827, + "Y": 434.39930222449431, + "IsEmpty": false + }, + "Timestamp": 637320035705685000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.624505997, + "Position": { + "X": 402.73325748206912, + "Y": 437.57748233236481, + "IsEmpty": false + }, + "Timestamp": 637320035706291530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.251941711, + "Position": { + "X": 402.55207227340281, + "Y": 442.34475249417062, + "IsEmpty": false + }, + "Timestamp": 637320035706759970, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FFE61B1B", + "Size": 16, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "cca9e988-dbe9-4e62-b8e1-8f867cd9019d", + "Points": [ + { + "Pressure": 0.332021058, + "Position": { + "X": 410.38643119649464, + "Y": 459.89626857432029, + "IsEmpty": false + }, + "Timestamp": 637320037971309950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.41820401, + "Position": { + "X": 408.55861094966582, + "Y": 459.14084099092236, + "IsEmpty": false + }, + "Timestamp": 637320037973450090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.422110319, + "Position": { + "X": 407.17808645388919, + "Y": 458.57196200653436, + "IsEmpty": false + }, + "Timestamp": 637320037973553110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.439688712, + "Position": { + "X": 403.27992594610396, + "Y": 456.94945082933964, + "IsEmpty": false + }, + "Timestamp": 637320037973994780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.461173415, + "Position": { + "X": 400.09017147552879, + "Y": 455.60168811788884, + "IsEmpty": false + }, + "Timestamp": 637320037974390560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.482413977, + "Position": { + "X": 394.99278905722059, + "Y": 453.56477601916743, + "IsEmpty": false + }, + "Timestamp": 637320037974992380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.490226597, + "Position": { + "X": 393.83791879793057, + "Y": 453.07628070030012, + "IsEmpty": false + }, + "Timestamp": 637320037975045180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.506096005, + "Position": { + "X": 388.24514584791928, + "Y": 450.81803730174562, + "IsEmpty": false + }, + "Timestamp": 637320037975449620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.517814934, + "Position": { + "X": 382.2288282460953, + "Y": 448.44147895235523, + "IsEmpty": false + }, + "Timestamp": 637320037976036480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.566155493, + "Position": { + "X": 380.5124627717463, + "Y": 447.74400844734026, + "IsEmpty": false + }, + "Timestamp": 637320037976398370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 371.54121871240915, + "Y": 444.23851558918659, + "IsEmpty": false + }, + "Timestamp": 637320037977026350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 366.27165186211357, + "Y": 442.22254408866866, + "IsEmpty": false + }, + "Timestamp": 637320037977397140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 362.33168016553509, + "Y": 440.7046446947495, + "IsEmpty": false + }, + "Timestamp": 637320037977780140, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 355.63067334487954, + "Y": 438.16778980635979, + "IsEmpty": false + }, + "Timestamp": 637320037978133640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 343.45174271454283, + "Y": 433.69049116233793, + "IsEmpty": false + }, + "Timestamp": 637320037978620380, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.5283131, + "Position": { + "X": 337.01527909578539, + "Y": 431.34695026910862, + "IsEmpty": false + }, + "Timestamp": 637320037978987500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 330.13783860611898, + "Y": 428.90449578948426, + "IsEmpty": false + }, + "Timestamp": 637320037979309520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 317.64879987012142, + "Y": 424.54153687585102, + "IsEmpty": false + }, + "Timestamp": 637320037979722690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 310.5183486628714, + "Y": 422.11990428936906, + "IsEmpty": false + }, + "Timestamp": 637320037980039410, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 296.98742790248599, + "Y": 417.61549001215104, + "IsEmpty": false + }, + "Timestamp": 637320037980632320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530266285, + "Position": { + "X": 290.61107173248854, + "Y": 415.53385118078194, + "IsEmpty": false + }, + "Timestamp": 637320037981014800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53221941, + "Position": { + "X": 283.17846187907003, + "Y": 413.1756128143702, + "IsEmpty": false + }, + "Timestamp": 637320037981267660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53221941, + "Position": { + "X": 274.79352576415067, + "Y": 410.55023898093424, + "IsEmpty": false + }, + "Timestamp": 637320037981660390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.534172595, + "Position": { + "X": 265.68379220783186, + "Y": 407.76872328705178, + "IsEmpty": false + }, + "Timestamp": 637320037982057730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.53612572, + "Position": { + "X": 258.65980829095633, + "Y": 405.6886902237647, + "IsEmpty": false + }, + "Timestamp": 637320037982460780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.538078904, + "Position": { + "X": 249.2574785498073, + "Y": 402.99055495916696, + "IsEmpty": false + }, + "Timestamp": 637320037982928180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.538078904, + "Position": { + "X": 241.19904613038307, + "Y": 400.70580985327535, + "IsEmpty": false + }, + "Timestamp": 637320037983527990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.540032029, + "Position": { + "X": 225.43876349149818, + "Y": 396.44403948291625, + "IsEmpty": false + }, + "Timestamp": 637320037984108830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.540032029, + "Position": { + "X": 216.81709066043013, + "Y": 394.20995839470169, + "IsEmpty": false + }, + "Timestamp": 637320037984420450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.540032029, + "Position": { + "X": 208.81014408812828, + "Y": 392.19821242330357, + "IsEmpty": false + }, + "Timestamp": 637320037984784590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.540032029, + "Position": { + "X": 201.71000478810529, + "Y": 390.48074018391986, + "IsEmpty": false + }, + "Timestamp": 637320037985145610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.540032029, + "Position": { + "X": 192.94993696848746, + "Y": 388.41088948511339, + "IsEmpty": false + }, + "Timestamp": 637320037985559710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.540032029, + "Position": { + "X": 181.4293697113078, + "Y": 385.80581544370767, + "IsEmpty": false + }, + "Timestamp": 637320037985930960, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.540032029, + "Position": { + "X": 173.25720571342174, + "Y": 384.04037323261139, + "IsEmpty": false + }, + "Timestamp": 637320037986284330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.540032029, + "Position": { + "X": 170.52643335531997, + "Y": 383.46598560745065, + "IsEmpty": false + }, + "Timestamp": 637320037986583330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 157.5140188394225, + "Y": 380.83813280107904, + "IsEmpty": false + }, + "Timestamp": 637320037987384130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 150.93374286493997, + "Y": 379.58963781529178, + "IsEmpty": false + }, + "Timestamp": 637320037987839750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.548088789, + "Position": { + "X": 146.80391915646771, + "Y": 378.82377122998105, + "IsEmpty": false + }, + "Timestamp": 637320037988730090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.579339266, + "Position": { + "X": 136.0651552510445, + "Y": 376.93183416651721, + "IsEmpty": false + }, + "Timestamp": 637320037989620070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.52806896, + "Position": { + "X": 135.37464165013097, + "Y": 376.81406716908515, + "IsEmpty": false + }, + "Timestamp": 637320037990270850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.52806896, + "Position": { + "X": 136.0651552510445, + "Y": 376.93183416651721, + "IsEmpty": false + }, + "Timestamp": 637320037990627710, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "29b60efc-1591-4180-8306-ea7bdfc76b8e", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 401.04943505167046, + "Y": 460.06704552461122, + "IsEmpty": false + }, + "Timestamp": 637320041861843730, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.218493938, + "Position": { + "X": 402.01393209919269, + "Y": 460.41845224878097, + "IsEmpty": false + }, + "Timestamp": 637320041862307300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.36546883, + "Position": { + "X": 403.37051812103243, + "Y": 460.89866539148193, + "IsEmpty": false + }, + "Timestamp": 637320041862559430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.52806896, + "Position": { + "X": 403.84883896611274, + "Y": 461.07360194300747, + "IsEmpty": false + }, + "Timestamp": 637320041863101430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.633051038, + "Position": { + "X": 404.3262434404341, + "Y": 461.24835270404913, + "IsEmpty": false + }, + "Timestamp": 637320041863361220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701411486, + "Position": { + "X": 402.41113580332285, + "Y": 460.54824103889644, + "IsEmpty": false + }, + "Timestamp": 637320041864472390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710933089, + "Position": { + "X": 397.55996317107645, + "Y": 458.78549220997468, + "IsEmpty": false + }, + "Timestamp": 637320041864713870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.715815961, + "Position": { + "X": 395.50827849917403, + "Y": 458.02929786847193, + "IsEmpty": false + }, + "Timestamp": 637320041865028180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 386.5775140252623, + "Y": 454.85120492567592, + "IsEmpty": false + }, + "Timestamp": 637320041865336100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 376.57914690661192, + "Y": 451.30577720592163, + "IsEmpty": false + }, + "Timestamp": 637320041865605620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 371.82577495034587, + "Y": 449.65747217369722, + "IsEmpty": false + }, + "Timestamp": 637320041865869100, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 354.87879946111491, + "Y": 443.88335176085531, + "IsEmpty": false + }, + "Timestamp": 637320041866196200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 338.28183135559789, + "Y": 438.39260871537977, + "IsEmpty": false + }, + "Timestamp": 637320041866488110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 324.8818933330142, + "Y": 434.11594390425512, + "IsEmpty": false + }, + "Timestamp": 637320041866735980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 307.31070318013133, + "Y": 428.65907666615499, + "IsEmpty": false + }, + "Timestamp": 637320041867003920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.734615088, + "Position": { + "X": 286.8902917910313, + "Y": 422.6020312698688, + "IsEmpty": false + }, + "Timestamp": 637320041867261030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.736568272, + "Position": { + "X": 279.37323828973729, + "Y": 420.45080765276725, + "IsEmpty": false + }, + "Timestamp": 637320041867514900, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.738521397, + "Position": { + "X": 264.02882730175384, + "Y": 416.17166980491652, + "IsEmpty": false + }, + "Timestamp": 637320041867766330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.742427707, + "Position": { + "X": 247.15199925497251, + "Y": 411.66733719437633, + "IsEmpty": false + }, + "Timestamp": 637320041868219310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.744380891, + "Position": { + "X": 234.10330918452101, + "Y": 408.34279159090954, + "IsEmpty": false + }, + "Timestamp": 637320041868577180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.748287201, + "Position": { + "X": 212.18948988859589, + "Y": 403.05159512247019, + "IsEmpty": false + }, + "Timestamp": 637320041869035910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 196.71965636958851, + "Y": 399.55349897664217, + "IsEmpty": false + }, + "Timestamp": 637320041869347920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 186.12448318438896, + "Y": 397.29297564770502, + "IsEmpty": false + }, + "Timestamp": 637320041869626270, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 181.41892609158606, + "Y": 396.31674246881244, + "IsEmpty": false + }, + "Timestamp": 637320041869889250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 172.52759138309028, + "Y": 394.51890770744149, + "IsEmpty": false + }, + "Timestamp": 637320041870181330, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.75609982, + "Position": { + "X": 171.85321055439559, + "Y": 394.38619494461204, + "IsEmpty": false + }, + "Timestamp": 637320041870236110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760738552, + "Position": { + "X": 165.91630745866851, + "Y": 393.24418892577654, + "IsEmpty": false + }, + "Timestamp": 637320041870483020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760738552, + "Position": { + "X": 163.89044517077409, + "Y": 392.85934640344209, + "IsEmpty": false + }, + "Timestamp": 637320041870744290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760738552, + "Position": { + "X": 157.80895859476928, + "Y": 391.72783349702036, + "IsEmpty": false + }, + "Timestamp": 637320041871096230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760738552, + "Position": { + "X": 151.7228251603955, + "Y": 390.63171036338701, + "IsEmpty": false + }, + "Timestamp": 637320041871442640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760738552, + "Position": { + "X": 146.31027779117537, + "Y": 389.68799058438378, + "IsEmpty": false + }, + "Timestamp": 637320041871712090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.760738552, + "Position": { + "X": 143.60342482401975, + "Y": 389.22719201380431, + "IsEmpty": false + }, + "Timestamp": 637320041871986310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 136.29970354559794, + "Y": 388.02792271253122, + "IsEmpty": false + }, + "Timestamp": 637320041872251190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 130.21034972666769, + "Y": 387.06551403577873, + "IsEmpty": false + }, + "Timestamp": 637320041872526020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 126.15200868886475, + "Y": 386.44630615046663, + "IsEmpty": false + }, + "Timestamp": 637320041872774650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.768795311, + "Position": { + "X": 123.44726253550598, + "Y": 386.04364937619931, + "IsEmpty": false + }, + "Timestamp": 637320041873058260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.772701621, + "Position": { + "X": 122.23766790143571, + "Y": 385.87173429537944, + "IsEmpty": false + }, + "Timestamp": 637320041873332560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.776607931, + "Position": { + "X": 122.095184728744, + "Y": 385.84540226535756, + "IsEmpty": false + }, + "Timestamp": 637320041873586000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58104831, + "Position": { + "X": 121.56179374570415, + "Y": 385.77325205634537, + "IsEmpty": false + }, + "Timestamp": 637320041874063600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.58104831, + "Position": { + "X": 122.095184728744, + "Y": 385.84540226535756, + "IsEmpty": false + }, + "Timestamp": 637320041874566610, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d9353ddc-0a58-4182-a453-74311e920014", + "Points": [ + { + "Pressure": 0.212634474, + "Position": { + "X": 135.74267588435353, + "Y": 378.72077199865527, + "IsEmpty": false + }, + "Timestamp": 637320041879633630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.212634474, + "Position": { + "X": 136.43080467573355, + "Y": 378.83732412582418, + "IsEmpty": false + }, + "Timestamp": 637320041882205210, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF000000", + "Size": 4, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "5da20e07-0b27-4fc2-92d9-86bc2ec84f1b", + "Points": [ + { + "Pressure": 0.199206531, + "Position": { + "X": 523.08878347380858, + "Y": 374.93237239799078, + "IsEmpty": false + }, + "Timestamp": 637320042106877490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.35350576, + "Position": { + "X": 522.82538074084744, + "Y": 374.72241665201494, + "IsEmpty": false + }, + "Timestamp": 637320042107656190, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.427969784, + "Position": { + "X": 524.56373278131514, + "Y": 375.2999376418195, + "IsEmpty": false + }, + "Timestamp": 637320042108196720, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.443839163, + "Position": { + "X": 526.67081195663297, + "Y": 376.40238876466958, + "IsEmpty": false + }, + "Timestamp": 637320042108440300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.480704963, + "Position": { + "X": 534.62503635305916, + "Y": 380.4974634776363, + "IsEmpty": false + }, + "Timestamp": 637320042108709130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.499015778, + "Position": { + "X": 538.4704675688447, + "Y": 382.33496355193176, + "IsEmpty": false + }, + "Timestamp": 637320042108954430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.526604116, + "Position": { + "X": 556.53868831403906, + "Y": 391.99496627211994, + "IsEmpty": false + }, + "Timestamp": 637320042109176500, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.530510426, + "Position": { + "X": 565.86251723202975, + "Y": 395.564947779617, + "IsEmpty": false + }, + "Timestamp": 637320042109442790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.547112226, + "Position": { + "X": 590.8314329780178, + "Y": 406.32756469507927, + "IsEmpty": false + }, + "Timestamp": 637320042109671200, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.56054014, + "Position": { + "X": 599.94455194007151, + "Y": 410.8425508999976, + "IsEmpty": false + }, + "Timestamp": 637320042109928080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582269013, + "Position": { + "X": 617.74939033635769, + "Y": 417.51009310249322, + "IsEmpty": false + }, + "Timestamp": 637320042110175790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 622.75369573371768, + "Y": 419.61005824331147, + "IsEmpty": false + }, + "Timestamp": 637320042110429320, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.586175323, + "Position": { + "X": 626.33572421654208, + "Y": 421.34262121272508, + "IsEmpty": false + }, + "Timestamp": 637320042110676340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593987942, + "Position": { + "X": 631.02397487202302, + "Y": 423.65262363573123, + "IsEmpty": false + }, + "Timestamp": 637320042110903510, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.593987942, + "Position": { + "X": 631.81414230280029, + "Y": 423.91508870225397, + "IsEmpty": false + }, + "Timestamp": 637320042111151790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 633.44714955732593, + "Y": 424.59762833315244, + "IsEmpty": false + }, + "Timestamp": 637320042111383170, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.595941126, + "Position": { + "X": 634.86942647186152, + "Y": 425.07013068186308, + "IsEmpty": false + }, + "Timestamp": 637320042111601130, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.597894251, + "Position": { + "X": 635.60688074156189, + "Y": 425.43761438947979, + "IsEmpty": false + }, + "Timestamp": 637320042111831350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.553948283, + "Position": { + "X": 637.23988799608753, + "Y": 426.59265636908884, + "IsEmpty": false + }, + "Timestamp": 637320042112047260, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.501213074, + "Position": { + "X": 637.87199747984573, + "Y": 426.96014007670556, + "IsEmpty": false + }, + "Timestamp": 637320042112286250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.43895629, + "Position": { + "X": 638.50414773171008, + "Y": 427.22260514322829, + "IsEmpty": false + }, + "Timestamp": 637320042112541200, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "fb14a5ab-2c45-43a2-ac5c-ee62a7c2fe5b", + "Points": [ + { + "Pressure": 0.0842145383, + "Position": { + "X": 532.46528478477035, + "Y": 367.10986975209812, + "IsEmpty": false + }, + "Timestamp": 637320042119839490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.411612123, + "Position": { + "X": 530.99033547726378, + "Y": 363.43486960350714, + "IsEmpty": false + }, + "Timestamp": 637320042119876940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.43871215, + "Position": { + "X": 547.47824174495634, + "Y": 371.20486292885278, + "IsEmpty": false + }, + "Timestamp": 637320042119908070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.183581293, + "Position": { + "X": 648.77616125939119, + "Y": 420.71259090237362, + "IsEmpty": false + }, + "Timestamp": 637320042120498820, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d4b27c78-a0f1-4631-ac5a-8dde1e60e68e", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 533.1500870455526, + "Y": 351.4647829241008, + "IsEmpty": false + }, + "Timestamp": 637320042128780290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.584222198, + "Position": { + "X": 606.42382702899113, + "Y": 385.95745437997584, + "IsEmpty": false + }, + "Timestamp": 637320042128868080, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643549263, + "Position": { + "X": 649.14486801018825, + "Y": 405.48749710253998, + "IsEmpty": false + }, + "Timestamp": 637320042129551740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.654779911, + "Position": { + "X": 657.46783992551764, + "Y": 410.89506022054456, + "IsEmpty": false + }, + "Timestamp": 637320042130033530, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.661860049, + "Position": { + "X": 659.78562905677256, + "Y": 412.5750323331992, + "IsEmpty": false + }, + "Timestamp": 637320042130372780, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.254871428, + "Position": { + "X": 658.04731778441089, + "Y": 415.51506506655682, + "IsEmpty": false + }, + "Timestamp": 637320042130804800, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "d192773a-f922-429c-a2de-da7e5b85aa86", + "Points": [ + { + "Pressure": 0.0842145383, + "Position": { + "X": 531.88584769398312, + "Y": 330.25472732077606, + "IsEmpty": false + }, + "Timestamp": 637320042138092420, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.582513154, + "Position": { + "X": 563.91347561967802, + "Y": 347.42229906789311, + "IsEmpty": false + }, + "Timestamp": 637320042138129450, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.630853713, + "Position": { + "X": 594.36078906787122, + "Y": 363.11981368022538, + "IsEmpty": false + }, + "Timestamp": 637320042138163770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.640619516, + "Position": { + "X": 607.6880663805606, + "Y": 370.83737922123612, + "IsEmpty": false + }, + "Timestamp": 637320042138179520, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.643549263, + "Position": { + "X": 613.64057677166397, + "Y": 373.40992824697702, + "IsEmpty": false + }, + "Timestamp": 637320042138196800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.673090696, + "Position": { + "X": 648.09133861455587, + "Y": 393.5174919593457, + "IsEmpty": false + }, + "Timestamp": 637320042138675030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.693110526, + "Position": { + "X": 661.89272861614347, + "Y": 400.86749225652773, + "IsEmpty": false + }, + "Timestamp": 637320042138940250, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.703608751, + "Position": { + "X": 671.95405257194045, + "Y": 407.0625321103127, + "IsEmpty": false + }, + "Timestamp": 637320042139228660, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.705561936, + "Position": { + "X": 675.11464075883771, + "Y": 409.26751589222488, + "IsEmpty": false + }, + "Timestamp": 637320042139530840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.707515061, + "Position": { + "X": 680.64573123806701, + "Y": 411.99759287960671, + "IsEmpty": false + }, + "Timestamp": 637320042139868810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.709468246, + "Position": { + "X": 684.06976292603133, + "Y": 413.57254635116738, + "IsEmpty": false + }, + "Timestamp": 637320042140133370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.527824819, + "Position": { + "X": 684.75454480276062, + "Y": 413.99253937933105, + "IsEmpty": false + }, + "Timestamp": 637320042140494540, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "02bd4701-31ec-44cb-a269-de3eb0c43edc", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 537.94370287102856, + "Y": 311.30212405180447, + "IsEmpty": false + }, + "Timestamp": 637320042147866810, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684565485, + "Position": { + "X": 695.13194388448983, + "Y": 390.57745922598809, + "IsEmpty": false + }, + "Timestamp": 637320042147976280, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.62987715, + "Position": { + "X": 719.04728946673947, + "Y": 403.02004825410501, + "IsEmpty": false + }, + "Timestamp": 637320042148534220, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.481437385, + "Position": { + "X": 719.36336459267159, + "Y": 403.28251332062774, + "IsEmpty": false + }, + "Timestamp": 637320042148775430, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "76a3a862-581e-4f79-8b65-a40de7d7f227", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 548.37375396167579, + "Y": 288.30703692662513, + "IsEmpty": false + }, + "Timestamp": 637320042156435570, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.458731979, + "Position": { + "X": 550.84956027184376, + "Y": 286.57451472531756, + "IsEmpty": false + }, + "Timestamp": 637320042156464650, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.545159101, + "Position": { + "X": 555.90655844622779, + "Y": 288.83204859588272, + "IsEmpty": false + }, + "Timestamp": 637320042156487550, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.554924846, + "Position": { + "X": 557.01278061888422, + "Y": 289.51454745867517, + "IsEmpty": false + }, + "Timestamp": 637320042156498150, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.753170073, + "Position": { + "X": 700.13622889779685, + "Y": 363.64482534948291, + "IsEmpty": false + }, + "Timestamp": 637320042157012870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762935817, + "Position": { + "X": 724.26230482003655, + "Y": 375.61491202888925, + "IsEmpty": false + }, + "Timestamp": 637320042157338310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.762447536, + "Position": { + "X": 740.75023147178217, + "Y": 385.48495203126521, + "IsEmpty": false + }, + "Timestamp": 637320042157819790, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.345449001, + "Position": { + "X": 744.22689478461155, + "Y": 389.78998249020771, + "IsEmpty": false + }, + "Timestamp": 637320042158189580, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "88448c07-b87d-4e07-9a80-5b4c98649247", + "Points": [ + { + "Pressure": 0.216052487, + "Position": { + "X": 400.08793214635756, + "Y": 417.40507446139929, + "IsEmpty": false + }, + "Timestamp": 637320042183806340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.239490345, + "Position": { + "X": 399.71919481948089, + "Y": 417.35256514085233, + "IsEmpty": false + }, + "Timestamp": 637320042183824850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.260730892, + "Position": { + "X": 399.35045749260422, + "Y": 417.30005582030537, + "IsEmpty": false + }, + "Timestamp": 637320042184057970, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.357656211, + "Position": { + "X": 398.77101020979052, + "Y": 416.93257211268866, + "IsEmpty": false + }, + "Timestamp": 637320042184297620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.500480652, + "Position": { + "X": 398.77101020979052, + "Y": 416.67010704616587, + "IsEmpty": false + }, + "Timestamp": 637320042184516600, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.546135664, + "Position": { + "X": 398.77101020979052, + "Y": 416.40756044343107, + "IsEmpty": false + }, + "Timestamp": 637320042184782110, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.57689786, + "Position": { + "X": 399.77186721245192, + "Y": 415.51506506655682, + "IsEmpty": false + }, + "Timestamp": 637320042185046350, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.592767239, + "Position": { + "X": 400.93076177807939, + "Y": 415.20009067948706, + "IsEmpty": false + }, + "Timestamp": 637320042185281980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.596673548, + "Position": { + "X": 401.35218168995357, + "Y": 415.09507203839314, + "IsEmpty": false + }, + "Timestamp": 637320042185494700, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.602777123, + "Position": { + "X": 400.61469684417375, + "Y": 416.30254180233715, + "IsEmpty": false + }, + "Timestamp": 637320042185744840, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 397.40140568822596, + "Y": 418.35007915882051, + "IsEmpty": false + }, + "Timestamp": 637320042186047630, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.604730308, + "Position": { + "X": 396.76927582041469, + "Y": 418.82258150753114, + "IsEmpty": false + }, + "Timestamp": 637320042186270800, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.59740597, + "Position": { + "X": 396.2425111225985, + "Y": 419.45261181788266, + "IsEmpty": false + }, + "Timestamp": 637320042186542010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.59325552, + "Position": { + "X": 402.14233892870436, + "Y": 418.29756983827355, + "IsEmpty": false + }, + "Timestamp": 637320042187253240, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.623285294, + "Position": { + "X": 417.57670560873805, + "Y": 412.10252998448857, + "IsEmpty": false + }, + "Timestamp": 637320042187576770, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.663813233, + "Position": { + "X": 446.60174214239578, + "Y": 396.24748741051548, + "IsEmpty": false + }, + "Timestamp": 637320042187983060, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.680903316, + "Position": { + "X": 463.24768597305444, + "Y": 388.16243816188802, + "IsEmpty": false + }, + "Timestamp": 637320042188325430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 480.36770172450537, + "Y": 377.60994006482559, + "IsEmpty": false + }, + "Timestamp": 637320042188643620, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 487.84785420013935, + "Y": 373.09487232369526, + "IsEmpty": false + }, + "Timestamp": 637320042188888370, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692378104, + "Position": { + "X": 489.63885824952507, + "Y": 372.30739558791493, + "IsEmpty": false + }, + "Timestamp": 637320042189155010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.675532162, + "Position": { + "X": 491.32453789702174, + "Y": 371.51991885213454, + "IsEmpty": false + }, + "Timestamp": 637320042189393920, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.650629461, + "Position": { + "X": 492.06201255077508, + "Y": 371.36239089049366, + "IsEmpty": false + }, + "Timestamp": 637320042189850850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.587640166, + "Position": { + "X": 492.85215959749939, + "Y": 371.25737224939974, + "IsEmpty": false + }, + "Timestamp": 637320042190117640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.545403242, + "Position": { + "X": 493.22090711640254, + "Y": 371.25737224939974, + "IsEmpty": false + }, + "Timestamp": 637320042190377690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.405996799, + "Position": { + "X": 495.69673381062353, + "Y": 370.994907182877, + "IsEmpty": false + }, + "Timestamp": 637320042190607490, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.357900351, + "Position": { + "X": 497.80381298594136, + "Y": 370.57491415471333, + "IsEmpty": false + }, + "Timestamp": 637320042190850910, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.194567785, + "Position": { + "X": 500.54300164501745, + "Y": 369.73484656217397, + "IsEmpty": false + }, + "Timestamp": 637320042191142960, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "aa9bf91a-d3d6-4235-b6f2-ac9bbb400172", + "Points": [ + { + "Pressure": 0.0983749107, + "Position": { + "X": 371.74769787348214, + "Y": 413.78258363335522, + "IsEmpty": false + }, + "Timestamp": 637320042197968020, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.694331288, + "Position": { + "X": 489.90226098248621, + "Y": 350.4148003536917, + "IsEmpty": false + }, + "Timestamp": 637320042198024430, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.701167285, + "Position": { + "X": 498.06719533484949, + "Y": 346.84477807808861, + "IsEmpty": false + }, + "Timestamp": 637320042198477090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.696772695, + "Position": { + "X": 499.06805233751089, + "Y": 347.05477459217042, + "IsEmpty": false + }, + "Timestamp": 637320042198764870, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.240222782, + "Position": { + "X": 497.22435551110112, + "Y": 350.04727587796896, + "IsEmpty": false + }, + "Timestamp": 637320042199145050, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "6b109765-3e91-4be1-93dd-09f1dc944c2b", + "Points": [ + { + "Pressure": 0.188952461, + "Position": { + "X": 360.52748954408412, + "Y": 404.43755530023685, + "IsEmpty": false + }, + "Timestamp": 637320042206666390, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.677729428, + "Position": { + "X": 475.57410628308241, + "Y": 338.54973231537934, + "IsEmpty": false + }, + "Timestamp": 637320042206861740, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.685786247, + "Position": { + "X": 507.60173420877732, + "Y": 318.75714299008041, + "IsEmpty": false + }, + "Timestamp": 637320042206888750, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.687739372, + "Position": { + "X": 511.81589255941304, + "Y": 315.13465216203633, + "IsEmpty": false + }, + "Timestamp": 637320042206901180, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.512687862, + "Position": { + "X": 511.76322016644201, + "Y": 314.87214632740756, + "IsEmpty": false + }, + "Timestamp": 637320042206912170, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8fb6d6a1-895a-4b5e-b562-524cb7a71795", + "Points": [ + { + "Pressure": 0.0561379418, + "Position": { + "X": 360.00071975025463, + "Y": 397.87503173883516, + "IsEmpty": false + }, + "Timestamp": 637320042215354560, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.490714878, + "Position": { + "X": 371.95839763739269, + "Y": 394.72496172328971, + "IsEmpty": false + }, + "Timestamp": 637320042215492340, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.657221317, + "Position": { + "X": 425.3202200492272, + "Y": 365.11484171616172, + "IsEmpty": false + }, + "Timestamp": 637320042215511070, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.692378104, + "Position": { + "X": 465.77618506024646, + "Y": 342.53974761914606, + "IsEmpty": false + }, + "Timestamp": 637320042215857480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.699946582, + "Position": { + "X": 502.65010120438831, + "Y": 321.53968852990312, + "IsEmpty": false + }, + "Timestamp": 637320042216935440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.499015778, + "Position": { + "X": 515.23990386332434, + "Y": 314.18964746461512, + "IsEmpty": false + }, + "Timestamp": 637320042216964500, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "8aca9453-faca-4c31-b12d-40a98d4c37be", + "Points": [ + { + "Pressure": 0.0280613415, + "Position": { + "X": 337.19156576458198, + "Y": 392.46746862083052, + "IsEmpty": false + }, + "Timestamp": 637320042223707230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.608880758, + "Position": { + "X": 385.49639509804564, + "Y": 364.11732769819355, + "IsEmpty": false + }, + "Timestamp": 637320042223802590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.689936697, + "Position": { + "X": 448.86684868865319, + "Y": 326.42219921054419, + "IsEmpty": false + }, + "Timestamp": 637320042223891830, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710688949, + "Position": { + "X": 489.428168677641, + "Y": 304.37211678278607, + "IsEmpty": false + }, + "Timestamp": 637320042223908580, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.710688949, + "Position": { + "X": 500.01623694720126, + "Y": 297.96708041491928, + "IsEmpty": false + }, + "Timestamp": 637320042223920950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712642074, + "Position": { + "X": 508.91866633737084, + "Y": 292.55955806502067, + "IsEmpty": false + }, + "Timestamp": 637320042223935710, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.712642074, + "Position": { + "X": 516.39879842895186, + "Y": 287.88704389846146, + "IsEmpty": false + }, + "Timestamp": 637320042223961230, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.714595258, + "Position": { + "X": 526.40742960772491, + "Y": 282.32199358692196, + "IsEmpty": false + }, + "Timestamp": 637320042223977990, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.219714656, + "Position": { + "X": 530.5689155653896, + "Y": 278.69950275887794, + "IsEmpty": false + }, + "Timestamp": 637320042224555080, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "e8a5abd8-002c-43ef-b2df-8d413985e513", + "Points": [ + { + "Pressure": 0.168688491, + "Position": { + "X": 320.49295208895887, + "Y": 376.40238876466958, + "IsEmpty": false + }, + "Timestamp": 637320042232970000, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.365957111, + "Position": { + "X": 529.51536578570415, + "Y": 253.18437592850464, + "IsEmpty": false + }, + "Timestamp": 637320042233352960, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + }, + { + "Id": "41ddd740-f558-42e5-8475-1e648ab4c13a", + "Points": [ + { + "Pressure": 0.208239868, + "Position": { + "X": 389.18378875086518, + "Y": 450.21769226840763, + "IsEmpty": false + }, + "Timestamp": 637320042400434030, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.274647146, + "Position": { + "X": 390.18465594555306, + "Y": 448.59022947629995, + "IsEmpty": false + }, + "Timestamp": 637320042400701440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.38158235, + "Position": { + "X": 390.60606566540071, + "Y": 446.17520841219994, + "IsEmpty": false + }, + "Timestamp": 637320042400965610, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.441153586, + "Position": { + "X": 390.23732833852409, + "Y": 443.91771530974074, + "IsEmpty": false + }, + "Timestamp": 637320042401226690, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.518547356, + "Position": { + "X": 383.91609081257053, + "Y": 440.50518022767255, + "IsEmpty": false + }, + "Timestamp": 637320042401481470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.558831155, + "Position": { + "X": 379.59656729193978, + "Y": 439.24520114318159, + "IsEmpty": false + }, + "Timestamp": 637320042401711470, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.585687041, + "Position": { + "X": 377.06806820474776, + "Y": 440.03267787896192, + "IsEmpty": false + }, + "Timestamp": 637320042401983980, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.600579858, + "Position": { + "X": 376.54130350693157, + "Y": 442.39518962251498, + "IsEmpty": false + }, + "Timestamp": 637320042402203940, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.625238419, + "Position": { + "X": 377.43681572365091, + "Y": 445.59768742239538, + "IsEmpty": false + }, + "Timestamp": 637320042402464480, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.648187995, + "Position": { + "X": 379.80727724787687, + "Y": 446.59520144036355, + "IsEmpty": false + }, + "Timestamp": 637320042402699290, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.684321344, + "Position": { + "X": 382.8098686399141, + "Y": 446.43767347872267, + "IsEmpty": false + }, + "Timestamp": 637320042402942120, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.71923399, + "Position": { + "X": 383.70538085663344, + "Y": 442.5002082636089, + "IsEmpty": false + }, + "Timestamp": 637320042403210310, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.724849343, + "Position": { + "X": 384.23214555444963, + "Y": 439.50766620970433, + "IsEmpty": false + }, + "Timestamp": 637320042403439540, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.728755653, + "Position": { + "X": 378.91176503115753, + "Y": 435.36016371240271, + "IsEmpty": false + }, + "Timestamp": 637320042403688300, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.732661963, + "Position": { + "X": 378.49035531130983, + "Y": 434.1526124122467, + "IsEmpty": false + }, + "Timestamp": 637320042403949590, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.741695285, + "Position": { + "X": 377.33146074568236, + "Y": 435.46518235349663, + "IsEmpty": false + }, + "Timestamp": 637320042404199930, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.758785367, + "Position": { + "X": 378.22696277037522, + "Y": 437.51263817376793, + "IsEmpty": false + }, + "Timestamp": 637320042404417850, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.785152972, + "Position": { + "X": 381.12419918444391, + "Y": 439.927659237868, + "IsEmpty": false + }, + "Timestamp": 637320042404646010, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.797360182, + "Position": { + "X": 383.17860596679071, + "Y": 439.50766620970433, + "IsEmpty": false + }, + "Timestamp": 637320042404933950, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.809811532, + "Position": { + "X": 384.6008828813263, + "Y": 438.09015916357248, + "IsEmpty": false + }, + "Timestamp": 637320042405158640, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.814694464, + "Position": { + "X": 384.75892044429236, + "Y": 437.46012885322097, + "IsEmpty": false + }, + "Timestamp": 637320042405435360, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.81689173, + "Position": { + "X": 383.28396094475926, + "Y": 435.6226287789255, + "IsEmpty": false + }, + "Timestamp": 637320042405743440, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.81689173, + "Position": { + "X": 382.54648629100598, + "Y": 435.46518235349663, + "IsEmpty": false + }, + "Timestamp": 637320042405966090, + "TiltX": 0, + "TiltY": 0 + }, + { + "Pressure": 0.645746529, + "Position": { + "X": 377.48948811662194, + "Y": 438.77269879447095, + "IsEmpty": false + }, + "Timestamp": 637320042406195220, + "TiltX": 0, + "TiltY": 0 + } + ], + "DrawingAttributes": { + "Color": "#FF613D30", + "Size": 2, + "PenTip": 0, + "Kind": 0, + "IgnorePressure": false + } + } + ], + "Width": 2000, + "Height": 1000 +} \ No newline at end of file diff --git a/Source/Sketch360.XPlat/Commands/BusyCommand.cs b/Source/Sketch360.XPlat/Commands/BusyCommand.cs new file mode 100644 index 0000000..a99c7cc --- /dev/null +++ b/Source/Sketch360.XPlat/Commands/BusyCommand.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.AppCenter.Crashes; +using System; +using System.Threading.Tasks; +using System.Windows.Input; + +namespace Sketch360.Core.Commands +{ + /// + /// a command that is busy while executing + /// + public abstract class BusyCommand : ICommand + { + private bool _isBusy; + + /// + /// the can exeute changed event handler + /// + public event EventHandler CanExecuteChanged; + + /// + /// Can the command execute? + /// + /// the parameter + /// true if the command is not busy + public bool CanExecute(object parameter) + { + if (_isBusy) return false; + + return OnCanExecute(parameter); + } + + internal void RaiseCanExecuteChanged() + { + CanExecuteChanged?.Invoke(this, new EventArgs()); + } + + /// + /// Can the command execute? (override to provide additional checks) + /// + /// the paramter + /// true + protected virtual bool OnCanExecute(object parameter) + { + return true; + } + + + /// + /// Execute the command + /// + /// the parameter + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "")] + public async void Execute(object parameter) + { + _isBusy = true; + + CanExecuteChanged?.Invoke(this, new EventArgs()); + + try + { + await ExecuteAsync(parameter).ConfigureAwait(true); + } + catch (Exception e) + { + System.Diagnostics.Debug.WriteLine($"Error executing {GetType().Name} command: {e.Message}"); + + Crashes.TrackError(e); + } + _isBusy = false; + + CanExecuteChanged?.Invoke(this, new EventArgs()); + } + + /// + /// Execute override + /// + /// the parameter + /// an async task + protected abstract Task ExecuteAsync(object parameter); + } +} diff --git a/Source/Sketch360.XPlat/Commands/ExportImageCommand.cs b/Source/Sketch360.XPlat/Commands/ExportImageCommand.cs new file mode 100644 index 0000000..95df669 --- /dev/null +++ b/Source/Sketch360.XPlat/Commands/ExportImageCommand.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.AppCenter.Analytics; +using Sketch360.Core.Commands; +using Sketch360.XPlat.Interfaces; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Xamarin.Forms; +using Xamarin.Forms.Inking.Support; + +namespace Sketch360.XPlat.Commands +{ + /// + /// Export image command + /// + public class ExportImageCommand : BusyCommand, IExportImageCommand + { + /// + /// Gets or sets the page + /// + public Page Page { get; set; } + + /// + /// Export the image in a background task + /// + /// the parameter is not used + /// an async task + protected override async Task ExecuteAsync(object parameter) + { + var data = App.GetSketchData(); + + using var stream = new MemoryStream(); + InkRenderer.RenderImage(data.Width, data.Height, data.BackgroundColor, data.InkStrokes.ToList(), stream, data.Width); + + stream.Seek(0, SeekOrigin.Begin); + + var array = stream.ToArray(); + //https://github.com/Studyxnet/FilePicker-Plugin-for-Xamarin-and-Windows/ + var photoLibrary = DependencyService.Get(); + var now = DateTime.Now; + var filename = string.Format( + CultureInfo.InvariantCulture, + Resources.AppResources.DateFilenameFormat, + string.IsNullOrWhiteSpace(data.Name) ? "Sketch360" : data.Name, + now.Year, + now.Month, + now.Day, + now.Hour, + now.Minute, + now.Second, + "jpg"); + + var chars = Path.GetInvalidFileNameChars(); + + int index; + + var filenameChars = filename.ToCharArray(); + + do + { + index = filename.IndexOfAny(chars); + + if (index >= 0) + { + filenameChars[index] = '_'; + + filename = new string(filenameChars); + } + } + while (index != -1); + + var saved = await photoLibrary.SavePhotoAsync(array, string.Empty, filename, Page).ConfigureAwait(false); + + var properties = new Dictionary + { + ["saved"] = saved.ToString(CultureInfo.InvariantCulture), + ["width"] = data.Width.ToString(CultureInfo.InvariantCulture), + ["inkstrokes"] = data.InkStrokes.Count().ToString(CultureInfo.InvariantCulture), + ["background"] = data.BackgroundColor.ToHex(), + ["duration"] = data.Duration.TotalMinutes.ToString(CultureInfo.InvariantCulture) + }; + + Analytics.TrackEvent("Image Exported", properties); + } + } +} diff --git a/Source/Sketch360.XPlat/Commands/OpenSketchCommand.cs b/Source/Sketch360.XPlat/Commands/OpenSketchCommand.cs new file mode 100644 index 0000000..3b24851 --- /dev/null +++ b/Source/Sketch360.XPlat/Commands/OpenSketchCommand.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using ICSharpCode.SharpZipLib.Zip; +using Sketch360.Core.Commands; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using Xamarin.Essentials; + +namespace Sketch360.XPlat.Commands +{ + /// + /// Open sketch command + /// + public class OpenSketchCommand : BusyCommand + { + /// + /// Open a .sketch360 file + /// + /// the parameter is not used. + /// an async task + protected override async Task ExecuteAsync(object parameter) + { + var customFileType = + new FilePickerFileType(new Dictionary> + { + { DevicePlatform.Android, new[] { "application/octet-stream" } }, + { DevicePlatform.UWP, new[] { "application/octet-stream"} }, + }); + + var options = new PickOptions + { + PickerTitle = "Please select a Sketch 360 File", + FileTypes = customFileType, + }; + + var fileData = await Xamarin.Essentials.FilePicker.PickAsync(options).ConfigureAwait(true); + + if (fileData == null) return; + using var stream = await fileData.OpenReadStreamAsync().ConfigureAwait(true); + using var zipFile = new ZipFile(stream); + var entry = zipFile.GetEntry("sketch360.json"); + + using var jsonStream = zipFile.GetInputStream(entry); + using var reader = new StreamReader(jsonStream); + var json = await reader.ReadToEndAsync().ConfigureAwait(true); + + (App.Current as App).LoadSketch(json); + } + } +} diff --git a/Source/Sketch360.XPlat/Commands/PushModalPageCommand.cs b/Source/Sketch360.XPlat/Commands/PushModalPageCommand.cs new file mode 100644 index 0000000..c58512c --- /dev/null +++ b/Source/Sketch360.XPlat/Commands/PushModalPageCommand.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.Core.Commands; +using System.Linq; +using System.Threading.Tasks; +using Xamarin.Forms; +using Xamarin.Forms.DualScreen; + +namespace Sketch360.XPlat.Commands +{ + + /// + /// Push modal page command + /// + /// the type of Xamarin Page + public class PushModalPageCommand : BusyCommand where TPageType : Page, new() + { + /// + /// Push the page onto the navigation stack + /// + /// the parameter is not used + /// an async task + protected override async Task ExecuteAsync(object parameter) + { + var page = App.Current.MainPage as Page; + await page.Navigation.PushAsync(new TPageType(), true).ConfigureAwait(false); + } + } +} diff --git a/Source/Sketch360.XPlat/Commands/RemoteCommand.cs b/Source/Sketch360.XPlat/Commands/RemoteCommand.cs new file mode 100644 index 0000000..8838a1b --- /dev/null +++ b/Source/Sketch360.XPlat/Commands/RemoteCommand.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.Core.Commands; +using Sketch360.XPlat.Interfaces; +using System.Threading.Tasks; +using Xamarin.Forms; + +namespace Sketch360.XPlat.Commands +{ + public class RemoteCommand : BusyCommand + { + private readonly IRemote _remote; + + public RemoteCommand() + { + _remote = DependencyService.Get(); + } + + protected override async Task ExecuteAsync(object parameter) + { + if (await _remote.ConnectAsync().ConfigureAwait(false)) + { + + } + } + } +} diff --git a/Source/Sketch360.XPlat/Commands/SaveSketchCommand.cs b/Source/Sketch360.XPlat/Commands/SaveSketchCommand.cs new file mode 100644 index 0000000..dd551ff --- /dev/null +++ b/Source/Sketch360.XPlat/Commands/SaveSketchCommand.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using ICSharpCode.SharpZipLib.Core; +using ICSharpCode.SharpZipLib.Zip; +using Microsoft.AppCenter.Analytics; +using Sketch360.Core.Commands; +using Sketch360.XPlat.Interfaces; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Xamarin.Forms; +using Xamarin.Forms.Inking.Support; + +namespace Sketch360.XPlat +{ + /// + /// Save sketch command + /// + public class SaveSketchCommand : BusyCommand, IExportImageCommand + { + public Page Page { get; set; } + + /// + /// Save the sketch file + /// + /// the parameter is not used + /// an async task + protected override async Task ExecuteAsync(object parameter) + { + var photoLibrary = DependencyService.Get(); + + var json = (App.Current as App).SerializeSketchData(); + + using var stream = new MemoryStream(); + + var sketchData = App.GetSketchData(); + + using (var zipStream = new ZipOutputStream(stream)) + { + await AddJsonFileAsync(json, zipStream).ConfigureAwait(false); + + AddJpegImage(sketchData, zipStream); + } + + var now = DateTime.Now; + var filename = string.Format( + CultureInfo.InvariantCulture, + Resources.AppResources.DateFilenameFormat, + string.IsNullOrWhiteSpace(sketchData.Name) ? "Sketch360" : sketchData.Name, + now.Year, + now.Month, + now.Day, + now.Hour, + now.Minute, + now.Second, + "sketch360"); + + var chars = Path.GetInvalidFileNameChars(); + + int index; + + var filenameChars = filename.ToCharArray(); + + do + { + index = filename.IndexOfAny(chars); + + if (index >= 0) + { + filenameChars[index] = '_'; + + filename = new string(filenameChars); + } + } + while (index != -1); + + bool result = await photoLibrary.SaveSketchAsync(stream.ToArray(), "Sketch360", filename, Page).ConfigureAwait(true); + + if (result && App.Current.MainPage is Page page) + { + await page.DisplayAlert( + Resources.AppResources.SketchSaved, + string.Format(CultureInfo.CurrentCulture, + Resources.AppResources.SketchSavedMessageFormat, + filename), + Resources.AppResources.OK).ConfigureAwait(false); + } + + var properties = new Dictionary + { + ["saved"] = result.ToString(CultureInfo.InvariantCulture), + ["inkstrokes"] = sketchData.InkStrokes.Count().ToString(CultureInfo.InvariantCulture), + ["background"] = sketchData.BackgroundColor.ToHex(), + ["duration"] = sketchData.Duration.TotalMinutes.ToString(CultureInfo.InvariantCulture) + + }; + + Analytics.TrackEvent("Sketch Saved", properties); + } + + private static async Task AddJsonFileAsync(string json, ZipOutputStream zipStream) + { + var jsonEntry = new ZipEntry("sketch360.json") + { + DateTime = DateTime.UtcNow + }; + + zipStream.PutNextEntry(jsonEntry); + + using var memoryStream = new MemoryStream(); + using var writer = new StreamWriter(memoryStream); + await writer.WriteAsync(json).ConfigureAwait(false); + + await writer.FlushAsync().ConfigureAwait(false); + + memoryStream.Seek(0, SeekOrigin.Begin); + + var buffer = new byte[4096]; + + StreamUtils.Copy(memoryStream, zipStream, buffer); + } + + private static void AddJpegImage(ISketchData sketchData, ZipOutputStream zipStream) + { + var jpegEntry = new ZipEntry("sketch.jpeg") + { + DateTime = DateTime.UtcNow + }; + + zipStream.PutNextEntry(jpegEntry); + + using var memoryStream = new MemoryStream(); + InkRenderer.RenderImage(sketchData.Width, sketchData.Height, sketchData.BackgroundColor, + sketchData.InkStrokes.ToList(), memoryStream, sketchData.Width); + + memoryStream.Seek(0, SeekOrigin.Begin); + + var buffer = new byte[4096]; + + StreamUtils.Copy(memoryStream, zipStream, buffer); + } + } +} diff --git a/Source/Sketch360.XPlat/Commands/ShareCommand.cs b/Source/Sketch360.XPlat/Commands/ShareCommand.cs new file mode 100644 index 0000000..061a6d9 --- /dev/null +++ b/Source/Sketch360.XPlat/Commands/ShareCommand.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.AppCenter.Analytics; +using Sketch360.Core.Commands; +using Sketch360.XPlat.Interfaces; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Xamarin.Essentials; +using Xamarin.Forms; +using Xamarin.Forms.Inking.Support; + +namespace Sketch360.XPlat.Commands +{ + /// + /// Command to share the current jpeg image + /// + public class ShareCommand : BusyCommand + { + /// + /// Share the current sketch as a JPEG with EXIF data + /// + /// the parameter is not used + /// an async task + protected override async Task ExecuteAsync(object parameter) + { + var data = App.GetSketchData(); + + var title = string.IsNullOrWhiteSpace(data.Name) ? "Sketch" : data.Name; + + var filename = Path.Combine(FileSystem.CacheDirectory, title + ".jpeg"); + + using (var stream = File.Create(filename)) + { + InkRenderer.RenderImage(data.Width, data.Height, data.BackgroundColor, data.InkStrokes.ToList(), stream, data.Width); + } + + var photoLibrary = DependencyService.Get(); + + photoLibrary.AddExifData(filename); + + var request = new ShareFileRequest(title + " #Sketch360", new ShareFile(filename)); + + await Share.RequestAsync(request).ConfigureAwait(false); + + var properties = new Dictionary + { + ["width"] = data.Width.ToString(CultureInfo.InvariantCulture), + ["inkstrokes"] = data.InkStrokes.Count().ToString(CultureInfo.InvariantCulture), + ["background"] = data.BackgroundColor.ToHex(), + ["duration"] = data.Duration.TotalMinutes.ToString(CultureInfo.InvariantCulture) + + }; + + Analytics.TrackEvent("Share", properties); + } + } +} diff --git a/Source/Sketch360.XPlat/Data/AddStrokesUndoItem.cs b/Source/Sketch360.XPlat/Data/AddStrokesUndoItem.cs new file mode 100644 index 0000000..7828501 --- /dev/null +++ b/Source/Sketch360.XPlat/Data/AddStrokesUndoItem.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.XPlat.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using Xamarin.Forms.Inking; + +namespace Sketch360.XPlat.Data +{ + public sealed class AddStrokesUndoItem : UndoItem, IAddStrokesUndoItem, IDisposable + { + public bool IsErase { get; set; } + + public ISketchData Container { get; set; } + + + /// + /// Gets or sets the strokes + /// + /// Ignore CA2227 as this needs to have public get and set for serialization + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "")] + public IList Strokes { get; set; } + + public override void Undo() + { + if (IsErase) + { + AddStrokes(); + } + else + { + RemoveStrokes(); + } + + } + + private void RemoveStrokes() + { + var strokeIds = from item in Strokes + select item.Id; + + var itemsToRemove = (from item in Container.InkStrokes + where strokeIds.Contains(item.Id) + select item).ToList(); + + foreach (var item in itemsToRemove) + { + Container.Remove(item); + } + } + + public override void Redo() + { + if (IsErase) + { + RemoveStrokes(); + } + else + { + AddStrokes(); + } + } + + private void AddStrokes() + { + Container.Add(Strokes); + } + + /// + /// Dispose of the strokes. + /// + public void Dispose() + { + if (Strokes != null) + { + foreach (var item in Strokes) + { + item.Dispose(); + } + + Strokes.Clear(); + } + } + } +} diff --git a/Source/Sketch360.XPlat/Data/EraseOperation.cs b/Source/Sketch360.XPlat/Data/EraseOperation.cs new file mode 100644 index 0000000..34d62a3 --- /dev/null +++ b/Source/Sketch360.XPlat/Data/EraseOperation.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Xamarin.Forms; +using Xamarin.Forms.Inking; + +namespace Sketch360.XPlat.Data +{ + public class EraseOperation + { + public string StrokeId { get; set; } + + public int Index { get; set; } + + public Point Point { get; set; } + + public XInkStroke NewStroke { get; set; } + } +} diff --git a/Source/Sketch360.XPlat/Data/EraseStrokesUndoItem.cs b/Source/Sketch360.XPlat/Data/EraseStrokesUndoItem.cs new file mode 100644 index 0000000..6351ea3 --- /dev/null +++ b/Source/Sketch360.XPlat/Data/EraseStrokesUndoItem.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.XPlat.Interfaces; +using System.Collections.Generic; +using System.Linq; +using Xamarin.Forms; + +namespace Sketch360.XPlat.Data +{ + /// + /// Erase stroke undo item + /// + public class EraseStrokesUndoItem : UndoItem, IEraseStrokesUndoItem + { + private readonly List _operations = new List(); + + /// + /// Gets the operations + /// + public IList Operations => _operations; + + /// + /// Gets or sets the sketch data + /// + public ISketchData Container { get; set; } + + /// + /// Redo the operation (erase strokes again) + /// + public override void Redo() + { + _operations.ForEach(RedoOperation); + } + + /// + /// Undo the operation: un-erase the strokes + /// + public override void Undo() + { + _operations.ForEach(UndoOperation); + } + + private void RedoOperation(EraseOperation operation) + { + var stroke = (from item in Container.InkStrokes + where item.Id == operation.StrokeId + select item).FirstOrDefault(); + + if (stroke == null) return; + + if (operation.Index == 0) + { + // trim off the beginning + // stroke.Points.RemoveAt(0); + } + else + { + // var newPoints = stroke.Points.Take(operation.Index); + + // stroke.Points = new List(newPoints); + + if (operation.NewStroke != null) + { + Container.Add(new[] { operation.NewStroke }); + } + } + } + + private void UndoOperation(EraseOperation operation) + { + var stroke = (from item in Container.InkStrokes + where item.Id == operation.StrokeId + select item).FirstOrDefault(); + + if (stroke == null) return; + + //stroke.Points.Add(operation.Point); + if (operation.NewStroke != null) + { + //stroke.Points.AddRange(operation.NewStroke.Points); + Container.Remove(operation.NewStroke); + } + } + } +} diff --git a/Source/Sketch360.XPlat/Data/ExportResolution.cs b/Source/Sketch360.XPlat/Data/ExportResolution.cs new file mode 100644 index 0000000..f0f4c2f --- /dev/null +++ b/Source/Sketch360.XPlat/Data/ExportResolution.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Globalization; + +namespace Sketch360.XPlat.Data +{ + public class ExportResolution + { + public ExportResolution(int width, int height) + { + Width = width; + Height = height; + } + public int Width { get; set; } + public int Height { get; set; } + + public override string ToString() + { + return string.Format(CultureInfo.CurrentCulture, "{0} x {1}", Width, Height); + } + } +} diff --git a/Source/Sketch360.XPlat/Data/NamedColor.cs b/Source/Sketch360.XPlat/Data/NamedColor.cs new file mode 100644 index 0000000..43c5dd3 --- /dev/null +++ b/Source/Sketch360.XPlat/Data/NamedColor.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Xamarin.Forms; + +namespace Sketch360.XPlat.Data +{ + public class NamedColor + { + public string Name { get; set; } + public Color Color { get; set; } + } +} diff --git a/Source/Sketch360.XPlat/Data/RemoteSystemInfo.cs b/Source/Sketch360.XPlat/Data/RemoteSystemInfo.cs new file mode 100644 index 0000000..4d0c149 --- /dev/null +++ b/Source/Sketch360.XPlat/Data/RemoteSystemInfo.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat.Data +{ + public class RemoteSystemInfo + { + public string DisplayName { get; set; } + public string Id { get; set; } + public string Kind { get; set; } + } +} diff --git a/Source/Sketch360.XPlat/Data/SketchData.cs b/Source/Sketch360.XPlat/Data/SketchData.cs new file mode 100644 index 0000000..837cbce --- /dev/null +++ b/Source/Sketch360.XPlat/Data/SketchData.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.XPlat.Interfaces; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; +using Xamarin.Forms; +using Xamarin.Forms.Inking; + +namespace Sketch360.XPlat.Data +{ + /// + /// Sketch data + /// + public sealed class SketchData : ISketchData + { + private readonly List _inkStrokes = new List(); + + /// + /// Initializes a new instance of the SketchData class + /// + public SketchData() + { + Start = DateTimeOffset.UtcNow; + } + + /// + /// Gets or sets the start date/time of the sketch + /// + public DateTimeOffset Start { get; set; } + + /// + /// Gets the amount of time from the creation of this sketch + /// + [JsonIgnore] + public TimeSpan Duration + { + get + { + return DateTimeOffset.UtcNow - Start; + } + } + + /// + /// Gets or sets the name of the sketch + /// + public string Name { get; set; } = "Sketch"; + + /// + /// Gets or sets the background color + /// + public Color BackgroundColor { get; set; } = Color.Beige; + + /// + /// gets or sets the ink strokes + /// + public IEnumerable InkStrokes + { + get => _inkStrokes; + + set + { + lock (_inkStrokes) + { + _inkStrokes.Clear(); + _inkStrokes.AddRange(value); + } + } + } + + public void Add(IEnumerable strokes) + { + lock (_inkStrokes) + { + _inkStrokes.AddRange(strokes); + } + } + + public void Remove(XInkStroke stroke) + { + lock (_inkStrokes) + { + _inkStrokes.Remove(stroke); + } + } + /// + /// Gets or sets the width of the sketch in pixels + /// + public int Width { get; set; } = 2000; + + + /// + /// Gets or sets the height of the sketch in pixels + /// + public int Height { get; set; } = 1000; + } +} diff --git a/Source/Sketch360.XPlat/Data/UndoItem.cs b/Source/Sketch360.XPlat/Data/UndoItem.cs new file mode 100644 index 0000000..114f7ee --- /dev/null +++ b/Source/Sketch360.XPlat/Data/UndoItem.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.XPlat.Interfaces; + +namespace Sketch360.XPlat.Data +{ + /// + /// Undo item base class + /// + public abstract class UndoItem : IUndoItem + { + /// + /// Undo an operation + /// + public abstract void Undo(); + + /// + /// Redo an operation + /// + public abstract void Redo(); + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IAddStrokesUndoItem.cs b/Source/Sketch360.XPlat/Interfaces/IAddStrokesUndoItem.cs new file mode 100644 index 0000000..7c5399a --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IAddStrokesUndoItem.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Collections.Generic; +using Xamarin.Forms.Inking; + +namespace Sketch360.XPlat.Interfaces +{ + public interface IAddStrokesUndoItem : IUndoItem + { + ISketchData Container { get; set; } + + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "")] + IList Strokes { get; set; } + + bool IsErase { get; set; } + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IBaseUrl.cs b/Source/Sketch360.XPlat/Interfaces/IBaseUrl.cs new file mode 100644 index 0000000..5da884d --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IBaseUrl.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.IO; + +namespace Sketch360.XPlat +{ + /// + /// Base URI interface + /// + public interface IBaseUrl + { + /// + /// Gets the platform-dependent base URL + /// + /// + string GetBase(); + Stream GetDrawableImageStream(string filename); + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/ICarouselPage.cs b/Source/Sketch360.XPlat/Interfaces/ICarouselPage.cs new file mode 100644 index 0000000..39e1a8a --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/ICarouselPage.cs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat.Interfaces +{ + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1040:Avoid empty interfaces", Justification = "")] + public interface ICarouselPage + { + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IDrawingMode.cs b/Source/Sketch360.XPlat/Interfaces/IDrawingMode.cs new file mode 100644 index 0000000..f6aa3d4 --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IDrawingMode.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat.Interfaces +{ + public interface IDrawingMode : IDrawingViewMode + { + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IDrawingPage.cs b/Source/Sketch360.XPlat/Interfaces/IDrawingPage.cs new file mode 100644 index 0000000..bee1ac4 --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IDrawingPage.cs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat.Interfaces +{ + public interface IDrawingPage + { + double ZoomFactor { get; set; } + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IDrawingPageViewModel.cs b/Source/Sketch360.XPlat/Interfaces/IDrawingPageViewModel.cs new file mode 100644 index 0000000..03f068b --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IDrawingPageViewModel.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Windows.Input; +using Xamarin.Forms.Inking.Interfaces; + +namespace Sketch360.XPlat.Interfaces +{ + public interface IDrawingPageViewModel + { + IInkCanvasView InkCanvasView { get; set; } + + IUndoManager UndoManager { get; } + + ICommand ActivateModeCommand { get; set; } + + ICommand TouchDrawingCommand { get; set; } + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IDrawingViewMode.cs b/Source/Sketch360.XPlat/Interfaces/IDrawingViewMode.cs new file mode 100644 index 0000000..fbb4825 --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IDrawingViewMode.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Xamarin.Forms.Inking.Interfaces; + +namespace Sketch360.XPlat.Interfaces +{ + public interface IDrawingViewMode + { + IInkCanvasView InkCanvasView { get; set; } + + void Deactivate(); + + void Activate(); + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IEraseStrokesUndoItem.cs b/Source/Sketch360.XPlat/Interfaces/IEraseStrokesUndoItem.cs new file mode 100644 index 0000000..cc8992b --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IEraseStrokesUndoItem.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.XPlat.Data; +using System.Collections.Generic; + +namespace Sketch360.XPlat.Interfaces +{ + /// + /// Erase stroke undo item interface + /// + public interface IEraseStrokesUndoItem : IUndoItem + { + /// + /// Gets or sets the sketch data + /// + ISketchData Container { get; set; } + + /// + /// Gets the erase operations + /// + IList Operations { get; } + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IErasingMode.cs b/Source/Sketch360.XPlat/Interfaces/IErasingMode.cs new file mode 100644 index 0000000..585598e --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IErasingMode.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat.Interfaces +{ + public interface IErasingMode : IDrawingViewMode + { + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IExportImageCommand.cs b/Source/Sketch360.XPlat/Interfaces/IExportImageCommand.cs new file mode 100644 index 0000000..e2092bb --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IExportImageCommand.cs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat.Interfaces +{ + public interface IExportImageCommand : System.Windows.Input.ICommand + { + Xamarin.Forms.Page Page { get; set; } + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/ILayoutService.cs b/Source/Sketch360.XPlat/Interfaces/ILayoutService.cs new file mode 100644 index 0000000..0cb028e --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/ILayoutService.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using Xamarin.Forms; + +namespace Xamarin.Duo.Forms.Samples +{ + public interface ILayoutService + { + Point? GetLocationOnScreen(VisualElement visualElement); + + void AddLayoutGuide(string name, Rectangle location); + + IReadOnlyDictionary LayoutGuides { get; } + + event EventHandler LayoutGuideChanged; + } + + public abstract class LayoutServiceBase : ILayoutService + { + public LayoutServiceBase() + { + LayoutGuides = LayoutGuidesInternal; + } + + public event EventHandler LayoutGuideChanged; + + public IReadOnlyDictionary LayoutGuides { get; } + + Dictionary LayoutGuidesInternal { get; } = + new Dictionary(); + + public void AddLayoutGuide(string name, Rectangle location) + { + var guide = new LayoutGuide(name, location); + LayoutGuidesInternal[name] = guide; + LayoutGuideChanged?.Invoke(this, new LayoutGuideChangedArgs(guide)); + } + + public abstract Point? GetLocationOnScreen(VisualElement visualElement); + } + + + public class LayoutGuideChangedArgs : EventArgs + { + public LayoutGuideChangedArgs(LayoutGuide layoutGuide) + { + LayoutGuide = layoutGuide; + } + + public LayoutGuide LayoutGuide { get; } + } + + public class LayoutGuide + { + public LayoutGuide(string name, Rectangle rectangle) + { + Name = name; + Rectangle = rectangle; + } + + public string Name { get; } + public Rectangle Rectangle { get; } + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IPanningMode.cs b/Source/Sketch360.XPlat/Interfaces/IPanningMode.cs new file mode 100644 index 0000000..af1e2bb --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IPanningMode.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat.Interfaces +{ + public interface IPanningMode : IDrawingViewMode + { + double MinZoomFactor { get; set; } + + double MaxZoomFactor { get; set; } + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IPhotoLibrary.cs b/Source/Sketch360.XPlat/Interfaces/IPhotoLibrary.cs new file mode 100644 index 0000000..e7ffc96 --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IPhotoLibrary.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Threading.Tasks; + +namespace Sketch360.XPlat.Interfaces +{ + public interface IPhotoLibrary + { + //Task PickPhotoAsync(); + + Task SavePhotoAsync(byte[] data, string folder, string filename, Xamarin.Forms.Page page); + + Task SaveSketchAsync(byte[] data, string folder, string filename, Xamarin.Forms.Page page); + + void AddExifData(string filename); + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IRemote.cs b/Source/Sketch360.XPlat/Interfaces/IRemote.cs new file mode 100644 index 0000000..b926d65 --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IRemote.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.XPlat.Data; +using System.Collections.ObjectModel; +using System.Threading.Tasks; + +namespace Sketch360.XPlat.Interfaces +{ + public interface IRemote + { + ObservableCollection RemoteSystems { get; } + + Task ConnectAsync(); + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/ISketchData.cs b/Source/Sketch360.XPlat/Interfaces/ISketchData.cs new file mode 100644 index 0000000..e09e66b --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/ISketchData.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using Xamarin.Forms; +using Xamarin.Forms.Inking; + +namespace Sketch360.XPlat.Interfaces +{ + public interface ISketchData + { + int Width { get; set; } + + int Height { get; set; } + + IEnumerable InkStrokes { get; set; } + + Color BackgroundColor { get; set; } + + string Name { get; set; } + + public TimeSpan Duration { get; } + + void Add(IEnumerable strokes); + + void Remove(XInkStroke stroke); + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/ISplitPage.cs b/Source/Sketch360.XPlat/Interfaces/ISplitPage.cs new file mode 100644 index 0000000..b9fb7a0 --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/ISplitPage.cs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat.Interfaces +{ + public interface ISplitPage + { + void SketchDataUpdated(ISketchData sketchData); + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/ISplitPageViewModel.cs b/Source/Sketch360.XPlat/Interfaces/ISplitPageViewModel.cs new file mode 100644 index 0000000..cc18d19 --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/ISplitPageViewModel.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.XPlat.ViewModels; +using System.Windows.Input; +using Xamarin.Forms.Inking.Interfaces; + +namespace Sketch360.XPlat.Interfaces +{ + public interface ISplitPageViewModel + { + DisplayMode Mode { get; set; } + bool IsLandscape { get; set; } + bool IsSpanned { get; set; } + ICommand ActivateModeCommand { get; set; } + + IUndoManager UndoManager { get; } + + IInkCanvasView InkCanvasView { get; set; } + ICommand TouchDrawingCommand { get; set; } + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IUndoItem.cs b/Source/Sketch360.XPlat/Interfaces/IUndoItem.cs new file mode 100644 index 0000000..8862bc0 --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IUndoItem.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat.Interfaces +{ + /// + /// Undo item interface + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1040:Avoid empty interfaces", Justification = "")] + public interface IUndoItem + { + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IUndoManager.cs b/Source/Sketch360.XPlat/Interfaces/IUndoManager.cs new file mode 100644 index 0000000..8337187 --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IUndoManager.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Windows.Input; + +namespace Sketch360.XPlat.Interfaces +{ + /// + /// Undo manager interface + /// + public interface IUndoManager + { + ICommand UndoCommand { get; } + ICommand RedoCommand { get; } + + event EventHandler Updated; + + void Add(IUndoItem item); + + /// + /// Reset the undo manager, clearing the undo and redo stacks. + /// + void Reset(); + } +} diff --git a/Source/Sketch360.XPlat/Interfaces/IZoomableScrollView.cs b/Source/Sketch360.XPlat/Interfaces/IZoomableScrollView.cs new file mode 100644 index 0000000..0d4fe96 --- /dev/null +++ b/Source/Sketch360.XPlat/Interfaces/IZoomableScrollView.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat +{ + /// + /// Zoomable scrollview interface + /// + public interface IZoomableScrollView + { + /// + /// Gets or sets a value indicating whether the scrollview is zoomable + /// + bool IsZoomEnabled { get; set; } + } +} diff --git a/Source/Sketch360.XPlat/MenuItemProperties.cs b/Source/Sketch360.XPlat/MenuItemProperties.cs new file mode 100644 index 0000000..b8639d9 --- /dev/null +++ b/Source/Sketch360.XPlat/MenuItemProperties.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using SkiaSharp; +using SkiaSharp.Views.Forms; +using System; +using Xamarin.Forms; + +namespace Sketch360.XPlat +{ + /// + /// attached properties + /// + public static class MenuItemProperties + { + /// + /// BackgroundColor attached property + /// + /// To use this, change the Build Action for the resource from AndroidImage to Embedded Resource + public static readonly BindableProperty BackgroundColorProperty = BindableProperty.CreateAttached( + "BackgroundColor", + typeof(Color), + typeof(MenuItemProperties), + Color.Transparent, + default, + default, + OnBackgroundColorChanged); + + /// + /// Gets the name of the embedded resource + /// + public static readonly BindableProperty ResourceNameProperty = BindableProperty.CreateAttached( + "ResourceName", + typeof(string), + typeof(MenuItemProperties), + string.Empty, + default, + default, + OnResourceNameChanged); + + /// + /// Gets or sets the bitmap scale + /// + public static double BitmapScale { get; set; } = 1.5; + + /// + /// Gets the resource name + /// + /// the + /// the embedded resource name + public static string GetResourceName(BindableObject target) + { + if (target == null) throw new ArgumentNullException(nameof(target)); + + return (string)target.GetValue(ResourceNameProperty); + } + + /// + /// Sets the resource name + /// + /// the + /// the embedded resource name + public static void SetResourceName(BindableObject target, string name) + { + if (target == null) throw new ArgumentNullException(nameof(target)); + + target.SetValue(ResourceNameProperty, name); + } + + /// + /// Gets the background color + /// + /// the + /// the background color + public static Color GetBackgroundColor(BindableObject target) + { + if (target == null) throw new ArgumentNullException(nameof(target)); + + return (Color)target.GetValue(BackgroundColorProperty); + } + + /// + /// sets the background color + /// + /// the + /// the background color + public static void SetBackgroundColor(BindableObject target, Color color) + { + if (target == null) throw new ArgumentNullException(nameof(target)); + + target.SetValue(BackgroundColorProperty, color); + } + + private static void OnResourceNameChanged(BindableObject bindable, object oldValue, object newValue) + { + UpdateImageSource(bindable); + } + + private static void OnBackgroundColorChanged(BindableObject bindable, object oldValue, object newValue) + { + UpdateImageSource(bindable); + } + + private static void UpdateImageSource(BindableObject bindable) + { + if (bindable is MenuItem item) + { + var resourceName = GetResourceName(bindable); + + if (string.IsNullOrWhiteSpace(resourceName)) return; + + var baseUrl = DependencyService.Get(); + + var stream = baseUrl.GetDrawableImageStream(resourceName); + + if (stream != null) + { + using (stream) + { + var bitmap = SKBitmap.Decode(stream); + + SKBitmap newBitmap = null; + try + { + newBitmap = new SKBitmap( + Convert.ToInt32(bitmap.Width * BitmapScale), + Convert.ToInt32(bitmap.Height * BitmapScale)); + + using (var canvas = new SKCanvas(newBitmap)) + { + var backgroundColor = GetBackgroundColor(bindable); + + canvas.Clear(backgroundColor.ToSKColor()); + + canvas.DrawBitmap(bitmap, new SKRect(0, 0, newBitmap.Width, newBitmap.Height)); + } + + var newImageSource = (SKBitmapImageSource)newBitmap; + + item.IconImageSource = newImageSource; + + newBitmap = null; + } + finally + { + newBitmap?.Dispose(); + } + } + } + } + } + } +} diff --git a/Source/Sketch360.XPlat/Modes/DrawingMode.cs b/Source/Sketch360.XPlat/Modes/DrawingMode.cs new file mode 100644 index 0000000..3787c05 --- /dev/null +++ b/Source/Sketch360.XPlat/Modes/DrawingMode.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.XPlat.Interfaces; +using Xamarin.Forms.Inking; + +namespace Sketch360.XPlat.Modes +{ + public class DrawingMode : PanningMode, IDrawingMode + { + public override void Activate() + { + base.Activate(); + + InkCanvasView.InkPresenter.InputProcessingConfiguration.Mode = XInkInputProcessingMode.Inking; + } + + public override void Deactivate() + { + base.Deactivate(); + + InkCanvasView.InkPresenter.InputProcessingConfiguration.Mode = XInkInputProcessingMode.None; + } + } +} diff --git a/Source/Sketch360.XPlat/Modes/ErasingMode.cs b/Source/Sketch360.XPlat/Modes/ErasingMode.cs new file mode 100644 index 0000000..1406861 --- /dev/null +++ b/Source/Sketch360.XPlat/Modes/ErasingMode.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.XPlat.Interfaces; +using Xamarin.Forms.Inking; + +namespace Sketch360.XPlat.Modes +{ + public class ErasingMode : PanningMode, IErasingMode + { + public override void Activate() + { + base.Activate(); + + InkCanvasView.InkPresenter.InputProcessingConfiguration.Mode = XInkInputProcessingMode.Erasing; + } + + public override void Deactivate() + { + base.Deactivate(); + + InkCanvasView.InkPresenter.InputProcessingConfiguration.Mode = XInkInputProcessingMode.None; + } + } +} diff --git a/Source/Sketch360.XPlat/Modes/Mode.cs b/Source/Sketch360.XPlat/Modes/Mode.cs new file mode 100644 index 0000000..a54b870 --- /dev/null +++ b/Source/Sketch360.XPlat/Modes/Mode.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Sketch360.XPlat.Modes +{ + public enum Mode + { + Drawing, + Erasing, + Panning, + } +} diff --git a/Source/Sketch360.XPlat/Modes/PanningMode.cs b/Source/Sketch360.XPlat/Modes/PanningMode.cs new file mode 100644 index 0000000..26e48e3 --- /dev/null +++ b/Source/Sketch360.XPlat/Modes/PanningMode.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Sketch360.XPlat.Interfaces; +using Xamarin.Forms; +using Xamarin.Forms.Inking.Interfaces; +using Xamarin.Forms.Internals; + +namespace Sketch360.XPlat.Modes +{ + /// + /// Panning & zooming mode + /// + /// Add a panning and pinch gesture recognizer to this https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/gestures/pan + /// Trying sample at https://stackoverflow.com/questions/40181090/xamarin-forms-pinch-and-pan-together + public class PanningMode : IPanningMode + { + private readonly PanGestureRecognizer _panRecognizer = new PanGestureRecognizer(); + private readonly PinchGestureRecognizer _pinchGestureRecognizer = new PinchGestureRecognizer(); + + private double _startScale; + private double _currentScale = 1.0; + private double _xOffset; + private double _yOffset; + + /// + /// Initializes a new instance of the PanningMode class. + /// + public PanningMode() + { + _panRecognizer.PanUpdated += PanUpdated; + _pinchGestureRecognizer.PinchUpdated += PinchUpdated; + } + + /// + /// Gets or sets the ink canvas + /// + public IInkCanvasView InkCanvasView { get; set; } + + public double MinZoomFactor { get; set; } = 0.5; + + public double MaxZoomFactor { get; set; } = 5; + + /// + /// Activate the gesture recognizers + /// + public virtual void Activate() + { + if (InkCanvasView is View view) + { + view.GestureRecognizers.Add(_panRecognizer); + view.GestureRecognizers.Add(_pinchGestureRecognizer); + } + } + + /// + /// Deactivate the gesture recognizers + /// + public virtual void Deactivate() + { + if (InkCanvasView is View view) + { + view.GestureRecognizers.Remove(_panRecognizer); + view.GestureRecognizers.Remove(_pinchGestureRecognizer); + } + } + + bool _startedWithZoom; + + private void PanUpdated(object sender, PanUpdatedEventArgs e) + { + switch (e.StatusType) + { + case GestureStatus.Started: + _xOffset = InkCanvasView.HorizontalOffset; + _yOffset = InkCanvasView.VerticalOffset; + _startedWithZoom = false; + break; + + case GestureStatus.Running: + if (!_pinchGestureRecognizer.IsPinching && !_startedWithZoom) + { + var newX = _xOffset - (e.TotalX * InkCanvasView.PixelDensity); + var newY = _yOffset - (e.TotalY * InkCanvasView.PixelDensity); + + var zoomFactor = InkCanvasView.ZoomFactor; + + // allow the canvas to scroll off the screen, but only half way + var halfWidth = InkCanvasView.PixelWidth * 0.5; + var halfHeight = InkCanvasView.PixelHeight * 0.5; + + var minX = -halfWidth; + var minY = -halfHeight; + + var maxX = (InkCanvasView.CanvasWidth * zoomFactor) - halfWidth; + var maxY = (InkCanvasView.CanvasHeight * zoomFactor) - halfHeight; + + InkCanvasView.HorizontalOffset = newX.Clamp(minX, maxX); + InkCanvasView.VerticalOffset = newY.Clamp(minY, maxY); + } + break; + + case GestureStatus.Completed: + break; + } + } + + private void PinchUpdated(object sender, PinchGestureUpdatedEventArgs e) + { + switch (e.Status) + { + case GestureStatus.Started: + _startScale = InkCanvasView.ZoomFactor; + _currentScale = InkCanvasView.ZoomFactor; + _startedWithZoom = true; + break; + + case GestureStatus.Running: + // Calculate the scale factor to be applied. + _currentScale += (e.Scale - 1) * _startScale; + _currentScale = _currentScale.Clamp(MinZoomFactor, MaxZoomFactor); + + // Apply scale factor + InkCanvasView.ZoomFactor = _currentScale; + + _xOffset = InkCanvasView.HorizontalOffset; + _yOffset = InkCanvasView.VerticalOffset; + break; + + case GestureStatus.Completed: + break; + } + } + } +} diff --git a/Source/Sketch360.XPlat/Pages/AboutPage.xaml b/Source/Sketch360.XPlat/Pages/AboutPage.xaml new file mode 100644 index 0000000..6236fc7 --- /dev/null +++ b/Source/Sketch360.XPlat/Pages/AboutPage.xaml @@ -0,0 +1,24 @@ + + + + + + +